Template Melya

This commit is contained in:
2026-05-27 21:20:20 +02:00
parent c2d4e34516
commit 50ac9f297c
6 changed files with 26 additions and 9 deletions

View File

@@ -1546,7 +1546,6 @@
<table:table-cell table:style-name="Tableau1.A1" office:value-type="string">
<text:p text:style-name="P4"/>
<text:p text:style-name="P8"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T6">Buyer:</text:span></text:span></text:p>
<text:p text:style-name="P8"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T7"><text:placeholder text:placeholder-type="text">&lt;invoice.party.rec_name if invoice.party else &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P8"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T7"><text:placeholder text:placeholder-type="text">&lt;&apos;TAX ID: &apos; + invoice.party_tax_identifier.code if invoice.party_tax_identifier else &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P8"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T7"><text:placeholder text:placeholder-type="text">&lt;for each=&quot;line in invoice.report_address.splitlines()&quot;&gt;</text:placeholder></text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T7"><text:placeholder text:placeholder-type="text">&lt;line&gt;</text:placeholder></text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T7"><text:placeholder text:placeholder-type="text">&lt;/for&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P8"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T7"/></text:span></text:p>
@@ -1705,7 +1704,7 @@
<text:p text:style-name="P19"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T6">Net weight: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T12"><text:placeholder text:placeholder-type="text">&lt;format_number_symbol(invoice.report_net, invoice.party.lang, invoice.lines[0].unit, digits=2) if invoice.lines else &apos;&apos;&gt;</text:placeholder></text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T9"><text:s/></text:span></text:span></text:p>
<text:p text:style-name="P19"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T6">Gross weight: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T12"><text:placeholder text:placeholder-type="text">&lt;format_number_symbol(invoice.report_gross, invoice.party.lang, invoice.lines[0].unit, digits=2) if invoice.lines else &apos;&apos;&gt;</text:placeholder></text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T9"><text:s/></text:span></text:span></text:p>
<text:p text:style-name="P4"/>
<text:p text:style-name="P8"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T6">Packaging: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T9"><text:placeholder text:placeholder-type="text">&lt;invoice.report_nb_bale or &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P8"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T6">Packaging: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T9"><text:placeholder text:placeholder-type="text">&lt;invoice.report_packaging or &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="Normal"><text:tab/><text:tab/><text:tab/><text:tab/><text:tab/><text:tab/><text:tab/><text:tab/><text:tab/></text:p>
<text:p text:style-name="Standard"><text:placeholder text:placeholder-type="text">&lt;/for&gt;</text:placeholder></text:p>
</office:text>

View File

@@ -1426,7 +1426,6 @@
<table:table-cell table:style-name="Tableau1.A1" office:value-type="string">
<text:p text:style-name="P4"/>
<text:p text:style-name="P7"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T5">Buyer:</text:span></text:span></text:p>
<text:p text:style-name="P7"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T6"><text:placeholder text:placeholder-type="text">&lt;invoice.party.rec_name if invoice.party else &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P7"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T6"><text:placeholder text:placeholder-type="text">&lt;invoice.report_address or &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P7"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T6"><text:placeholder text:placeholder-type="text">&lt;&apos;TAX ID: &apos; + invoice.party_tax_identifier.code if invoice.party_tax_identifier else &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P4"/>
@@ -1491,7 +1490,7 @@
<text:p text:style-name="P11"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T5">Net weight: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T8"><text:placeholder text:placeholder-type="text">&lt;format_number_symbol(invoice.report_net, invoice.party.lang, invoice.lines[0].unit, digits=2) if invoice.lines else &apos;&apos;&gt;</text:placeholder></text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T7"> </text:span></text:span></text:p>
<text:p text:style-name="P11"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T5">Gross weight: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T8"><text:placeholder text:placeholder-type="text">&lt;format_number_symbol(invoice.report_gross, invoice.party.lang, invoice.lines[0].unit, digits=2) if invoice.lines else &apos;&apos;&gt;</text:placeholder></text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T7"> </text:span></text:span></text:p>
<text:p text:style-name="P4"/>
<text:p text:style-name="P7"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T5">Packaging: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T7"><text:placeholder text:placeholder-type="text">&lt;invoice.report_nb_bale or &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="P7"><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T5">Packaging: </text:span></text:span><text:span text:style-name="Police_20_par_20_défaut"><text:span text:style-name="T7"><text:placeholder text:placeholder-type="text">&lt;invoice.report_packaging or &apos;&apos;&gt;</text:placeholder></text:span></text:span></text:p>
<text:p text:style-name="Normal"><text:tab/><text:tab/><text:tab/><text:tab/><text:tab/><text:tab/><text:tab/><text:tab/><text:tab/></text:p>
<text:p text:style-name="Standard"><text:placeholder text:placeholder-type="text">&lt;/for&gt;</text:placeholder></text:p>
</office:text>

View File

