Changeset 2336

Show
Ignore:
Timestamp:
11/05/08 16:04:19 (2 months ago)
Author:
rage
Message:

fix bug in pdf creation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ecs/packages/ECS/branches/phonepha/utils/billingTools.py

    r2335 r2336  
    4444from Products.PyDB.Adresse import Adresse 
    4545from Products.PyDB.Country import Country 
     46from Products.PhonePha.storage.ClothingProduct import ClothingProduct 
    4647 
    4748from emencia.ecsreportroom.reportroom import generatePDF 
     
    142143    total_by_vat = {} 
    143144    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 
    146150        vat_value = phonepha_vatvalue.select(vat_vat_id=product['vat_idvat']).fetchall()[0].value 
    147151        line['unitpricehtbillline'] = float(line['unitpricebillline']) / float(((100 + vat_value) / 100)) 
     
    225229    xml['billing_address'] = data['adrs_fact'] 
    226230    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'])
    228232    xml['lines'] = data['billline'] 
    229233 
     
    233237    xml['customer_id'] = data['client'].idclient 
    234238    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']) 
    238242    res = generatePDF(xsl, xml) 
    239243 
  • ecs/packages/ECS/branches/phonepha/utils/templates/Billing_pdf.pt

    r2335 r2336  
    173173        <pageTemplate id="first"> 
    174174          <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" /> 
    176176            <drawCentredString x="100mm" y="1cm">TFT Souve, 71190 Thil France</drawCentredString> 
    177177            <drawCentredString x="100mm" y="0.6cm">SIRET : 500 554 019</drawCentredString>