add placeholder 'rate'
This commit is contained in:
parent
a3cba97892
commit
722b265c33
5 changed files with 28 additions and 9 deletions
12
planner.py
12
planner.py
|
@ -515,6 +515,15 @@ class ScheduledBooking(DeactivableMixin, ModelSQL, ModelView):
|
|||
quantity_txt = Report.format_number(
|
||||
quantity, lang=None, digits=uom_digits)
|
||||
|
||||
asset_rate = '-'
|
||||
if quantity and amount is not None:
|
||||
asset_rate = '%(rate)s %(currency)s/%(uom)s' % {
|
||||
'rate': Report.format_number(
|
||||
amount / quantity, lang=None,
|
||||
digits=to_book.currency.digits),
|
||||
'currency': to_book.currency.symbol,
|
||||
'uom': to_book.quantity_uom.symbol}
|
||||
|
||||
return Template(linedata.get('description')).safe_substitute({
|
||||
'date': Report.format_date(line_date, lang=None),
|
||||
'month': line_date.month,
|
||||
|
@ -522,7 +531,8 @@ class ScheduledBooking(DeactivableMixin, ModelSQL, ModelView):
|
|||
'amount': Report.format_currency(
|
||||
amount, lang=None, currency=from_book.currency)
|
||||
if (amount is not None) and from_book else '-',
|
||||
'quantity': quantity_txt})
|
||||
'quantity': quantity_txt,
|
||||
'rate': asset_rate})
|
||||
|
||||
@classmethod
|
||||
def update_next_occurence(cls, records, query_date=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue