Subversion Repositories SmartDukaan

Rev

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

Rev 11015 Rev 11095
Line 2140... Line 2140...
2140
            itemHistory.updatedOn = item.updatedOn
2140
            itemHistory.updatedOn = item.updatedOn
2141
            itemHistory.maxNlc = item.maxNlc
2141
            itemHistory.maxNlc = item.maxNlc
2142
            itemHistory.skuAtSource = item.skuAtSnapdeal
2142
            itemHistory.skuAtSource = item.skuAtSnapdeal
2143
            itemHistory.marketPlaceSerialNumber = item.supc
2143
            itemHistory.marketPlaceSerialNumber = item.supc
2144
            itemHistory.priceUpdatedBy = item.priceUpdatedBy
2144
            itemHistory.priceUpdatedBy = item.priceUpdatedBy
-
 
2145
            itemHistory.courierCostMarketplace = item.courierCostMarketplace
2145
            
2146
            
2146
            if (item.sellingPrice!=snapdealitem.sellingPrice):
2147
            if (item.sellingPrice!=snapdealitem.sellingPrice):
2147
                item.priceUpdatedBy = snapdealitem.updatedBy
2148
                item.priceUpdatedBy = snapdealitem.updatedBy
2148
                
2149
                
2149
            if snapdealitem.exceptionPrice is not None:
2150
            if snapdealitem.exceptionPrice is not None:
Line 2167... Line 2168...
2167
            if snapdealitem.maxNlc is not None:
2168
            if snapdealitem.maxNlc is not None:
2168
                item.maxNlc = snapdealitem.maxNlc
2169
                item.maxNlc = snapdealitem.maxNlc
2169
            item.skuAtSnapdeal = snapdealitem.skuAtSnapdeal
2170
            item.skuAtSnapdeal = snapdealitem.skuAtSnapdeal
2170
            item.updatedOn = datetime.datetime.now()
2171
            item.updatedOn = datetime.datetime.now()
2171
            item.supc = snapdealitem.supc
2172
            item.supc = snapdealitem.supc
-
 
2173
            item.courierCostMarketplace = snapdealitem.courierCostMarketplace
2172
            __markStatusForMarketplaceItems(snapdealitem,item)
2174
            __markStatusForMarketplaceItems(snapdealitem,item)
2173
            return update_marketplace_attributes_for_item(snapdealitem.marketplaceItems)
2175
            return update_marketplace_attributes_for_item(snapdealitem.marketplaceItems)
2174
        else:
2176
        else:
2175
            item = SnapdealItem()
2177
            item = SnapdealItem()
2176
            if snapdealitem.item_id is not None:
2178
            if snapdealitem.item_id is not None:
Line 2196... Line 2198...
2196
                item.maxNlc = snapdealitem.maxNlc
2198
                item.maxNlc = snapdealitem.maxNlc
2197
                item.skuAtSnapdeal = snapdealitem.skuAtSnapdeal
2199
                item.skuAtSnapdeal = snapdealitem.skuAtSnapdeal
2198
                item.supc = snapdealitem.supc
2200
                item.supc = snapdealitem.supc
2199
                item.updatedOn = datetime.datetime.now()  
2201
                item.updatedOn = datetime.datetime.now()  
2200
                item.priceUpdatedBy = snapdealitem.updatedBy
2202
                item.priceUpdatedBy = snapdealitem.updatedBy
-
 
2203
                item.courierCostMarketplace = snapdealitem.courierCostMarketplace
2201
                __markStatusForMarketplaceItems(snapdealitem,item)
2204
                __markStatusForMarketplaceItems(snapdealitem,item)
2202
                return update_marketplace_attributes_for_item(snapdealitem.marketplaceItems)  
2205
                return update_marketplace_attributes_for_item(snapdealitem.marketplaceItems)  
2203
    except Exception as ex:
2206
    except Exception as ex:
2204
        print "Unable to addOrupdate snapdealItem"
2207
        print "Unable to addOrupdate snapdealItem"
2205
        print ex
2208
        print ex
Line 2337... Line 2340...
2337
            marketplaceItem.currentTp = t_marketplaceItem.currentTp
2340
            marketplaceItem.currentTp = t_marketplaceItem.currentTp
2338
            marketplaceItem.minimumPossibleSp = t_marketplaceItem.minimumPossibleSp
2341
            marketplaceItem.minimumPossibleSp = t_marketplaceItem.minimumPossibleSp
2339
            marketplaceItem.minimumPossibleTp = t_marketplaceItem.minimumPossibleTp
2342
            marketplaceItem.minimumPossibleTp = t_marketplaceItem.minimumPossibleTp
2340
            marketplaceItem.maximumSellingPrice = t_marketplaceItem.maximumSellingPrice
2343
            marketplaceItem.maximumSellingPrice = t_marketplaceItem.maximumSellingPrice
2341
            marketplaceItem.pgFee = t_marketplaceItem.pgFee
2344
            marketplaceItem.pgFee = t_marketplaceItem.pgFee
-
 
2345
            marketplaceItem.courierCostMarketplace = t_marketplaceItem.courierCostMarketplace
2342
        else:
2346
        else:
2343
            marketplaceItem.courierCost = t_marketplaceItem.courierCost
2347
            marketplaceItem.courierCost = t_marketplaceItem.courierCost
2344
            marketplaceItem.otherCost = t_marketplaceItem.otherCost
2348
            marketplaceItem.otherCost = t_marketplaceItem.otherCost
2345
            marketplaceItem.autoIncrement = t_marketplaceItem.autoIncrement
2349
            marketplaceItem.autoIncrement = t_marketplaceItem.autoIncrement
