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