| Line 5143... |
Line 5143... |
| 5143 |
return orders
|
5143 |
return orders
|
| 5144 |
|
5144 |
|
| 5145 |
def get_store_order_advance_invoice(orderId):
|
5145 |
def get_store_order_advance_invoice(orderId):
|
| 5146 |
order = Order.get_by(id = orderId)
|
5146 |
order = Order.get_by(id = orderId)
|
| 5147 |
filename = "/tmp/recharge" + str(order.id) + ".pdf"
|
5147 |
filename = "/tmp/recharge" + str(order.id) + ".pdf"
|
| - |
|
5148 |
modelName = " "
|
| - |
|
5149 |
modelNumber = " "
|
| - |
|
5150 |
color = " "
|
| - |
|
5151 |
if order.lineitems[0].model_name:
|
| - |
|
5152 |
modelName = modelName + order.lineitems[0].model_name
|
| - |
|
5153 |
if order.lineitems[0].model_number:
|
| - |
|
5154 |
modelNumber = modelNumber + order.lineitems[0].model_number
|
| - |
|
5155 |
if order.lineitems[0].color:
|
| - |
|
5156 |
color = color + order.lineitems[0].color
|
| - |
|
5157 |
|
| 5148 |
product = order.lineitems[0].brand + order.lineitems[0].model_name + order.lineitems[0].model_number + order.lineitems[0].color
|
5158 |
product = order.lineitems[0].brand + modelName + modelNumber + color
|
| 5149 |
amount = order.advanceAmount
|
5159 |
amount = order.advanceAmount
|
| 5150 |
totalAmount = order.total_amount
|
5160 |
totalAmount = order.total_amount
|
| 5151 |
delivery = order.created_timestamp
|
5161 |
delivery = order.expected_delivery_time
|
| 5152 |
customerName = order.customer_name
|
5162 |
customerName = order.customer_name
|
| 5153 |
#payMethod = recharge.payMethod
|
5163 |
#payMethod = recharge.payMethod
|
| 5154 |
return __printStoreOrderAdvanceInvoice(filename, product, amount, totalAmount, customerName, delivery)
|
5164 |
return __printStoreOrderAdvanceInvoice(filename, product, amount, totalAmount, customerName, delivery)
|
| 5155 |
|
5165 |
|
| 5156 |
|
5166 |
|
| Line 5187... |
Line 5197... |
| 5187 |
Story.append(Paragraph("{0:<6s}{1:<34s}".format("NAME:", customerName).replace(" ", " "), textStyle))
|
5197 |
Story.append(Paragraph("{0:<6s}{1:<34s}".format("NAME:", customerName).replace(" ", " "), textStyle))
|
| 5188 |
Story.append(Paragraph("{0:<15s}{1: %d/%m/%Y}".format("EXP DELIVERY:", delivery).replace(" ", " "), textStyle))
|
5198 |
Story.append(Paragraph("{0:<15s}{1: %d/%m/%Y}".format("EXP DELIVERY:", delivery).replace(" ", " "), textStyle))
|
| 5189 |
Story.append(Paragraph("{0:<15s}{1:<25s}".format("PAYMENT MODE:", "CARD").replace(" ", " "), textStyle))
|
5199 |
Story.append(Paragraph("{0:<15s}{1:<25s}".format("PAYMENT MODE:", "CARD").replace(" ", " "), textStyle))
|
| 5190 |
|
5200 |
|
| 5191 |
drawLine(Story, lineStyle)
|
5201 |
drawLine(Story, lineStyle)
|
| 5192 |
Story.append(Paragraph("{0:<15s}{1:<25s}".format("PAYMENT MODE:", "CARD").replace(" ", " "), textStyle))
|
5202 |
Story.append(Paragraph("{0:^39s}".format("PRODUCT NAME").replace(" ", " "), textStyle))
|
| 5193 |
drawLine(Story, lineStyle)
|
5203 |
drawLine(Story, lineStyle)
|
| 5194 |
Story.append(Paragraph("{0:<39s}".format(product).replace(" ", " "), textStyle))
|
5204 |
Story.append(Paragraph("{0:<39s}".format(product).replace(" ", " "), textStyle))
|
| 5195 |
drawLine(Story, lineStyle)
|
5205 |
drawLine(Story, lineStyle)
|
| 5196 |
|
5206 |
|
| 5197 |
Story.append(Paragraph(('{0:<20s}{1:>19.2f}').format("TOTAL PRICE: ", totalAmount).replace(' ', ' '),textStyle))
|
5207 |
Story.append(Paragraph(('{0:<20s}{1:>19.2f}').format("TOTAL PRICE: ", totalAmount).replace(' ', ' '),textStyle))
|
| 5198 |
Story.append(Paragraph(('{0:<20s}{1:>19.2f}').format("ADVANCE PAID: ", amount).replace(' ', ' '),textStyle))
|
5208 |
Story.append(Paragraph(('{0:<20s}{1:>19.2f}').format("ADVANCE PAID: ", amount).replace(' ', ' '),textStyle))
|
| 5199 |
|
5209 |
|
| 5200 |
drawLine(Story, lineStyle)
|
5210 |
drawLine(Story, lineStyle)
|
| - |
|
5211 |
drawLine(Story, lineStyle)
|
| - |
|
5212 |
Story.append(Paragraph(('{0:<20s}{1:>19s}').format("Customer care : ", "0120-6744700").replace(' ', ' '),textStyle))
|
| 5201 |
|
5213 |
|
| 5202 |
doc.addPageTemplates([PageTemplate(id='TwoCol',frames=[frame1]), ])
|
5214 |
doc.addPageTemplates([PageTemplate(id='TwoCol',frames=[frame1]), ])
|
| 5203 |
|
5215 |
|
| 5204 |
#start the construction of the pdf
|
5216 |
#start the construction of the pdf
|
| 5205 |
doc.build(Story)
|
5217 |
doc.build(Story)
|