@@ -1080,6 +1080,14 @@ class Invoice(metaclass=PoolMeta):
return 'Unchanged'
return nb_bale
@property
def report_packaging(self):
nb_bale = self.report_nb_bale
if nb_bale.startswith('NB ') and ': ' in nb_bale:
label, quantity = nb_bale[3:].split(': ', 1)
return f"{quantity} {label}"
return nb_bale
@property
def report_net_display(self):
net = self.report_net

View File

@@ -4307,6 +4307,18 @@ class PurchaseTradeTestCase(ModuleTestCase):
self.assertEqual(invoice.report_cndn_nb_bale, 'Unchanged')
def test_invoice_report_packaging_displays_quantity_before_unit(self):
'invoice packaging label displays quantity before package unit'
Invoice = Pool().get('account.invoice')
lot = Mock(lot_qt=Decimal('990'), lot_unit=Mock(symbol='BAGS25'))
line = Mock(type='line', quantity=Decimal('1000'), lot=lot)
invoice = Invoice()
invoice.lines = [line]
self.assertEqual(invoice.report_nb_bale, 'NB BAGS25: 990')
self.assertEqual(invoice.report_packaging, '990 BAGS25')
def test_invoice_report_positive_rate_lines_keep_positive_components(self):
'invoice final note pricing section keeps only positive component lines'
Invoice = Pool().get('account.invoice')

View File

@@ -519,10 +519,9 @@
<table:table-cell table:style-name="Tableau1.A1" table:number-columns-spanned="5" office:value-type="string">
<text:p text:style-name="P4" loext:marker-style-name="T7"/>
<text:p text:style-name="P2" loext:marker-style-name="T1"/>
<text:p text:style-name="P1" loext:marker-style-name="T1"><text:span text:style-name="T1"><text:placeholder text:placeholder-type="text">&lt;sale.party.rec_name&gt;</text:placeholder></text:span><text:span text:style-name="T1"/></text:p>
<text:p text:style-name="P1" loext:marker-style-name="T1"><text:span text:style-name="T1"><text:placeholder text:placeholder-type="text">&lt;sale.full_number&gt;</text:placeholder></text:span><text:span text:style-name="T1"/></text:p>
<text:p text:style-name="P1" loext:marker-style-name="T1"><text:span text:style-name="T1"><text:placeholder text:placeholder-type="text">&lt;sale.party.addresses[0].city if sale.party and sale.party.addresses else &apos;&apos;&gt;</text:placeholder></text:span><text:span text:style-name="T1"/></text:p>
<text:p text:style-name="P1" loext:marker-style-name="T1"><text:span text:style-name="T1"><text:placeholder text:placeholder-type="text">&lt;sale.reference if sale.reference else &apos;&apos;&gt;</text:placeholder></text:span><text:span text:style-name="T1"/></text:p>
<text:p text:style-name="P1" loext:marker-style-name="T1"><text:span text:style-name="T1"><text:placeholder text:placeholder-type="text">&lt;for each=&quot;line in sale.report_address.splitlines()&quot;&gt;</text:placeholder></text:span><text:span text:style-name="T1"/></text:p>
<text:p text:style-name="P1" loext:marker-style-name="T1"><text:span text:style-name="T1"><text:placeholder text:placeholder-type="text">&lt;line&gt;</text:placeholder></text:span><text:span text:style-name="T1"/></text:p>
<text:p text:style-name="P1" loext:marker-style-name="T1"><text:span text:style-name="T1"><text:placeholder text:placeholder-type="text">&lt;/for&gt;</text:placeholder></text:span><text:span text:style-name="T1"/></text:p>
<text:p text:style-name="P2" loext:marker-style-name="T1"/>
</table:table-cell>
<table:covered-table-cell/>

View File

@@ -1720,7 +1720,7 @@
</office:binary-data>
</draw:image>
</draw:frame><text:tab/><text:tab/><text:span text:style-name="T1">PROFORMA INVOICE</text:span></text:p>
<text:p text:style-name="Standard"><text:tab/><text:tab/><text:span text:style-name="T10">Proforma Nr:<text:tab/><text:tab/><text:tab/>Date:</text:span></text:p>
<text:p text:style-name="Standard"><text:tab/><text:tab/><text:span text:style-name="T10">Order reference:<text:tab/><text:tab/><text:tab/>Date:</text:span></text:p>
<text:p text:style-name="Standard"><text:tab/><text:tab/><text:span text:style-name="T35"><text:placeholder text:placeholder-type="text">&lt;sale.report_melya_proforma_number&gt;</text:placeholder></text:span><text:tab/><text:tab/><text:tab/><text:span text:style-name="T35"><text:placeholder text:placeholder-type="text">&lt;format_date(sale.sale_date, sale.party.lang) if sale.sale_date else &apos;&apos;&gt;</text:placeholder></text:span></text:p>
<text:p text:style-name="Standard"/>
<text:p text:style-name="Standard"/>