Skip to content

Commit

Permalink
Merge pull request #338 from yrestom/develop
Browse files Browse the repository at this point in the history
Version: 6.0.3
  • Loading branch information
yrestom authored Jun 18, 2023
2 parents 3a2b5a6 + 5ed208c commit e8d9f92
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion posawesome/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe

__version__ = "6.0.2"
__version__ = "6.0.3"


def console(*data):
Expand Down
19 changes: 3 additions & 16 deletions posawesome/posawesome/api/posapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,22 +561,8 @@ def submit_invoice(invoice, data):
invoice_doc.is_pos = 0
is_payment_entry = 1

payments = []
for payment in invoice.get("payments"):
for i in invoice_doc.payments:
if i.mode_of_payment == payment["mode_of_payment"]:
i.amount = payment["amount"]
i.base_amount = 0
if i.amount:
payments.append(i)
break

if len(payments) == 0 and not invoice_doc.is_return and invoice_doc.is_pos:
payments = [invoice_doc.payments[0]]
else:
invoice_doc.is_pos = 0
payments = invoice_doc.payments

invoice_doc.payments = payments
if frappe.get_value("POS Profile", invoice_doc.pos_profile, "posa_auto_set_batch"):
set_batch_nos(invoice_doc, "warehouse", throw=True)
set_batch_nos_for_bundels(invoice_doc, "warehouse", throw=True)
Expand Down Expand Up @@ -750,11 +736,12 @@ def submit_in_background_job(kwargs):
is_payment_entry = kwargs.get("is_payment_entry")
total_cash = kwargs.get("total_cash")
cash_account = kwargs.get("cash_account")
payments = kwargs.get("payments")

invoice_doc = frappe.get_doc("Sales Invoice", invoice)
invoice_doc.submit()
redeeming_customer_credit(
invoice_doc, data, is_payment_entry, total_cash, cash_account
invoice_doc, data, is_payment_entry, total_cash, cash_account, payments
)


Expand Down
7 changes: 6 additions & 1 deletion posawesome/public/js/posapp/components/pos/Invoice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@
>
<template v-slot:item.amount="{ item }"
>{{ currencySymbol(pos_profile.currency) }}
{{ formtCurrency(flt(item.qty) * flt(item.rate)) }}</template
{{
formtCurrency(
flt(item.qty, float_precision) *
flt(item.rate, currency_precision)
)
}}</template
>
<template v-slot:item.posa_is_offer="{ item }">
<v-simple-checkbox
Expand Down

0 comments on commit e8d9f92

Please sign in to comment.