From 67d402024144cfa42b2719db3c6d9cd3ec2f2118 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 18 Jul 2024 15:29:30 +0530 Subject: [PATCH 01/10] chore: remove stale code from sales invoice (cherry picked from commit f3fda9ce989f98aa971537799afa9ecf5b848547) # Conflicts: # erpnext/accounts/doctype/sales_invoice/sales_invoice.js --- erpnext/accounts/doctype/sales_invoice/sales_invoice.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 4c899b901ca..13be7f23ff7 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -49,6 +49,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e this.frm.toggle_reqd("due_date", !this.frm.doc.is_return); +<<<<<<< HEAD if (this.frm.doc.repost_required && this.frm.doc.docstatus===1) { this.frm.set_intro(__("Accounting entries for this invoice needs to be reposted. Please click on 'Repost' button to update.")); this.frm.add_custom_button(__('Repost Accounting Entries'), @@ -68,6 +69,8 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e }).removeClass('btn-default').addClass('btn-warning'); } +======= +>>>>>>> f3fda9ce98 (chore: remove stale code from sales invoice) if (this.frm.doc.is_return) { this.frm.return_print_format = "Sales Invoice Return"; } From 8f1a4b9717b26e9cf4044b2b8c6fad1f3b639042 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 18 Jul 2024 15:31:01 +0530 Subject: [PATCH 02/10] chore: remove stale 'repost_required' flag from sales invoice (cherry picked from commit 06c5334f2a6db3114b675dbf393abe94afe9bdb7) # Conflicts: # erpnext/accounts/doctype/sales_invoice/sales_invoice.json # erpnext/accounts/doctype/sales_invoice/sales_invoice.py --- .../doctype/sales_invoice/sales_invoice.json | 5 +- .../doctype/sales_invoice/sales_invoice.py | 184 ++++++++++++++++++ 2 files changed, 188 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index cf7d01c4035..3fea7dcab5d 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -213,7 +213,6 @@ "is_internal_customer", "is_discounted", "remarks", - "repost_required", "connections_tab" ], "fields": [ @@ -2184,7 +2183,11 @@ "link_fieldname": "consolidated_invoice" } ], +<<<<<<< HEAD "modified": "2024-05-08 18:02:28.549041", +======= + "modified": "2024-07-18 15:30:39.428519", +>>>>>>> 06c5334f2a (chore: remove stale 'repost_required' flag from sales invoice) "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index d01e494e60d..f3e7bca6f15 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -49,6 +49,190 @@ form_grid_templates = {"items": "templates/form_grid/item_grid.html"} class SalesInvoice(SellingController): +<<<<<<< HEAD +======= + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + from erpnext.accounts.doctype.payment_schedule.payment_schedule import PaymentSchedule + from erpnext.accounts.doctype.pricing_rule_detail.pricing_rule_detail import PricingRuleDetail + from erpnext.accounts.doctype.sales_invoice_advance.sales_invoice_advance import SalesInvoiceAdvance + from erpnext.accounts.doctype.sales_invoice_item.sales_invoice_item import SalesInvoiceItem + from erpnext.accounts.doctype.sales_invoice_payment.sales_invoice_payment import SalesInvoicePayment + from erpnext.accounts.doctype.sales_invoice_timesheet.sales_invoice_timesheet import ( + SalesInvoiceTimesheet, + ) + from erpnext.accounts.doctype.sales_taxes_and_charges.sales_taxes_and_charges import ( + SalesTaxesandCharges, + ) + from erpnext.selling.doctype.sales_team.sales_team import SalesTeam + from erpnext.stock.doctype.packed_item.packed_item import PackedItem + + account_for_change_amount: DF.Link | None + additional_discount_account: DF.Link | None + additional_discount_percentage: DF.Float + address_display: DF.TextEditor | None + advances: DF.Table[SalesInvoiceAdvance] + against_income_account: DF.SmallText | None + allocate_advances_automatically: DF.Check + amended_from: DF.Link | None + amount_eligible_for_commission: DF.Currency + apply_discount_on: DF.Literal["", "Grand Total", "Net Total"] + auto_repeat: DF.Link | None + base_change_amount: DF.Currency + base_discount_amount: DF.Currency + base_grand_total: DF.Currency + base_in_words: DF.SmallText | None + base_net_total: DF.Currency + base_paid_amount: DF.Currency + base_rounded_total: DF.Currency + base_rounding_adjustment: DF.Currency + base_total: DF.Currency + base_total_taxes_and_charges: DF.Currency + base_write_off_amount: DF.Currency + campaign: DF.Link | None + cash_bank_account: DF.Link | None + change_amount: DF.Currency + commission_rate: DF.Float + company: DF.Link + company_address: DF.Link | None + company_address_display: DF.TextEditor | None + company_tax_id: DF.Data | None + contact_display: DF.SmallText | None + contact_email: DF.Data | None + contact_mobile: DF.SmallText | None + contact_person: DF.Link | None + conversion_rate: DF.Float + cost_center: DF.Link | None + coupon_code: DF.Link | None + currency: DF.Link + customer: DF.Link | None + customer_address: DF.Link | None + customer_group: DF.Link | None + customer_name: DF.SmallText | None + debit_to: DF.Link + disable_rounded_total: DF.Check + discount_amount: DF.Currency + dispatch_address: DF.TextEditor | None + dispatch_address_name: DF.Link | None + dont_create_loyalty_points: DF.Check + due_date: DF.Date | None + from_date: DF.Date | None + grand_total: DF.Currency + group_same_items: DF.Check + ignore_default_payment_terms_template: DF.Check + ignore_pricing_rule: DF.Check + in_words: DF.SmallText | None + incoterm: DF.Link | None + inter_company_invoice_reference: DF.Link | None + is_cash_or_non_trade_discount: DF.Check + is_consolidated: DF.Check + is_debit_note: DF.Check + is_discounted: DF.Check + is_internal_customer: DF.Check + is_opening: DF.Literal["No", "Yes"] + is_pos: DF.Check + is_return: DF.Check + items: DF.Table[SalesInvoiceItem] + language: DF.Link | None + letter_head: DF.Link | None + loyalty_amount: DF.Currency + loyalty_points: DF.Int + loyalty_program: DF.Link | None + loyalty_redemption_account: DF.Link | None + loyalty_redemption_cost_center: DF.Link | None + named_place: DF.Data | None + naming_series: DF.Literal["ACC-SINV-.YYYY.-", "ACC-SINV-RET-.YYYY.-"] + net_total: DF.Currency + only_include_allocated_payments: DF.Check + other_charges_calculation: DF.TextEditor | None + outstanding_amount: DF.Currency + packed_items: DF.Table[PackedItem] + paid_amount: DF.Currency + party_account_currency: DF.Link | None + payment_schedule: DF.Table[PaymentSchedule] + payment_terms_template: DF.Link | None + payments: DF.Table[SalesInvoicePayment] + plc_conversion_rate: DF.Float + po_date: DF.Date | None + po_no: DF.Data | None + pos_profile: DF.Link | None + posting_date: DF.Date + posting_time: DF.Time | None + price_list_currency: DF.Link + pricing_rules: DF.Table[PricingRuleDetail] + project: DF.Link | None + redeem_loyalty_points: DF.Check + remarks: DF.SmallText | None + represents_company: DF.Link | None + return_against: DF.Link | None + rounded_total: DF.Currency + rounding_adjustment: DF.Currency + sales_partner: DF.Link | None + sales_team: DF.Table[SalesTeam] + scan_barcode: DF.Data | None + select_print_heading: DF.Link | None + selling_price_list: DF.Link + set_posting_time: DF.Check + set_target_warehouse: DF.Link | None + set_warehouse: DF.Link | None + shipping_address: DF.TextEditor | None + shipping_address_name: DF.Link | None + shipping_rule: DF.Link | None + source: DF.Link | None + status: DF.Literal[ + "", + "Draft", + "Return", + "Credit Note Issued", + "Submitted", + "Paid", + "Partly Paid", + "Unpaid", + "Unpaid and Discounted", + "Partly Paid and Discounted", + "Overdue and Discounted", + "Overdue", + "Cancelled", + "Internal Transfer", + ] + subscription: DF.Link | None + tax_category: DF.Link | None + tax_id: DF.Data | None + taxes: DF.Table[SalesTaxesandCharges] + taxes_and_charges: DF.Link | None + tc_name: DF.Link | None + terms: DF.TextEditor | None + territory: DF.Link | None + timesheets: DF.Table[SalesInvoiceTimesheet] + title: DF.Data | None + to_date: DF.Date | None + total: DF.Currency + total_advance: DF.Currency + total_billing_amount: DF.Currency + total_billing_hours: DF.Float + total_commission: DF.Currency + total_net_weight: DF.Float + total_qty: DF.Float + total_taxes_and_charges: DF.Currency + unrealized_profit_loss_account: DF.Link | None + update_billed_amount_in_delivery_note: DF.Check + update_billed_amount_in_sales_order: DF.Check + update_outstanding_for_self: DF.Check + update_stock: DF.Check + use_company_roundoff_cost_center: DF.Check + write_off_account: DF.Link | None + write_off_amount: DF.Currency + write_off_cost_center: DF.Link | None + write_off_outstanding_amount_automatically: DF.Check + # end: auto-generated types + +>>>>>>> 06c5334f2a (chore: remove stale 'repost_required' flag from sales invoice) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.status_updater = [ From 925a164101f7d463d9816944f3be6f309c7bac04 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 18 Jul 2024 15:31:59 +0530 Subject: [PATCH 03/10] chore: remove 'repost_required' from purchase invoice (cherry picked from commit a467888a67088e1a7997bf5d2b800817e64b08cb) # Conflicts: # erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json # erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py --- .../purchase_invoice/purchase_invoice.json | 14 +- .../purchase_invoice/purchase_invoice.py | 170 ++++++++++++++++++ 2 files changed, 174 insertions(+), 10 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 6b0ec8e8c85..6c6f8537d4a 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -170,7 +170,6 @@ "against_expense_account", "column_break_63", "unrealized_profit_loss_account", - "repost_required", "subscription_section", "auto_repeat", "update_auto_repeat_reference", @@ -1590,15 +1589,6 @@ "fieldtype": "Check", "label": "Use Company Default Round Off Cost Center" }, - { - "default": "0", - "fieldname": "repost_required", - "fieldtype": "Check", - "hidden": 1, - "label": "Repost Required", - "options": "Account", - "read_only": 1 - }, { "default": "0", "fieldname": "use_transaction_date_exchange_rate", @@ -1619,7 +1609,11 @@ "idx": 204, "is_submittable": 1, "links": [], +<<<<<<< HEAD "modified": "2024-03-20 15:57:00.736868", +======= + "modified": "2024-07-18 15:31:49.488566", +>>>>>>> a467888a67 (chore: remove 'repost_required' from purchase invoice) "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index fd018309282..0003933c88f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -54,6 +54,176 @@ form_grid_templates = {"items": "templates/form_grid/item_grid.html"} class PurchaseInvoice(BuyingController): +<<<<<<< HEAD +======= + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + from erpnext.accounts.doctype.advance_tax.advance_tax import AdvanceTax + from erpnext.accounts.doctype.payment_schedule.payment_schedule import PaymentSchedule + from erpnext.accounts.doctype.pricing_rule_detail.pricing_rule_detail import PricingRuleDetail + from erpnext.accounts.doctype.purchase_invoice_advance.purchase_invoice_advance import ( + PurchaseInvoiceAdvance, + ) + from erpnext.accounts.doctype.purchase_invoice_item.purchase_invoice_item import PurchaseInvoiceItem + from erpnext.accounts.doctype.purchase_taxes_and_charges.purchase_taxes_and_charges import ( + PurchaseTaxesandCharges, + ) + from erpnext.accounts.doctype.tax_withheld_vouchers.tax_withheld_vouchers import TaxWithheldVouchers + from erpnext.buying.doctype.purchase_receipt_item_supplied.purchase_receipt_item_supplied import ( + PurchaseReceiptItemSupplied, + ) + + additional_discount_percentage: DF.Float + address_display: DF.TextEditor | None + advance_tax: DF.Table[AdvanceTax] + advances: DF.Table[PurchaseInvoiceAdvance] + against_expense_account: DF.SmallText | None + allocate_advances_automatically: DF.Check + amended_from: DF.Link | None + apply_discount_on: DF.Literal["", "Grand Total", "Net Total"] + apply_tds: DF.Check + auto_repeat: DF.Link | None + base_discount_amount: DF.Currency + base_grand_total: DF.Currency + base_in_words: DF.Data | None + base_net_total: DF.Currency + base_paid_amount: DF.Currency + base_rounded_total: DF.Currency + base_rounding_adjustment: DF.Currency + base_tax_withholding_net_total: DF.Currency + base_taxes_and_charges_added: DF.Currency + base_taxes_and_charges_deducted: DF.Currency + base_total: DF.Currency + base_total_taxes_and_charges: DF.Currency + base_write_off_amount: DF.Currency + bill_date: DF.Date | None + bill_no: DF.Data | None + billing_address: DF.Link | None + billing_address_display: DF.TextEditor | None + buying_price_list: DF.Link | None + cash_bank_account: DF.Link | None + clearance_date: DF.Date | None + company: DF.Link | None + contact_display: DF.SmallText | None + contact_email: DF.SmallText | None + contact_mobile: DF.SmallText | None + contact_person: DF.Link | None + conversion_rate: DF.Float + cost_center: DF.Link | None + credit_to: DF.Link + currency: DF.Link | None + disable_rounded_total: DF.Check + discount_amount: DF.Currency + due_date: DF.Date | None + from_date: DF.Date | None + grand_total: DF.Currency + group_same_items: DF.Check + hold_comment: DF.SmallText | None + ignore_default_payment_terms_template: DF.Check + ignore_pricing_rule: DF.Check + in_words: DF.Data | None + incoterm: DF.Link | None + inter_company_invoice_reference: DF.Link | None + is_internal_supplier: DF.Check + is_old_subcontracting_flow: DF.Check + is_opening: DF.Literal["No", "Yes"] + is_paid: DF.Check + is_return: DF.Check + is_subcontracted: DF.Check + items: DF.Table[PurchaseInvoiceItem] + language: DF.Data | None + letter_head: DF.Link | None + mode_of_payment: DF.Link | None + named_place: DF.Data | None + naming_series: DF.Literal["ACC-PINV-.YYYY.-", "ACC-PINV-RET-.YYYY.-"] + net_total: DF.Currency + on_hold: DF.Check + only_include_allocated_payments: DF.Check + other_charges_calculation: DF.TextEditor | None + outstanding_amount: DF.Currency + paid_amount: DF.Currency + party_account_currency: DF.Link | None + payment_schedule: DF.Table[PaymentSchedule] + payment_terms_template: DF.Link | None + per_received: DF.Percent + plc_conversion_rate: DF.Float + posting_date: DF.Date + posting_time: DF.Time | None + price_list_currency: DF.Link | None + pricing_rules: DF.Table[PricingRuleDetail] + project: DF.Link | None + rejected_warehouse: DF.Link | None + release_date: DF.Date | None + remarks: DF.SmallText | None + represents_company: DF.Link | None + return_against: DF.Link | None + rounded_total: DF.Currency + rounding_adjustment: DF.Currency + scan_barcode: DF.Data | None + select_print_heading: DF.Link | None + set_from_warehouse: DF.Link | None + set_posting_time: DF.Check + set_warehouse: DF.Link | None + shipping_address: DF.Link | None + shipping_address_display: DF.TextEditor | None + shipping_rule: DF.Link | None + status: DF.Literal[ + "", + "Draft", + "Return", + "Debit Note Issued", + "Submitted", + "Paid", + "Partly Paid", + "Unpaid", + "Overdue", + "Cancelled", + "Internal Transfer", + ] + subscription: DF.Link | None + supplied_items: DF.Table[PurchaseReceiptItemSupplied] + supplier: DF.Link + supplier_address: DF.Link | None + supplier_group: DF.Link | None + supplier_name: DF.Data | None + supplier_warehouse: DF.Link | None + tax_category: DF.Link | None + tax_id: DF.ReadOnly | None + tax_withheld_vouchers: DF.Table[TaxWithheldVouchers] + tax_withholding_category: DF.Link | None + tax_withholding_net_total: DF.Currency + taxes: DF.Table[PurchaseTaxesandCharges] + taxes_and_charges: DF.Link | None + taxes_and_charges_added: DF.Currency + taxes_and_charges_deducted: DF.Currency + tc_name: DF.Link | None + terms: DF.TextEditor | None + title: DF.Data | None + to_date: DF.Date | None + total: DF.Currency + total_advance: DF.Currency + total_net_weight: DF.Float + total_qty: DF.Float + total_taxes_and_charges: DF.Currency + unrealized_profit_loss_account: DF.Link | None + update_billed_amount_in_purchase_order: DF.Check + update_billed_amount_in_purchase_receipt: DF.Check + update_outstanding_for_self: DF.Check + update_stock: DF.Check + use_company_roundoff_cost_center: DF.Check + use_transaction_date_exchange_rate: DF.Check + write_off_account: DF.Link | None + write_off_amount: DF.Currency + write_off_cost_center: DF.Link | None + # end: auto-generated types + +>>>>>>> a467888a67 (chore: remove 'repost_required' from purchase invoice) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.status_updater = [ From 197e043fc9e23815ff36b69d58159186f909a643 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 18 Jul 2024 15:32:51 +0530 Subject: [PATCH 04/10] chore: remove 'repost_required' from Journal Entry (cherry picked from commit e81373bb6ae1bde6c5b3261f776ba647cd9b65e3) # Conflicts: # erpnext/accounts/doctype/journal_entry/journal_entry.json # erpnext/accounts/doctype/journal_entry/journal_entry.py --- .../doctype/journal_entry/journal_entry.json | 4 + .../doctype/journal_entry/journal_entry.py | 73 +++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json index 906760ec312..021c9e19c15 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.json +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json @@ -557,7 +557,11 @@ "table_fieldname": "payment_entries" } ], +<<<<<<< HEAD "modified": "2023-11-23 12:11:04.128015", +======= + "modified": "2024-07-18 15:32:29.413598", +>>>>>>> e81373bb6a (chore: remove 'repost_required' from Journal Entry) "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry", diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index b4fb13e42c3..d6ee0d4a68f 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -32,6 +32,79 @@ class StockAccountInvalidTransaction(frappe.ValidationError): class JournalEntry(AccountsController): +<<<<<<< HEAD +======= + # begin: auto-generated types + # This code is auto-generated. Do not modify anything in this block. + + from typing import TYPE_CHECKING + + if TYPE_CHECKING: + from frappe.types import DF + + from erpnext.accounts.doctype.journal_entry_account.journal_entry_account import JournalEntryAccount + + accounts: DF.Table[JournalEntryAccount] + amended_from: DF.Link | None + apply_tds: DF.Check + auto_repeat: DF.Link | None + bill_date: DF.Date | None + bill_no: DF.Data | None + cheque_date: DF.Date | None + cheque_no: DF.Data | None + clearance_date: DF.Date | None + company: DF.Link + difference: DF.Currency + due_date: DF.Date | None + finance_book: DF.Link | None + from_template: DF.Link | None + inter_company_journal_entry_reference: DF.Link | None + is_opening: DF.Literal["No", "Yes"] + is_system_generated: DF.Check + letter_head: DF.Link | None + mode_of_payment: DF.Link | None + multi_currency: DF.Check + naming_series: DF.Literal["ACC-JV-.YYYY.-"] + paid_loan: DF.Data | None + pay_to_recd_from: DF.Data | None + payment_order: DF.Link | None + posting_date: DF.Date + process_deferred_accounting: DF.Link | None + remark: DF.SmallText | None + reversal_of: DF.Link | None + select_print_heading: DF.Link | None + stock_entry: DF.Link | None + tax_withholding_category: DF.Link | None + title: DF.Data | None + total_amount: DF.Currency + total_amount_currency: DF.Link | None + total_amount_in_words: DF.Data | None + total_credit: DF.Currency + total_debit: DF.Currency + user_remark: DF.SmallText | None + voucher_type: DF.Literal[ + "Journal Entry", + "Inter Company Journal Entry", + "Bank Entry", + "Cash Entry", + "Credit Card Entry", + "Debit Note", + "Credit Note", + "Contra Entry", + "Excise Entry", + "Write Off Entry", + "Opening Entry", + "Depreciation Entry", + "Exchange Rate Revaluation", + "Exchange Gain Or Loss", + "Deferred Revenue", + "Deferred Expense", + ] + write_off_amount: DF.Currency + write_off_based_on: DF.Literal["Accounts Receivable", "Accounts Payable"] + # end: auto-generated types + +>>>>>>> e81373bb6a (chore: remove 'repost_required' from Journal Entry) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) From a243873ab04d24d5662d4eab8636fdcb5189a93f Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 18 Jul 2024 15:34:02 +0530 Subject: [PATCH 05/10] chore: remove stale UI code related to repost (cherry picked from commit fe46e1d0899724efdbbdd32881be62112b97c11c) # Conflicts: # erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js --- .../accounts/doctype/purchase_invoice/purchase_invoice.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index c29ec5fd12f..e51bd10082e 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -59,6 +59,7 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying. this.show_stock_ledger(); } +<<<<<<< HEAD if (this.frm.doc.repost_required && this.frm.doc.docstatus===1) { this.frm.set_intro(__("Accounting entries for this invoice need to be reposted. Please click on 'Repost' button to update.")); this.frm.add_custom_button(__('Repost Accounting Entries'), @@ -80,6 +81,10 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying. if(!doc.is_return && doc.docstatus == 1 && doc.outstanding_amount != 0){ if(doc.on_hold) { +======= + if (!doc.is_return && doc.docstatus == 1 && doc.outstanding_amount != 0) { + if (doc.on_hold) { +>>>>>>> fe46e1d089 (chore: remove stale UI code related to repost) this.frm.add_custom_button( __('Change Release Date'), function() {me.change_release_date()}, From 0284328e2c6ce16efbd5167bb028277ded7f3206 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 18 Jul 2024 15:34:59 +0530 Subject: [PATCH 06/10] refactor: repost without checking on flag (cherry picked from commit 09f429ffba15f1b9cd43ad8967efd71eb95b963c) --- erpnext/controllers/accounts_controller.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 792a0c02caf..a9494cf6e80 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -2376,16 +2376,12 @@ class AccountsController(TransactionBase): @frappe.whitelist() def repost_accounting_entries(self): - if self.repost_required: - repost_ledger = frappe.new_doc("Repost Accounting Ledger") - repost_ledger.company = self.company - repost_ledger.append("vouchers", {"voucher_type": self.doctype, "voucher_no": self.name}) - repost_ledger.flags.ignore_permissions = True - repost_ledger.insert() - repost_ledger.submit() - self.db_set("repost_required", 0) - else: - frappe.throw(_("No updates pending for reposting")) + repost_ledger = frappe.new_doc("Repost Accounting Ledger") + repost_ledger.company = self.company + repost_ledger.append("vouchers", {"voucher_type": self.doctype, "voucher_no": self.name}) + repost_ledger.flags.ignore_permissions = True + repost_ledger.insert() + repost_ledger.submit() @frappe.whitelist() From 149109649de3d68f2a34c17b5ec7bddfd7caf081 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 18 Jul 2024 15:38:15 +0530 Subject: [PATCH 07/10] refactor: remove attribute check on 'repost_required' (cherry picked from commit 07fc952a4383de79ee7c327719047b7c7e02dcd7) # Conflicts: # erpnext/accounts/doctype/journal_entry/journal_entry.py # erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py # erpnext/accounts/doctype/sales_invoice/sales_invoice.py --- .../doctype/journal_entry/journal_entry.py | 10 +++++++++ .../purchase_invoice/purchase_invoice.py | 14 +++++++++++++ .../doctype/sales_invoice/sales_invoice.py | 21 ++++++++++++++++++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index d6ee0d4a68f..68e5bdc1391 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -172,6 +172,16 @@ class JournalEntry(AccountsController): self.update_asset_value() self.update_inter_company_jv() self.update_invoice_discounting() +<<<<<<< HEAD +======= + self.update_booked_depreciation() + + def on_update_after_submit(self): + self.needs_repost = self.check_if_fields_updated(fields_to_check=[], child_tables={"accounts": []}) + if self.needs_repost: + self.validate_for_repost() + self.repost_accounting_entries() +>>>>>>> 07fc952a43 (refactor: remove attribute check on 'repost_required') def on_cancel(self): # References for this Journal are removed on the `on_cancel` event in accounts_controller diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 0003933c88f..0aa97f195a7 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -760,6 +760,7 @@ class PurchaseInvoice(BuyingController): self.process_common_party_accounting() def on_update_after_submit(self): +<<<<<<< HEAD if hasattr(self, "repost_required"): fields_to_check = [ "cash_bank_account", @@ -772,6 +773,19 @@ class PurchaseInvoice(BuyingController): self.validate_for_repost() self.db_set("repost_required", self.needs_repost) self.repost_accounting_entries() +======= + fields_to_check = [ + "cash_bank_account", + "write_off_account", + "unrealized_profit_loss_account", + "is_opening", + ] + child_tables = {"items": ("expense_account",), "taxes": ("account_head",)} + self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables) + if self.needs_repost: + self.validate_for_repost() + self.repost_accounting_entries() +>>>>>>> 07fc952a43 (refactor: remove attribute check on 'repost_required') def make_gl_entries(self, gl_entries=None, from_repost=False): update_outstanding = "No" if (cint(self.is_paid) or self.write_off_account) else "Yes" diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index f3e7bca6f15..7f64bee6a4a 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -569,7 +569,6 @@ class SalesInvoice(SellingController): self.repost_future_sle_and_gle() self.db_set("status", "Cancelled") - self.db_set("repost_required", 0) if frappe.db.get_single_value("Selling Settings", "sales_update_frequency") == "Each Transaction": update_company_current_month_sales(self.company) @@ -716,6 +715,7 @@ class SalesInvoice(SellingController): data.sales_invoice = sales_invoice def on_update_after_submit(self): +<<<<<<< HEAD if hasattr(self, "repost_required"): fields_to_check = [ "additional_discount_account", @@ -734,6 +734,25 @@ class SalesInvoice(SellingController): self.validate_for_repost() self.db_set("repost_required", self.needs_repost) self.repost_accounting_entries() +======= + fields_to_check = [ + "additional_discount_account", + "cash_bank_account", + "account_for_change_amount", + "write_off_account", + "loyalty_redemption_account", + "unrealized_profit_loss_account", + "is_opening", + ] + child_tables = { + "items": ("income_account", "expense_account", "discount_account"), + "taxes": ("account_head",), + } + self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables) + if self.needs_repost: + self.validate_for_repost() + self.repost_accounting_entries() +>>>>>>> 07fc952a43 (refactor: remove attribute check on 'repost_required') def set_paid_amount(self): paid_amount = 0.0 From 56b158202766e6edd6cc52b56b6a7b3ac769ad66 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Thu, 18 Jul 2024 15:39:30 +0530 Subject: [PATCH 08/10] refactor(test): remove assert on 'repost_required' (cherry picked from commit e71cb4eab7f07cad2f4245778a205750e5f0d768) --- .../accounts/doctype/purchase_invoice/test_purchase_invoice.py | 2 -- erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py | 3 --- 2 files changed, 5 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index b3a3a9634fb..f1f7f54a135 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -1917,8 +1917,6 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin): ["Service - _TC", 1000, 0.0, nowdate()], ] check_gl_entries(self, pi.name, expected_gle, nowdate()) - pi.load_from_db() - self.assertFalse(pi.repost_required) def test_default_cost_center_for_purchase(self): from erpnext.accounts.doctype.cost_center.test_cost_center import create_cost_center diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 159ed405686..9e81fcf502f 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -2896,9 +2896,6 @@ class TestSalesInvoice(FrappeTestCase): check_gl_entries(self, si.name, expected_gle, add_days(nowdate(), -1)) - si.load_from_db() - self.assertFalse(si.repost_required) - def test_asset_depreciation_on_sale_with_pro_rata(self): """ Tests if an Asset set to depreciate yearly on June 30, that gets sold on Sept 30, creates an additional depreciation entry on its date of sale. From 99d5b6dc71b3f471e6aa6a2761fdd0fe2ef28b55 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Wed, 24 Jul 2024 13:03:43 +0530 Subject: [PATCH 09/10] chore: resolve conflicts --- erpnext/accounts/doctype/journal_entry/journal_entry.json | 4 ---- .../accounts/doctype/purchase_invoice/purchase_invoice.json | 4 ---- erpnext/accounts/doctype/sales_invoice/sales_invoice.json | 4 ---- 3 files changed, 12 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json index 021c9e19c15..b229a20f7eb 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.json +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json @@ -557,11 +557,7 @@ "table_fieldname": "payment_entries" } ], -<<<<<<< HEAD - "modified": "2023-11-23 12:11:04.128015", -======= "modified": "2024-07-18 15:32:29.413598", ->>>>>>> e81373bb6a (chore: remove 'repost_required' from Journal Entry) "modified_by": "Administrator", "module": "Accounts", "name": "Journal Entry", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 6c6f8537d4a..7568e3486e5 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -1609,11 +1609,7 @@ "idx": 204, "is_submittable": 1, "links": [], -<<<<<<< HEAD - "modified": "2024-03-20 15:57:00.736868", -======= "modified": "2024-07-18 15:31:49.488566", ->>>>>>> a467888a67 (chore: remove 'repost_required' from purchase invoice) "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 3fea7dcab5d..632392511bd 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -2183,11 +2183,7 @@ "link_fieldname": "consolidated_invoice" } ], -<<<<<<< HEAD - "modified": "2024-05-08 18:02:28.549041", -======= "modified": "2024-07-18 15:30:39.428519", ->>>>>>> 06c5334f2a (chore: remove stale 'repost_required' flag from sales invoice) "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", From 07509b5e993ab0c6c895fb196058c044de8fbb51 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Wed, 24 Jul 2024 13:06:07 +0530 Subject: [PATCH 10/10] chore: resolve conflicts --- .../doctype/journal_entry/journal_entry.py | 83 ------- .../purchase_invoice/purchase_invoice.js | 24 -- .../purchase_invoice/purchase_invoice.py | 185 ---------------- .../doctype/sales_invoice/sales_invoice.js | 22 -- .../doctype/sales_invoice/sales_invoice.py | 205 ------------------ 5 files changed, 519 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 68e5bdc1391..b4fb13e42c3 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -32,79 +32,6 @@ class StockAccountInvalidTransaction(frappe.ValidationError): class JournalEntry(AccountsController): -<<<<<<< HEAD -======= - # begin: auto-generated types - # This code is auto-generated. Do not modify anything in this block. - - from typing import TYPE_CHECKING - - if TYPE_CHECKING: - from frappe.types import DF - - from erpnext.accounts.doctype.journal_entry_account.journal_entry_account import JournalEntryAccount - - accounts: DF.Table[JournalEntryAccount] - amended_from: DF.Link | None - apply_tds: DF.Check - auto_repeat: DF.Link | None - bill_date: DF.Date | None - bill_no: DF.Data | None - cheque_date: DF.Date | None - cheque_no: DF.Data | None - clearance_date: DF.Date | None - company: DF.Link - difference: DF.Currency - due_date: DF.Date | None - finance_book: DF.Link | None - from_template: DF.Link | None - inter_company_journal_entry_reference: DF.Link | None - is_opening: DF.Literal["No", "Yes"] - is_system_generated: DF.Check - letter_head: DF.Link | None - mode_of_payment: DF.Link | None - multi_currency: DF.Check - naming_series: DF.Literal["ACC-JV-.YYYY.-"] - paid_loan: DF.Data | None - pay_to_recd_from: DF.Data | None - payment_order: DF.Link | None - posting_date: DF.Date - process_deferred_accounting: DF.Link | None - remark: DF.SmallText | None - reversal_of: DF.Link | None - select_print_heading: DF.Link | None - stock_entry: DF.Link | None - tax_withholding_category: DF.Link | None - title: DF.Data | None - total_amount: DF.Currency - total_amount_currency: DF.Link | None - total_amount_in_words: DF.Data | None - total_credit: DF.Currency - total_debit: DF.Currency - user_remark: DF.SmallText | None - voucher_type: DF.Literal[ - "Journal Entry", - "Inter Company Journal Entry", - "Bank Entry", - "Cash Entry", - "Credit Card Entry", - "Debit Note", - "Credit Note", - "Contra Entry", - "Excise Entry", - "Write Off Entry", - "Opening Entry", - "Depreciation Entry", - "Exchange Rate Revaluation", - "Exchange Gain Or Loss", - "Deferred Revenue", - "Deferred Expense", - ] - write_off_amount: DF.Currency - write_off_based_on: DF.Literal["Accounts Receivable", "Accounts Payable"] - # end: auto-generated types - ->>>>>>> e81373bb6a (chore: remove 'repost_required' from Journal Entry) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -172,16 +99,6 @@ class JournalEntry(AccountsController): self.update_asset_value() self.update_inter_company_jv() self.update_invoice_discounting() -<<<<<<< HEAD -======= - self.update_booked_depreciation() - - def on_update_after_submit(self): - self.needs_repost = self.check_if_fields_updated(fields_to_check=[], child_tables={"accounts": []}) - if self.needs_repost: - self.validate_for_repost() - self.repost_accounting_entries() ->>>>>>> 07fc952a43 (refactor: remove attribute check on 'repost_required') def on_cancel(self): # References for this Journal are removed on the `on_cancel` event in accounts_controller diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index e51bd10082e..ff5550489c2 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -59,32 +59,8 @@ erpnext.accounts.PurchaseInvoice = class PurchaseInvoice extends erpnext.buying. this.show_stock_ledger(); } -<<<<<<< HEAD - if (this.frm.doc.repost_required && this.frm.doc.docstatus===1) { - this.frm.set_intro(__("Accounting entries for this invoice need to be reposted. Please click on 'Repost' button to update.")); - this.frm.add_custom_button(__('Repost Accounting Entries'), - () => { - this.frm.call({ - doc: this.frm.doc, - method: 'repost_accounting_entries', - freeze: true, - freeze_message: __('Reposting...'), - callback: (r) => { - if (!r.exc) { - frappe.msgprint(__('Accounting Entries are reposted.')); - me.frm.refresh(); - } - } - }); - }).removeClass('btn-default').addClass('btn-warning'); - } - if(!doc.is_return && doc.docstatus == 1 && doc.outstanding_amount != 0){ if(doc.on_hold) { -======= - if (!doc.is_return && doc.docstatus == 1 && doc.outstanding_amount != 0) { - if (doc.on_hold) { ->>>>>>> fe46e1d089 (chore: remove stale UI code related to repost) this.frm.add_custom_button( __('Change Release Date'), function() {me.change_release_date()}, diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 0aa97f195a7..d571ccc28a0 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -54,176 +54,6 @@ form_grid_templates = {"items": "templates/form_grid/item_grid.html"} class PurchaseInvoice(BuyingController): -<<<<<<< HEAD -======= - # begin: auto-generated types - # This code is auto-generated. Do not modify anything in this block. - - from typing import TYPE_CHECKING - - if TYPE_CHECKING: - from frappe.types import DF - - from erpnext.accounts.doctype.advance_tax.advance_tax import AdvanceTax - from erpnext.accounts.doctype.payment_schedule.payment_schedule import PaymentSchedule - from erpnext.accounts.doctype.pricing_rule_detail.pricing_rule_detail import PricingRuleDetail - from erpnext.accounts.doctype.purchase_invoice_advance.purchase_invoice_advance import ( - PurchaseInvoiceAdvance, - ) - from erpnext.accounts.doctype.purchase_invoice_item.purchase_invoice_item import PurchaseInvoiceItem - from erpnext.accounts.doctype.purchase_taxes_and_charges.purchase_taxes_and_charges import ( - PurchaseTaxesandCharges, - ) - from erpnext.accounts.doctype.tax_withheld_vouchers.tax_withheld_vouchers import TaxWithheldVouchers - from erpnext.buying.doctype.purchase_receipt_item_supplied.purchase_receipt_item_supplied import ( - PurchaseReceiptItemSupplied, - ) - - additional_discount_percentage: DF.Float - address_display: DF.TextEditor | None - advance_tax: DF.Table[AdvanceTax] - advances: DF.Table[PurchaseInvoiceAdvance] - against_expense_account: DF.SmallText | None - allocate_advances_automatically: DF.Check - amended_from: DF.Link | None - apply_discount_on: DF.Literal["", "Grand Total", "Net Total"] - apply_tds: DF.Check - auto_repeat: DF.Link | None - base_discount_amount: DF.Currency - base_grand_total: DF.Currency - base_in_words: DF.Data | None - base_net_total: DF.Currency - base_paid_amount: DF.Currency - base_rounded_total: DF.Currency - base_rounding_adjustment: DF.Currency - base_tax_withholding_net_total: DF.Currency - base_taxes_and_charges_added: DF.Currency - base_taxes_and_charges_deducted: DF.Currency - base_total: DF.Currency - base_total_taxes_and_charges: DF.Currency - base_write_off_amount: DF.Currency - bill_date: DF.Date | None - bill_no: DF.Data | None - billing_address: DF.Link | None - billing_address_display: DF.TextEditor | None - buying_price_list: DF.Link | None - cash_bank_account: DF.Link | None - clearance_date: DF.Date | None - company: DF.Link | None - contact_display: DF.SmallText | None - contact_email: DF.SmallText | None - contact_mobile: DF.SmallText | None - contact_person: DF.Link | None - conversion_rate: DF.Float - cost_center: DF.Link | None - credit_to: DF.Link - currency: DF.Link | None - disable_rounded_total: DF.Check - discount_amount: DF.Currency - due_date: DF.Date | None - from_date: DF.Date | None - grand_total: DF.Currency - group_same_items: DF.Check - hold_comment: DF.SmallText | None - ignore_default_payment_terms_template: DF.Check - ignore_pricing_rule: DF.Check - in_words: DF.Data | None - incoterm: DF.Link | None - inter_company_invoice_reference: DF.Link | None - is_internal_supplier: DF.Check - is_old_subcontracting_flow: DF.Check - is_opening: DF.Literal["No", "Yes"] - is_paid: DF.Check - is_return: DF.Check - is_subcontracted: DF.Check - items: DF.Table[PurchaseInvoiceItem] - language: DF.Data | None - letter_head: DF.Link | None - mode_of_payment: DF.Link | None - named_place: DF.Data | None - naming_series: DF.Literal["ACC-PINV-.YYYY.-", "ACC-PINV-RET-.YYYY.-"] - net_total: DF.Currency - on_hold: DF.Check - only_include_allocated_payments: DF.Check - other_charges_calculation: DF.TextEditor | None - outstanding_amount: DF.Currency - paid_amount: DF.Currency - party_account_currency: DF.Link | None - payment_schedule: DF.Table[PaymentSchedule] - payment_terms_template: DF.Link | None - per_received: DF.Percent - plc_conversion_rate: DF.Float - posting_date: DF.Date - posting_time: DF.Time | None - price_list_currency: DF.Link | None - pricing_rules: DF.Table[PricingRuleDetail] - project: DF.Link | None - rejected_warehouse: DF.Link | None - release_date: DF.Date | None - remarks: DF.SmallText | None - represents_company: DF.Link | None - return_against: DF.Link | None - rounded_total: DF.Currency - rounding_adjustment: DF.Currency - scan_barcode: DF.Data | None - select_print_heading: DF.Link | None - set_from_warehouse: DF.Link | None - set_posting_time: DF.Check - set_warehouse: DF.Link | None - shipping_address: DF.Link | None - shipping_address_display: DF.TextEditor | None - shipping_rule: DF.Link | None - status: DF.Literal[ - "", - "Draft", - "Return", - "Debit Note Issued", - "Submitted", - "Paid", - "Partly Paid", - "Unpaid", - "Overdue", - "Cancelled", - "Internal Transfer", - ] - subscription: DF.Link | None - supplied_items: DF.Table[PurchaseReceiptItemSupplied] - supplier: DF.Link - supplier_address: DF.Link | None - supplier_group: DF.Link | None - supplier_name: DF.Data | None - supplier_warehouse: DF.Link | None - tax_category: DF.Link | None - tax_id: DF.ReadOnly | None - tax_withheld_vouchers: DF.Table[TaxWithheldVouchers] - tax_withholding_category: DF.Link | None - tax_withholding_net_total: DF.Currency - taxes: DF.Table[PurchaseTaxesandCharges] - taxes_and_charges: DF.Link | None - taxes_and_charges_added: DF.Currency - taxes_and_charges_deducted: DF.Currency - tc_name: DF.Link | None - terms: DF.TextEditor | None - title: DF.Data | None - to_date: DF.Date | None - total: DF.Currency - total_advance: DF.Currency - total_net_weight: DF.Float - total_qty: DF.Float - total_taxes_and_charges: DF.Currency - unrealized_profit_loss_account: DF.Link | None - update_billed_amount_in_purchase_order: DF.Check - update_billed_amount_in_purchase_receipt: DF.Check - update_outstanding_for_self: DF.Check - update_stock: DF.Check - use_company_roundoff_cost_center: DF.Check - use_transaction_date_exchange_rate: DF.Check - write_off_account: DF.Link | None - write_off_amount: DF.Currency - write_off_cost_center: DF.Link | None - # end: auto-generated types - ->>>>>>> a467888a67 (chore: remove 'repost_required' from purchase invoice) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.status_updater = [ @@ -760,20 +590,6 @@ class PurchaseInvoice(BuyingController): self.process_common_party_accounting() def on_update_after_submit(self): -<<<<<<< HEAD - if hasattr(self, "repost_required"): - fields_to_check = [ - "cash_bank_account", - "write_off_account", - "unrealized_profit_loss_account", - ] - child_tables = {"items": ("expense_account",), "taxes": ("account_head",)} - self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables) - if self.needs_repost: - self.validate_for_repost() - self.db_set("repost_required", self.needs_repost) - self.repost_accounting_entries() -======= fields_to_check = [ "cash_bank_account", "write_off_account", @@ -785,7 +601,6 @@ class PurchaseInvoice(BuyingController): if self.needs_repost: self.validate_for_repost() self.repost_accounting_entries() ->>>>>>> 07fc952a43 (refactor: remove attribute check on 'repost_required') def make_gl_entries(self, gl_entries=None, from_repost=False): update_outstanding = "No" if (cint(self.is_paid) or self.write_off_account) else "Yes" diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 13be7f23ff7..bc458ffa272 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -49,28 +49,6 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends e this.frm.toggle_reqd("due_date", !this.frm.doc.is_return); -<<<<<<< HEAD - if (this.frm.doc.repost_required && this.frm.doc.docstatus===1) { - this.frm.set_intro(__("Accounting entries for this invoice needs to be reposted. Please click on 'Repost' button to update.")); - this.frm.add_custom_button(__('Repost Accounting Entries'), - () => { - this.frm.call({ - doc: this.frm.doc, - method: 'repost_accounting_entries', - freeze: true, - freeze_message: __('Reposting...'), - callback: (r) => { - if (!r.exc) { - frappe.msgprint(__('Accounting Entries are reposted')); - me.frm.refresh(); - } - } - }); - }).removeClass('btn-default').addClass('btn-warning'); - } - -======= ->>>>>>> f3fda9ce98 (chore: remove stale code from sales invoice) if (this.frm.doc.is_return) { this.frm.return_print_format = "Sales Invoice Return"; } diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 7f64bee6a4a..a254c917189 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -49,190 +49,6 @@ form_grid_templates = {"items": "templates/form_grid/item_grid.html"} class SalesInvoice(SellingController): -<<<<<<< HEAD -======= - # begin: auto-generated types - # This code is auto-generated. Do not modify anything in this block. - - from typing import TYPE_CHECKING - - if TYPE_CHECKING: - from frappe.types import DF - - from erpnext.accounts.doctype.payment_schedule.payment_schedule import PaymentSchedule - from erpnext.accounts.doctype.pricing_rule_detail.pricing_rule_detail import PricingRuleDetail - from erpnext.accounts.doctype.sales_invoice_advance.sales_invoice_advance import SalesInvoiceAdvance - from erpnext.accounts.doctype.sales_invoice_item.sales_invoice_item import SalesInvoiceItem - from erpnext.accounts.doctype.sales_invoice_payment.sales_invoice_payment import SalesInvoicePayment - from erpnext.accounts.doctype.sales_invoice_timesheet.sales_invoice_timesheet import ( - SalesInvoiceTimesheet, - ) - from erpnext.accounts.doctype.sales_taxes_and_charges.sales_taxes_and_charges import ( - SalesTaxesandCharges, - ) - from erpnext.selling.doctype.sales_team.sales_team import SalesTeam - from erpnext.stock.doctype.packed_item.packed_item import PackedItem - - account_for_change_amount: DF.Link | None - additional_discount_account: DF.Link | None - additional_discount_percentage: DF.Float - address_display: DF.TextEditor | None - advances: DF.Table[SalesInvoiceAdvance] - against_income_account: DF.SmallText | None - allocate_advances_automatically: DF.Check - amended_from: DF.Link | None - amount_eligible_for_commission: DF.Currency - apply_discount_on: DF.Literal["", "Grand Total", "Net Total"] - auto_repeat: DF.Link | None - base_change_amount: DF.Currency - base_discount_amount: DF.Currency - base_grand_total: DF.Currency - base_in_words: DF.SmallText | None - base_net_total: DF.Currency - base_paid_amount: DF.Currency - base_rounded_total: DF.Currency - base_rounding_adjustment: DF.Currency - base_total: DF.Currency - base_total_taxes_and_charges: DF.Currency - base_write_off_amount: DF.Currency - campaign: DF.Link | None - cash_bank_account: DF.Link | None - change_amount: DF.Currency - commission_rate: DF.Float - company: DF.Link - company_address: DF.Link | None - company_address_display: DF.TextEditor | None - company_tax_id: DF.Data | None - contact_display: DF.SmallText | None - contact_email: DF.Data | None - contact_mobile: DF.SmallText | None - contact_person: DF.Link | None - conversion_rate: DF.Float - cost_center: DF.Link | None - coupon_code: DF.Link | None - currency: DF.Link - customer: DF.Link | None - customer_address: DF.Link | None - customer_group: DF.Link | None - customer_name: DF.SmallText | None - debit_to: DF.Link - disable_rounded_total: DF.Check - discount_amount: DF.Currency - dispatch_address: DF.TextEditor | None - dispatch_address_name: DF.Link | None - dont_create_loyalty_points: DF.Check - due_date: DF.Date | None - from_date: DF.Date | None - grand_total: DF.Currency - group_same_items: DF.Check - ignore_default_payment_terms_template: DF.Check - ignore_pricing_rule: DF.Check - in_words: DF.SmallText | None - incoterm: DF.Link | None - inter_company_invoice_reference: DF.Link | None - is_cash_or_non_trade_discount: DF.Check - is_consolidated: DF.Check - is_debit_note: DF.Check - is_discounted: DF.Check - is_internal_customer: DF.Check - is_opening: DF.Literal["No", "Yes"] - is_pos: DF.Check - is_return: DF.Check - items: DF.Table[SalesInvoiceItem] - language: DF.Link | None - letter_head: DF.Link | None - loyalty_amount: DF.Currency - loyalty_points: DF.Int - loyalty_program: DF.Link | None - loyalty_redemption_account: DF.Link | None - loyalty_redemption_cost_center: DF.Link | None - named_place: DF.Data | None - naming_series: DF.Literal["ACC-SINV-.YYYY.-", "ACC-SINV-RET-.YYYY.-"] - net_total: DF.Currency - only_include_allocated_payments: DF.Check - other_charges_calculation: DF.TextEditor | None - outstanding_amount: DF.Currency - packed_items: DF.Table[PackedItem] - paid_amount: DF.Currency - party_account_currency: DF.Link | None - payment_schedule: DF.Table[PaymentSchedule] - payment_terms_template: DF.Link | None - payments: DF.Table[SalesInvoicePayment] - plc_conversion_rate: DF.Float - po_date: DF.Date | None - po_no: DF.Data | None - pos_profile: DF.Link | None - posting_date: DF.Date - posting_time: DF.Time | None - price_list_currency: DF.Link - pricing_rules: DF.Table[PricingRuleDetail] - project: DF.Link | None - redeem_loyalty_points: DF.Check - remarks: DF.SmallText | None - represents_company: DF.Link | None - return_against: DF.Link | None - rounded_total: DF.Currency - rounding_adjustment: DF.Currency - sales_partner: DF.Link | None - sales_team: DF.Table[SalesTeam] - scan_barcode: DF.Data | None - select_print_heading: DF.Link | None - selling_price_list: DF.Link - set_posting_time: DF.Check - set_target_warehouse: DF.Link | None - set_warehouse: DF.Link | None - shipping_address: DF.TextEditor | None - shipping_address_name: DF.Link | None - shipping_rule: DF.Link | None - source: DF.Link | None - status: DF.Literal[ - "", - "Draft", - "Return", - "Credit Note Issued", - "Submitted", - "Paid", - "Partly Paid", - "Unpaid", - "Unpaid and Discounted", - "Partly Paid and Discounted", - "Overdue and Discounted", - "Overdue", - "Cancelled", - "Internal Transfer", - ] - subscription: DF.Link | None - tax_category: DF.Link | None - tax_id: DF.Data | None - taxes: DF.Table[SalesTaxesandCharges] - taxes_and_charges: DF.Link | None - tc_name: DF.Link | None - terms: DF.TextEditor | None - territory: DF.Link | None - timesheets: DF.Table[SalesInvoiceTimesheet] - title: DF.Data | None - to_date: DF.Date | None - total: DF.Currency - total_advance: DF.Currency - total_billing_amount: DF.Currency - total_billing_hours: DF.Float - total_commission: DF.Currency - total_net_weight: DF.Float - total_qty: DF.Float - total_taxes_and_charges: DF.Currency - unrealized_profit_loss_account: DF.Link | None - update_billed_amount_in_delivery_note: DF.Check - update_billed_amount_in_sales_order: DF.Check - update_outstanding_for_self: DF.Check - update_stock: DF.Check - use_company_roundoff_cost_center: DF.Check - write_off_account: DF.Link | None - write_off_amount: DF.Currency - write_off_cost_center: DF.Link | None - write_off_outstanding_amount_automatically: DF.Check - # end: auto-generated types - ->>>>>>> 06c5334f2a (chore: remove stale 'repost_required' flag from sales invoice) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.status_updater = [ @@ -715,26 +531,6 @@ class SalesInvoice(SellingController): data.sales_invoice = sales_invoice def on_update_after_submit(self): -<<<<<<< HEAD - if hasattr(self, "repost_required"): - fields_to_check = [ - "additional_discount_account", - "cash_bank_account", - "account_for_change_amount", - "write_off_account", - "loyalty_redemption_account", - "unrealized_profit_loss_account", - ] - child_tables = { - "items": ("income_account", "expense_account", "discount_account"), - "taxes": ("account_head",), - } - self.needs_repost = self.check_if_fields_updated(fields_to_check, child_tables) - if self.needs_repost: - self.validate_for_repost() - self.db_set("repost_required", self.needs_repost) - self.repost_accounting_entries() -======= fields_to_check = [ "additional_discount_account", "cash_bank_account", @@ -752,7 +548,6 @@ class SalesInvoice(SellingController): if self.needs_repost: self.validate_for_repost() self.repost_accounting_entries() ->>>>>>> 07fc952a43 (refactor: remove attribute check on 'repost_required') def set_paid_amount(self): paid_amount = 0.0