mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-22 00:12:14 +00:00
feat: update billed amount in PO and PR
(cherry picked from commit 9f6535472d)
# Conflicts:
# erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
This commit is contained in:
@@ -22,6 +22,8 @@
|
|||||||
"is_paid",
|
"is_paid",
|
||||||
"is_return",
|
"is_return",
|
||||||
"return_against",
|
"return_against",
|
||||||
|
"update_billed_amount_in_purchase_order",
|
||||||
|
"update_billed_amount_in_purchase_receipt",
|
||||||
"apply_tds",
|
"apply_tds",
|
||||||
"tax_withholding_category",
|
"tax_withholding_category",
|
||||||
"amended_from",
|
"amended_from",
|
||||||
@@ -412,6 +414,20 @@
|
|||||||
"read_only": 1,
|
"read_only": 1,
|
||||||
"search_index": 1
|
"search_index": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"depends_on": "eval: doc.is_return",
|
||||||
|
"fieldname": "update_billed_amount_in_purchase_order",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Update Billed Amount in Purchase Order"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"depends_on": "eval: doc.is_return",
|
||||||
|
"fieldname": "update_billed_amount_in_purchase_receipt",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Update Billed Amount in Purchase Receipt"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "section_addresses",
|
"fieldname": "section_addresses",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
@@ -1612,7 +1628,11 @@
|
|||||||
"idx": 204,
|
"idx": 204,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
|
<<<<<<< HEAD
|
||||||
"modified": "2023-11-29 15:35:44.697496",
|
"modified": "2023-11-29 15:35:44.697496",
|
||||||
|
=======
|
||||||
|
"modified": "2024-02-25 11:20:28.366808",
|
||||||
|
>>>>>>> 9f6535472d (feat: update billed amount in PO and PR)
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Purchase Invoice",
|
"name": "Purchase Invoice",
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
supplied_items: DF.Table[PurchaseReceiptItemSupplied]
|
supplied_items: DF.Table[PurchaseReceiptItemSupplied]
|
||||||
supplier: DF.Link
|
supplier: DF.Link
|
||||||
supplier_address: DF.Link | None
|
supplier_address: DF.Link | None
|
||||||
|
supplier_group: DF.Link | None
|
||||||
supplier_name: DF.Data | None
|
supplier_name: DF.Data | None
|
||||||
supplier_warehouse: DF.Link | None
|
supplier_warehouse: DF.Link | None
|
||||||
tax_category: DF.Link | None
|
tax_category: DF.Link | None
|
||||||
@@ -214,6 +215,8 @@ class PurchaseInvoice(BuyingController):
|
|||||||
total_qty: DF.Float
|
total_qty: DF.Float
|
||||||
total_taxes_and_charges: DF.Currency
|
total_taxes_and_charges: DF.Currency
|
||||||
unrealized_profit_loss_account: DF.Link | None
|
unrealized_profit_loss_account: DF.Link | None
|
||||||
|
update_billed_amount_in_purchase_order: DF.Check
|
||||||
|
update_billed_amount_in_purchase_receipt: DF.Check
|
||||||
update_stock: DF.Check
|
update_stock: DF.Check
|
||||||
use_company_roundoff_cost_center: DF.Check
|
use_company_roundoff_cost_center: DF.Check
|
||||||
use_transaction_date_exchange_rate: DF.Check
|
use_transaction_date_exchange_rate: DF.Check
|
||||||
@@ -679,6 +682,11 @@ class PurchaseInvoice(BuyingController):
|
|||||||
super(PurchaseInvoice, self).on_submit()
|
super(PurchaseInvoice, self).on_submit()
|
||||||
|
|
||||||
self.check_prev_docstatus()
|
self.check_prev_docstatus()
|
||||||
|
|
||||||
|
if self.is_return and not self.update_billed_amount_in_purchase_order:
|
||||||
|
# NOTE status updating bypassed for is_return
|
||||||
|
self.status_updater = []
|
||||||
|
|
||||||
self.update_status_updater_args()
|
self.update_status_updater_args()
|
||||||
self.update_prevdoc_status()
|
self.update_prevdoc_status()
|
||||||
|
|
||||||
@@ -1426,6 +1434,10 @@ class PurchaseInvoice(BuyingController):
|
|||||||
|
|
||||||
self.check_on_hold_or_closed_status()
|
self.check_on_hold_or_closed_status()
|
||||||
|
|
||||||
|
if self.is_return and not self.update_billed_amount_in_purchase_order:
|
||||||
|
# NOTE status updating bypassed for is_return
|
||||||
|
self.status_updater = []
|
||||||
|
|
||||||
self.update_status_updater_args()
|
self.update_status_updater_args()
|
||||||
self.update_prevdoc_status()
|
self.update_prevdoc_status()
|
||||||
|
|
||||||
@@ -1520,6 +1532,9 @@ class PurchaseInvoice(BuyingController):
|
|||||||
frappe.throw(_("Supplier Invoice No exists in Purchase Invoice {0}").format(pi))
|
frappe.throw(_("Supplier Invoice No exists in Purchase Invoice {0}").format(pi))
|
||||||
|
|
||||||
def update_billing_status_in_pr(self, update_modified=True):
|
def update_billing_status_in_pr(self, update_modified=True):
|
||||||
|
if self.is_return and not self.update_billed_amount_in_purchase_receipt:
|
||||||
|
return
|
||||||
|
|
||||||
updated_pr = []
|
updated_pr = []
|
||||||
po_details = []
|
po_details = []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user