Changeset 2336
- Timestamp:
- 11/05/08 16:04:19 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
ecs/packages/ECS/branches/phonepha/utils/billingTools.py
r2335 r2336 44 44 from Products.PyDB.Adresse import Adresse 45 45 from Products.PyDB.Country import Country 46 from Products.PhonePha.storage.ClothingProduct import ClothingProduct 46 47 47 48 from emencia.ecsreportroom.reportroom import generatePDF … … 142 143 total_by_vat = {} 143 144 for line in billline: 144 product = ProductBootique.search(query={'reference': line['referencebillline']})[0] 145 145 try: 146 product = ProductBootique.search(query={'reference': line['referencebillline']})[0] 147 except: 148 product = ClothingProduct.search(query={'reference': line['referencebillline']})[0] 149 146 150 vat_value = phonepha_vatvalue.select(vat_vat_id=product['vat_idvat']).fetchall()[0].value 147 151 line['unitpricehtbillline'] = float(line['unitpricebillline']) / float(((100 + vat_value) / 100)) … … 225 229 xml['billing_address'] = data['adrs_fact'] 226 230 xml['delivery_address'] = data['adrs_livr'] 227 xml['amountbill'] = "%.2f" % float(data['amountart'] + xml['deliverycostbill'])231 xml['amountbill'] = "%.2f" % (float(data['amountart']) + float(xml['deliverycostbill'])) 228 232 xml['lines'] = data['billline'] 229 233 … … 233 237 xml['customer_id'] = data['client'].idclient 234 238 xml['customer_id_str'] = data['client'].loginclient 235 xml['netoftaxbill'] = "%.2f" % xml['netoftaxbill']236 xml['deliverycostbill'] = "%.2f" % xml['deliverycostbill']237 xml['amounttax'] = "%.2f" % xml['amounttax']239 xml['netoftaxbill'] = "%.2f" % float(xml['netoftaxbill']) 240 xml['deliverycostbill'] = "%.2f" % float(xml['deliverycostbill']) 241 xml['amounttax'] = "%.2f" % float(xml['amounttax']) 238 242 res = generatePDF(xsl, xml) 239 243 ecs/packages/ECS/branches/phonepha/utils/templates/Billing_pdf.pt
r2335 r2336 173 173 <pageTemplate id="first"> 174 174 <pageGraphics> 175 <image x="5mm" y="260mm" file="logo.jpg" width=" 300mm" height="30mm" />175 <image x="5mm" y="260mm" file="logo.jpg" width="90mm" /> 176 176 <drawCentredString x="100mm" y="1cm">TFT Souve, 71190 Thil France</drawCentredString> 177 177 <drawCentredString x="100mm" y="0.6cm">SIRET : 500 554 019</drawCentredString>
