From 68251c6bf3984c65918c9c1020fff34aaca8394a Mon Sep 17 00:00:00 2001 From: Antoine Date: Tue, 13 Feb 2024 18:17:58 +0100 Subject: [PATCH] Siren Number added to sales invoice --- .../doctype/sales_invoice/sales_invoice.json | 59 ++++++++----------- .../doctype/sales_invoice/sales_invoice.py | 47 +++++---------- 2 files changed, 38 insertions(+), 68 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 919488c2cd..023d018bae 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -16,6 +16,7 @@ "is_down_payment_invoice", "company", "company_tax_id", + "siren_number", "column_break1", "posting_date", "posting_time", @@ -164,8 +165,6 @@ "shipping_address_name", "shipping_address", "shipping_addr_col_break", - "dispatch_address_name", - "dispatch_address", "company_address_section", "company_address", "company_addr_col_break", @@ -1222,15 +1221,6 @@ "options": "Account", "print_hide": 1 }, - { - "collapsible": 1, - "collapsible_depends_on": "write_off_amount", - "depends_on": "is_pos", - "fieldname": "column_break4", - "fieldtype": "Section Break", - "label": "Write Off", - "width": "50%" - }, { "fieldname": "write_off_amount", "fieldtype": "Currency", @@ -1489,13 +1479,6 @@ "options": "Sales Partner", "print_hide": 1 }, - { - "fieldname": "column_break10", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "width": "50%" - }, { "fetch_from": "sales_partner.commission_rate", "fetch_if_empty": 1, @@ -1883,20 +1866,27 @@ "no_copy": 1 }, { - "fieldname": "accounting_journal", - "fieldtype": "Link", - "label": "Accounting Journal", - "options": "Accounting Journal", - "read_only": 1 - }, - { - "fieldname": "clearance_date", - "fieldtype": "Date", - "hidden": 1, - "label": "Clearance Date", - "no_copy": 1, - "print_hide": 1 - } + "fieldname": "accounting_journal", + "fieldtype": "Link", + "label": "Accounting Journal", + "options": "Accounting Journal", + "read_only": 1 + }, + { + "fieldname": "clearance_date", + "fieldtype": "Date", + "hidden": 1, + "label": "Clearance Date", + "no_copy": 1, + "print_hide": 1 + }, + { + "fetch_from": "customer.siren_number", + "fieldname": "siren_number", + "fieldtype": "Data", + "label": "SIREN Number", + "read_only": 1 + } ], "icon": "uil uil-file-alt", "idx": 181, @@ -1910,12 +1900,11 @@ "link_fieldname": "consolidated_invoice" } ], - "modified": "2024-01-02 17:25:46.027523", + "modified": "2024-02-13 18:17:27.157676", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", "name_after_submit": 1, - "name_case": "Title Case", "naming_rule": "By \"Naming Series\" field", "owner": "Administrator", "permissions": [ @@ -1969,4 +1958,4 @@ "track_changes": 1, "track_print": 1, "track_seen": 1 -} +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 88106b6ce0..9dc034235a 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -55,27 +55,19 @@ class SalesInvoice(SellingController): 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_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.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 + from frappe.types import DF account_for_change_amount: DF.Link | None + accounting_journal: DF.Link | None additional_discount_account: DF.Link | None additional_discount_percentage: DF.Float address_display: DF.SmallText | None @@ -100,6 +92,7 @@ class SalesInvoice(SellingController): campaign: DF.Link | None cash_bank_account: DF.Link | None change_amount: DF.Currency + clearance_date: DF.Date | None commission_rate: DF.Float company: DF.Link company_address: DF.Link | None @@ -119,10 +112,10 @@ class SalesInvoice(SellingController): debit_to: DF.Link disable_rounded_total: DF.Check discount_amount: DF.Currency - dispatch_address: DF.SmallText | None - dispatch_address_name: DF.Link | None dont_create_loyalty_points: DF.Check + down_payment_against: DF.Link | None due_date: DF.Date | None + external_reference: DF.Data | None from_date: DF.Date | None grand_total: DF.Currency group_same_items: DF.Check @@ -135,6 +128,7 @@ class SalesInvoice(SellingController): is_consolidated: DF.Check is_debit_note: DF.Check is_discounted: DF.Check + is_down_payment_invoice: DF.Check is_internal_customer: DF.Check is_opening: DF.Literal["No", "Yes"] is_pos: DF.Check @@ -151,7 +145,7 @@ class SalesInvoice(SellingController): 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.LongText | None + other_charges_calculation: DF.Text | None outstanding_amount: DF.Currency packed_items: DF.Table[PackedItem] paid_amount: DF.Currency @@ -186,23 +180,9 @@ class SalesInvoice(SellingController): shipping_address: DF.SmallText | None shipping_address_name: DF.Link | None shipping_rule: DF.Link | None + siren_number: DF.Data | 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", - ] + 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 @@ -223,6 +203,7 @@ class SalesInvoice(SellingController): total_qty: DF.Float total_taxes_and_charges: DF.Currency unrealized_profit_loss_account: DF.Link | None + unreconciled_amount: DF.Currency update_billed_amount_in_delivery_note: DF.Check update_billed_amount_in_sales_order: DF.Check update_stock: DF.Check -- GitLab