Broker DN/CN ICT
This commit is contained in:
3886
modules/account_invoice/commission__ict_final.fodt
Normal file
3886
modules/account_invoice/commission__ict_final.fodt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -326,6 +326,19 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="action" ref="report_invoice_ict_final"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.action.report" id="report_invoice_ict_commission_final">
|
||||
<field name="name">CN/DN Commission</field>
|
||||
<field name="model">account.invoice</field>
|
||||
<field name="report_name">account.invoice</field>
|
||||
<field name="report">account_invoice/commission__ict_final.fodt</field>
|
||||
<field name="single" eval="True"/>
|
||||
</record>
|
||||
<record model="ir.action.keyword" id="report_invoice_ict_commission_final_keyword">
|
||||
<field name="keyword">form_print</field>
|
||||
<field name="model">account.invoice,-1</field>
|
||||
<field name="action" ref="report_invoice_ict_commission_final"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.sequence.type" id="sequence_type_account_invoice">
|
||||
<field name="name">Invoice</field>
|
||||
</record>
|
||||
|
||||
@@ -4101,7 +4101,7 @@
|
||||
<text:p text:style-name="P16" loext:marker-style-name="T3"><text:span text:style-name="T7">TOTAL DUE TO US</text:span><text:span text:style-name="T7"/></text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Tableau6.B3" office:value-type="string">
|
||||
<text:p text:style-name="P17" loext:marker-style-name="T3"><text:span text:style-name="T7"><text:placeholder text:placeholder-type="text"><invoice.currency.code></text:placeholder></text:span><text:span text:style-name="T7"/></text:p>
|
||||
<text:p text:style-name="P17" loext:marker-style-name="T3"><text:span text:style-name="T7"><text:placeholder text:placeholder-type="text"><invoice.currency.name></text:placeholder></text:span><text:span text:style-name="T7"/></text:p>
|
||||
</table:table-cell>
|
||||
<table:table-cell table:style-name="Tableau6.B3" office:value-type="string">
|
||||
<text:p text:style-name="P19" loext:marker-style-name="T3"><text:span text:style-name="T7"><text:placeholder text:placeholder-type="text"><format_currency(invoice.total_amount, invoice.party.lang, invoice.currency)></text:placeholder></text:span><text:span text:style-name="T7"/></text:p>
|
||||
@@ -4124,3 +4124,4 @@
|
||||
</office:text>
|
||||
</office:body>
|
||||
</office:document>
|
||||
|
||||
|
||||
@@ -63,6 +63,8 @@ class Configuration(ModelSingleton, ModelSQL, ModelView):
|
||||
'Invoice'),
|
||||
('invoice_cndn_report_label', 'account_invoice',
|
||||
'report_invoice_ict_final', 'CN/DN'),
|
||||
('invoice_commission_cndn_report_label', 'account_invoice',
|
||||
'report_invoice_ict_commission_final', 'CN/DN Commission'),
|
||||
('invoice_prepayment_report_label', 'account_invoice',
|
||||
'report_prepayment', 'Prepayment'),
|
||||
('invoice_packing_list_report_label', 'purchase_trade',
|
||||
@@ -90,6 +92,10 @@ class Configuration(ModelSingleton, ModelSQL, ModelView):
|
||||
invoice_report_label = fields.Char("Invoice Menu Label")
|
||||
invoice_cndn_report_template = fields.Char("CN/DN Template")
|
||||
invoice_cndn_report_label = fields.Char("CN/DN Menu Label")
|
||||
invoice_commission_cndn_report_template = fields.Char(
|
||||
"CN/DN Commission Template")
|
||||
invoice_commission_cndn_report_label = fields.Char(
|
||||
"CN/DN Commission Menu Label")
|
||||
invoice_prepayment_report_template = fields.Char("Prepayment Template")
|
||||
invoice_prepayment_report_label = fields.Char("Prepayment Menu Label")
|
||||
invoice_packing_list_report_template = fields.Char("Packing List Template")
|
||||
|
||||
@@ -1340,6 +1340,27 @@ class Invoice(metaclass=PoolMeta):
|
||||
return ''
|
||||
return self._format_report_quantity_display(lbs)
|
||||
|
||||
@property
|
||||
def report_gross_lbs_display(self):
|
||||
lbs = self.report_gross_lbs
|
||||
if lbs == '':
|
||||
return ''
|
||||
return self._format_report_quantity_display(lbs)
|
||||
|
||||
@property
|
||||
def report_weight_difference_display(self):
|
||||
difference = self.report_weight_difference
|
||||
if difference == '':
|
||||
return ''
|
||||
return self._format_report_quantity_display(difference)
|
||||
|
||||
@property
|
||||
def report_weight_difference_lbs_display(self):
|
||||
lbs = self.report_weight_difference_lbs
|
||||
if lbs == '':
|
||||
return ''
|
||||
return self._format_report_quantity_display(lbs)
|
||||
|
||||
@property
|
||||
def report_gross(self):
|
||||
if self.lines:
|
||||
@@ -1386,6 +1407,32 @@ class Invoice(metaclass=PoolMeta):
|
||||
unit = self._get_report_invoice_line_unit(invoice_line) if invoice_line else None
|
||||
return self._convert_report_quantity_to_lbs(net, unit)
|
||||
|
||||
@property
|
||||
def report_gross_lbs(self):
|
||||
gross = self.report_gross
|
||||
if gross == '':
|
||||
return ''
|
||||
invoice_line = self._get_report_invoice_line()
|
||||
unit = self._get_report_invoice_line_unit(invoice_line) if invoice_line else None
|
||||
return self._convert_report_quantity_to_lbs(gross, unit)
|
||||
|
||||
@property
|
||||
def report_weight_difference(self):
|
||||
gross = self.report_gross
|
||||
net = self.report_net
|
||||
if gross == '' or net == '':
|
||||
return ''
|
||||
return gross - net
|
||||
|
||||
@property
|
||||
def report_weight_difference_lbs(self):
|
||||
difference = self.report_weight_difference
|
||||
if difference == '':
|
||||
return ''
|
||||
invoice_line = self._get_report_invoice_line()
|
||||
unit = self._get_report_invoice_line_unit(invoice_line) if invoice_line else None
|
||||
return self._convert_report_quantity_to_lbs(difference, unit)
|
||||
|
||||
@property
|
||||
def report_weight_unit_upper(self):
|
||||
invoice_line = self._get_report_invoice_line()
|
||||
@@ -1905,6 +1952,9 @@ class InvoiceReport(ReportTemplateMixin, BaseInvoiceReport):
|
||||
elif (report_path.endswith('/invoice_ict_final.fodt')
|
||||
or action_name == 'CN/DN'):
|
||||
field_name = 'invoice_cndn_report_template'
|
||||
elif (report_path.endswith('/commission__ict_final.fodt')
|
||||
or action_name == 'CN/DN Commission'):
|
||||
field_name = 'invoice_commission_cndn_report_template'
|
||||
else:
|
||||
field_name = 'invoice_report_template'
|
||||
return cls._resolve_template_path(action, field_name, 'account_invoice')
|
||||
|
||||
@@ -4555,6 +4555,8 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
sale_final_report_template='sale_final_melya.fodt',
|
||||
invoice_report_template='invoice_melya.fodt',
|
||||
invoice_cndn_report_template='invoice_ict_final.fodt',
|
||||
invoice_commission_cndn_report_template=(
|
||||
'commission__ict_final.fodt'),
|
||||
invoice_prepayment_report_template='prepayment.fodt',
|
||||
invoice_packing_list_report_template='packing_list.fodt',
|
||||
invoice_payment_order_report_template='payment_order.fodt',
|
||||
@@ -4585,6 +4587,12 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
'report': 'account_invoice/invoice_ict_final.fodt',
|
||||
}),
|
||||
'account_invoice/invoice_ict_final.fodt')
|
||||
self.assertEqual(
|
||||
report_class._resolve_configured_report_path({
|
||||
'name': 'CN/DN Commission',
|
||||
'report': 'account_invoice/commission__ict_final.fodt',
|
||||
}),
|
||||
'account_invoice/commission__ict_final.fodt')
|
||||
self.assertEqual(
|
||||
report_class._resolve_configured_report_path({
|
||||
'name': 'Payment Order',
|
||||
@@ -4606,6 +4614,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
Mock(
|
||||
invoice_report_template='',
|
||||
invoice_cndn_report_template='',
|
||||
invoice_commission_cndn_report_template='',
|
||||
invoice_prepayment_report_template='',
|
||||
invoice_packing_list_report_template='',
|
||||
invoice_payment_order_report_template='',
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
<field name="invoice_cndn_report_template" colspan="3"/>
|
||||
<label name="invoice_cndn_report_label"/>
|
||||
<field name="invoice_cndn_report_label" colspan="3"/>
|
||||
<label name="invoice_commission_cndn_report_template"/>
|
||||
<field name="invoice_commission_cndn_report_template" colspan="3"/>
|
||||
<label name="invoice_commission_cndn_report_label"/>
|
||||
<field name="invoice_commission_cndn_report_label" colspan="3"/>
|
||||
<label name="invoice_prepayment_report_template"/>
|
||||
<field name="invoice_prepayment_report_template" colspan="3"/>
|
||||
<label name="invoice_prepayment_report_label"/>
|
||||
|
||||
Reference in New Issue
Block a user