02.04.26
This commit is contained in:
@@ -191,6 +191,19 @@ class Invoice(metaclass=PoolMeta):
|
||||
details.append(detail)
|
||||
return '\n'.join(details)
|
||||
|
||||
@property
|
||||
def report_trade_blocks(self):
|
||||
sale = self._get_report_sale()
|
||||
if sale and getattr(sale, 'report_trade_blocks', None):
|
||||
return sale.report_trade_blocks
|
||||
blocks = []
|
||||
quantity_lines = self.report_quantity_lines.splitlines()
|
||||
rate_lines = self.report_rate_lines.splitlines()
|
||||
for index, quantity_line in enumerate(quantity_lines):
|
||||
price_line = rate_lines[index] if index < len(rate_lines) else ''
|
||||
blocks.append((quantity_line, price_line))
|
||||
return blocks
|
||||
|
||||
@property
|
||||
def report_rate_currency_upper(self):
|
||||
line = self._get_report_invoice_line()
|
||||
@@ -337,6 +350,17 @@ class Invoice(metaclass=PoolMeta):
|
||||
return ''
|
||||
return round(Decimal(net) * Decimal('2204.62'),2)
|
||||
|
||||
@property
|
||||
def report_weight_unit_upper(self):
|
||||
sale = self._get_report_sale()
|
||||
if sale and getattr(sale, 'report_quantity_unit_upper', None):
|
||||
return sale.report_quantity_unit_upper
|
||||
line = self._get_report_trade_line() or self._get_report_invoice_line()
|
||||
unit = getattr(line, 'unit', None) if line else None
|
||||
if unit and unit.rec_name:
|
||||
return unit.rec_name.upper()
|
||||
return 'KGS'
|
||||
|
||||
@property
|
||||
def report_bl_date(self):
|
||||
shipment = self._get_report_shipment()
|
||||
|
||||
Reference in New Issue
Block a user