02.04.26
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user