Subversion Repositories SmartDukaan

Rev

Rev 6914 | Rev 6916 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6914 Rev 6915
Line 855... Line 855...
855
        html_tr += "<td align='center'> Rs. " + ("%.2f" % lineitem.unit_price) + "</td>"
855
        html_tr += "<td align='center'> Rs. " + ("%.2f" % lineitem.unit_price) + "</td>"
856
        html_tr += "<td align='center'> Rs. " + ("%.2f" % lineitem_total_price) + "</td></tr>"
856
        html_tr += "<td align='center'> Rs. " + ("%.2f" % lineitem_total_price) + "</td></tr>"
857
        total_amount += lineitem_total_price
857
        total_amount += lineitem_total_price
858
        html_table += html_tr
858
        html_table += html_tr
859
    if order.insurer:
859
    if order.insurer:
860
        html_table += "<tr><td align='center'></td><td>Insured Against Theft for 1 Year. <a href='http://www.saholic.com/static/insurance-terms'>Know More</a></td><td align='center'></td><td align='center'></td>"
860
        html_table += "<tr><td align='center'></td><td style='font-style:italic;'>Insured Against Theft for 1 Year. <a href='http://www.saholic.com/static/insurance-terms'>Know More</a></td><td align='center'></td><td align='center'></td>"
861
        html_table += "<td align='center'>" + str(order.insuranceAmount) + "</td></tr>"
861
        html_table += "<td align='center'>" + str(order.insuranceAmount) + "</td></tr>"
862
        total_amount += order.insuranceAmount
862
        total_amount += order.insuranceAmount
863
            
863
            
864
    html_footer = """
864
    html_footer = """
865
        <tr><td colspan=5>&nbsp;</td></tr>
865
        <tr><td colspan=5>&nbsp;</td></tr>
Line 4222... Line 4222...
4222
    text = ("""<b>WARRANTY</b> -  Warranted that the Mobile Handset sold during the Policy Period of 25/02/2013 to 24/02/2014
4222
    text = ("""<b>WARRANTY</b> -  Warranted that the Mobile Handset sold during the Policy Period of 25/02/2013 to 24/02/2014
4223
             are only covered irrespective of date of delivery to the customer""")
4223
             are only covered irrespective of date of delivery to the customer""")
4224
    p = Paragraph(text, style)
4224
    p = Paragraph(text, style)
4225
    Story.append(p)
4225
    Story.append(p)
4226
    Story.append(Spacer(1,0.2*inch))
4226
    Story.append(Spacer(1,0.2*inch))
4227
    text = ("<b>INSURER</b> - New India Assurance company limited.")
4227
    text = ("<b>INSURER</b> -The New India Assurance company limited.")
4228
    p = Paragraph(text, style)
4228
    p = Paragraph(text, style)
4229
    Story.append(p)
4229
    Story.append(p)
4230
    Story.append(Spacer(1,0.2*inch))
4230
    Story.append(Spacer(1,0.2*inch))
4231
    text = ("<b>INSURED</b> - Purchaser of the Mobile Handset OR his/her spouse or children. If the Purchaser is a ‘Company’, user is the duly authorised person.") 
4231
    text = ("<b>INSURED</b> - Purchaser of the Mobile Handset OR his/her spouse or children. If the Purchaser is a ‘Company’, user is the duly authorised person.") 
4232
    p = Paragraph(text, style)
4232
    p = Paragraph(text, style)
Line 4238... Line 4238...
4238
    Story.append(Spacer(1,0.2*inch))
4238
    Story.append(Spacer(1,0.2*inch))
4239
    text = ("<b>RISK COVERAGE</b> – Theft and/or burglary only") 
4239
    text = ("<b>RISK COVERAGE</b> – Theft and/or burglary only") 
4240
    p = Paragraph(text, style)
4240
    p = Paragraph(text, style)
4241
    Story.append(p)
4241
    Story.append(p)
4242
    Story.append(Spacer(1,0.2*inch))
4242
    Story.append(Spacer(1,0.2*inch))
-
 
4243
    text = ("Terms and Conditions of Insurance:") 
-
 
4244
    p = Paragraph(text, styles["h2"])
-
 
4245
    Story.append(p)
-
 
4246
    Story.append(Spacer(1,0.1*inch))
-
 
4247
    text = ("""Insurance Premium paid will not be refunded.""")
-
 
4248
    p = Paragraph(text, styles["bullet"], bulletText='\xe2\x80\xa2')
-
 
4249
    Story.append(p)
-
 
4250
    Story.append(Spacer(1,0.1*inch))
-
 
4251
    text = ("""Insurance will be invalidated for returned products.""")
-
 
4252
    p = Paragraph(text, styles["bullet"], bulletText='\xe2\x80\xa2')
-
 
4253
    Story.append(p)
-
 
4254
    Story.append(Spacer(1,0.2*inch))
4243
    text = ("Exclusions:") 
4255
    text = ("Exclusions:") 
4244
    p = Paragraph(text, styles["h2"])
4256
    p = Paragraph(text, styles["h2"])
4245
    Story.append(p)
4257
    Story.append(p)
4246
    Story.append(Spacer(1,0.1*inch))
4258
    Story.append(Spacer(1,0.1*inch))
