Merge branch 'develop' into stock-reservation

This commit is contained in:
s-aga-r
2023-05-03 12:06:11 +05:30
60 changed files with 523 additions and 224 deletions

View File

@@ -1662,7 +1662,10 @@ class AccountsController(TransactionBase):
)
self.append("payment_schedule", data)
if not automatically_fetch_payment_terms:
if not (
automatically_fetch_payment_terms
and self.linked_order_has_payment_terms(po_or_so, fieldname, doctype)
):
for d in self.get("payment_schedule"):
if d.invoice_portion:
d.payment_amount = flt(
@@ -1901,12 +1904,14 @@ class AccountsController(TransactionBase):
reconcilation_entry.party = secondary_party
reconcilation_entry.reference_type = self.doctype
reconcilation_entry.reference_name = self.name
reconcilation_entry.cost_center = self.cost_center
reconcilation_entry.cost_center = self.cost_center or erpnext.get_default_cost_center(
self.company
)
advance_entry.account = primary_account
advance_entry.party_type = primary_party_type
advance_entry.party = primary_party
advance_entry.cost_center = self.cost_center
advance_entry.cost_center = self.cost_center or erpnext.get_default_cost_center(self.company)
advance_entry.is_advance = "Yes"
if self.doctype == "Sales Invoice":