This commit is contained in:
2026-02-27 05:48:07 +01:00
parent 02993336de
commit 4eae444c93
3 changed files with 228 additions and 125 deletions

View File

@@ -15,6 +15,7 @@ import datetime
import logging
import json
from trytond.exceptions import UserWarning, UserError
from trytond.modules.purchase_trade.numbers_to_words import number_to_words
logger = logging.getLogger(__name__)
@@ -264,13 +265,31 @@ class Sale(metaclass=PoolMeta):
else:
return ''
@property
def report_qt(self):
if self.lines:
return number_to_words(self.lines[0].quantity)
else:
return ''
@property
def report_price(self):
if self.lines:
return number_to_words(self.lines[0].unit_price)
else:
return ''
@property
def report_shipment(self):
if self.lines:
if len(self.lines[0].lots)>1:
shipment = self.lines[0].lots[1].lot_shipment_in
if shipment:
info = 'B/L ' + shipment.bl_number + ' ' + shipment.note
info = 'B/L ' + shipment.bl_number
if shipment.container and shipment.container[0].container_no:
info += ' ' + shipment.container[0].container_no
if shipment.note:
info += ' ' + shipment.note
return info
else:
return ''