This commit is contained in:
2026-04-02 11:16:26 +02:00
parent b644aea007
commit 346a34951d
6 changed files with 129 additions and 2 deletions

View File

@@ -408,6 +408,29 @@ class Sale(metaclass=PoolMeta):
total = sum(Decimal(str(line.quantity or 0)) for line in lines)
return quantity_to_words(total)
return ''
@property
def report_quantity_lines(self):
lines = self._get_report_lines()
if not lines:
return ''
details = []
for line in lines:
quantity = self._format_report_number(
line.quantity, keep_trailing_decimal=True)
unit = line.unit.rec_name.upper() if line.unit and line.unit.rec_name else ''
words = quantity_to_words(Decimal(str(line.quantity or 0)))
period = line.del_period.description if getattr(line, 'del_period', None) else ''
detail = ' '.join(
part for part in [
quantity,
unit,
f"({words})",
f"- {period}" if period else '',
] if part)
if detail:
details.append(detail)
return '\n'.join(details)
@property
def report_nb_bale(self):