4247
    
-
 
4248
    text = ("Insurer is not liable") 
4259
    text = ("Insurer is not liable") 
4249
    p = Paragraph(text, styles["left"])
4260
    p = Paragraph(text, styles["left"])
4250
    Story.append(p)
4261
    Story.append(p)
4251
    Story.append(Spacer(1,0.1*inch))
4262
    Story.append(Spacer(1,0.1*inch))
4252
    
-
 
4253
    text = ("If the handset is not connected to Mobile Service Provider Network")
4263
    text = ("If the handset is not connected to Mobile Service Provider Network")
4254
    p = Paragraph(text, styles["bullet"], bulletText='\xe2\x80\xa2')
4264
    p = Paragraph(text, styles["bullet"], bulletText='\xe2\x80\xa2')
4255
    Story.append(p)
4265
    Story.append(p)
4256
    Story.append(Spacer(1,0.1*inch))
4266
    Story.append(Spacer(1,0.1*inch))
4257
    text = ("Caused by incorrect storage, poor care and maintenance, careless use, negligence.")
4267
    text = ("Caused by incorrect storage, poor care and maintenance, careless use, negligence.")
Line 4300... Line 4310...
4300
     and inform the service provider within 48 hours about theft of handset in order to block the SIM services.""")
4310
     and inform the service provider within 48 hours about theft of handset in order to block the SIM services.""")
4301
    p = Paragraph(text, styles["bullet"], bulletText='\xe2\x80\xa2')
4311
    p = Paragraph(text, styles["bullet"], bulletText='\xe2\x80\xa2')
4302
    Story.append(p)
4312
    Story.append(p)
4303
    Story.append(Spacer(1,0.1*inch))
4313
    Story.append(Spacer(1,0.1*inch))
4304
    text = ("""To intimate Insurance Company about the loss of Mobile Handset within 48 hours 
4314
    text = ("""To intimate Insurance Company about the loss of Mobile Handset within 48 hours 
4305
     through Call Centre No.022-49107910 OR through e-mail saholic.claims@universalinsurance.co.in OR through 
4315
     through Call Centre No.022-49107910 OR through e-mail <u>saholic.claims@universalinsurance.co.in</u> OR through 
4306
     written communication to <i>Universal Insurance brokers (UIB) No.304, Commerce House, 9/1,Cunningham Road, Bangalore – 560052</i>.""")
4316
     written communication to <i>Universal Insurance brokers (UIB) No.304, Commerce House, 9/1,Cunningham Road, Bangalore – 560052</i>.""")
4307
    p = Paragraph(text, styles["bullet"], bulletText='\xe2\x80\xa2')
4317
    p = Paragraph(text, styles["bullet"], bulletText='\xe2\x80\xa2')
4308
    Story.append(p)
4318
    Story.append(p)
4309
    Story.append(Spacer(1,0.1*inch))
4319
    Story.append(Spacer(1,0.1*inch))
4310
    text = ("""Claim documents can be downloaded through UIB Website ***TO BE DECIDED***
4320
    text = ("""Claim documents can be downloaded through UIB Website <u>http://www.universalinsurance.co.in/mobileinsurance/claiminfo.html</u>
4311
    To know or track your claim please contact Call Centre No. 022-49107910 of Universal Insurance brokers (UIB). """)
4321
    <br></br>To know or track your claim please contact Call Centre No. 022-49107910 of Universal Insurance brokers (UIB). """)
4312
    p = Paragraph(text, styles["bullet"], bulletText='\xe2\x80\xa2')
4322
    p = Paragraph(text, styles["bullet"], bulletText='\xe2\x80\xa2')
4313
    Story.append(p)
4323
    Story.append(p)
4314
    Story.append(Spacer(1,0.1*inch))
4324
    Story.append(Spacer(1,0.1*inch))
4315
    text = ("""All the completed claim documents to reach ‘Universal Insurance Brokers (UIB)’ office 
4325
    text = ("""All the completed claim documents to reach ‘Universal Insurance Brokers (UIB)’ office 
4316
    at <i>No.304, Commerce House, 9/1, Cunningham Road, Bangalore – 560052</i> <b>within 21 days</b>.""")
4326
    at <i>No.304, Commerce House, 9/1, Cunningham Road, Bangalore – 560052</i> <b>within 21 days</b>.""")
Line 4352... Line 4362...
4352
    p = Paragraph(text, style)
4362
    p = Paragraph(text, style)
4353
    Story.append(p)
4363
    Story.append(p)
4354
    Story.append(Spacer(1,0.2*inch))
4364
    Story.append(Spacer(1,0.2*inch))
4355
    
4365
    
4356
    doc.build(Story, onFirstPage=myFirstPage)
4366
    doc.build(Story, onFirstPage=myFirstPage)
-
 
4367
 
-
 
4368
if __name__ == '__main__':
-
 
4369
    try:
-
 
4370
        DataService.initialize("transaction", "localhost", True)
-
 
4371
        order = Order.get_by(id = 127)
-
 
4372
        __generate_policy_doc(order, "/home/anupam/Desktop/testing.pdf")
-
 
4373
        print "Done"
-
 
4374
    except:
-
 
4375
        print "error"
4357
4376