| Line 83... |
Line 83... |
| 83 |
br = getBrowserObject()
|
83 |
br = getBrowserObject()
|
| 84 |
br.open(url)
|
84 |
br.open(url)
|
| 85 |
response = br.open(url)
|
85 |
response = br.open(url)
|
| 86 |
br.select_form(nr=0)
|
86 |
br.select_form(nr=0)
|
| 87 |
br.form['username'] = "saholic-snapdeal@saholic.com"
|
87 |
br.form['username'] = "saholic-snapdeal@saholic.com"
|
| 88 |
br.form['password'] = "saholic15"
|
88 |
br.form['password'] = "snapsaholic15"
|
| 89 |
print "Trying to login"
|
89 |
print "Trying to login"
|
| 90 |
response = br.submit()
|
90 |
response = br.submit()
|
| 91 |
return br
|
91 |
return br
|
| 92 |
|
92 |
|
| 93 |
def populateStuff(br):
|
93 |
def populateStuff(br):
|
| Line 180... |
Line 180... |
| 180 |
<td style="text-align:center">"""+xstr(data.brand)+" "+xstr(data.modelName)+" "+xstr(data.modelNumber)+" "+xstr(data.color)+"""</td>
|
180 |
<td style="text-align:center">"""+xstr(data.brand)+" "+xstr(data.modelName)+" "+xstr(data.modelNumber)+" "+xstr(data.color)+"""</td>
|
| 181 |
<td style="text-align:center">"""+str(data.sellingPrice)+"""</td>
|
181 |
<td style="text-align:center">"""+str(data.sellingPrice)+"""</td>
|
| 182 |
<td style="text-align:center">"""+str(data.sellingPriceSnapdeal)+"""</td>
|
182 |
<td style="text-align:center">"""+str(data.sellingPriceSnapdeal)+"""</td>
|
| 183 |
<td style="text-align:center">"""+str(data.transferPrice)+"""</td>
|
183 |
<td style="text-align:center">"""+str(data.transferPrice)+"""</td>
|
| 184 |
<td style="text-align:center">"""+str(data.transferPriceSnapdeal)+"""</td>
|
184 |
<td style="text-align:center">"""+str(data.transferPriceSnapdeal)+"""</td>
|
| 185 |
<td style="text-align:center">"""+str(round(data.commission*1.1236,2))+"""</td>
|
185 |
<td style="text-align:center">"""+str(round(data.commission*1.14,2))+"""</td>
|
| 186 |
<td style="text-align:center">"""+str(round(float(data.fixedMargin)+float(data.collectionCharges),2))+"""</td>
|
186 |
<td style="text-align:center">"""+str(round(float(data.fixedMargin)+float(data.collectionCharges),2))+"""</td>
|
| 187 |
<td style="text-align:center">"""+str(data.commissionPercentage)+"%"+"""</td>
|
187 |
<td style="text-align:center">"""+str(data.commissionPercentage)+"%"+"""</td>
|
| 188 |
<td style="text-align:center">"""+str(round(float(data.fixedMarginPercentage)/1.1236,2))+"%"+"""</td>
|
188 |
<td style="text-align:center">"""+str(round(float(data.fixedMarginPercentage)/1.14,2))+"%"+"""</td>
|
| 189 |
<td style="text-align:center">"""+str(data.weight*1000)+" gms"+"""</td>
|
189 |
<td style="text-align:center">"""+str(data.weight*1000)+" gms"+"""</td>
|
| 190 |
<td style="text-align:center">"""+str(data.weightSnapdeal)+" gms"+"""</td>
|
190 |
<td style="text-align:center">"""+str(data.weightSnapdeal)+" gms"+"""</td>
|
| 191 |
<td style="text-align:center">"""+str(round(data.courierCost*1.1236,2))+"""</td>
|
191 |
<td style="text-align:center">"""+str(round(data.courierCost*1.14,2))+"""</td>
|
| 192 |
<td style="text-align:center">"""+str(round(data.logisticCostSnapdeal,2)+round(data.woodenPackagingCost,2))+"""</td>
|
192 |
<td style="text-align:center">"""+str(round(data.logisticCostSnapdeal,2)+round(data.woodenPackagingCost,2))+"""</td>
|
| 193 |
<td style="text-align:center">"""+getReason(data)+"""</td>
|
193 |
<td style="text-align:center">"""+getReason(data)+"""</td>
|
| 194 |
</tr>"""
|
194 |
</tr>"""
|
| 195 |
message+="""</tbody></table>"""
|
195 |
message+="""</tbody></table>"""
|
| 196 |
message+="""
|
196 |
message+="""
|
| Line 221... |
Line 221... |
| 221 |
<td style="text-align:center">"""+xstr(data.brand)+" "+xstr(data.modelName)+" "+xstr(data.modelNumber)+" "+xstr(data.color)+"""</td>
|
221 |
<td style="text-align:center">"""+xstr(data.brand)+" "+xstr(data.modelName)+" "+xstr(data.modelNumber)+" "+xstr(data.color)+"""</td>
|
| 222 |
<td style="text-align:center">"""+str(data.sellingPrice)+"""</td>
|
222 |
<td style="text-align:center">"""+str(data.sellingPrice)+"""</td>
|
| 223 |
<td style="text-align:center">"""+str(data.sellingPriceSnapdeal)+"""</td>
|
223 |
<td style="text-align:center">"""+str(data.sellingPriceSnapdeal)+"""</td>
|
| 224 |
<td style="text-align:center">"""+str(data.transferPrice)+"""</td>
|
224 |
<td style="text-align:center">"""+str(data.transferPrice)+"""</td>
|
| 225 |
<td style="text-align:center">"""+str(data.transferPriceSnapdeal)+"""</td>
|
225 |
<td style="text-align:center">"""+str(data.transferPriceSnapdeal)+"""</td>
|
| 226 |
<td style="text-align:center">"""+str(round(data.commission*1.1236,2))+"""</td>
|
226 |
<td style="text-align:center">"""+str(round(data.commission*1.14,2))+"""</td>
|
| 227 |
<td style="text-align:center">"""+str(round(float(data.fixedMargin)+float(data.collectionCharges),2))+"""</td>
|
227 |
<td style="text-align:center">"""+str(round(float(data.fixedMargin)+float(data.collectionCharges),2))+"""</td>
|
| 228 |
<td style="text-align:center">"""+str(data.commissionPercentage)+"%"+"""</td>
|
228 |
<td style="text-align:center">"""+str(data.commissionPercentage)+"%"+"""</td>
|
| 229 |
<td style="text-align:center">"""+str(round(float(data.fixedMarginPercentage)/1.1236,2))+"%"+"""</td>
|
229 |
<td style="text-align:center">"""+str(round(float(data.fixedMarginPercentage)/1.14,2))+"%"+"""</td>
|
| 230 |
<td style="text-align:center">"""+str(data.weight*1000)+" gms"+"""</td>
|
230 |
<td style="text-align:center">"""+str(data.weight*1000)+" gms"+"""</td>
|
| 231 |
<td style="text-align:center">"""+str(data.weightSnapdeal)+" gms"+"""</td>
|
231 |
<td style="text-align:center">"""+str(data.weightSnapdeal)+" gms"+"""</td>
|
| 232 |
<td style="text-align:center">"""+str(round(data.courierCost*1.1236,2))+"""</td>
|
232 |
<td style="text-align:center">"""+str(round(data.courierCost*1.14,2))+"""</td>
|
| 233 |
<td style="text-align:center">"""+str(round(data.logisticCostSnapdeal,2)+round(data.woodenPackagingCost,2))+"""</td>
|
233 |
<td style="text-align:center">"""+str(round(data.logisticCostSnapdeal,2)+round(data.woodenPackagingCost,2))+"""</td>
|
| 234 |
<td style="text-align:center">"""+getReason(data)+"""</td>
|
234 |
<td style="text-align:center">"""+getReason(data)+"""</td>
|
| 235 |
</tr>"""
|
235 |
</tr>"""
|
| 236 |
message+="""</tbody></table>"""
|
236 |
message+="""</tbody></table>"""
|
| 237 |
message+="""
|
237 |
message+="""
|
| Line 256... |
Line 256... |
| 256 |
message+="""<tr>
|
256 |
message+="""<tr>
|
| 257 |
<td style="text-align:center">"""+str(ds_item.id)+"""</td>
|
257 |
<td style="text-align:center">"""+str(ds_item.id)+"""</td>
|
| 258 |
<td style="text-align:center">"""+xstr(ds_item.brand)+" "+xstr(ds_item.model_name)+" "+xstr(ds_item.model_number)+" "+xstr(ds_item.color)+"""</td>
|
258 |
<td style="text-align:center">"""+xstr(ds_item.brand)+" "+xstr(ds_item.model_name)+" "+xstr(ds_item.model_number)+" "+xstr(ds_item.color)+"""</td>
|
| 259 |
<td style="text-align:center">"""+str(snapdealItem.sellingPrice)+"""</td>
|
259 |
<td style="text-align:center">"""+str(snapdealItem.sellingPrice)+"""</td>
|
| 260 |
<td style="text-align:center">"""+str(snapdealItem.transferPrice)+"""</td>
|
260 |
<td style="text-align:center">"""+str(snapdealItem.transferPrice)+"""</td>
|
| 261 |
<td style="text-align:center">"""+str(round(snapdealItem.commission*1.1236,2))+"""</td>
|
261 |
<td style="text-align:center">"""+str(round(snapdealItem.commission*1.14,2))+"""</td>
|
| 262 |
<td style="text-align:center">"""+str(marketplaceItem.commission)+"%"+"""</td>
|
262 |
<td style="text-align:center">"""+str(marketplaceItem.commission)+"%"+"""</td>
|
| 263 |
<td style="text-align:center">"""+str(ds_item.weight*1000)+" gms"+"""</td>
|
263 |
<td style="text-align:center">"""+str(ds_item.weight*1000)+" gms"+"""</td>
|
| 264 |
<td style="text-align:center">"""+str(round(snapdealItem.courierCost*1.1236,2))+"""</td>
|
264 |
<td style="text-align:center">"""+str(round(snapdealItem.courierCost*1.14,2))+"""</td>
|
| 265 |
</tr>"""
|
265 |
</tr>"""
|
| 266 |
message+="""</tbody></table></body></html>"""
|
266 |
message+="""</tbody></table></body></html>"""
|
| 267 |
print message
|
267 |
print message
|
| 268 |
mailServer = smtplib.SMTP("smtp.gmail.com", 587)
|
268 |
mailServer = smtplib.SMTP("smtp.gmail.com", 587)
|
| 269 |
mailServer.ehlo()
|
269 |
mailServer.ehlo()
|
| Line 336... |
Line 336... |
| 336 |
sheet.write(sheet_iterator, 5, xstr(data.brand)+" "+xstr(data.modelName)+" "+xstr(data.modelNumber)+" "+xstr(data.color))
|
336 |
sheet.write(sheet_iterator, 5, xstr(data.brand)+" "+xstr(data.modelName)+" "+xstr(data.modelNumber)+" "+xstr(data.color))
|
| 337 |
sheet.write(sheet_iterator, 6, data.sellingPrice)
|
337 |
sheet.write(sheet_iterator, 6, data.sellingPrice)
|
| 338 |
sheet.write(sheet_iterator, 7, data.sellingPriceSnapdeal)
|
338 |
sheet.write(sheet_iterator, 7, data.sellingPriceSnapdeal)
|
| 339 |
sheet.write(sheet_iterator, 8, data.transferPrice)
|
339 |
sheet.write(sheet_iterator, 8, data.transferPrice)
|
| 340 |
sheet.write(sheet_iterator, 9, data.transferPriceSnapdeal)
|
340 |
sheet.write(sheet_iterator, 9, data.transferPriceSnapdeal)
|
| 341 |
sheet.write(sheet_iterator, 10, round(data.commission*1.1236,2))
|
341 |
sheet.write(sheet_iterator, 10, round(data.commission*1.14,2))
|
| 342 |
sheet.write(sheet_iterator, 11, round(float(data.fixedMargin)+float(data.collectionCharges),2))
|
342 |
sheet.write(sheet_iterator, 11, round(float(data.fixedMargin)+float(data.collectionCharges),2))
|
| 343 |
sheet.write(sheet_iterator, 12, data.commissionPercentage)
|
343 |
sheet.write(sheet_iterator, 12, data.commissionPercentage)
|
| 344 |
sheet.write(sheet_iterator, 13, round(float(data.fixedMarginPercentage)/1.1236,2))
|
344 |
sheet.write(sheet_iterator, 13, round(float(data.fixedMarginPercentage)/1.14,2))
|
| 345 |
sheet.write(sheet_iterator, 14, data.weight*1000)
|
345 |
sheet.write(sheet_iterator, 14, data.weight*1000)
|
| 346 |
sheet.write(sheet_iterator, 15, data.weightSnapdeal)
|
346 |
sheet.write(sheet_iterator, 15, data.weightSnapdeal)
|
| 347 |
sheet.write(sheet_iterator, 16, round(data.courierCost*1.1236,2))
|
347 |
sheet.write(sheet_iterator, 16, round(data.courierCost*1.14,2))
|
| 348 |
sheet.write(sheet_iterator, 17, round(data.logisticCostSnapdeal,2)+round(data.woodenPackagingCost,2))
|
348 |
sheet.write(sheet_iterator, 17, round(data.logisticCostSnapdeal,2)+round(data.woodenPackagingCost,2))
|
| 349 |
sheet.write(sheet_iterator, 18, getReasonSheet(data))
|
349 |
sheet.write(sheet_iterator, 18, getReasonSheet(data))
|
| 350 |
sheet_iterator+=1
|
350 |
sheet_iterator+=1
|
| 351 |
|
351 |
|
| 352 |
sheet = wbk.add_sheet('High TP SD')
|
352 |
sheet = wbk.add_sheet('High TP SD')
|
| Line 389... |
Line 389... |
| 389 |
sheet.write(sheet_iterator, 5, xstr(data.brand)+" "+xstr(data.modelName)+" "+xstr(data.modelNumber)+" "+xstr(data.color))
|
389 |
sheet.write(sheet_iterator, 5, xstr(data.brand)+" "+xstr(data.modelName)+" "+xstr(data.modelNumber)+" "+xstr(data.color))
|
| 390 |
sheet.write(sheet_iterator, 6, data.sellingPrice)
|
390 |
sheet.write(sheet_iterator, 6, data.sellingPrice)
|
| 391 |
sheet.write(sheet_iterator, 7, data.sellingPriceSnapdeal)
|
391 |
sheet.write(sheet_iterator, 7, data.sellingPriceSnapdeal)
|
| 392 |
sheet.write(sheet_iterator, 8, data.transferPrice)
|
392 |
sheet.write(sheet_iterator, 8, data.transferPrice)
|
| 393 |
sheet.write(sheet_iterator, 9, data.transferPriceSnapdeal)
|
393 |
sheet.write(sheet_iterator, 9, data.transferPriceSnapdeal)
|
| 394 |
sheet.write(sheet_iterator, 10, round(data.commission*1.1236,2))
|
394 |
sheet.write(sheet_iterator, 10, round(data.commission*1.14,2))
|
| 395 |
sheet.write(sheet_iterator, 11, round(float(data.fixedMargin)+float(data.collectionCharges),2))
|
395 |
sheet.write(sheet_iterator, 11, round(float(data.fixedMargin)+float(data.collectionCharges),2))
|
| 396 |
sheet.write(sheet_iterator, 12, data.commissionPercentage)
|
396 |
sheet.write(sheet_iterator, 12, data.commissionPercentage)
|
| 397 |
sheet.write(sheet_iterator, 13, round(float(data.fixedMarginPercentage)/1.1236,2))
|
397 |
sheet.write(sheet_iterator, 13, round(float(data.fixedMarginPercentage)/1.14,2))
|
| 398 |
sheet.write(sheet_iterator, 14, data.weight*1000)
|
398 |
sheet.write(sheet_iterator, 14, data.weight*1000)
|
| 399 |
sheet.write(sheet_iterator, 15, data.weightSnapdeal)
|
399 |
sheet.write(sheet_iterator, 15, data.weightSnapdeal)
|
| 400 |
sheet.write(sheet_iterator, 16, round(data.courierCost*1.1236,2))
|
400 |
sheet.write(sheet_iterator, 16, round(data.courierCost*1.14,2))
|
| 401 |
sheet.write(sheet_iterator, 17, round(data.logisticCostSnapdeal,2)+round(data.woodenPackagingCost,2))
|
401 |
sheet.write(sheet_iterator, 17, round(data.logisticCostSnapdeal,2)+round(data.woodenPackagingCost,2))
|
| 402 |
sheet.write(sheet_iterator, 18, getReasonSheet(data))
|
402 |
sheet.write(sheet_iterator, 18, getReasonSheet(data))
|
| 403 |
sheet_iterator+=1
|
403 |
sheet_iterator+=1
|
| 404 |
|
404 |
|
| 405 |
sheet = wbk.add_sheet('Exceptions')
|
405 |
sheet = wbk.add_sheet('Exceptions')
|
| Line 431... |
Line 431... |
| 431 |
sheet.write(sheet_iterator, 1, snapdealItem.supc)
|
431 |
sheet.write(sheet_iterator, 1, snapdealItem.supc)
|
| 432 |
sheet.write(sheet_iterator, 2, ds_item.brand)
|
432 |
sheet.write(sheet_iterator, 2, ds_item.brand)
|
| 433 |
sheet.write(sheet_iterator, 3, xstr(ds_item.brand)+" "+xstr(ds_item.model_name)+" "+xstr(ds_item.model_number)+" "+xstr(ds_item.color))
|
433 |
sheet.write(sheet_iterator, 3, xstr(ds_item.brand)+" "+xstr(ds_item.model_name)+" "+xstr(ds_item.model_number)+" "+xstr(ds_item.color))
|
| 434 |
sheet.write(sheet_iterator, 4, snapdealItem.sellingPrice)
|
434 |
sheet.write(sheet_iterator, 4, snapdealItem.sellingPrice)
|
| 435 |
sheet.write(sheet_iterator, 5, snapdealItem.transferPrice)
|
435 |
sheet.write(sheet_iterator, 5, snapdealItem.transferPrice)
|
| 436 |
sheet.write(sheet_iterator, 6, round(snapdealItem.commission*1.1236,2))
|
436 |
sheet.write(sheet_iterator, 6, round(snapdealItem.commission*1.14,2))
|
| 437 |
sheet.write(sheet_iterator, 7, marketplaceItem.commission)
|
437 |
sheet.write(sheet_iterator, 7, marketplaceItem.commission)
|
| 438 |
sheet.write(sheet_iterator, 8, (ds_item.weight*1000))
|
438 |
sheet.write(sheet_iterator, 8, (ds_item.weight*1000))
|
| 439 |
sheet.write(sheet_iterator, 9, round(snapdealItem.courierCost*1.1236,2))
|
439 |
sheet.write(sheet_iterator, 9, round(snapdealItem.courierCost*1.14,2))
|
| 440 |
sheet_iterator+=1
|
440 |
sheet_iterator+=1
|
| 441 |
|
441 |
|
| 442 |
filename = "/tmp/snapdeal-tp-reconciliation-" + str(datetime.now()) + ".xls"
|
442 |
filename = "/tmp/snapdeal-tp-reconciliation-" + str(datetime.now()) + ".xls"
|
| 443 |
wbk.save(filename)
|
443 |
wbk.save(filename)
|
| 444 |
|
444 |
|
| Line 471... |
Line 471... |
| 471 |
def getReason(data):
|
471 |
def getReason(data):
|
| 472 |
global courierCostToSync
|
472 |
global courierCostToSync
|
| 473 |
reason=""
|
473 |
reason=""
|
| 474 |
if data.sellingPrice!=data.sellingPriceSnapdeal:
|
474 |
if data.sellingPrice!=data.sellingPriceSnapdeal:
|
| 475 |
reason+="Selling Price is different."
|
475 |
reason+="Selling Price is different."
|
| 476 |
if data.commissionPercentage!= round(float(data.fixedMarginPercentage)/1.1236,2):
|
476 |
if data.commissionPercentage!= round(float(data.fixedMarginPercentage)/1.14,2):
|
| 477 |
reason+="Commission is different."
|
477 |
reason+="Commission is different."
|
| 478 |
if round(data.courierCost*1.1236)!=round(data.logisticCostSnapdeal+data.woodenPackagingCost):
|
478 |
if round(data.courierCost*1.14)!=round(data.logisticCostSnapdeal+data.woodenPackagingCost):
|
| 479 |
reason+="Courier Cost is different-Check Weight."
|
479 |
reason+="Courier Cost is different-Check Weight."
|
| 480 |
courierCostToSync.append(data)
|
480 |
courierCostToSync.append(data)
|
| 481 |
return reason
|
481 |
return reason
|
| 482 |
|
482 |
|
| 483 |
def getReasonSheet(data):
|
483 |
def getReasonSheet(data):
|
| 484 |
reason=""
|
484 |
reason=""
|
| 485 |
if data.sellingPrice!=data.sellingPriceSnapdeal:
|
485 |
if data.sellingPrice!=data.sellingPriceSnapdeal:
|
| 486 |
reason+="Selling Price is different."
|
486 |
reason+="Selling Price is different."
|
| 487 |
if data.commissionPercentage!= round(float(data.fixedMarginPercentage)/1.1236,2):
|
487 |
if data.commissionPercentage!= round(float(data.fixedMarginPercentage)/1.14,2):
|
| 488 |
reason+="Commission is different."
|
488 |
reason+="Commission is different."
|
| 489 |
if round(data.courierCost*1.1236)!=round(data.logisticCostSnapdeal+data.woodenPackagingCost):
|
489 |
if round(data.courierCost*1.14)!=round(data.logisticCostSnapdeal+data.woodenPackagingCost):
|
| 490 |
reason+="Courier Cost is different-Check Weight."
|
490 |
reason+="Courier Cost is different-Check Weight."
|
| 491 |
return reason
|
491 |
return reason
|
| 492 |
|
492 |
|
| 493 |
def syncCourierCost(courierCostToSync):
|
493 |
def syncCourierCost(courierCostToSync):
|
| 494 |
global oldPricing
|
494 |
global oldPricing
|
| Line 498... |
Line 498... |
| 498 |
oldMpItem = copy.deepcopy(mpItem)
|
498 |
oldMpItem = copy.deepcopy(mpItem)
|
| 499 |
temp = []
|
499 |
temp = []
|
| 500 |
temp.append(item)
|
500 |
temp.append(item)
|
| 501 |
temp.append(oldMpItem)
|
501 |
temp.append(oldMpItem)
|
| 502 |
addHistory(sdItem)
|
502 |
addHistory(sdItem)
|
| 503 |
sdItem.courierCostMarketplace = round((item.logisticCostSnapdeal+item.woodenPackagingCost)/1.1236)
|
503 |
sdItem.courierCostMarketplace = round((item.logisticCostSnapdeal+item.woodenPackagingCost)/1.14)
|
| 504 |
sdItem.transferPrice = getNewTp(mpItem,item)
|
504 |
sdItem.transferPrice = getNewTp(mpItem,item)
|
| 505 |
sdItem.serviceTax = getNewServiceTax(mpItem,sdItem,item)
|
505 |
sdItem.serviceTax = getNewServiceTax(mpItem,sdItem,item)
|
| 506 |
mpItem.courierCostMarketplace = round((item.logisticCostSnapdeal+item.woodenPackagingCost)/1.1236)
|
506 |
mpItem.courierCostMarketplace = round((item.logisticCostSnapdeal+item.woodenPackagingCost)/1.14)
|
| 507 |
mpItem.currentTp = getNewTp(mpItem,item)
|
507 |
mpItem.currentTp = getNewTp(mpItem,item)
|
| 508 |
mpItem.minimumPossibleSp = getNewLowestPossibleSp(mpItem,sdItem,item)
|
508 |
mpItem.minimumPossibleSp = getNewLowestPossibleSp(mpItem,sdItem,item)
|
| 509 |
temp.append(mpItem)
|
509 |
temp.append(mpItem)
|
| 510 |
oldPricing.append(temp)
|
510 |
oldPricing.append(temp)
|
| 511 |
session.commit()
|
511 |
session.commit()
|
| Line 532... |
Line 532... |
| 532 |
itemHistory.courierCostMarketplace = item.courierCostMarketplace
|
532 |
itemHistory.courierCostMarketplace = item.courierCostMarketplace
|
| 533 |
|
533 |
|
| 534 |
|
534 |
|
| 535 |
|
535 |
|
| 536 |
def getNewTp(mpItem,data):
|
536 |
def getNewTp(mpItem,data):
|
| 537 |
ourTp = mpItem.currentSp- mpItem.currentSp*(mpItem.commission/100+mpItem.emiFee/100)*(1+(mpItem.serviceTax/100))-((data.logisticCostSnapdeal+data.woodenPackagingCost)/1.1236+mpItem.closingFee)*(1+(mpItem.serviceTax/100))-(max(20,(mpItem.pgFee/100)*mpItem.currentSp)*(1+(mpItem.serviceTax/100)));
|
537 |
ourTp = mpItem.currentSp- mpItem.currentSp*(mpItem.commission/100+mpItem.emiFee/100)*(1+(mpItem.serviceTax/100))-((data.logisticCostSnapdeal+data.woodenPackagingCost)/1.14+mpItem.closingFee)*(1+(mpItem.serviceTax/100))-(max(20,(mpItem.pgFee/100)*mpItem.currentSp)*(1+(mpItem.serviceTax/100)));
|
| 538 |
return round(ourTp,2)
|
538 |
return round(ourTp,2)
|
| 539 |
|
539 |
|
| 540 |
def getNewServiceTax(mpItem,sdItem,data):
|
540 |
def getNewServiceTax(mpItem,sdItem,data):
|
| 541 |
return round(mpItem.serviceTax/100*(sdItem.commission+(data.logisticCostSnapdeal+data.woodenPackagingCost)/1.1236),2)
|
541 |
return round(mpItem.serviceTax/100*(sdItem.commission+(data.logisticCostSnapdeal+data.woodenPackagingCost)/1.14),2)
|
| 542 |
|
542 |
|
| 543 |
def getNewLowestPossibleSp(mpItem,sdItem,data):
|
543 |
def getNewLowestPossibleSp(mpItem,sdItem,data):
|
| 544 |
if (mpItem.pgFee/100)*mpItem.currentSp>=20:
|
544 |
if (mpItem.pgFee/100)*mpItem.currentSp>=20:
|
| 545 |
lowestPossibleSp = (sdItem.maxNlc+(((data.logisticCostSnapdeal+data.woodenPackagingCost)/1.1236)+mpItem.closingFee)*(1+(mpItem.serviceTax/100))*(1+(mpItem.vat/100))+(mpItem.packagingCost+mpItem.otherCost)*(1+(mpItem.vat)/100))/(1-(mpItem.commission/100+mpItem.emiFee/100+mpItem.pgFee/100)*(1+(mpItem.serviceTax/100))*(1+(mpItem.vat)/100)-(mpItem.returnProvision/100)*(1+(mpItem.vat)/100));
|
545 |
lowestPossibleSp = (sdItem.maxNlc+(((data.logisticCostSnapdeal+data.woodenPackagingCost)/1.14)+mpItem.closingFee)*(1+(mpItem.serviceTax/100))*(1+(mpItem.vat/100))+(mpItem.packagingCost+mpItem.otherCost)*(1+(mpItem.vat)/100))/(1-(mpItem.commission/100+mpItem.emiFee/100+mpItem.pgFee/100)*(1+(mpItem.serviceTax/100))*(1+(mpItem.vat)/100)-(mpItem.returnProvision/100)*(1+(mpItem.vat)/100));
|
| 546 |
else:
|
546 |
else:
|
| 547 |
lowestPossibleSp = (sdItem.maxNlc+(((data.logisticCostSnapdeal+data.woodenPackagingCost)/1.1236)+mpItem.closingFee+20)*(1+(mpItem.serviceTax/100))*(1+(mpItem.vat/100))+(mpItem.packagingCost+mpItem.otherCost)*(1+(mpItem.vat)/100))/(1-(mpItem.commission/100+mpItem.emiFee/100)*(1+(mpItem.serviceTax/100))*(1+(mpItem.vat)/100)-(mpItem.returnProvision/100)*(1+(mpItem.vat)/100));
|
547 |
lowestPossibleSp = (sdItem.maxNlc+(((data.logisticCostSnapdeal+data.woodenPackagingCost)/1.14)+mpItem.closingFee+20)*(1+(mpItem.serviceTax/100))*(1+(mpItem.vat/100))+(mpItem.packagingCost+mpItem.otherCost)*(1+(mpItem.vat)/100))/(1-(mpItem.commission/100+mpItem.emiFee/100)*(1+(mpItem.serviceTax/100))*(1+(mpItem.vat)/100)-(mpItem.returnProvision/100)*(1+(mpItem.vat)/100));
|
| 548 |
return round(lowestPossibleSp,2)
|
548 |
return round(lowestPossibleSp,2)
|
| 549 |
|
549 |
|
| 550 |
def sendCCSyncMail():
|
550 |
def sendCCSyncMail():
|
| 551 |
if len(courierCostToSync) == 0:
|
551 |
if len(courierCostToSync) == 0:
|
| 552 |
return
|
552 |
return
|