adding returns field to cashier closing (#15752)

* adding returns field to cashier closing

* Update cashier_closing.json
This commit is contained in:
Bassam Ramadan 2018-11-08 08:56:24 +02:00 committed by Rushabh Mehta
parent ea42980de6
commit bf86953b4c
2 changed files with 36 additions and 5 deletions

View File

@ -19,7 +19,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Cashier-closing-",
"default": "POS-CLO-",
"fieldname": "naming_series",
"fieldtype": "Select",
"hidden": 0,
@ -32,7 +32,7 @@
"label": "Series",
"length": 0,
"no_copy": 0,
"options": "Cashier-closing-\n",
"options": "POS-CLO-",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@ -230,6 +230,37 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "0.00",
"fieldname": "returns",
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Returns",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "2",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_on_submit": 0,
@ -364,7 +395,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-09-03 10:59:54.500567",
"modified": "2018-10-21 14:26:15.812416",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cashier Closing",
@ -400,4 +431,4 @@
"sort_order": "DESC",
"track_changes": 1,
"track_seen": 0
}
}

View File

@ -29,7 +29,7 @@ class CashierClosing(Document):
for i in self.payments:
total += flt(i.amount)
self.net_amount = total + self.outstanding_amount + self.expense - self.custody
self.net_amount = total + self.outstanding_amount + self.expense - self.custody + self.returns
def validate_time(self):
if self.from_time >= self.time: