| Line 2150... |
Line 2150... |
| 2150 |
isListed = "Yes"
|
2150 |
isListed = "Yes"
|
| 2151 |
else:
|
2151 |
else:
|
| 2152 |
isListed = "No"
|
2152 |
isListed = "No"
|
| 2153 |
if amItem.suppressFbaPriceUpdate:
|
2153 |
if amItem.suppressFbaPriceUpdate:
|
| 2154 |
priceSuppress = "Yes"
|
2154 |
priceSuppress = "Yes"
|
| - |
|
2155 |
else:
|
| - |
|
2156 |
priceSuppress = "No"
|
| - |
|
2157 |
elif item.warehouseLocation==2:
|
| - |
|
2158 |
if amItem.isFbb:
|
| - |
|
2159 |
isListed = "Yes"
|
| - |
|
2160 |
else:
|
| - |
|
2161 |
isListed = "No"
|
| - |
|
2162 |
if amItem.suppressFbbPriceUpdate:
|
| - |
|
2163 |
priceSuppress = "Yes"
|
| 2155 |
else:
|
2164 |
else:
|
| 2156 |
priceSuppress = "No"
|
2165 |
priceSuppress = "No"
|
| - |
|
2166 |
else:
|
| - |
|
2167 |
pass
|
| 2157 |
vatRate = getNewVatRate(item.item_id,item.warehouseLocation,item.proposedSp)
|
2168 |
vatRate = getNewVatRate(item.item_id,item.warehouseLocation,item.proposedSp)
|
| 2158 |
#oldMargin = item.ourSellingPrice - item.lowestPossibleSp
|
2169 |
#oldMargin = item.ourSellingPrice - item.lowestPossibleSp
|
| 2159 |
oldMargin = item.promoPrice - item.lowestPossibleSp
|
2170 |
oldMargin = item.promoPrice - item.lowestPossibleSp
|
| 2160 |
newMargin = round(item.proposedSp - getNewLowestPossibleSp(item,12.36,vatRate))
|
2171 |
newMargin = round(item.proposedSp - getNewLowestPossibleSp(item,12.36,vatRate))
|
| 2161 |
sku = ''
|
2172 |
sku = ''
|
| Line 2174... |
Line 2185... |
| 2174 |
<td style="text-align:center">"""+sku+"""</td>
|
2185 |
<td style="text-align:center">"""+sku+"""</td>
|
| 2175 |
<td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
|
2186 |
<td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
|
| 2176 |
<td style="text-align:center">"""+str(item.promoPrice)+"""</td>
|
2187 |
<td style="text-align:center">"""+str(item.promoPrice)+"""</td>
|
| 2177 |
<td style="text-align:center">"""+str(math.ceil(item.proposedSp))+"""</td>
|
2188 |
<td style="text-align:center">"""+str(math.ceil(item.proposedSp))+"""</td>
|
| 2178 |
<td style="text-align:center">"""+str(round(subsidy))+"""</td>
|
2189 |
<td style="text-align:center">"""+str(round(subsidy))+"""</td>
|
| 2179 |
<td style="text-align:center">"""+str(round(oldMargin))+" ("+str(round((oldMargin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
|
2190 |
<td style="text-align:center">"""+str(round(oldMargin))+" ("+str(round((oldMargin/item.promoPrice)*100,1))+"%)"+"""</td>
|
| 2180 |
<td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/item.proposedSp)*100,1))+"%)"+"""</td>
|
2191 |
<td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/item.proposedSp)*100,1))+"%)"+"""</td>
|
| 2181 |
<td style="text-align:center">"""+str(item.commission)+" %"+"""</td>
|
2192 |
<td style="text-align:center">"""+str(item.commission)+" %"+"""</td>
|
| 2182 |
<td style="text-align:center">"""+str(item.returnProvision)+" %"+"""</td>
|
2193 |
<td style="text-align:center">"""+str(item.returnProvision)+" %"+"""</td>
|
| 2183 |
<td style="text-align:center">"""+str(item.ourInventory)+"""</td>
|
2194 |
<td style="text-align:center">"""+str(item.ourInventory)+"""</td>
|
| 2184 |
<td style="text-align:center">"""+getOosString(saleMap.get(sku))+"""</td>
|
2195 |
<td style="text-align:center">"""+getOosString(saleMap.get(sku))+"""</td>
|
| Line 2217... |
Line 2228... |
| 2217 |
isListed = "No"
|
2228 |
isListed = "No"
|
| 2218 |
if amItem.suppressFbaPriceUpdate:
|
2229 |
if amItem.suppressFbaPriceUpdate:
|
| 2219 |
priceSuppress = "Yes"
|
2230 |
priceSuppress = "Yes"
|
| 2220 |
else:
|
2231 |
else:
|
| 2221 |
priceSuppress = "No"
|
2232 |
priceSuppress = "No"
|
| - |
|
2233 |
elif item.warehouseLocation==2:
|
| - |
|
2234 |
if amItem.isFbb:
|
| - |
|
2235 |
isListed = "Yes"
|
| - |
|
2236 |
else:
|
| - |
|
2237 |
isListed = "No"
|
| - |
|
2238 |
if amItem.suppressFbbPriceUpdate:
|
| - |
|
2239 |
priceSuppress = "Yes"
|
| - |
|
2240 |
else:
|
| - |
|
2241 |
priceSuppress = "No"
|
| - |
|
2242 |
else:
|
| - |
|
2243 |
pass
|
| 2222 |
vatRate = getNewVatRate(item.item_id,item.warehouseLocation,math.ceil(item.promoPrice+max(10,.01*item.promoPrice)))
|
2244 |
vatRate = getNewVatRate(item.item_id,item.warehouseLocation,math.ceil(item.promoPrice+max(10,.01*item.promoPrice)))
|
| 2223 |
#oldMargin = item.ourSellingPrice - item.lowestPossibleSp
|
2245 |
#oldMargin = item.ourSellingPrice - item.lowestPossibleSp
|
| 2224 |
oldMargin = item.promoPrice - item.lowestPossibleSp
|
2246 |
oldMargin = item.promoPrice - item.lowestPossibleSp
|
| 2225 |
newMargin = round(math.ceil(item.promoPrice+max(10,.01*item.promoPrice)) - getNewLowestPossibleSp(item,12.36,vatRate))
|
2247 |
newMargin = round(math.ceil(item.promoPrice+max(10,.01*item.promoPrice)) - getNewLowestPossibleSp(item,12.36,vatRate))
|
| 2226 |
sku = ''
|
2248 |
sku = ''
|
| Line 2498... |
Line 2520... |
| 2498 |
if item.isPromotion:
|
2520 |
if item.isPromotion:
|
| 2499 |
amItem.fbbPromoPrice = math.ceil(item.proposedSp)
|
2521 |
amItem.fbbPromoPrice = math.ceil(item.proposedSp)
|
| 2500 |
else:
|
2522 |
else:
|
| 2501 |
amItem.fbbPrice = math.ceil(item.proposedSp)
|
2523 |
amItem.fbbPrice = math.ceil(item.proposedSp)
|
| 2502 |
amItem.fbaPriceLastUpdatedOn = datetime.now()
|
2524 |
amItem.fbaPriceLastUpdatedOn = datetime.now()
|
| - |
|
2525 |
else:
|
| - |
|
2526 |
pass
|
| 2503 |
session.commit()
|
2527 |
session.commit()
|
| 2504 |
for item in successfulAutoIncrease:
|
2528 |
for item in successfulAutoIncrease:
|
| 2505 |
amItem = Amazonlisted.get_by(itemId=item.item_id)
|
2529 |
amItem = Amazonlisted.get_by(itemId=item.item_id)
|
| 2506 |
if item.warehouseLocation==1:
|
2530 |
if item.warehouseLocation==1:
|
| 2507 |
if item.isPromotion:
|
2531 |
if item.isPromotion:
|
| Line 2513... |
Line 2537... |
| 2513 |
if item.isPromotion:
|
2537 |
if item.isPromotion:
|
| 2514 |
amItem.fbbPromoPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
|
2538 |
amItem.fbbPromoPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
|
| 2515 |
else:
|
2539 |
else:
|
| 2516 |
amItem.fbbPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
|
2540 |
amItem.fbbPrice = math.ceil(item.promoPrice+max(10,.01*item.promoPrice))
|
| 2517 |
amItem.fbbPriceLastUpdatedOn = datetime.now()
|
2541 |
amItem.fbbPriceLastUpdatedOn = datetime.now()
|
| - |
|
2542 |
else:
|
| - |
|
2543 |
pass
|
| 2518 |
session.commit()
|
2544 |
session.commit()
|
| 2519 |
|
2545 |
|
| 2520 |
|
2546 |
|
| 2521 |
def main():
|
2547 |
def main():
|
| 2522 |
parser = optparse.OptionParser()
|
2548 |
parser = optparse.OptionParser()
|