| Line 2841... |
Line 2841... |
| 2841 |
for item in successfulAutoDecrease:
|
2841 |
for item in successfulAutoDecrease:
|
| 2842 |
it = Item.query.filter_by(id=item.item_id).one()
|
2842 |
it = Item.query.filter_by(id=item.item_id).one()
|
| 2843 |
mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.FLIPKART)
|
2843 |
mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.FLIPKART)
|
| 2844 |
fkItem = FlipkartItem.get_by(item_id=item.item_id)
|
2844 |
fkItem = FlipkartItem.get_by(item_id=item.item_id)
|
| 2845 |
warehouse = inventory_client.getWarehouse(fkItem.warehouseId)
|
2845 |
warehouse = inventory_client.getWarehouse(fkItem.warehouseId)
|
| 2846 |
vatRate = catalog_client.getVatPercentageForItem(item.item_id, warehouse.stateId, item.proposedSellingPrice)
|
2846 |
vatRate = catalog_client.getVatPercentageForItem(item.item_id, warehouse.stateId, math.ceil(item.proposedSellingPrice))
|
| 2847 |
mpItem.currentTp = getNewOurTp(mpItem,item.proposedSellingPrice)
|
2847 |
mpItem.currentTp = getNewOurTp(mpItem,math.ceil(item.proposedSellingPrice))
|
| 2848 |
mpItem.currentSp = math.ceil(item.proposedSellingPrice)
|
2848 |
mpItem.currentSp = math.ceil(item.proposedSellingPrice)
|
| 2849 |
fkItem.commissionValue = round((mpItem.commission/100)*(mpItem.currentSp),2)
|
2849 |
fkItem.commissionValue = round((mpItem.commission/100)*(mpItem.currentSp),2)
|
| 2850 |
fkItem.serviceTaxValue = round((mpItem.serviceTax/100)*(fkItem.commissionValue+mpItem.courierCost),2)
|
2850 |
fkItem.serviceTaxValue = round((mpItem.serviceTax/100)*(fkItem.commissionValue+mpItem.courierCost),2)
|
| 2851 |
fkItem.updatedOn = timestamp
|
2851 |
fkItem.updatedOn = timestamp
|
| 2852 |
fkItem.priceUpdatedBy = 'SYSTEM'
|
2852 |
fkItem.priceUpdatedBy = 'SYSTEM'
|
| Line 2860... |
Line 2860... |
| 2860 |
mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.FLIPKART)
|
2860 |
mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.FLIPKART)
|
| 2861 |
fkItem = FlipkartItem.get_by(item_id=item.item_id)
|
2861 |
fkItem = FlipkartItem.get_by(item_id=item.item_id)
|
| 2862 |
addHistory(fkItem,mpItem)
|
2862 |
addHistory(fkItem,mpItem)
|
| 2863 |
warehouse = inventory_client.getWarehouse(fkItem.warehouseId)
|
2863 |
warehouse = inventory_client.getWarehouse(fkItem.warehouseId)
|
| 2864 |
vatRate = catalog_client.getVatPercentageForItem(item.item_id, warehouse.stateId, math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))
|
2864 |
vatRate = catalog_client.getVatPercentageForItem(item.item_id, warehouse.stateId, math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))
|
| 2865 |
mpItem.currentTp = getNewOurTp(mpItem,item.ourSellingPrice+max(10,.01*item.ourSellingPrice))
|
2865 |
mpItem.currentTp = getNewOurTp(mpItem,math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))
|
| 2866 |
mpItem.currentSp = math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice))
|
2866 |
mpItem.currentSp = math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice))
|
| 2867 |
fkItem.commissionValue = round((mpItem.commission/100)*(mpItem.currentSp),2)
|
2867 |
fkItem.commissionValue = round((mpItem.commission/100)*(mpItem.currentSp),2)
|
| 2868 |
fkItem.serviceTaxValue = round((mpItem.serviceTax/100)*(fkItem.commissionValue+mpItem.courierCost),2)
|
2868 |
fkItem.serviceTaxValue = round((mpItem.serviceTax/100)*(fkItem.commissionValue+mpItem.courierCost),2)
|
| 2869 |
fkItem.updatedOn = timestamp
|
2869 |
fkItem.updatedOn = timestamp
|
| 2870 |
fkItem.priceUpdatedBy = 'SYSTEM'
|
2870 |
fkItem.priceUpdatedBy = 'SYSTEM'
|