Python bindings - no instance necessary anymore

This commit is contained in:
Christoph Holtermann 2014-05-29 23:44:36 +02:00 committed by Geert Janssens
parent 88bfbb19a0
commit 840feccbf7
2 changed files with 52 additions and 52 deletions

View File

@ -162,8 +162,8 @@ def invoice_to_lco(invoice):
ent=Entry(instance=ent) # Add to method_returns_list
descr = ent.GetDescription()
price = gnucash.GncNumeric(instance=ent.GetInvPrice()).to_double()
n = gnucash.GncNumeric(instance=ent.GetQuantity()) # change gncucash_core.py
price = ent.GetInvPrice().to_double()
n = ent.GetQuantity()
uprice = locale.currency(price).rstrip(" EUR")
un = unicode(int(float(n.num())/n.denom())) # choose best way to format numbers according to locale

View File

@ -367,9 +367,9 @@ def __entry__unicode__(self):
"notes_name":"Notes:",
"notes_value":self.GetNotes(),
"quant_name":"Quantity:",
"quant_value":unicode(gnucash.GncNumeric(instance=self.GetQuantity())),
"quant_value":unicode(self.GetQuantity()),
"invprice_name":"InvPrice:",
"invprice_value":unicode(gnucash.GncNumeric(instance=self.GetInvPrice()))}
"invprice_value":unicode(self.GetInvPrice())}
return (u"{date_name:6}{date_value:15} {description_name:13}{description_value:20} {notes_name:7}{notes_value:20}"+
u"{quant_name:12}{quant_value:7} {invprice_name:10}{invprice_value:7}").\