| Line 169... |
Line 169... |
| 169 |
sheet.write(0, 14, "Lowest Seller", heading_xf)
|
169 |
sheet.write(0, 14, "Lowest Seller", heading_xf)
|
| 170 |
sheet.write(0, 15, "Lowest SP", heading_xf)
|
170 |
sheet.write(0, 15, "Lowest SP", heading_xf)
|
| 171 |
sheet.write(0, 16, "Lowest TP", heading_xf)
|
171 |
sheet.write(0, 16, "Lowest TP", heading_xf)
|
| 172 |
sheet.write(0, 17, "Lowest Offer Price", heading_xf)
|
172 |
sheet.write(0, 17, "Lowest Offer Price", heading_xf)
|
| 173 |
sheet.write(0, 18, "Inventory of Top Vendors", heading_xf)
|
173 |
sheet.write(0, 18, "Inventory of Top Vendors", heading_xf)
|
| 174 |
sheet.write(0, 19, "Our Inventory", heading_xf)
|
174 |
sheet.write(0, 19, "Our Snapdeal Inventory", heading_xf)
|
| 175 |
sheet.write(0, 20, "Our NLC", heading_xf)
|
175 |
sheet.write(0, 20, "Our NLC", heading_xf)
|
| 176 |
sheet.write(0, 21, "Lowest Possible TP", heading_xf)
|
176 |
sheet.write(0, 21, "Lowest Possible TP", heading_xf)
|
| 177 |
sheet.write(0, 22, "Lowest Possible SP", heading_xf)
|
177 |
sheet.write(0, 22, "Lowest Possible SP", heading_xf)
|
| 178 |
sheet.write(0, 23, "Competition Basis ", heading_xf)
|
178 |
sheet.write(0, 23, "Competition Basis ", heading_xf)
|
| 179 |
sheet.write(0, 24, "Can Compete", heading_xf)
|
179 |
sheet.write(0, 24, "Can Compete", heading_xf)
|
| 180 |
sheet.write(0, 25, "Proposed TP", heading_xf)
|
180 |
sheet.write(0, 25, "Target TP", heading_xf)
|
| 181 |
sheet.write(0, 26, "Proposed SP", heading_xf)
|
181 |
sheet.write(0, 26, "Target SP", heading_xf)
|
| - |
|
182 |
sheet.write(0, 27, "Target NLC", heading_xf)
|
| 182 |
sheet.write(0, 27, "Sales Potential", heading_xf)
|
183 |
sheet.write(0, 28, "Sales Potential", heading_xf)
|
| 183 |
|
184 |
|
| 184 |
i, sheet_iterator=1,1
|
185 |
i, sheet_iterator=1,1
|
| 185 |
for one_line in all_lines:
|
186 |
for one_line in all_lines:
|
| 186 |
supc = all_supc[i-1]
|
187 |
supc = all_supc[i-1]
|
| 187 |
supc_data = fetchDetails(supc)
|
188 |
supc_data = fetchDetails(supc)
|
| 188 |
|
189 |
|
| 189 |
courierCost = 45
|
190 |
courierCost = 45
|
| 190 |
|
191 |
|
| 191 |
if one_line.weight:
|
192 |
if one_line.weight:
|
| 192 |
slab = int(((one_line.weight+.1) - .001)/.5)
|
193 |
slab = int(((one_line.weight+0.05) - .001)/.5)
|
| 193 |
for x in range (0,slab):
|
194 |
for x in range (0,slab):
|
| 194 |
courierCost = courierCost + 35
|
195 |
courierCost = courierCost + 35
|
| 195 |
|
196 |
|
| 196 |
courierCost = courierCost * 1.1236
|
197 |
courierCost = courierCost * 1.1236
|
| 197 |
|
198 |
|
| Line 234... |
Line 235... |
| 234 |
continue
|
235 |
continue
|
| 235 |
lowest_possible_tp = one_line.our_nlc/0.988+15+6
|
236 |
lowest_possible_tp = one_line.our_nlc/0.988+15+6
|
| 236 |
lowest_possible_sp = (lowest_possible_tp+courierCost)/0.9597
|
237 |
lowest_possible_sp = (lowest_possible_tp+courierCost)/0.9597
|
| 237 |
sheet.write(sheet_iterator, 21, round(lowest_possible_tp))
|
238 |
sheet.write(sheet_iterator, 21, round(lowest_possible_tp))
|
| 238 |
sheet.write(sheet_iterator, 22, round(lowest_possible_sp))
|
239 |
sheet.write(sheet_iterator, 22, round(lowest_possible_sp))
|
| 239 |
if (supc_data.ourOfferPrice == supc_data.ourSp):
|
240 |
if (supc_data.lowestOfferPrice == supc_data.lowestSp):
|
| 240 |
sheet.write(sheet_iterator, 23, 'SP')
|
241 |
sheet.write(sheet_iterator, 23, 'SP')
|
| 241 |
else:
|
242 |
else:
|
| 242 |
sheet.write(sheet_iterator, 23, 'TP')
|
243 |
sheet.write(sheet_iterator, 23, 'TP')
|
| 243 |
proposed_tp = 0
|
244 |
proposed_tp = 0
|
| 244 |
if lowestTp > lowest_possible_tp:
|
245 |
if lowestTp > lowest_possible_tp:
|
| Line 246... |
Line 247... |
| 246 |
proposed_tp = max(lowestTp - max((10, lowestTp*0.001)), lowest_possible_tp)
|
247 |
proposed_tp = max(lowestTp - max((10, lowestTp*0.001)), lowest_possible_tp)
|
| 247 |
sheet.write(sheet_iterator, 25, round(proposed_tp))
|
248 |
sheet.write(sheet_iterator, 25, round(proposed_tp))
|
| 248 |
sheet.write(sheet_iterator, 26, round((proposed_tp+courierCost)/0.9597))
|
249 |
sheet.write(sheet_iterator, 26, round((proposed_tp+courierCost)/0.9597))
|
| 249 |
else:
|
250 |
else:
|
| 250 |
sheet.write(sheet_iterator, 24, "No")
|
251 |
sheet.write(sheet_iterator, 24, "No")
|
| - |
|
252 |
|
| - |
|
253 |
sheet.write(sheet_iterator, 27, round(proposed_tp*.0988+21)))
|
| 251 |
|
254 |
|
| 252 |
if (supc_data.lowestOfferPrice - one_line.our_nlc) < 0:
|
255 |
if (supc_data.lowestOfferPrice - one_line.our_nlc) < 0:
|
| 253 |
sheet.write(sheet_iterator, 27, "HIGH")
|
256 |
sheet.write(sheet_iterator, 28, "HIGH")
|
| 254 |
elif (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice >=0 and (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice <= .02:
|
257 |
elif (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice >=0 and (supc_data.lowestOfferPrice - one_line.our_nlc)/supc_data.lowestOfferPrice <= .02:
|
| 255 |
sheet.write(sheet_iterator, 27, "MEDIUM")
|
258 |
sheet.write(sheet_iterator, 28, "MEDIUM")
|
| 256 |
else:
|
259 |
else:
|
| 257 |
sheet.write(sheet_iterator, 27, "LOW")
|
260 |
sheet.write(sheet_iterator, 28, "LOW")
|
| 258 |
i= i+1
|
261 |
i= i+1
|
| 259 |
sheet_iterator+=1
|
262 |
sheet_iterator+=1
|
| 260 |
|
263 |
|
| 261 |
createSheetForBuyBoxItems(buyBoxItems,wbk)
|
264 |
createSheetForBuyBoxItems(buyBoxItems,wbk)
|
| 262 |
wbk.save(filename)
|
265 |
wbk.save(filename)
|
| Line 291... |
Line 294... |
| 291 |
sheet.write(0, 14, "Lowest Seller", heading_xf)
|
294 |
sheet.write(0, 14, "Lowest Seller", heading_xf)
|
| 292 |
sheet.write(0, 15, "Lowest Offer Price", heading_xf)
|
295 |
sheet.write(0, 15, "Lowest Offer Price", heading_xf)
|
| 293 |
sheet.write(0, 16, "Second Lowest Seller", heading_xf)
|
296 |
sheet.write(0, 16, "Second Lowest Seller", heading_xf)
|
| 294 |
sheet.write(0, 17, "Second Lowest Price", heading_xf)
|
297 |
sheet.write(0, 17, "Second Lowest Price", heading_xf)
|
| 295 |
sheet.write(0, 18, "Second Lowest Offer Price", heading_xf)
|
298 |
sheet.write(0, 18, "Second Lowest Offer Price", heading_xf)
|
| 296 |
sheet.write(0, 19, "Our Inventory", heading_xf)
|
299 |
sheet.write(0, 19, "Our Snapdeal Inventory", heading_xf)
|
| 297 |
sheet.write(0, 20, "Second Lowest Seller Inventory", heading_xf)
|
300 |
sheet.write(0, 20, "Second Lowest Seller Inventory", heading_xf)
|
| 298 |
sheet.write(0, 21, "Our NLC", heading_xf)
|
301 |
sheet.write(0, 21, "Our NLC", heading_xf)
|
| 299 |
sheet.write(0, 22, "Second Lowest Seller TP", heading_xf)
|
302 |
sheet.write(0, 22, "Target TP", heading_xf)
|
| - |
|
303 |
sheet.write(0, 23, "Target SP", heading_xf)
|
| - |
|
304 |
sheet.write(0, 24, "Target NLC", heading_xf)
|
| - |
|
305 |
sheet.write(0, 25, "MARGIN INCREASED POTENTIAL", heading_xf)
|
| 300 |
|
306 |
|
| 301 |
i=1
|
307 |
i=1
|
| 302 |
|
308 |
|
| 303 |
for data in buyBoxItems:
|
309 |
for data in buyBoxItems:
|
| 304 |
supc_data =data[0]
|
310 |
supc_data =data[0]
|
| 305 |
one_line = data[1]
|
311 |
one_line = data[1]
|
| 306 |
|
312 |
|
| 307 |
courierCost = 45
|
313 |
courierCost = 45
|
| 308 |
|
314 |
|
| 309 |
if one_line.weight:
|
315 |
if one_line.weight:
|
| 310 |
slab = int(((one_line.weight+.1) - .001)/.5)
|
316 |
slab = int(((one_line.weight+0.05) - .001)/.5)
|
| 311 |
for x in range (0,slab):
|
317 |
for x in range (0,slab):
|
| 312 |
courierCost = courierCost + 35
|
318 |
courierCost = courierCost + 35
|
| 313 |
|
319 |
|
| 314 |
courierCost = courierCost * 1.1236
|
320 |
courierCost = courierCost * 1.1236
|
| 315 |
|
321 |
|
| Line 337... |
Line 343... |
| 337 |
sheet.write(i, 21, one_line.our_nlc)
|
343 |
sheet.write(i, 21, one_line.our_nlc)
|
| 338 |
if one_line.parent_category ==10011:
|
344 |
if one_line.parent_category ==10011:
|
| 339 |
lowestTp = (supc_data.secondLowestSellerSp*(1-.0803))-courierCost
|
345 |
lowestTp = (supc_data.secondLowestSellerSp*(1-.0803))-courierCost
|
| 340 |
else:
|
346 |
else:
|
| 341 |
lowestTp = supc_data.secondLowestSellerSp*0.9497-courierCost
|
347 |
lowestTp = supc_data.secondLowestSellerSp*0.9497-courierCost
|
| - |
|
348 |
lowest_possible_tp = one_line.our_nlc/0.988+15+6
|
| - |
|
349 |
proposed_tp = max(lowestTp - max((20, lowestTp*0.002)), lowest_possible_tp)
|
| 342 |
sheet.write(i, 22, round(lowestTp))
|
350 |
sheet.write(i, 22, round(proposed_tp))
|
| - |
|
351 |
sheet.write(i, 23, round((proposed_tp+courierCost)/0.9597))
|
| - |
|
352 |
sheet.write(i, 24, round((proposed_tp*0.988+21))
|
| - |
|
353 |
sheet.write(i, 25, proposed_tp-one_line.our_nlc)
|
| 343 |
i+=1
|
354 |
i+=1
|
| 344 |
|
355 |
|
| 345 |
|
356 |
|
| 346 |
def main():
|
357 |
def main():
|
| 347 |
parser = optparse.OptionParser()
|
358 |
parser = optparse.OptionParser()
|