2346
            marketplaceItem.autoDecrement = t_marketplaceItem.autoDecrement
2350
            marketplaceItem.autoDecrement = t_marketplaceItem.autoDecrement
Line 2355... Line 2359...
2355
            marketplaceItem.commission = t_marketplaceItem.commission
2359
            marketplaceItem.commission = t_marketplaceItem.commission
2356
            marketplaceItem.vat = t_marketplaceItem.vat
2360
            marketplaceItem.vat = t_marketplaceItem.vat
2357
            marketplaceItem.serviceTax = t_marketplaceItem.serviceTax
2361
            marketplaceItem.serviceTax = t_marketplaceItem.serviceTax
2358
            marketplaceItem.maximumSellingPrice = t_marketplaceItem.maximumSellingPrice
2362
            marketplaceItem.maximumSellingPrice = t_marketplaceItem.maximumSellingPrice
2359
            marketplaceItem.pgFee = t_marketplaceItem.pgFee
2363
            marketplaceItem.pgFee = t_marketplaceItem.pgFee
-
 
2364
            marketplaceItem.courierCostMarketplace = t_marketplaceItem.courierCostMarketplace
2360
        session.commit()
2365
        session.commit()
2361
        return True
2366
        return True
2362
    except Exception as ex:
2367
    except Exception as ex:
2363
        print "Unable to addOrupdate MarketplaceItem"
2368
        print "Unable to addOrupdate MarketplaceItem"
2364
        print ex
2369
        print ex
Line 2476... Line 2481...
2476
                item.maxNlc = nlc
2481
                item.maxNlc = nlc
2477
                vat = (item.sellingPrice/(1+(marketplaceitem.vat/100))-(nlc/(1+(marketplaceitem.vat/100))))*(marketplaceitem.vat/100)
2482
                vat = (item.sellingPrice/(1+(marketplaceitem.vat/100))-(nlc/(1+(marketplaceitem.vat/100))))*(marketplaceitem.vat/100)
2478
                inHouseCost = 15 + vat + (marketplaceitem.returnProvision/100)*item.sellingPrice + marketplaceitem.otherCost
2483
                inHouseCost = 15 + vat + (marketplaceitem.returnProvision/100)*item.sellingPrice + marketplaceitem.otherCost
2479
                marketplaceitem.minimumPossibleTp  = nlc + inHouseCost
2484
                marketplaceitem.minimumPossibleTp  = nlc + inHouseCost
2480
                if (marketplaceitem.pgFee/100)*item.sellingPrice>=20:
2485
                if (marketplaceitem.pgFee/100)*item.sellingPrice>=20:
2481
                    marketplaceitem.minimumPossibleSp = (nlc+(item.courierCost+marketplaceitem.closingFee)*(1+(marketplaceitem.serviceTax/100))*(1+(marketplaceitem.vat/100))+(15+marketplaceitem.otherCost)*(1+(marketplaceitem.vat)/100))/(1-(marketplaceitem.commission/100+marketplaceitem.emiFee/100+marketplaceitem.pgFee/100)*(1+(marketplaceitem.serviceTax/100))*(1+(marketplaceitem.vat)/100)-(marketplaceitem.returnProvision/100)*(1+(marketplaceitem.vat)/100))
2486
                    marketplaceitem.minimumPossibleSp = (nlc+(item.courierCostMarketplace+marketplaceitem.closingFee)*(1+(marketplaceitem.serviceTax/100))*(1+(marketplaceitem.vat/100))+(15+marketplaceitem.otherCost)*(1+(marketplaceitem.vat)/100))/(1-(marketplaceitem.commission/100+marketplaceitem.emiFee/100+marketplaceitem.pgFee/100)*(1+(marketplaceitem.serviceTax/100))*(1+(marketplaceitem.vat)/100)-(marketplaceitem.returnProvision/100)*(1+(marketplaceitem.vat)/100))
2482
                else:
2487
                else:
2483
                    marketplaceitem.minimumPossibleSp = (nlc+(item.courierCost+marketplaceitem.closingFee+20)*(1+(marketplaceitem.serviceTax/100))*(1+(marketplaceitem.vat/100))+(15+marketplaceitem.otherCost)*(1+(marketplaceitem.vat)/100))/(1-(marketplaceitem.commission/100+marketplaceitem.emiFee/100)*(1+(marketplaceitem.serviceTax/100))*(1+(marketplaceitem.vat)/100)-(marketplaceitem.returnProvision/100)*(1+(marketplaceitem.vat)/100))
2488
                    marketplaceitem.minimumPossibleSp = (nlc+(item.courierCostMarketplace+marketplaceitem.closingFee+20)*(1+(marketplaceitem.serviceTax/100))*(1+(marketplaceitem.vat/100))+(15+marketplaceitem.otherCost)*(1+(marketplaceitem.vat)/100))/(1-(marketplaceitem.commission/100+marketplaceitem.emiFee/100)*(1+(marketplaceitem.serviceTax/100))*(1+(marketplaceitem.vat)/100)-(marketplaceitem.returnProvision/100)*(1+(marketplaceitem.vat)/100))
2484
                session.commit()
2489
                session.commit()
2485
        flipkartitem = FlipkartItem.get_by(item_id=itemid)
2490
        flipkartitem = FlipkartItem.get_by(item_id=itemid)
2486
        if flipkartitem is not None:
2491
        if flipkartitem is not None:
2487
            ic = InventoryClient().get_client()
2492
            ic = InventoryClient().get_client()
2488
            fmarketplaceitem =  MarketplaceItems.get_by(itemId=itemid,source=8)
2493
            fmarketplaceitem =  MarketplaceItems.get_by(itemId=itemid,source=8)