Merge pull request #38213 from frappe/mergify/bp/version-14-hotfix/pr-38210

refactor: extend billed amount update flag to POS Invoice as well (backport #38210)
This commit is contained in:
ruthra kumar
2023-11-20 15:02:44 +05:30
committed by GitHub
3 changed files with 12 additions and 3 deletions

View File

@@ -18,6 +18,7 @@
"is_pos", "is_pos",
"is_return", "is_return",
"update_billed_amount_in_sales_order", "update_billed_amount_in_sales_order",
"update_billed_amount_in_delivery_note",
"column_break1", "column_break1",
"company", "company",
"posting_date", "posting_date",
@@ -1549,12 +1550,19 @@
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Amount Eligible for Commission", "label": "Amount Eligible for Commission",
"read_only": 1 "read_only": 1
},
{
"default": "1",
"depends_on": "eval: doc.is_return && doc.return_against",
"fieldname": "update_billed_amount_in_delivery_note",
"fieldtype": "Check",
"label": "Update Billed Amount in Delivery Note"
} }
], ],
"icon": "fa fa-file-text", "icon": "fa fa-file-text",
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2022-09-30 03:49:50.455199", "modified": "2023-11-20 12:27:12.848149",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "POS Invoice", "name": "POS Invoice",

View File

@@ -2147,7 +2147,7 @@
"label": "Use Company default Cost Center for Round off" "label": "Use Company default Cost Center for Round off"
}, },
{ {
"default": "0", "default": "1",
"depends_on": "eval: doc.is_return", "depends_on": "eval: doc.is_return",
"fieldname": "update_billed_amount_in_delivery_note", "fieldname": "update_billed_amount_in_delivery_note",
"fieldtype": "Check", "fieldtype": "Check",
@@ -2164,7 +2164,7 @@
"link_fieldname": "consolidated_invoice" "link_fieldname": "consolidated_invoice"
} }
], ],
"modified": "2023-11-03 14:39:38.012346", "modified": "2023-11-20 11:51:43.555197",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Accounts", "module": "Accounts",
"name": "Sales Invoice", "name": "Sales Invoice",

View File

@@ -356,6 +356,7 @@ def make_return_doc(doctype: str, source_name: str, target_doc=None):
if doc.doctype == "Sales Invoice" or doc.doctype == "POS Invoice": if doc.doctype == "Sales Invoice" or doc.doctype == "POS Invoice":
doc.consolidated_invoice = "" doc.consolidated_invoice = ""
doc.set("payments", []) doc.set("payments", [])
doc.update_billed_amount_in_delivery_note = True
for data in source.payments: for data in source.payments:
paid_amount = 0.00 paid_amount = 0.00
base_paid_amount = 0.00 base_paid_amount = 0.00