Skip to content

Commit

Permalink
Merge pull request #241 from yrestom/develop
Browse files Browse the repository at this point in the history
Version 4.1.1
  • Loading branch information
yrestom authored Jan 19, 2023
2 parents c2ca54d + 8777986 commit e750fc9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 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__ = "4.1.0"
__version__ = "4.1.1"


def console(*data):
Expand Down
6 changes: 5 additions & 1 deletion posawesome/posawesome/api/posapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,9 +862,13 @@ def create_customer(
)
if customer_group:
customer.customer_group = customer_group
else:
customer.customer_group = "All Customer Groups"
if territory:
customer.territory = territory
customer.save(ignore_permissions=True)
else:
customer.territory = "All Territories"
customer.save()
return customer


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import json
from frappe import _
from frappe.model.document import Document
from frappe.utils import getdate, get_datetime, flt
from collections import defaultdict
from erpnext.controllers.taxes_and_totals import get_itemised_tax_breakup_data
from frappe.utils import flt


class POSClosingShift(Document):
Expand All @@ -28,6 +26,14 @@ def validate(self):
if frappe.db.get_value("POS Opening Shift", self.pos_opening_shift, "status") != "Open":
frappe.throw(_("Selected POS Opening Shift should be open."), title=_(
"Invalid Opening Entry"))
self.update_payment_reconciliation()

def update_payment_reconciliation(self):
# update the difference values in Payment Reconciliation child table
# get default precision for site
precision = frappe.get_cached_value('System Settings', None, 'currency_precision') or 3
for d in self.payment_reconciliation:
d.difference = flt(d.opening_amount, precision) + flt(d.closing_amount, precision) - flt(d.expected_amount, precision)

def on_submit(self):
opening_entry = frappe.get_doc(
Expand Down

0 comments on commit e750fc9

Please sign in to comment.