fix: added tags for discount amount, multiple customer po no, delivery notes
This commit is contained in:
parent
6d2bb9126a
commit
22ebaf1b11
@ -587,5 +587,5 @@ erpnext.patches.v11_1.setup_guardian_role
|
|||||||
execute:frappe.delete_doc('DocType', 'Notification Control')
|
execute:frappe.delete_doc('DocType', 'Notification Control')
|
||||||
erpnext.patches.v11_0.remove_barcodes_field_from_copy_fields_to_variants
|
erpnext.patches.v11_0.remove_barcodes_field_from_copy_fields_to_variants
|
||||||
erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019
|
erpnext.patches.v10_0.item_barcode_childtable_migrate # 16-02-2019
|
||||||
erpnext.patches.v11_0.make_italian_localization_fields # 01-03-2019
|
erpnext.patches.v11_0.make_italian_localization_fields # 07-03-2019
|
||||||
erpnext.patches.v11_1.make_job_card_time_logs
|
erpnext.patches.v11_1.make_job_card_time_logs
|
@ -6,7 +6,6 @@ from erpnext.regional.italy.setup import make_custom_fields, setup_report
|
|||||||
from erpnext.regional.italy import state_codes
|
from erpnext.regional.italy import state_codes
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
company = frappe.get_all('Company', filters = {'country': 'Italy'})
|
company = frappe.get_all('Company', filters = {'country': 'Italy'})
|
||||||
if not company:
|
if not company:
|
||||||
@ -27,4 +26,5 @@ def execute():
|
|||||||
frappe.db.sql("""
|
frappe.db.sql("""
|
||||||
UPDATE tabAddress set {condition} country_code = UPPER(ifnull((select code
|
UPDATE tabAddress set {condition} country_code = UPPER(ifnull((select code
|
||||||
from `tabCountry` where name = `tabAddress`.country), ''))
|
from `tabCountry` where name = `tabAddress`.country), ''))
|
||||||
|
where country_code is null and state_code is null
|
||||||
""".format(condition=condition))
|
""".format(condition=condition))
|
||||||
|
@ -127,22 +127,46 @@
|
|||||||
<ImportoBollo>{{ format_float(doc.stamp_duty) }}</ImportoBollo>
|
<ImportoBollo>{{ format_float(doc.stamp_duty) }}</ImportoBollo>
|
||||||
</DatiBollo>
|
</DatiBollo>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
<ImportoTotaleDocumento>{{ format_float(doc.grand_total) }}</ImportoTotaleDocumento>
|
{%- if doc.discount_amount %}
|
||||||
|
<ScontoMaggiorazione>
|
||||||
|
{%- if doc.discount_amount > 0.0 %}
|
||||||
|
<Tipo>SC</Tipo>
|
||||||
|
{%- else %}
|
||||||
|
<Tipo>MG</Tipo>
|
||||||
|
{%- endif %}
|
||||||
|
{%- if doc.additional_discount_percentage > 0.0 %}
|
||||||
|
<Percentuale>{{ format_float(doc.additional_discount_percentage) }}</Percentuale>
|
||||||
|
{%- endif %}
|
||||||
|
<Importo>{{ format_float(doc.discount_amount) }}</Importo>
|
||||||
|
</ScontoMaggiorazione>
|
||||||
|
{%- endif %}
|
||||||
|
<ImportoTotaleDocumento>{{ format_float(doc.rounded_total or doc.grand_total) }}</ImportoTotaleDocumento>
|
||||||
<Causale>VENDITA</Causale>
|
<Causale>VENDITA</Causale>
|
||||||
</DatiGeneraliDocumento>
|
</DatiGeneraliDocumento>
|
||||||
{%- if doc.po_no %}
|
{%- for row in doc.e_invoice_items %}
|
||||||
<DatiOrdineAcquisto>
|
{%- if row.customer_po_no %}
|
||||||
<IdDocumento>{{ doc.po_no }}</IdDocumento>
|
<DatiOrdineAcquisto>
|
||||||
{%- if doc.po_date %}
|
<IdDocumento>{{ row.customer_po_no }}</IdDocumento>
|
||||||
<Data>{{ doc.po_date }}</Data>
|
{%- if row.customer_po_date %}
|
||||||
|
<Data>{{ row.customer_po_date }}</Data>
|
||||||
|
{%- endif %}
|
||||||
|
</DatiOrdineAcquisto>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</DatiOrdineAcquisto>
|
{%- endfor %}
|
||||||
{%- endif %}
|
|
||||||
{%- if doc.is_return and doc.return_against_unamended %}
|
{%- if doc.is_return and doc.return_against_unamended %}
|
||||||
<DatiFattureCollegate>
|
<DatiFattureCollegate>
|
||||||
<IdDocumento>{{ doc.return_against_unamended }}</IdDocumento>
|
<IdDocumento>{{ doc.return_against_unamended }}</IdDocumento>
|
||||||
</DatiFattureCollegate>
|
</DatiFattureCollegate>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- for row in doc.e_invoice_items %}
|
||||||
|
{%- if row.delivery_note %}
|
||||||
|
<DatiDDT>
|
||||||
|
<NumeroDDT>{{ row.delivery_note }}</NumeroDDT>
|
||||||
|
<DataDDT>{{ frappe.db.get_value('Delivery Note', row.delivery_note, 'posting_date') }}</DataDDT>
|
||||||
|
<RiferimentoNumeroLinea>{{ row.idx }}</RiferimentoNumeroLinea>
|
||||||
|
</DatiDDT>
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
||||||
{%- if doc.shipping_address_data %}
|
{%- if doc.shipping_address_data %}
|
||||||
<DatiTrasporto>
|
<DatiTrasporto>
|
||||||
<IndirizzoResa>
|
<IndirizzoResa>
|
||||||
@ -198,7 +222,9 @@
|
|||||||
<ModalitaPagamento>{{ payment_term.mode_of_payment_code.split("-")[0] }}</ModalitaPagamento>
|
<ModalitaPagamento>{{ payment_term.mode_of_payment_code.split("-")[0] }}</ModalitaPagamento>
|
||||||
<DataScadenzaPagamento>{{ payment_term.due_date }}</DataScadenzaPagamento>
|
<DataScadenzaPagamento>{{ payment_term.due_date }}</DataScadenzaPagamento>
|
||||||
<ImportoPagamento>{{ format_float(payment_term.payment_amount) }}</ImportoPagamento>
|
<ImportoPagamento>{{ format_float(payment_term.payment_amount) }}</ImportoPagamento>
|
||||||
<IstitutoFinanziario>{{ payment_term.bank_account_name }}</IstitutoFinanziario>
|
{%- if payment_term.bank_account_name %}
|
||||||
|
<IstitutoFinanziario>{{ payment_term.bank_account_name }}</IstitutoFinanziario>
|
||||||
|
{%- endif %}
|
||||||
{%- if payment_term.bank_account_iban %}
|
{%- if payment_term.bank_account_iban %}
|
||||||
<IBAN>{{ payment_term.bank_account_iban }}</IBAN>
|
<IBAN>{{ payment_term.bank_account_iban }}</IBAN>
|
||||||
<ABI>{{ payment_term.bank_account_iban[5:10] }}</ABI>
|
<ABI>{{ payment_term.bank_account_iban[5:10] }}</ABI>
|
||||||
|
@ -26,6 +26,22 @@ def make_custom_fields(update=True):
|
|||||||
print_hide=1, hidden=1, read_only=1, options="currency")
|
print_hide=1, hidden=1, read_only=1, options="currency")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
customer_po_fields = [
|
||||||
|
dict(fieldname='customer_po_details', label='Customer PO',
|
||||||
|
fieldtype='Section Break', insert_after='image'),
|
||||||
|
dict(fieldname='customer_po_no', label='Customer PO No',
|
||||||
|
fieldtype='Data', insert_after='customer_po_details',
|
||||||
|
fetch_from = 'sales_order.po_no',
|
||||||
|
print_hide=1, allow_on_submit=1, fetch_if_empty= 1, read_only=1),
|
||||||
|
dict(fieldname='customer_po_clm_brk', label='',
|
||||||
|
fieldtype='Column Break', insert_after='customer_po_no',
|
||||||
|
print_hide=1, read_only=1),
|
||||||
|
dict(fieldname='customer_po_date', label='Customer PO Date',
|
||||||
|
fieldtype='Date', insert_after='customer_po_clm_brk',
|
||||||
|
fetch_from = 'sales_order.po_date',
|
||||||
|
print_hide=1, allow_on_submit=1, fetch_if_empty= 1, read_only=1)
|
||||||
|
]
|
||||||
|
|
||||||
custom_fields = {
|
custom_fields = {
|
||||||
'Company': [
|
'Company': [
|
||||||
dict(fieldname='sb_e_invoicing', label='E-Invoicing',
|
dict(fieldname='sb_e_invoicing', label='E-Invoicing',
|
||||||
@ -128,7 +144,7 @@ def make_custom_fields(update=True):
|
|||||||
'Purchase Invoice Item': invoice_item_fields,
|
'Purchase Invoice Item': invoice_item_fields,
|
||||||
'Sales Order Item': invoice_item_fields,
|
'Sales Order Item': invoice_item_fields,
|
||||||
'Delivery Note Item': invoice_item_fields,
|
'Delivery Note Item': invoice_item_fields,
|
||||||
'Sales Invoice Item': invoice_item_fields,
|
'Sales Invoice Item': invoice_item_fields + customer_po_fields,
|
||||||
'Quotation Item': invoice_item_fields,
|
'Quotation Item': invoice_item_fields,
|
||||||
'Purchase Order Item': invoice_item_fields,
|
'Purchase Order Item': invoice_item_fields,
|
||||||
'Purchase Receipt Item': invoice_item_fields,
|
'Purchase Receipt Item': invoice_item_fields,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user