Polish linkage report table spacing
This commit is contained in:
@@ -1721,6 +1721,8 @@ class ShipmentIn(metaclass=PoolMeta):
|
||||
getattr(product, 'name', None)
|
||||
or cls._report_rec_name(product)
|
||||
or 'Fee')
|
||||
if label.startswith('[') and '] ' in label:
|
||||
label = label.split('] ', 1)[1]
|
||||
return label
|
||||
|
||||
def _get_report_linkage_summary_rows(self):
|
||||
@@ -1844,10 +1846,10 @@ class ShipmentIn(metaclass=PoolMeta):
|
||||
-self._report_line_amount(line)))
|
||||
for fee in self._get_report_linkage_fees():
|
||||
rows.append(self._get_report_linkage_fee_detail_row(fee))
|
||||
total = sum((row[-1] for row in rows), Decimal('0'))
|
||||
total = sum((row[7] for row in rows), Decimal('0'))
|
||||
if rows:
|
||||
rows.append(('A', 'Total', '', '', '', '', total, total))
|
||||
rows.append(('P&L', '', '', '', '', '', total, total))
|
||||
rows.append(('A', 'Total', '', '', '', '', total, total, 'total'))
|
||||
rows.append(('P&L', '', '', '', '', '', total, total, 'pnl'))
|
||||
return rows
|
||||
|
||||
def _get_report_linkage_detail_row(self, group, label, trade, line, amount):
|
||||
@@ -1867,6 +1869,7 @@ class ShipmentIn(metaclass=PoolMeta):
|
||||
quantity,
|
||||
amount,
|
||||
amount,
|
||||
'line',
|
||||
)
|
||||
|
||||
def _get_report_linkage_fee_detail_row(self, fee):
|
||||
@@ -1888,7 +1891,7 @@ class ShipmentIn(metaclass=PoolMeta):
|
||||
quantity = self._report_line_quantity(trade_line)
|
||||
return (
|
||||
'A',
|
||||
self._report_rec_name(product) or 'Fee',
|
||||
self._report_linkage_fee_label(fee),
|
||||
self._report_rec_name(getattr(fee, 'supplier', None)),
|
||||
self._report_number(trade),
|
||||
' '.join(part for part in [
|
||||
@@ -1898,6 +1901,7 @@ class ShipmentIn(metaclass=PoolMeta):
|
||||
self._format_report_quantity(quantity or 0),
|
||||
amount,
|
||||
amount,
|
||||
'fee',
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@@ -2168,7 +2172,7 @@ class ShipmentIn(metaclass=PoolMeta):
|
||||
return self._report_table_rows(
|
||||
self._get_report_linkage_detail_rows(),
|
||||
('group', 'cost_type', 'counterpart', 'source', 'unit_price',
|
||||
'quantity', 'estimated', 'validated'),
|
||||
'quantity', 'estimated', 'validated', 'kind'),
|
||||
{'estimated', 'validated'})
|
||||
|
||||
def get_rec_name(self, name=None):
|
||||
|
||||
@@ -6669,7 +6669,7 @@ description</t></is></c>
|
||||
shipment.bl_date = datetime.date(2026, 4, 30)
|
||||
freight_product = SimpleNamespace(
|
||||
rec_name='[Maritime Freight] Maritime freight',
|
||||
name='Maritime freight')
|
||||
name='[Maritime Freight] Maritime freight')
|
||||
shipment.fees = [
|
||||
SimpleNamespace(
|
||||
id=201, product=freight_product, price=Decimal('10'),
|
||||
|
||||
Reference in New Issue
Block a user