| Line 1033... |
Line 1033... |
| 1033 |
sheet.write(0, 4, "Brand", heading_xf)
|
1033 |
sheet.write(0, 4, "Brand", heading_xf)
|
| 1034 |
sheet.write(0, 5, "Product Name", heading_xf)
|
1034 |
sheet.write(0, 5, "Product Name", heading_xf)
|
| 1035 |
sheet.write(0, 6, "Weight", heading_xf)
|
1035 |
sheet.write(0, 6, "Weight", heading_xf)
|
| 1036 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
1036 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
| 1037 |
sheet.write(0, 8, "Risky", heading_xf)
|
1037 |
sheet.write(0, 8, "Risky", heading_xf)
|
| - |
|
1038 |
sheet.write(0, 9, "Commission Rate", heading_xf)
|
| - |
|
1039 |
sheet.write(0, 10, "Return Provision", heading_xf)
|
| 1038 |
sheet.write(0, 9, "Our Rating", heading_xf)
|
1040 |
sheet.write(0, 11, "Our Rating", heading_xf)
|
| 1039 |
sheet.write(0, 10, "Our Shipping Time", heading_xf)
|
1041 |
sheet.write(0, 12, "Our Shipping Time", heading_xf)
|
| 1040 |
sheet.write(0, 11, "Our Rank", heading_xf)
|
1042 |
sheet.write(0, 13, "Our Rank", heading_xf)
|
| 1041 |
sheet.write(0, 12, "Our SP", heading_xf)
|
1043 |
sheet.write(0, 14, "Our SP", heading_xf)
|
| 1042 |
sheet.write(0, 13, "Our TP", heading_xf)
|
1044 |
sheet.write(0, 15, "Our TP", heading_xf)
|
| 1043 |
sheet.write(0, 14, "Lowest Seller", heading_xf)
|
1045 |
sheet.write(0, 16, "Lowest Seller", heading_xf)
|
| 1044 |
sheet.write(0, 15, "Lowest Seller Rating", heading_xf)
|
1046 |
sheet.write(0, 17, "Lowest Seller Rating", heading_xf)
|
| 1045 |
sheet.write(0, 16, "Lowest Seller Shipping Time", heading_xf)
|
1047 |
sheet.write(0, 18, "Lowest Seller Shipping Time", heading_xf)
|
| 1046 |
sheet.write(0, 17, "Lowest Seller SP", heading_xf)
|
1048 |
sheet.write(0, 19, "Lowest Seller SP", heading_xf)
|
| 1047 |
sheet.write(0, 18, "Lowest Seller TP", heading_xf)
|
1049 |
sheet.write(0, 20, "Lowest Seller TP", heading_xf)
|
| 1048 |
sheet.write(0, 19, "Preffered Seller", heading_xf)
|
1050 |
sheet.write(0, 21, "Preffered Seller", heading_xf)
|
| 1049 |
sheet.write(0, 20, "Preffered Seller Rating", heading_xf)
|
1051 |
sheet.write(0, 22, "Preffered Seller Rating", heading_xf)
|
| 1050 |
sheet.write(0, 21, "Preffered Seller Shipping Time", heading_xf)
|
1052 |
sheet.write(0, 23, "Preffered Seller Shipping Time", heading_xf)
|
| 1051 |
sheet.write(0, 22, "Preffer Seller SP", heading_xf)
|
1053 |
sheet.write(0, 24, "Preffer Seller SP", heading_xf)
|
| 1052 |
sheet.write(0, 23, "Preffered Seller TP", heading_xf)
|
1054 |
sheet.write(0, 25, "Preffered Seller TP", heading_xf)
|
| 1053 |
sheet.write(0, 24, "Our Flipkart Inventory", heading_xf)
|
1055 |
sheet.write(0, 26, "Our Flipkart Inventory", heading_xf)
|
| 1054 |
sheet.write(0, 25, "Our Net Availability",heading_xf)
|
1056 |
sheet.write(0, 27, "Our Net Availability",heading_xf)
|
| 1055 |
sheet.write(0, 26, "Last Five Day Sale", heading_xf)
|
1057 |
sheet.write(0, 28, "Last Five Day Sale", heading_xf)
|
| 1056 |
sheet.write(0, 27, "Average Sale", heading_xf)
|
1058 |
sheet.write(0, 29, "Average Sale", heading_xf)
|
| 1057 |
sheet.write(0, 28, "Our NLC", heading_xf)
|
1059 |
sheet.write(0, 30, "Our NLC", heading_xf)
|
| 1058 |
sheet.write(0, 29, "Lowest Possible SP", heading_xf)
|
1060 |
sheet.write(0, 31, "Lowest Possible SP", heading_xf)
|
| 1059 |
sheet.write(0, 30, "Lowest Possible TP", heading_xf)
|
1061 |
sheet.write(0, 32, "Lowest Possible TP", heading_xf)
|
| 1060 |
sheet.write(0, 31, "Target SP", heading_xf)
|
1062 |
sheet.write(0, 33, "Target SP", heading_xf)
|
| 1061 |
sheet.write(0, 32, "Target TP", heading_xf)
|
1063 |
sheet.write(0, 34, "Target TP", heading_xf)
|
| 1062 |
sheet.write(0, 33, "Target NLC", heading_xf)
|
1064 |
sheet.write(0, 35, "Target NLC", heading_xf)
|
| 1063 |
sheet.write(0, 34, "Sales Potential", heading_xf)
|
1065 |
sheet.write(0, 36, "Sales Potential", heading_xf)
|
| 1064 |
sheet.write(0, 35, "Total Seller", heading_xf)
|
1066 |
sheet.write(0, 37, "Total Seller", heading_xf)
|
| 1065 |
sheet_iterator = 1
|
1067 |
sheet_iterator = 1
|
| 1066 |
canCompeteItems = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
1068 |
canCompeteItems = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
| 1067 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
1069 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
| 1068 |
.join((MarketplaceItems,MarketPlaceHistory.item_id==MarketplaceItems.itemId))\
|
1070 |
.join((MarketplaceItems,MarketPlaceHistory.item_id==MarketplaceItems.itemId))\
|
| 1069 |
.join((Item,MarketPlaceHistory.item_id==Item.id))\
|
1071 |
.join((Item,MarketPlaceHistory.item_id==Item.id))\
|
| Line 1081... |
Line 1083... |
| 1081 |
sheet.write(sheet_iterator,4,catItem.brand)
|
1083 |
sheet.write(sheet_iterator,4,catItem.brand)
|
| 1082 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
1084 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
| 1083 |
sheet.write(sheet_iterator,6,catItem.weight)
|
1085 |
sheet.write(sheet_iterator,6,catItem.weight)
|
| 1084 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
1086 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
| 1085 |
sheet.write(sheet_iterator,8,catItem.risky)
|
1087 |
sheet.write(sheet_iterator,8,catItem.risky)
|
| - |
|
1088 |
sheet.write(sheet_iterator,9,mpItem.commission)
|
| - |
|
1089 |
sheet.write(sheet_iterator,10,mpItem.returnProvision)
|
| 1086 |
sheet.write(sheet_iterator,9,mpHistory.ourRating)
|
1090 |
sheet.write(sheet_iterator,11,mpHistory.ourRating)
|
| 1087 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
1091 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
| 1088 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
1092 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
| 1089 |
sheet.write(sheet_iterator,10,mpHistory.ourShippingTime)
|
1093 |
sheet.write(sheet_iterator,12,mpHistory.ourShippingTime)
|
| 1090 |
sheet.write(sheet_iterator,11,mpHistory.ourRank)
|
1094 |
sheet.write(sheet_iterator,13,mpHistory.ourRank)
|
| 1091 |
sheet.write(sheet_iterator,12,mpHistory.ourSellingPrice)
|
1095 |
sheet.write(sheet_iterator,14,mpHistory.ourSellingPrice)
|
| 1092 |
sheet.write(sheet_iterator,13,mpHistory.ourTp)
|
1096 |
sheet.write(sheet_iterator,15,mpHistory.ourTp)
|
| 1093 |
sheet.write(sheet_iterator,14,mpHistory.lowestSellerName)
|
1097 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerName)
|
| 1094 |
sheet.write(sheet_iterator,15,mpHistory.lowestSellerRating)
|
1098 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellerRating)
|
| 1095 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
1099 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
| 1096 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
1100 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
| 1097 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerShippingTime)
|
1101 |
sheet.write(sheet_iterator,18,mpHistory.lowestSellerShippingTime)
|
| 1098 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellingPrice)
|
1102 |
sheet.write(sheet_iterator,19,mpHistory.lowestSellingPrice)
|
| 1099 |
sheet.write(sheet_iterator,18,mpHistory.lowestTp)
|
1103 |
sheet.write(sheet_iterator,20,mpHistory.lowestTp)
|
| 1100 |
sheet.write(sheet_iterator,19,mpHistory.prefferedSellerName)
|
1104 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerName)
|
| 1101 |
sheet.write(sheet_iterator,20,mpHistory.prefferedSellerRating)
|
1105 |
sheet.write(sheet_iterator,22,mpHistory.prefferedSellerRating)
|
| 1102 |
# prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
1106 |
# prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
| 1103 |
# else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
1107 |
# else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
| 1104 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerShippingTime)
|
1108 |
sheet.write(sheet_iterator,23,mpHistory.prefferedSellerShippingTime)
|
| 1105 |
sheet.write(sheet_iterator,22,mpHistory.prefferedSellerSellingPrice)
|
1109 |
sheet.write(sheet_iterator,24,mpHistory.prefferedSellerSellingPrice)
|
| 1106 |
sheet.write(sheet_iterator,23,mpHistory.prefferedSellerTp)
|
1110 |
sheet.write(sheet_iterator,25,mpHistory.prefferedSellerTp)
|
| 1107 |
sheet.write(sheet_iterator,24,mpHistory.ourInventory)
|
1111 |
sheet.write(sheet_iterator,26,mpHistory.ourInventory)
|
| 1108 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
1112 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
| 1109 |
sheet.write(sheet_iterator, 25, 'Info not available')
|
1113 |
sheet.write(sheet_iterator, 27, 'Info not available')
|
| 1110 |
else:
|
1114 |
else:
|
| 1111 |
sheet.write(sheet_iterator, 25, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
1115 |
sheet.write(sheet_iterator, 27, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
| 1112 |
sheet.write(sheet_iterator, 26, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
1116 |
sheet.write(sheet_iterator, 28, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
| 1113 |
sheet.write(sheet_iterator, 27, (itemSaleMap.get(mpHistory.item_id))[3])
|
1117 |
sheet.write(sheet_iterator, 29, (itemSaleMap.get(mpHistory.item_id))[3])
|
| 1114 |
sheet.write(sheet_iterator, 28, mpHistory.ourNlc)
|
1118 |
sheet.write(sheet_iterator, 30, mpHistory.ourNlc)
|
| 1115 |
sheet.write(sheet_iterator, 29, mpHistory.lowestPossibleSp)
|
1119 |
sheet.write(sheet_iterator, 31, mpHistory.lowestPossibleSp)
|
| 1116 |
sheet.write(sheet_iterator, 30, mpHistory.lowestPossibleTp)
|
1120 |
sheet.write(sheet_iterator, 32, mpHistory.lowestPossibleTp)
|
| 1117 |
proposed_sp = mpHistory.lowestSellingPrice - max(10, mpHistory.lowestSellingPrice*0.001)
|
1121 |
proposed_sp = mpHistory.lowestSellingPrice - max(10, mpHistory.lowestSellingPrice*0.001)
|
| 1118 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
1122 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
| 1119 |
target_nlc = proposed_tp - mpHistory.lowestPossibleTp + mpHistory.ourNlc
|
1123 |
target_nlc = proposed_tp - mpHistory.lowestPossibleTp + mpHistory.ourNlc
|
| 1120 |
sheet.write(sheet_iterator, 31, proposed_sp)
|
1124 |
sheet.write(sheet_iterator, 33, proposed_sp)
|
| 1121 |
sheet.write(sheet_iterator, 32, proposed_tp)
|
1125 |
sheet.write(sheet_iterator, 34, proposed_tp)
|
| 1122 |
sheet.write(sheet_iterator, 33, target_nlc)
|
1126 |
sheet.write(sheet_iterator, 35, target_nlc)
|
| 1123 |
sheet.write(sheet_iterator, 34, getSalesPotential(mpHistory.lowestSellingPrice,mpHistory.ourNlc))
|
1127 |
sheet.write(sheet_iterator, 36, getSalesPotential(mpHistory.lowestSellingPrice,mpHistory.ourNlc))
|
| 1124 |
sheet.write(sheet_iterator, 35, mpHistory.totalSeller)
|
1128 |
sheet.write(sheet_iterator, 37, mpHistory.totalSeller)
|
| 1125 |
sheet_iterator+=1
|
1129 |
sheet_iterator+=1
|
| 1126 |
|
1130 |
|
| 1127 |
canCompeteItems[:] = []
|
1131 |
canCompeteItems[:] = []
|
| 1128 |
|
1132 |
|
| 1129 |
|
1133 |
|
| Line 1149... |
Line 1153... |
| 1149 |
sheet.write(0, 4, "Brand", heading_xf)
|
1153 |
sheet.write(0, 4, "Brand", heading_xf)
|
| 1150 |
sheet.write(0, 5, "Product Name", heading_xf)
|
1154 |
sheet.write(0, 5, "Product Name", heading_xf)
|
| 1151 |
sheet.write(0, 6, "Weight", heading_xf)
|
1155 |
sheet.write(0, 6, "Weight", heading_xf)
|
| 1152 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
1156 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
| 1153 |
sheet.write(0, 8, "Risky", heading_xf)
|
1157 |
sheet.write(0, 8, "Risky", heading_xf)
|
| - |
|
1158 |
sheet.write(0, 9, "Commission Rate", heading_xf)
|
| - |
|
1159 |
sheet.write(0, 10, "Return Provision", heading_xf)
|
| 1154 |
sheet.write(0, 9, "Our Rating", heading_xf)
|
1160 |
sheet.write(0, 11, "Our Rating", heading_xf)
|
| 1155 |
sheet.write(0, 10, "Our Shipping Time", heading_xf)
|
1161 |
sheet.write(0, 12, "Our Shipping Time", heading_xf)
|
| 1156 |
sheet.write(0, 11, "Our Rank", heading_xf)
|
1162 |
sheet.write(0, 13, "Our Rank", heading_xf)
|
| 1157 |
sheet.write(0, 12, "Our SP", heading_xf)
|
1163 |
sheet.write(0, 14, "Our SP", heading_xf)
|
| 1158 |
sheet.write(0, 13, "Our TP", heading_xf)
|
1164 |
sheet.write(0, 15, "Our TP", heading_xf)
|
| 1159 |
sheet.write(0, 14, "Lowest Seller", heading_xf)
|
1165 |
sheet.write(0, 16, "Lowest Seller", heading_xf)
|
| 1160 |
sheet.write(0, 15, "Lowest Seller Rating", heading_xf)
|
1166 |
sheet.write(0, 17, "Lowest Seller Rating", heading_xf)
|
| 1161 |
sheet.write(0, 16, "Lowest Seller Shipping Time", heading_xf)
|
1167 |
sheet.write(0, 18, "Lowest Seller Shipping Time", heading_xf)
|
| 1162 |
sheet.write(0, 17, "Lowest Seller SP", heading_xf)
|
1168 |
sheet.write(0, 19, "Lowest Seller SP", heading_xf)
|
| 1163 |
sheet.write(0, 18, "Lowest Seller TP", heading_xf)
|
1169 |
sheet.write(0, 20, "Lowest Seller TP", heading_xf)
|
| 1164 |
sheet.write(0, 19, "Second Lowest Seller", heading_xf)
|
1170 |
sheet.write(0, 21, "Second Lowest Seller", heading_xf)
|
| 1165 |
sheet.write(0, 20, "Second Lowest Seller Rating", heading_xf)
|
1171 |
sheet.write(0, 22, "Second Lowest Seller Rating", heading_xf)
|
| 1166 |
sheet.write(0, 21, "Second Lowest Seller Shipping Time", heading_xf)
|
1172 |
sheet.write(0, 23, "Second Lowest Seller Shipping Time", heading_xf)
|
| 1167 |
sheet.write(0, 22, "Second Lowest Seller SP", heading_xf)
|
1173 |
sheet.write(0, 24, "Second Lowest Seller SP", heading_xf)
|
| 1168 |
sheet.write(0, 23, "Second Lowest Seller TP", heading_xf)
|
1174 |
sheet.write(0, 25, "Second Lowest Seller TP", heading_xf)
|
| 1169 |
sheet.write(0, 24, "Our Flipkart Inventory", heading_xf)
|
1175 |
sheet.write(0, 26, "Our Flipkart Inventory", heading_xf)
|
| 1170 |
sheet.write(0, 25, "Our Net Availability",heading_xf)
|
1176 |
sheet.write(0, 27, "Our Net Availability",heading_xf)
|
| 1171 |
sheet.write(0, 26, "Last Five Day Sale", heading_xf)
|
1177 |
sheet.write(0, 28, "Last Five Day Sale", heading_xf)
|
| 1172 |
sheet.write(0, 27, "Average Sale", heading_xf)
|
1178 |
sheet.write(0, 29, "Average Sale", heading_xf)
|
| 1173 |
sheet.write(0, 28, "Our NLC", heading_xf)
|
1179 |
sheet.write(0, 30, "Our NLC", heading_xf)
|
| 1174 |
sheet.write(0, 29, "Lowest Possible SP", heading_xf)
|
1180 |
sheet.write(0, 31, "Lowest Possible SP", heading_xf)
|
| 1175 |
sheet.write(0, 30, "Lowest Possible TP", heading_xf)
|
1181 |
sheet.write(0, 32, "Lowest Possible TP", heading_xf)
|
| 1176 |
sheet.write(0, 31, "Target SP", heading_xf)
|
1182 |
sheet.write(0, 33, "Target SP", heading_xf)
|
| 1177 |
sheet.write(0, 32, "Target TP", heading_xf)
|
1183 |
sheet.write(0, 34, "Target TP", heading_xf)
|
| 1178 |
sheet.write(0, 33, "Margin Increased Potential", heading_xf)
|
1184 |
sheet.write(0, 35, "Margin Increased Potential", heading_xf)
|
| 1179 |
sheet.write(0, 34, "Total Seller", heading_xf)
|
1185 |
sheet.write(0, 36, "Total Seller", heading_xf)
|
| 1180 |
sheet.write(0, 35, "Auto Pricing Decision", heading_xf)
|
1186 |
sheet.write(0, 37, "Auto Pricing Decision", heading_xf)
|
| 1181 |
sheet.write(0, 36, "Reason", heading_xf)
|
1187 |
sheet.write(0, 38, "Reason", heading_xf)
|
| 1182 |
sheet.write(0, 37, "Updated Price", heading_xf)
|
1188 |
sheet.write(0, 39, "Updated Price", heading_xf)
|
| 1183 |
sheet_iterator = 1
|
1189 |
sheet_iterator = 1
|
| 1184 |
|
1190 |
|
| 1185 |
buyBoxItems = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
1191 |
buyBoxItems = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
| 1186 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
1192 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
| 1187 |
.join((MarketplaceItems,MarketPlaceHistory.item_id==MarketplaceItems.itemId))\
|
1193 |
.join((MarketplaceItems,MarketPlaceHistory.item_id==MarketplaceItems.itemId))\
|
| Line 1202... |
Line 1208... |
| 1202 |
sheet.write(sheet_iterator,4,catItem.brand)
|
1208 |
sheet.write(sheet_iterator,4,catItem.brand)
|
| 1203 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
1209 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
| 1204 |
sheet.write(sheet_iterator,6,catItem.weight)
|
1210 |
sheet.write(sheet_iterator,6,catItem.weight)
|
| 1205 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
1211 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
| 1206 |
sheet.write(sheet_iterator,8,catItem.risky)
|
1212 |
sheet.write(sheet_iterator,8,catItem.risky)
|
| - |
|
1213 |
sheet.write(sheet_iterator,9,mpItem.commission)
|
| - |
|
1214 |
sheet.write(sheet_iterator,10,mpItem.returnProvision)
|
| 1207 |
sheet.write(sheet_iterator,9,mpHistory.ourRating)
|
1215 |
sheet.write(sheet_iterator,11,mpHistory.ourRating)
|
| 1208 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
1216 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
| 1209 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
1217 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
| 1210 |
sheet.write(sheet_iterator,10,mpHistory.ourShippingTime)
|
1218 |
sheet.write(sheet_iterator,12,mpHistory.ourShippingTime)
|
| 1211 |
sheet.write(sheet_iterator,11,mpHistory.ourRank)
|
1219 |
sheet.write(sheet_iterator,13,mpHistory.ourRank)
|
| 1212 |
sheet.write(sheet_iterator,12,mpHistory.ourSellingPrice)
|
1220 |
sheet.write(sheet_iterator,14,mpHistory.ourSellingPrice)
|
| 1213 |
sheet.write(sheet_iterator,13,mpHistory.ourTp)
|
1221 |
sheet.write(sheet_iterator,15,mpHistory.ourTp)
|
| 1214 |
sheet.write(sheet_iterator,14,mpHistory.lowestSellerName)
|
1222 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerName)
|
| 1215 |
sheet.write(sheet_iterator,15,mpHistory.lowestSellerRating)
|
1223 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellerRating)
|
| 1216 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
1224 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
| 1217 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
1225 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
| 1218 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerShippingTime)
|
1226 |
sheet.write(sheet_iterator,18,mpHistory.lowestSellerShippingTime)
|
| 1219 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellingPrice)
|
1227 |
sheet.write(sheet_iterator,19,mpHistory.lowestSellingPrice)
|
| 1220 |
sheet.write(sheet_iterator,18,mpHistory.lowestTp)
|
1228 |
sheet.write(sheet_iterator,20,mpHistory.lowestTp)
|
| 1221 |
sheet.write(sheet_iterator,19,mpHistory.secondLowestSellerName)
|
1229 |
sheet.write(sheet_iterator,21,mpHistory.secondLowestSellerName)
|
| 1222 |
sheet.write(sheet_iterator,20,mpHistory.secondLowestSellerRating)
|
1230 |
sheet.write(sheet_iterator,22,mpHistory.secondLowestSellerRating)
|
| 1223 |
# secondLowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitSecondLowestSeller) if flipkartDetails.shippingTimeUpperLimitSecondLowestSeller==0\
|
1231 |
# secondLowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitSecondLowestSeller) if flipkartDetails.shippingTimeUpperLimitSecondLowestSeller==0\
|
| 1224 |
# else str(flipkartDetails.shippingTimeLowerLimitSecondLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitSecondLowestSeller)
|
1232 |
# else str(flipkartDetails.shippingTimeLowerLimitSecondLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitSecondLowestSeller)
|
| 1225 |
sheet.write(sheet_iterator,21,mpHistory.secondLowestSellerShippingTime)
|
1233 |
sheet.write(sheet_iterator,23,mpHistory.secondLowestSellerShippingTime)
|
| 1226 |
sheet.write(sheet_iterator,22,mpHistory.secondLowestSellingPrice)
|
1234 |
sheet.write(sheet_iterator,24,mpHistory.secondLowestSellingPrice)
|
| 1227 |
sheet.write(sheet_iterator,23,mpHistory.secondLowestTp)
|
1235 |
sheet.write(sheet_iterator,25,mpHistory.secondLowestTp)
|
| 1228 |
sheet.write(sheet_iterator,24,mpHistory.ourInventory)
|
1236 |
sheet.write(sheet_iterator,26,mpHistory.ourInventory)
|
| 1229 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
1237 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
| 1230 |
sheet.write(sheet_iterator, 25, 'Info not available')
|
1238 |
sheet.write(sheet_iterator, 27, 'Info not available')
|
| 1231 |
else:
|
1239 |
else:
|
| 1232 |
sheet.write(sheet_iterator, 25, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
1240 |
sheet.write(sheet_iterator, 27, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
| 1233 |
sheet.write(sheet_iterator, 26, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
1241 |
sheet.write(sheet_iterator, 28, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
| 1234 |
sheet.write(sheet_iterator, 27, (itemSaleMap.get(mpHistory.item_id))[3])
|
1242 |
sheet.write(sheet_iterator, 29, (itemSaleMap.get(mpHistory.item_id))[3])
|
| 1235 |
sheet.write(sheet_iterator, 28, mpHistory.ourNlc)
|
1243 |
sheet.write(sheet_iterator, 30, mpHistory.ourNlc)
|
| 1236 |
sheet.write(sheet_iterator, 29, mpHistory.lowestPossibleSp)
|
1244 |
sheet.write(sheet_iterator, 31, mpHistory.lowestPossibleSp)
|
| 1237 |
sheet.write(sheet_iterator, 30, mpHistory.lowestPossibleTp)
|
1245 |
sheet.write(sheet_iterator, 32, mpHistory.lowestPossibleTp)
|
| 1238 |
proposed_sp = max(mpHistory.secondLowestSellingPrice - max((20, mpHistory.secondLowestSellingPrice*0.002)), mpHistory.lowestPossibleSp)
|
1246 |
proposed_sp = max(mpHistory.secondLowestSellingPrice - max((20, mpHistory.secondLowestSellingPrice*0.002)), mpHistory.lowestPossibleSp)
|
| 1239 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
1247 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
| 1240 |
target_nlc = proposed_tp - mpHistory.lowestPossibleTp + mpHistory.ourNlc
|
1248 |
target_nlc = proposed_tp - mpHistory.lowestPossibleTp + mpHistory.ourNlc
|
| 1241 |
sheet.write(sheet_iterator, 31, proposed_sp)
|
1249 |
sheet.write(sheet_iterator, 33, proposed_sp)
|
| 1242 |
sheet.write(sheet_iterator, 32, proposed_tp)
|
1250 |
sheet.write(sheet_iterator, 34, proposed_tp)
|
| 1243 |
sheet.write(sheet_iterator, 33, proposed_tp -mpHistory.ourTp )
|
1251 |
sheet.write(sheet_iterator, 35, proposed_tp -mpHistory.ourTp )
|
| 1244 |
sheet.write(sheet_iterator, 34, mpHistory.totalSeller)
|
1252 |
sheet.write(sheet_iterator, 36, mpHistory.totalSeller)
|
| 1245 |
if mpHistory.decision is None:
|
1253 |
if mpHistory.decision is None:
|
| 1246 |
sheet.write(sheet_iterator, 35, 'Auto Pricing Inactive')
|
1254 |
sheet.write(sheet_iterator, 37, 'Auto Pricing Inactive')
|
| 1247 |
sheet_iterator+=1
|
1255 |
sheet_iterator+=1
|
| 1248 |
continue
|
1256 |
continue
|
| 1249 |
sheet.write(sheet_iterator, 35, Decision._VALUES_TO_NAMES.get(mpHistory.decision))
|
1257 |
sheet.write(sheet_iterator, 37, Decision._VALUES_TO_NAMES.get(mpHistory.decision))
|
| 1250 |
sheet.write(sheet_iterator, 36, mpHistory.reason)
|
1258 |
sheet.write(sheet_iterator, 38, mpHistory.reason)
|
| 1251 |
if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_DECREMENT_SUCCESS":
|
1259 |
if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1252 |
sheet.write(sheet_iterator, 37, math.ceil(mpHistory.proposedSellingPrice))
|
1260 |
sheet.write(sheet_iterator, 39, math.ceil(mpHistory.proposedSellingPrice))
|
| 1253 |
if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_INCREMENT_SUCCESS":
|
1261 |
if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1254 |
sheet.write(sheet_iterator, 37, math.ceil(mpHistory.ourSellingPrice+max(10,.01*mpHistory.ourSellingPrice)))
|
1262 |
sheet.write(sheet_iterator, 39, math.ceil(mpHistory.ourSellingPrice+max(10,.01*mpHistory.ourSellingPrice)))
|
| 1255 |
|
1263 |
|
| 1256 |
sheet_iterator+=1
|
1264 |
sheet_iterator+=1
|
| 1257 |
|
1265 |
|
| 1258 |
buyBoxItems[:] = []
|
1266 |
buyBoxItems[:] = []
|
| 1259 |
|
1267 |
|
| Line 1279... |
Line 1287... |
| 1279 |
sheet.write(0, 4, "Brand", heading_xf)
|
1287 |
sheet.write(0, 4, "Brand", heading_xf)
|
| 1280 |
sheet.write(0, 5, "Product Name", heading_xf)
|
1288 |
sheet.write(0, 5, "Product Name", heading_xf)
|
| 1281 |
sheet.write(0, 6, "Weight", heading_xf)
|
1289 |
sheet.write(0, 6, "Weight", heading_xf)
|
| 1282 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
1290 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
| 1283 |
sheet.write(0, 8, "Risky", heading_xf)
|
1291 |
sheet.write(0, 8, "Risky", heading_xf)
|
| - |
|
1292 |
sheet.write(0, 9, "Commission Rate", heading_xf)
|
| - |
|
1293 |
sheet.write(0, 10, "Return Provision", heading_xf)
|
| 1284 |
sheet.write(0, 9, "Our Rating", heading_xf)
|
1294 |
sheet.write(0, 11, "Our Rating", heading_xf)
|
| 1285 |
sheet.write(0, 10, "Our Shipping Time", heading_xf)
|
1295 |
sheet.write(0, 12, "Our Shipping Time", heading_xf)
|
| 1286 |
sheet.write(0, 11, "Our Rank", heading_xf)
|
1296 |
sheet.write(0, 13, "Our Rank", heading_xf)
|
| 1287 |
sheet.write(0, 12, "Our SP", heading_xf)
|
1297 |
sheet.write(0, 14, "Our SP", heading_xf)
|
| 1288 |
sheet.write(0, 13, "Our TP", heading_xf)
|
1298 |
sheet.write(0, 15, "Our TP", heading_xf)
|
| 1289 |
sheet.write(0, 14, "Lowest Seller", heading_xf)
|
1299 |
sheet.write(0, 16, "Lowest Seller", heading_xf)
|
| 1290 |
sheet.write(0, 15, "Lowest Seller Rating", heading_xf)
|
1300 |
sheet.write(0, 17, "Lowest Seller Rating", heading_xf)
|
| 1291 |
sheet.write(0, 16, "Lowest Seller Shipping Time", heading_xf)
|
1301 |
sheet.write(0, 18, "Lowest Seller Shipping Time", heading_xf)
|
| 1292 |
sheet.write(0, 17, "Lowest Seller SP", heading_xf)
|
1302 |
sheet.write(0, 19, "Lowest Seller SP", heading_xf)
|
| 1293 |
sheet.write(0, 18, "Lowest Seller TP", heading_xf)
|
1303 |
sheet.write(0, 20, "Lowest Seller TP", heading_xf)
|
| 1294 |
sheet.write(0, 19, "Preffered Seller", heading_xf)
|
1304 |
sheet.write(0, 21, "Preffered Seller", heading_xf)
|
| 1295 |
sheet.write(0, 20, "Preffered Seller Rating", heading_xf)
|
1305 |
sheet.write(0, 22, "Preffered Seller Rating", heading_xf)
|
| 1296 |
sheet.write(0, 21, "Preffered Seller Shipping Time", heading_xf)
|
1306 |
sheet.write(0, 23, "Preffered Seller Shipping Time", heading_xf)
|
| 1297 |
sheet.write(0, 22, "Preffered Seller SP", heading_xf)
|
1307 |
sheet.write(0, 24, "Preffered Seller SP", heading_xf)
|
| 1298 |
sheet.write(0, 23, "Preffered Seller TP", heading_xf)
|
1308 |
sheet.write(0, 25, "Preffered Seller TP", heading_xf)
|
| 1299 |
sheet.write(0, 24, "Our Flipkart Inventory", heading_xf)
|
1309 |
sheet.write(0, 26, "Our Flipkart Inventory", heading_xf)
|
| 1300 |
sheet.write(0, 25, "Our Net Availability",heading_xf)
|
1310 |
sheet.write(0, 27, "Our Net Availability",heading_xf)
|
| 1301 |
sheet.write(0, 26, "Last Five Day Sale", heading_xf)
|
1311 |
sheet.write(0, 28, "Last Five Day Sale", heading_xf)
|
| 1302 |
sheet.write(0, 27, "Average Sale", heading_xf)
|
1312 |
sheet.write(0, 29, "Average Sale", heading_xf)
|
| 1303 |
sheet.write(0, 28, "Our NLC", heading_xf)
|
1313 |
sheet.write(0, 30, "Our NLC", heading_xf)
|
| 1304 |
sheet.write(0, 29, "Lowest Possible SP", heading_xf)
|
1314 |
sheet.write(0, 31, "Lowest Possible SP", heading_xf)
|
| 1305 |
sheet.write(0, 30, "Lowest Possible TP", heading_xf)
|
1315 |
sheet.write(0, 32, "Lowest Possible TP", heading_xf)
|
| 1306 |
sheet.write(0, 31, "Target SP", heading_xf)
|
1316 |
sheet.write(0, 33, "Target SP", heading_xf)
|
| 1307 |
sheet.write(0, 32, "Target TP", heading_xf)
|
1317 |
sheet.write(0, 34, "Target TP", heading_xf)
|
| 1308 |
sheet.write(0, 33, "Total Seller", heading_xf)
|
1318 |
sheet.write(0, 35, "Total Seller", heading_xf)
|
| 1309 |
sheet.write(0, 34, "Auto Pricing Decision", heading_xf)
|
1319 |
sheet.write(0, 36, "Auto Pricing Decision", heading_xf)
|
| 1310 |
sheet.write(0, 35, "Reason", heading_xf)
|
1320 |
sheet.write(0, 37, "Reason", heading_xf)
|
| 1311 |
sheet.write(0, 36, "Updated Price", heading_xf)
|
1321 |
sheet.write(0, 38, "Updated Price", heading_xf)
|
| 1312 |
|
1322 |
|
| 1313 |
sheet_iterator = 1
|
1323 |
sheet_iterator = 1
|
| 1314 |
|
1324 |
|
| 1315 |
prefNotCheapItems = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
1325 |
prefNotCheapItems = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
| 1316 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
1326 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
| Line 1332... |
Line 1342... |
| 1332 |
sheet.write(sheet_iterator,4,catItem.brand)
|
1342 |
sheet.write(sheet_iterator,4,catItem.brand)
|
| 1333 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
1343 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
| 1334 |
sheet.write(sheet_iterator,6,catItem.weight)
|
1344 |
sheet.write(sheet_iterator,6,catItem.weight)
|
| 1335 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
1345 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
| 1336 |
sheet.write(sheet_iterator,8,catItem.risky)
|
1346 |
sheet.write(sheet_iterator,8,catItem.risky)
|
| - |
|
1347 |
sheet.write(sheet_iterator,9,mpItem.commission)
|
| - |
|
1348 |
sheet.write(sheet_iterator,10,mpItem.returnProvision)
|
| 1337 |
sheet.write(sheet_iterator,9,mpHistory.ourRating)
|
1349 |
sheet.write(sheet_iterator,11,mpHistory.ourRating)
|
| 1338 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
1350 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
| 1339 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
1351 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
| 1340 |
sheet.write(sheet_iterator,10,mpHistory.ourShippingTime)
|
1352 |
sheet.write(sheet_iterator,12,mpHistory.ourShippingTime)
|
| 1341 |
sheet.write(sheet_iterator,11,mpHistory.ourRank)
|
1353 |
sheet.write(sheet_iterator,13,mpHistory.ourRank)
|
| 1342 |
sheet.write(sheet_iterator,12,mpHistory.ourSellingPrice)
|
1354 |
sheet.write(sheet_iterator,14,mpHistory.ourSellingPrice)
|
| 1343 |
sheet.write(sheet_iterator,13,mpHistory.ourTp)
|
1355 |
sheet.write(sheet_iterator,15,mpHistory.ourTp)
|
| 1344 |
sheet.write(sheet_iterator,14,mpHistory.lowestSellerName)
|
1356 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerName)
|
| 1345 |
sheet.write(sheet_iterator,15,mpHistory.lowestSellerRating)
|
1357 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellerRating)
|
| 1346 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
1358 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
| 1347 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
1359 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
| 1348 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerShippingTime)
|
1360 |
sheet.write(sheet_iterator,18,mpHistory.lowestSellerShippingTime)
|
| 1349 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellingPrice)
|
1361 |
sheet.write(sheet_iterator,19,mpHistory.lowestSellingPrice)
|
| 1350 |
sheet.write(sheet_iterator,18,mpHistory.lowestTp)
|
1362 |
sheet.write(sheet_iterator,20,mpHistory.lowestTp)
|
| 1351 |
sheet.write(sheet_iterator,19,mpHistory.prefferedSellerName)
|
1363 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerName)
|
| 1352 |
sheet.write(sheet_iterator,20,mpHistory.prefferedSellerRating)
|
1364 |
sheet.write(sheet_iterator,22,mpHistory.prefferedSellerRating)
|
| 1353 |
# secondLowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitSecondLowestSeller) if flipkartDetails.shippingTimeUpperLimitSecondLowestSeller==0\
|
1365 |
# secondLowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitSecondLowestSeller) if flipkartDetails.shippingTimeUpperLimitSecondLowestSeller==0\
|
| 1354 |
# else str(flipkartDetails.shippingTimeLowerLimitSecondLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitSecondLowestSeller)
|
1366 |
# else str(flipkartDetails.shippingTimeLowerLimitSecondLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitSecondLowestSeller)
|
| 1355 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerShippingTime)
|
1367 |
sheet.write(sheet_iterator,23,mpHistory.prefferedSellerShippingTime)
|
| 1356 |
sheet.write(sheet_iterator,22,mpHistory.prefferedSellerSellingPrice)
|
1368 |
sheet.write(sheet_iterator,24,mpHistory.prefferedSellerSellingPrice)
|
| 1357 |
sheet.write(sheet_iterator,23,mpHistory.prefferedSellerTp)
|
1369 |
sheet.write(sheet_iterator,25,mpHistory.prefferedSellerTp)
|
| 1358 |
sheet.write(sheet_iterator,24,mpHistory.ourInventory)
|
1370 |
sheet.write(sheet_iterator,26,mpHistory.ourInventory)
|
| 1359 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
1371 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
| 1360 |
sheet.write(sheet_iterator, 25, 'Info not available')
|
1372 |
sheet.write(sheet_iterator, 27, 'Info not available')
|
| 1361 |
else:
|
1373 |
else:
|
| 1362 |
sheet.write(sheet_iterator, 25, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
1374 |
sheet.write(sheet_iterator, 27, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
| 1363 |
sheet.write(sheet_iterator, 26, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
1375 |
sheet.write(sheet_iterator, 28, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
| 1364 |
sheet.write(sheet_iterator, 27, (itemSaleMap.get(mpHistory.item_id))[3])
|
1376 |
sheet.write(sheet_iterator, 29, (itemSaleMap.get(mpHistory.item_id))[3])
|
| 1365 |
sheet.write(sheet_iterator, 28, mpHistory.ourNlc)
|
1377 |
sheet.write(sheet_iterator, 30, mpHistory.ourNlc)
|
| 1366 |
sheet.write(sheet_iterator, 29, mpHistory.lowestPossibleSp)
|
1378 |
sheet.write(sheet_iterator, 31, mpHistory.lowestPossibleSp)
|
| 1367 |
sheet.write(sheet_iterator, 30, mpHistory.lowestPossibleTp)
|
1379 |
sheet.write(sheet_iterator, 32, mpHistory.lowestPossibleTp)
|
| 1368 |
proposed_sp = max(mpHistory.lowestSellingPrice - max((10, mpHistory.lowestSellingPrice*0.001)), mpHistory.lowestPossibleSp)
|
1380 |
proposed_sp = max(mpHistory.lowestSellingPrice - max((10, mpHistory.lowestSellingPrice*0.001)), mpHistory.lowestPossibleSp)
|
| 1369 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
1381 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
| 1370 |
target_nlc = proposed_tp - mpHistory.lowestPossibleTp + mpHistory.ourNlc
|
1382 |
target_nlc = proposed_tp - mpHistory.lowestPossibleTp + mpHistory.ourNlc
|
| 1371 |
sheet.write(sheet_iterator, 31, proposed_sp)
|
1383 |
sheet.write(sheet_iterator, 33, proposed_sp)
|
| 1372 |
sheet.write(sheet_iterator, 32, proposed_tp)
|
1384 |
sheet.write(sheet_iterator, 34, proposed_tp)
|
| 1373 |
sheet.write(sheet_iterator, 33, mpHistory.totalSeller)
|
1385 |
sheet.write(sheet_iterator, 35, mpHistory.totalSeller)
|
| 1374 |
if mpHistory.decision is None:
|
1386 |
if mpHistory.decision is None:
|
| 1375 |
sheet.write(sheet_iterator, 34, 'Auto Pricing Inactive')
|
1387 |
sheet.write(sheet_iterator, 36, 'Auto Pricing Inactive')
|
| 1376 |
sheet_iterator+=1
|
1388 |
sheet_iterator+=1
|
| 1377 |
continue
|
1389 |
continue
|
| 1378 |
sheet.write(sheet_iterator, 34, Decision._VALUES_TO_NAMES.get(mpHistory.decision))
|
1390 |
sheet.write(sheet_iterator, 36, Decision._VALUES_TO_NAMES.get(mpHistory.decision))
|
| 1379 |
sheet.write(sheet_iterator, 35, mpHistory.reason)
|
1391 |
sheet.write(sheet_iterator, 37, mpHistory.reason)
|
| 1380 |
if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_DECREMENT_SUCCESS":
|
1392 |
if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1381 |
sheet.write(sheet_iterator, 36, math.ceil(mpHistory.proposedSellingPrice))
|
1393 |
sheet.write(sheet_iterator, 38, math.ceil(mpHistory.proposedSellingPrice))
|
| 1382 |
if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_INCREMENT_SUCCESS":
|
1394 |
if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1383 |
sheet.write(sheet_iterator, 36, math.ceil(mpHistory.ourSellingPrice+max(10,.01*mpHistory.ourSellingPrice)))
|
1395 |
sheet.write(sheet_iterator, 38, math.ceil(mpHistory.ourSellingPrice+max(10,.01*mpHistory.ourSellingPrice)))
|
| 1384 |
|
1396 |
|
| 1385 |
sheet_iterator+=1
|
1397 |
sheet_iterator+=1
|
| 1386 |
|
1398 |
|
| 1387 |
prefNotCheapItems[:] = []
|
1399 |
prefNotCheapItems[:] = []
|
| 1388 |
|
1400 |
|
| Line 1408... |
Line 1420... |
| 1408 |
sheet.write(0, 4, "Brand", heading_xf)
|
1420 |
sheet.write(0, 4, "Brand", heading_xf)
|
| 1409 |
sheet.write(0, 5, "Product Name", heading_xf)
|
1421 |
sheet.write(0, 5, "Product Name", heading_xf)
|
| 1410 |
sheet.write(0, 6, "Weight", heading_xf)
|
1422 |
sheet.write(0, 6, "Weight", heading_xf)
|
| 1411 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
1423 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
| 1412 |
sheet.write(0, 8, "Risky", heading_xf)
|
1424 |
sheet.write(0, 8, "Risky", heading_xf)
|
| - |
|
1425 |
sheet.write(0, 9, "Commission Rate", heading_xf)
|
| - |
|
1426 |
sheet.write(0, 10, "Return Provision", heading_xf)
|
| 1413 |
sheet.write(0, 9, "Our Rank", heading_xf)
|
1427 |
sheet.write(0, 11, "Our Rank", heading_xf)
|
| 1414 |
sheet.write(0, 10, "Lowest Seller", heading_xf)
|
1428 |
sheet.write(0, 12, "Lowest Seller", heading_xf)
|
| 1415 |
sheet.write(0, 11, "Our Rating", heading_xf)
|
1429 |
sheet.write(0, 13, "Our Rating", heading_xf)
|
| 1416 |
sheet.write(0, 12, "Our Shipping Time", heading_xf)
|
1430 |
sheet.write(0, 14, "Our Shipping Time", heading_xf)
|
| 1417 |
sheet.write(0, 13, "Our SP", heading_xf)
|
1431 |
sheet.write(0, 15, "Our SP", heading_xf)
|
| 1418 |
sheet.write(0, 14, "Our TP", heading_xf)
|
1432 |
sheet.write(0, 16, "Our TP", heading_xf)
|
| 1419 |
sheet.write(0, 15, "Preffered Seller", heading_xf)
|
1433 |
sheet.write(0, 17, "Preffered Seller", heading_xf)
|
| 1420 |
sheet.write(0, 16, "Preffered Seller Rating", heading_xf)
|
1434 |
sheet.write(0, 18, "Preffered Seller Rating", heading_xf)
|
| 1421 |
sheet.write(0, 17, "Preffered Seller Shipping Time", heading_xf)
|
1435 |
sheet.write(0, 19, "Preffered Seller Shipping Time", heading_xf)
|
| 1422 |
sheet.write(0, 18, "Preffered Seller SP", heading_xf)
|
1436 |
sheet.write(0, 20, "Preffered Seller SP", heading_xf)
|
| 1423 |
sheet.write(0, 19, "Preffered Seller TP", heading_xf)
|
1437 |
sheet.write(0, 21, "Preffered Seller TP", heading_xf)
|
| 1424 |
sheet.write(0, 20, "Our Flipkart Inventory", heading_xf)
|
1438 |
sheet.write(0, 22, "Our Flipkart Inventory", heading_xf)
|
| 1425 |
sheet.write(0, 21, "Our Net Availability",heading_xf)
|
1439 |
sheet.write(0, 23, "Our Net Availability",heading_xf)
|
| 1426 |
sheet.write(0, 22, "Last Five Day Sale", heading_xf)
|
1440 |
sheet.write(0, 24, "Last Five Day Sale", heading_xf)
|
| 1427 |
sheet.write(0, 23, "Average Sale", heading_xf)
|
1441 |
sheet.write(0, 25, "Average Sale", heading_xf)
|
| 1428 |
sheet.write(0, 24, "Our NLC", heading_xf)
|
1442 |
sheet.write(0, 26, "Our NLC", heading_xf)
|
| 1429 |
sheet.write(0, 25, "Lowest Possible SP", heading_xf)
|
1443 |
sheet.write(0, 27, "Lowest Possible SP", heading_xf)
|
| 1430 |
sheet.write(0, 26, "Lowest Possible TP", heading_xf)
|
1444 |
sheet.write(0, 28, "Lowest Possible TP", heading_xf)
|
| 1431 |
sheet.write(0, 27, "Total Seller", heading_xf)
|
1445 |
sheet.write(0, 29, "Total Seller", heading_xf)
|
| 1432 |
sheet_iterator = 1
|
1446 |
sheet_iterator = 1
|
| 1433 |
|
1447 |
|
| 1434 |
cheapNotPrefferedItems = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
1448 |
cheapNotPrefferedItems = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
| 1435 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
1449 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
| 1436 |
.join((MarketplaceItems,MarketPlaceHistory.item_id==MarketplaceItems.itemId))\
|
1450 |
.join((MarketplaceItems,MarketPlaceHistory.item_id==MarketplaceItems.itemId))\
|
| Line 1450... |
Line 1464... |
| 1450 |
sheet.write(sheet_iterator,4,catItem.brand)
|
1464 |
sheet.write(sheet_iterator,4,catItem.brand)
|
| 1451 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
1465 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
| 1452 |
sheet.write(sheet_iterator,6,catItem.weight)
|
1466 |
sheet.write(sheet_iterator,6,catItem.weight)
|
| 1453 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
1467 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
| 1454 |
sheet.write(sheet_iterator,8,catItem.risky)
|
1468 |
sheet.write(sheet_iterator,8,catItem.risky)
|
| - |
|
1469 |
sheet.write(sheet_iterator,9,mpItem.commission)
|
| - |
|
1470 |
sheet.write(sheet_iterator,10,mpItem.returnProvision)
|
| 1455 |
sheet.write(sheet_iterator,9,mpHistory.ourRank)
|
1471 |
sheet.write(sheet_iterator,11,mpHistory.ourRank)
|
| 1456 |
sheet.write(sheet_iterator,10,mpHistory.lowestSellerName)
|
1472 |
sheet.write(sheet_iterator,12,mpHistory.lowestSellerName)
|
| 1457 |
sheet.write(sheet_iterator,11,mpHistory.ourRating)
|
1473 |
sheet.write(sheet_iterator,13,mpHistory.ourRating)
|
| 1458 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
1474 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
| 1459 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
1475 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
| 1460 |
sheet.write(sheet_iterator,12,mpHistory.lowestSellerShippingTime)
|
1476 |
sheet.write(sheet_iterator,14,mpHistory.lowestSellerShippingTime)
|
| 1461 |
sheet.write(sheet_iterator,13,mpHistory.lowestSellingPrice)
|
1477 |
sheet.write(sheet_iterator,15,mpHistory.lowestSellingPrice)
|
| 1462 |
sheet.write(sheet_iterator,14,mpHistory.lowestTp)
|
1478 |
sheet.write(sheet_iterator,16,mpHistory.lowestTp)
|
| 1463 |
sheet.write(sheet_iterator,15,mpHistory.prefferedSellerName)
|
1479 |
sheet.write(sheet_iterator,17,mpHistory.prefferedSellerName)
|
| 1464 |
sheet.write(sheet_iterator,16,mpHistory.prefferedSellerRating)
|
1480 |
sheet.write(sheet_iterator,18,mpHistory.prefferedSellerRating)
|
| 1465 |
# prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
1481 |
# prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
| 1466 |
# else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
1482 |
# else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
| 1467 |
sheet.write(sheet_iterator,17,mpHistory.prefferedSellerShippingTime)
|
1483 |
sheet.write(sheet_iterator,19,mpHistory.prefferedSellerShippingTime)
|
| 1468 |
sheet.write(sheet_iterator,18,mpHistory.prefferedSellerSellingPrice)
|
1484 |
sheet.write(sheet_iterator,20,mpHistory.prefferedSellerSellingPrice)
|
| 1469 |
sheet.write(sheet_iterator,19,mpHistory.prefferedSellerTp)
|
1485 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerTp)
|
| 1470 |
sheet.write(sheet_iterator,20,mpHistory.ourInventory)
|
1486 |
sheet.write(sheet_iterator,22,mpHistory.ourInventory)
|
| 1471 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
1487 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
| 1472 |
sheet.write(sheet_iterator, 21, 'Info not available')
|
1488 |
sheet.write(sheet_iterator, 23, 'Info not available')
|
| 1473 |
else:
|
1489 |
else:
|
| 1474 |
sheet.write(sheet_iterator, 21, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
1490 |
sheet.write(sheet_iterator, 23, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
| 1475 |
sheet.write(sheet_iterator, 22, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
1491 |
sheet.write(sheet_iterator, 24, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
| 1476 |
sheet.write(sheet_iterator, 23, (itemSaleMap.get(mpHistory.item_id))[3])
|
1492 |
sheet.write(sheet_iterator, 25, (itemSaleMap.get(mpHistory.item_id))[3])
|
| 1477 |
sheet.write(sheet_iterator, 24, mpHistory.ourNlc)
|
1493 |
sheet.write(sheet_iterator, 26, mpHistory.ourNlc)
|
| 1478 |
sheet.write(sheet_iterator, 25, mpHistory.lowestPossibleSp)
|
1494 |
sheet.write(sheet_iterator, 27, mpHistory.lowestPossibleSp)
|
| 1479 |
sheet.write(sheet_iterator, 26, mpHistory.lowestPossibleTp)
|
1495 |
sheet.write(sheet_iterator, 28, mpHistory.lowestPossibleTp)
|
| 1480 |
#proposed_sp = max(flipkartDetails.secondLowestSellerSp - max((20, flipkartDetails.secondLowestSellerSp*0.002)), flipkartPricing.lowestPossibleSp)
|
1496 |
#proposed_sp = max(flipkartDetails.secondLowestSellerSp - max((20, flipkartDetails.secondLowestSellerSp*0.002)), flipkartPricing.lowestPossibleSp)
|
| 1481 |
#proposed_tp = getTargetTp(proposed_sp,mpItem)
|
1497 |
#proposed_tp = getTargetTp(proposed_sp,mpItem)
|
| 1482 |
#target_nlc = proposed_tp - flipkartPricing.lowestPossibleTp + flipkartItemInfo.nlc
|
1498 |
#target_nlc = proposed_tp - flipkartPricing.lowestPossibleTp + flipkartItemInfo.nlc
|
| 1483 |
sheet.write(sheet_iterator, 27, mpHistory.totalSeller)
|
1499 |
sheet.write(sheet_iterator, 29, mpHistory.totalSeller)
|
| 1484 |
sheet_iterator+=1
|
1500 |
sheet_iterator+=1
|
| 1485 |
|
1501 |
|
| 1486 |
cheapNotPrefferedItems[:]=[]
|
1502 |
cheapNotPrefferedItems[:]=[]
|
| 1487 |
|
1503 |
|
| 1488 |
sheet = wbk.add_sheet('Can Compete-With Inventory')
|
1504 |
sheet = wbk.add_sheet('Can Compete-With Inventory')
|
| Line 1500... |
Line 1516... |
| 1500 |
sheet.write(0, 4, "Brand", heading_xf)
|
1516 |
sheet.write(0, 4, "Brand", heading_xf)
|
| 1501 |
sheet.write(0, 5, "Product Name", heading_xf)
|
1517 |
sheet.write(0, 5, "Product Name", heading_xf)
|
| 1502 |
sheet.write(0, 6, "Weight", heading_xf)
|
1518 |
sheet.write(0, 6, "Weight", heading_xf)
|
| 1503 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
1519 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
| 1504 |
sheet.write(0, 8, "Risky", heading_xf)
|
1520 |
sheet.write(0, 8, "Risky", heading_xf)
|
| - |
|
1521 |
sheet.write(0, 9, "Commission Rate", heading_xf)
|
| - |
|
1522 |
sheet.write(0, 10, "Return Provision", heading_xf)
|
| 1505 |
sheet.write(0, 9, "Our Rating", heading_xf)
|
1523 |
sheet.write(0, 11, "Our Rating", heading_xf)
|
| 1506 |
sheet.write(0, 10, "Our Shipping Time", heading_xf)
|
1524 |
sheet.write(0, 12, "Our Shipping Time", heading_xf)
|
| 1507 |
sheet.write(0, 11, "Our Rank", heading_xf)
|
1525 |
sheet.write(0, 13, "Our Rank", heading_xf)
|
| 1508 |
sheet.write(0, 12, "Our SP", heading_xf)
|
1526 |
sheet.write(0, 14, "Our SP", heading_xf)
|
| 1509 |
sheet.write(0, 13, "Our TP", heading_xf)
|
1527 |
sheet.write(0, 15, "Our TP", heading_xf)
|
| 1510 |
sheet.write(0, 14, "Lowest Seller", heading_xf)
|
1528 |
sheet.write(0, 16, "Lowest Seller", heading_xf)
|
| 1511 |
sheet.write(0, 15, "Lowest Seller Rating", heading_xf)
|
1529 |
sheet.write(0, 17, "Lowest Seller Rating", heading_xf)
|
| 1512 |
sheet.write(0, 16, "Lowest Seller Shipping Time", heading_xf)
|
1530 |
sheet.write(0, 18, "Lowest Seller Shipping Time", heading_xf)
|
| 1513 |
sheet.write(0, 17, "Lowest Seller SP", heading_xf)
|
1531 |
sheet.write(0, 19, "Lowest Seller SP", heading_xf)
|
| 1514 |
sheet.write(0, 18, "Lowest Seller TP", heading_xf)
|
1532 |
sheet.write(0, 20, "Lowest Seller TP", heading_xf)
|
| 1515 |
sheet.write(0, 19, "Preffered Seller", heading_xf)
|
1533 |
sheet.write(0, 21, "Preffered Seller", heading_xf)
|
| 1516 |
sheet.write(0, 20, "Preffered Seller Rating", heading_xf)
|
1534 |
sheet.write(0, 22, "Preffered Seller Rating", heading_xf)
|
| 1517 |
sheet.write(0, 21, "Preffered Seller Shipping Time", heading_xf)
|
1535 |
sheet.write(0, 23, "Preffered Seller Shipping Time", heading_xf)
|
| 1518 |
sheet.write(0, 22, "Preffer Seller SP", heading_xf)
|
1536 |
sheet.write(0, 24, "Preffer Seller SP", heading_xf)
|
| 1519 |
sheet.write(0, 23, "Preffered Seller TP", heading_xf)
|
1537 |
sheet.write(0, 25, "Preffered Seller TP", heading_xf)
|
| 1520 |
sheet.write(0, 24, "Our Flipkart Inventory", heading_xf)
|
1538 |
sheet.write(0, 26, "Our Flipkart Inventory", heading_xf)
|
| 1521 |
sheet.write(0, 25, "Our Net Availability",heading_xf)
|
1539 |
sheet.write(0, 27, "Our Net Availability",heading_xf)
|
| 1522 |
sheet.write(0, 26, "Last Five Day Sale", heading_xf)
|
1540 |
sheet.write(0, 28, "Last Five Day Sale", heading_xf)
|
| 1523 |
sheet.write(0, 27, "Average Sale", heading_xf)
|
1541 |
sheet.write(0, 29, "Average Sale", heading_xf)
|
| 1524 |
sheet.write(0, 28, "Our NLC", heading_xf)
|
1542 |
sheet.write(0, 30, "Our NLC", heading_xf)
|
| 1525 |
sheet.write(0, 29, "Lowest Possible SP", heading_xf)
|
1543 |
sheet.write(0, 31, "Lowest Possible SP", heading_xf)
|
| 1526 |
sheet.write(0, 30, "Lowest Possible TP", heading_xf)
|
1544 |
sheet.write(0, 32, "Lowest Possible TP", heading_xf)
|
| 1527 |
sheet.write(0, 31, "Target SP", heading_xf)
|
1545 |
sheet.write(0, 33, "Target SP", heading_xf)
|
| 1528 |
sheet.write(0, 32, "Target TP", heading_xf)
|
1546 |
sheet.write(0, 34, "Target TP", heading_xf)
|
| 1529 |
sheet.write(0, 33, "Target NLC", heading_xf)
|
1547 |
sheet.write(0, 35, "Target NLC", heading_xf)
|
| 1530 |
sheet.write(0, 34, "Sales Potential", heading_xf)
|
1548 |
sheet.write(0, 36, "Sales Potential", heading_xf)
|
| 1531 |
sheet.write(0, 35, "Total Seller", heading_xf)
|
1549 |
sheet.write(0, 37, "Total Seller", heading_xf)
|
| 1532 |
sheet.write(0, 36, "Auto Pricing Decision", heading_xf)
|
1550 |
sheet.write(0, 38, "Auto Pricing Decision", heading_xf)
|
| 1533 |
sheet.write(0, 37, "Reason", heading_xf)
|
1551 |
sheet.write(0, 39, "Reason", heading_xf)
|
| 1534 |
sheet.write(0, 38, "Updated Price", heading_xf)
|
1552 |
sheet.write(0, 40, "Updated Price", heading_xf)
|
| 1535 |
sheet_iterator = 1
|
1553 |
sheet_iterator = 1
|
| 1536 |
|
1554 |
|
| 1537 |
competitiveItems = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
1555 |
competitiveItems = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
| 1538 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
1556 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
| 1539 |
.join((MarketplaceItems,MarketPlaceHistory.item_id==MarketplaceItems.itemId))\
|
1557 |
.join((MarketplaceItems,MarketPlaceHistory.item_id==MarketplaceItems.itemId))\
|
| Line 1553... |
Line 1571... |
| 1553 |
sheet.write(sheet_iterator,4,catItem.brand)
|
1571 |
sheet.write(sheet_iterator,4,catItem.brand)
|
| 1554 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
1572 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
| 1555 |
sheet.write(sheet_iterator,6,catItem.weight)
|
1573 |
sheet.write(sheet_iterator,6,catItem.weight)
|
| 1556 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
1574 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
| 1557 |
sheet.write(sheet_iterator,8,catItem.risky)
|
1575 |
sheet.write(sheet_iterator,8,catItem.risky)
|
| - |
|
1576 |
sheet.write(sheet_iterator,9,mpItem.commission)
|
| - |
|
1577 |
sheet.write(sheet_iterator,10,mpItem.returnProvision)
|
| 1558 |
sheet.write(sheet_iterator,9,mpHistory.ourRating)
|
1578 |
sheet.write(sheet_iterator,11,mpHistory.ourRating)
|
| 1559 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
1579 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
| 1560 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
1580 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
| 1561 |
sheet.write(sheet_iterator,10,mpHistory.ourShippingTime)
|
1581 |
sheet.write(sheet_iterator,12,mpHistory.ourShippingTime)
|
| 1562 |
sheet.write(sheet_iterator,11,mpHistory.ourRank)
|
1582 |
sheet.write(sheet_iterator,13,mpHistory.ourRank)
|
| 1563 |
sheet.write(sheet_iterator,12,mpHistory.ourSellingPrice)
|
1583 |
sheet.write(sheet_iterator,14,mpHistory.ourSellingPrice)
|
| 1564 |
sheet.write(sheet_iterator,13,mpHistory.ourTp)
|
1584 |
sheet.write(sheet_iterator,15,mpHistory.ourTp)
|
| 1565 |
sheet.write(sheet_iterator,14,mpHistory.lowestSellerName)
|
1585 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerName)
|
| 1566 |
sheet.write(sheet_iterator,15,mpHistory.lowestSellerRating)
|
1586 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellerRating)
|
| 1567 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
1587 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
| 1568 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
1588 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
| 1569 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerShippingTime)
|
1589 |
sheet.write(sheet_iterator,18,mpHistory.lowestSellerShippingTime)
|
| 1570 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellingPrice)
|
1590 |
sheet.write(sheet_iterator,19,mpHistory.lowestSellingPrice)
|
| 1571 |
sheet.write(sheet_iterator,18,mpHistory.lowestTp)
|
1591 |
sheet.write(sheet_iterator,20,mpHistory.lowestTp)
|
| 1572 |
sheet.write(sheet_iterator,19,mpHistory.prefferedSellerName)
|
1592 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerName)
|
| 1573 |
sheet.write(sheet_iterator,20,mpHistory.prefferedSellerRating)
|
1593 |
sheet.write(sheet_iterator,22,mpHistory.prefferedSellerRating)
|
| 1574 |
# prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
1594 |
# prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
| 1575 |
# else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
1595 |
# else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
| 1576 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerShippingTime)
|
1596 |
sheet.write(sheet_iterator,23,mpHistory.prefferedSellerShippingTime)
|
| 1577 |
sheet.write(sheet_iterator,22,mpHistory.prefferedSellerSellingPrice)
|
1597 |
sheet.write(sheet_iterator,24,mpHistory.prefferedSellerSellingPrice)
|
| 1578 |
sheet.write(sheet_iterator,23,mpHistory.prefferedSellerTp)
|
1598 |
sheet.write(sheet_iterator,25,mpHistory.prefferedSellerTp)
|
| 1579 |
sheet.write(sheet_iterator,24,mpHistory.ourInventory)
|
1599 |
sheet.write(sheet_iterator,26,mpHistory.ourInventory)
|
| 1580 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
1600 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
| 1581 |
sheet.write(sheet_iterator, 25, 'Info not available')
|
1601 |
sheet.write(sheet_iterator, 27, 'Info not available')
|
| 1582 |
else:
|
1602 |
else:
|
| 1583 |
sheet.write(sheet_iterator, 25, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
1603 |
sheet.write(sheet_iterator, 27, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
| 1584 |
sheet.write(sheet_iterator, 26, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
1604 |
sheet.write(sheet_iterator, 28, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
| 1585 |
sheet.write(sheet_iterator, 27, (itemSaleMap.get(mpHistory.item_id))[3])
|
1605 |
sheet.write(sheet_iterator, 29, (itemSaleMap.get(mpHistory.item_id))[3])
|
| 1586 |
sheet.write(sheet_iterator, 28, mpHistory.ourNlc)
|
1606 |
sheet.write(sheet_iterator, 30, mpHistory.ourNlc)
|
| 1587 |
sheet.write(sheet_iterator, 29, mpHistory.lowestPossibleSp)
|
1607 |
sheet.write(sheet_iterator, 31, mpHistory.lowestPossibleSp)
|
| 1588 |
sheet.write(sheet_iterator, 30, mpHistory.lowestPossibleTp)
|
1608 |
sheet.write(sheet_iterator, 32, mpHistory.lowestPossibleTp)
|
| 1589 |
proposed_sp = max(mpHistory.lowestSellingPrice - max((10, mpHistory.lowestSellingPrice*0.001)), mpHistory.lowestPossibleSp)
|
1609 |
proposed_sp = max(mpHistory.lowestSellingPrice - max((10, mpHistory.lowestSellingPrice*0.001)), mpHistory.lowestPossibleSp)
|
| 1590 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
1610 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
| 1591 |
target_nlc = proposed_tp - mpHistory.lowestPossibleTp + mpHistory.ourNlc
|
1611 |
target_nlc = proposed_tp - mpHistory.lowestPossibleTp + mpHistory.ourNlc
|
| 1592 |
sheet.write(sheet_iterator, 31, proposed_sp)
|
1612 |
sheet.write(sheet_iterator, 33, proposed_sp)
|
| 1593 |
sheet.write(sheet_iterator, 32, proposed_tp)
|
1613 |
sheet.write(sheet_iterator, 34, proposed_tp)
|
| 1594 |
sheet.write(sheet_iterator, 33, target_nlc)
|
1614 |
sheet.write(sheet_iterator, 35, target_nlc)
|
| 1595 |
sheet.write(sheet_iterator, 34, getSalesPotential(mpHistory.lowestSellingPrice,mpHistory.ourNlc))
|
1615 |
sheet.write(sheet_iterator, 36, getSalesPotential(mpHistory.lowestSellingPrice,mpHistory.ourNlc))
|
| 1596 |
sheet.write(sheet_iterator, 35, mpHistory.totalSeller)
|
1616 |
sheet.write(sheet_iterator, 37, mpHistory.totalSeller)
|
| 1597 |
if mpHistory.decision is None:
|
1617 |
if mpHistory.decision is None:
|
| 1598 |
sheet.write(sheet_iterator, 36, 'Auto Pricing Inactive')
|
1618 |
sheet.write(sheet_iterator, 38, 'Auto Pricing Inactive')
|
| 1599 |
sheet_iterator+=1
|
1619 |
sheet_iterator+=1
|
| 1600 |
continue
|
1620 |
continue
|
| 1601 |
sheet.write(sheet_iterator, 36, Decision._VALUES_TO_NAMES.get(mpHistory.decision))
|
1621 |
sheet.write(sheet_iterator, 38, Decision._VALUES_TO_NAMES.get(mpHistory.decision))
|
| 1602 |
sheet.write(sheet_iterator, 37, mpHistory.reason)
|
1622 |
sheet.write(sheet_iterator, 39, mpHistory.reason)
|
| 1603 |
if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_DECREMENT_SUCCESS":
|
1623 |
if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_DECREMENT_SUCCESS":
|
| 1604 |
sheet.write(sheet_iterator, 38, math.ceil(mpHistory.proposedSellingPrice))
|
1624 |
sheet.write(sheet_iterator, 40, math.ceil(mpHistory.proposedSellingPrice))
|
| 1605 |
if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_INCREMENT_SUCCESS":
|
1625 |
if Decision._VALUES_TO_NAMES.get(mpHistory.decision) == "AUTO_INCREMENT_SUCCESS":
|
| 1606 |
sheet.write(sheet_iterator, 38, math.ceil(mpHistory.ourSellingPrice+max(10,.01*mpHistory.ourSellingPrice)))
|
1626 |
sheet.write(sheet_iterator, 40, math.ceil(mpHistory.ourSellingPrice+max(10,.01*mpHistory.ourSellingPrice)))
|
| 1607 |
|
1627 |
|
| 1608 |
sheet_iterator+=1
|
1628 |
sheet_iterator+=1
|
| 1609 |
|
1629 |
|
| 1610 |
competitiveItems[:]=[]
|
1630 |
competitiveItems[:]=[]
|
| 1611 |
|
1631 |
|
| Line 1624... |
Line 1644... |
| 1624 |
sheet.write(0, 4, "Brand", heading_xf)
|
1644 |
sheet.write(0, 4, "Brand", heading_xf)
|
| 1625 |
sheet.write(0, 5, "Product Name", heading_xf)
|
1645 |
sheet.write(0, 5, "Product Name", heading_xf)
|
| 1626 |
sheet.write(0, 6, "Weight", heading_xf)
|
1646 |
sheet.write(0, 6, "Weight", heading_xf)
|
| 1627 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
1647 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
| 1628 |
sheet.write(0, 8, "Risky", heading_xf)
|
1648 |
sheet.write(0, 8, "Risky", heading_xf)
|
| - |
|
1649 |
sheet.write(0, 9, "Commission Rate", heading_xf)
|
| - |
|
1650 |
sheet.write(0, 10, "Return Provision", heading_xf)
|
| 1629 |
sheet.write(0, 9, "Our Rating", heading_xf)
|
1651 |
sheet.write(0, 11, "Our Rating", heading_xf)
|
| 1630 |
sheet.write(0, 10, "Our Shipping Time", heading_xf)
|
1652 |
sheet.write(0, 12, "Our Shipping Time", heading_xf)
|
| 1631 |
sheet.write(0, 11, "Our Rank", heading_xf)
|
1653 |
sheet.write(0, 13, "Our Rank", heading_xf)
|
| 1632 |
sheet.write(0, 12, "Our SP", heading_xf)
|
1654 |
sheet.write(0, 14, "Our SP", heading_xf)
|
| 1633 |
sheet.write(0, 13, "Our TP", heading_xf)
|
1655 |
sheet.write(0, 15, "Our TP", heading_xf)
|
| 1634 |
sheet.write(0, 14, "Lowest Seller", heading_xf)
|
1656 |
sheet.write(0, 16, "Lowest Seller", heading_xf)
|
| 1635 |
sheet.write(0, 15, "Lowest Seller Rating", heading_xf)
|
1657 |
sheet.write(0, 17, "Lowest Seller Rating", heading_xf)
|
| 1636 |
sheet.write(0, 16, "Lowest Seller Shipping Time", heading_xf)
|
1658 |
sheet.write(0, 18, "Lowest Seller Shipping Time", heading_xf)
|
| 1637 |
sheet.write(0, 17, "Lowest Seller SP", heading_xf)
|
1659 |
sheet.write(0, 19, "Lowest Seller SP", heading_xf)
|
| 1638 |
sheet.write(0, 18, "Lowest Seller TP", heading_xf)
|
1660 |
sheet.write(0, 20, "Lowest Seller TP", heading_xf)
|
| 1639 |
sheet.write(0, 19, "Preffered Seller", heading_xf)
|
1661 |
sheet.write(0, 21, "Preffered Seller", heading_xf)
|
| 1640 |
sheet.write(0, 20, "Preffered Seller Rating", heading_xf)
|
1662 |
sheet.write(0, 22, "Preffered Seller Rating", heading_xf)
|
| 1641 |
sheet.write(0, 21, "Preffered Seller Shipping Time", heading_xf)
|
1663 |
sheet.write(0, 23, "Preffered Seller Shipping Time", heading_xf)
|
| 1642 |
sheet.write(0, 22, "Preffer Seller SP", heading_xf)
|
1664 |
sheet.write(0, 24, "Preffer Seller SP", heading_xf)
|
| 1643 |
sheet.write(0, 23, "Preffered Seller TP", heading_xf)
|
1665 |
sheet.write(0, 25, "Preffered Seller TP", heading_xf)
|
| 1644 |
sheet.write(0, 24, "Our Flipkart Inventory", heading_xf)
|
1666 |
sheet.write(0, 26, "Our Flipkart Inventory", heading_xf)
|
| 1645 |
sheet.write(0, 25, "Our Net Availability",heading_xf)
|
1667 |
sheet.write(0, 27, "Our Net Availability",heading_xf)
|
| 1646 |
sheet.write(0, 26, "Last Five Day Sale", heading_xf)
|
1668 |
sheet.write(0, 28, "Last Five Day Sale", heading_xf)
|
| 1647 |
sheet.write(0, 27, "Average Sale", heading_xf)
|
1669 |
sheet.write(0, 29, "Average Sale", heading_xf)
|
| 1648 |
sheet.write(0, 28, "Our NLC", heading_xf)
|
1670 |
sheet.write(0, 30, "Our NLC", heading_xf)
|
| 1649 |
sheet.write(0, 29, "Lowest Possible SP", heading_xf)
|
1671 |
sheet.write(0, 31, "Lowest Possible SP", heading_xf)
|
| 1650 |
sheet.write(0, 30, "Lowest Possible TP", heading_xf)
|
1672 |
sheet.write(0, 32, "Lowest Possible TP", heading_xf)
|
| 1651 |
sheet.write(0, 31, "Margin", heading_xf)
|
1673 |
sheet.write(0, 33, "Margin", heading_xf)
|
| 1652 |
sheet.write(0, 32, "Total Seller", heading_xf)
|
1674 |
sheet.write(0, 34, "Total Seller", heading_xf)
|
| 1653 |
sheet_iterator = 1
|
1675 |
sheet_iterator = 1
|
| 1654 |
|
1676 |
|
| 1655 |
negativeMargin = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
1677 |
negativeMargin = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
| 1656 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
1678 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
| 1657 |
.join((MarketplaceItems,MarketPlaceHistory.item_id==MarketplaceItems.itemId))\
|
1679 |
.join((MarketplaceItems,MarketPlaceHistory.item_id==MarketplaceItems.itemId))\
|
| Line 1671... |
Line 1693... |
| 1671 |
sheet.write(sheet_iterator,4,catItem.brand)
|
1693 |
sheet.write(sheet_iterator,4,catItem.brand)
|
| 1672 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
1694 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
| 1673 |
sheet.write(sheet_iterator,6,catItem.weight)
|
1695 |
sheet.write(sheet_iterator,6,catItem.weight)
|
| 1674 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
1696 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
| 1675 |
sheet.write(sheet_iterator,8,catItem.risky)
|
1697 |
sheet.write(sheet_iterator,8,catItem.risky)
|
| - |
|
1698 |
sheet.write(sheet_iterator,9,mpItem.commission)
|
| - |
|
1699 |
sheet.write(sheet_iterator,10,mpItem.returnProvision)
|
| 1676 |
sheet.write(sheet_iterator,9,mpHistory.ourRating)
|
1700 |
sheet.write(sheet_iterator,11,mpHistory.ourRating)
|
| 1677 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
1701 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
| 1678 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
1702 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
| 1679 |
sheet.write(sheet_iterator,10,mpHistory.ourShippingTime)
|
1703 |
sheet.write(sheet_iterator,12,mpHistory.ourShippingTime)
|
| 1680 |
sheet.write(sheet_iterator,11,mpHistory.ourRank)
|
1704 |
sheet.write(sheet_iterator,13,mpHistory.ourRank)
|
| 1681 |
sheet.write(sheet_iterator,12,mpHistory.ourSellingPrice)
|
1705 |
sheet.write(sheet_iterator,14,mpHistory.ourSellingPrice)
|
| 1682 |
sheet.write(sheet_iterator,13,mpHistory.ourTp)
|
1706 |
sheet.write(sheet_iterator,15,mpHistory.ourTp)
|
| 1683 |
sheet.write(sheet_iterator,14,mpHistory.lowestSellerName)
|
1707 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerName)
|
| 1684 |
sheet.write(sheet_iterator,15,mpHistory.lowestSellerRating)
|
1708 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellerRating)
|
| 1685 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
1709 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
| 1686 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
1710 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
| 1687 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerShippingTime)
|
1711 |
sheet.write(sheet_iterator,18,mpHistory.lowestSellerShippingTime)
|
| 1688 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellingPrice)
|
1712 |
sheet.write(sheet_iterator,19,mpHistory.lowestSellingPrice)
|
| 1689 |
sheet.write(sheet_iterator,18,mpHistory.lowestTp)
|
1713 |
sheet.write(sheet_iterator,20,mpHistory.lowestTp)
|
| 1690 |
sheet.write(sheet_iterator,19,mpHistory.prefferedSellerName)
|
1714 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerName)
|
| 1691 |
sheet.write(sheet_iterator,20,mpHistory.prefferedSellerRating)
|
1715 |
sheet.write(sheet_iterator,22,mpHistory.prefferedSellerRating)
|
| 1692 |
# prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
1716 |
# prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
| 1693 |
# else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
1717 |
# else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
| 1694 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerShippingTime)
|
1718 |
sheet.write(sheet_iterator,23,mpHistory.prefferedSellerShippingTime)
|
| 1695 |
sheet.write(sheet_iterator,22,mpHistory.prefferedSellerSellingPrice)
|
1719 |
sheet.write(sheet_iterator,24,mpHistory.prefferedSellerSellingPrice)
|
| 1696 |
sheet.write(sheet_iterator,23,mpHistory.prefferedSellerTp)
|
1720 |
sheet.write(sheet_iterator,25,mpHistory.prefferedSellerTp)
|
| 1697 |
sheet.write(sheet_iterator,24,mpHistory.ourInventory)
|
1721 |
sheet.write(sheet_iterator,26,mpHistory.ourInventory)
|
| 1698 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
1722 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
| 1699 |
sheet.write(sheet_iterator, 25, 'Info not available')
|
1723 |
sheet.write(sheet_iterator, 27, 'Info not available')
|
| 1700 |
else:
|
1724 |
else:
|
| 1701 |
sheet.write(sheet_iterator, 25, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
1725 |
sheet.write(sheet_iterator, 27, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
| 1702 |
sheet.write(sheet_iterator, 26, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
1726 |
sheet.write(sheet_iterator, 28, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
| 1703 |
sheet.write(sheet_iterator, 27, (itemSaleMap.get(mpHistory.item_id))[3])
|
1727 |
sheet.write(sheet_iterator, 29, (itemSaleMap.get(mpHistory.item_id))[3])
|
| 1704 |
sheet.write(sheet_iterator, 28, mpHistory.ourNlc)
|
1728 |
sheet.write(sheet_iterator, 30, mpHistory.ourNlc)
|
| 1705 |
sheet.write(sheet_iterator, 29, mpHistory.lowestPossibleSp)
|
1729 |
sheet.write(sheet_iterator, 31, mpHistory.lowestPossibleSp)
|
| 1706 |
sheet.write(sheet_iterator, 30, mpHistory.lowestPossibleTp)
|
1730 |
sheet.write(sheet_iterator, 32, mpHistory.lowestPossibleTp)
|
| 1707 |
sheet.write(sheet_iterator, 31, round((mpHistory.ourTp - mpHistory.lowestPossibleTp),2))
|
1731 |
sheet.write(sheet_iterator, 33, round((mpHistory.ourTp - mpHistory.lowestPossibleTp),2))
|
| 1708 |
sheet.write(sheet_iterator, 32, mpHistory.totalSeller)
|
1732 |
sheet.write(sheet_iterator, 34, mpHistory.totalSeller)
|
| 1709 |
sheet_iterator+=1
|
1733 |
sheet_iterator+=1
|
| 1710 |
|
1734 |
|
| 1711 |
negativeMargin[:]=[]
|
1735 |
negativeMargin[:]=[]
|
| 1712 |
|
1736 |
|
| 1713 |
if (runType=='FULL'):
|
1737 |
if (runType=='FULL'):
|
| Line 1804... |
Line 1828... |
| 1804 |
sheet.write(0, 4, "Brand", heading_xf)
|
1828 |
sheet.write(0, 4, "Brand", heading_xf)
|
| 1805 |
sheet.write(0, 5, "Product Name", heading_xf)
|
1829 |
sheet.write(0, 5, "Product Name", heading_xf)
|
| 1806 |
sheet.write(0, 6, "Weight", heading_xf)
|
1830 |
sheet.write(0, 6, "Weight", heading_xf)
|
| 1807 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
1831 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
| 1808 |
sheet.write(0, 8, "Risky", heading_xf)
|
1832 |
sheet.write(0, 8, "Risky", heading_xf)
|
| - |
|
1833 |
sheet.write(0, 9, "Commission Rate", heading_xf)
|
| - |
|
1834 |
sheet.write(0, 10, "Return Provision", heading_xf)
|
| 1809 |
sheet.write(0, 9, "Our Rating", heading_xf)
|
1835 |
sheet.write(0, 11, "Our Rating", heading_xf)
|
| 1810 |
sheet.write(0, 10, "Our Shipping Time", heading_xf)
|
1836 |
sheet.write(0, 12, "Our Shipping Time", heading_xf)
|
| 1811 |
sheet.write(0, 11, "Our Rank", heading_xf)
|
1837 |
sheet.write(0, 13, "Our Rank", heading_xf)
|
| 1812 |
sheet.write(0, 12, "Our SP", heading_xf)
|
1838 |
sheet.write(0, 14, "Our SP", heading_xf)
|
| 1813 |
sheet.write(0, 13, "Our TP", heading_xf)
|
1839 |
sheet.write(0, 15, "Our TP", heading_xf)
|
| 1814 |
sheet.write(0, 14, "Lowest Seller", heading_xf)
|
1840 |
sheet.write(0, 16, "Lowest Seller", heading_xf)
|
| 1815 |
sheet.write(0, 15, "Lowest Seller Rating", heading_xf)
|
1841 |
sheet.write(0, 17, "Lowest Seller Rating", heading_xf)
|
| 1816 |
sheet.write(0, 16, "Lowest Seller Shipping Time", heading_xf)
|
1842 |
sheet.write(0, 18, "Lowest Seller Shipping Time", heading_xf)
|
| 1817 |
sheet.write(0, 17, "Lowest Seller SP", heading_xf)
|
1843 |
sheet.write(0, 19, "Lowest Seller SP", heading_xf)
|
| 1818 |
sheet.write(0, 18, "Lowest Seller TP", heading_xf)
|
1844 |
sheet.write(0, 20, "Lowest Seller TP", heading_xf)
|
| 1819 |
sheet.write(0, 19, "Preffered Seller", heading_xf)
|
1845 |
sheet.write(0, 21, "Preffered Seller", heading_xf)
|
| 1820 |
sheet.write(0, 20, "Preffered Seller Rating", heading_xf)
|
1846 |
sheet.write(0, 22, "Preffered Seller Rating", heading_xf)
|
| 1821 |
sheet.write(0, 21, "Preffered Seller Shipping Time", heading_xf)
|
1847 |
sheet.write(0, 23, "Preffered Seller Shipping Time", heading_xf)
|
| 1822 |
sheet.write(0, 22, "Preffer Seller SP", heading_xf)
|
1848 |
sheet.write(0, 24, "Preffer Seller SP", heading_xf)
|
| 1823 |
sheet.write(0, 23, "Preffered Seller TP", heading_xf)
|
1849 |
sheet.write(0, 25, "Preffered Seller TP", heading_xf)
|
| 1824 |
sheet.write(0, 24, "Our Flipkart Inventory", heading_xf)
|
1850 |
sheet.write(0, 26, "Our Flipkart Inventory", heading_xf)
|
| 1825 |
sheet.write(0, 25, "Our Net Availability",heading_xf)
|
1851 |
sheet.write(0, 27, "Our Net Availability",heading_xf)
|
| 1826 |
sheet.write(0, 26, "Last Five Day Sale", heading_xf)
|
1852 |
sheet.write(0, 28, "Last Five Day Sale", heading_xf)
|
| 1827 |
sheet.write(0, 27, "Average Sale", heading_xf)
|
1853 |
sheet.write(0, 29, "Average Sale", heading_xf)
|
| 1828 |
sheet.write(0, 28, "Our NLC", heading_xf)
|
1854 |
sheet.write(0, 30, "Our NLC", heading_xf)
|
| 1829 |
sheet.write(0, 29, "Lowest Possible SP", heading_xf)
|
1855 |
sheet.write(0, 31, "Lowest Possible SP", heading_xf)
|
| 1830 |
sheet.write(0, 30, "Lowest Possible TP", heading_xf)
|
1856 |
sheet.write(0, 32, "Lowest Possible TP", heading_xf)
|
| 1831 |
sheet.write(0, 31, "Target SP", heading_xf)
|
1857 |
sheet.write(0, 33, "Target SP", heading_xf)
|
| 1832 |
sheet.write(0, 32, "Target TP", heading_xf)
|
1858 |
sheet.write(0, 34, "Target TP", heading_xf)
|
| 1833 |
sheet.write(0, 33, "Sales Potential", heading_xf)
|
1859 |
sheet.write(0, 35, "Sales Potential", heading_xf)
|
| 1834 |
sheet.write(0, 34, "Total Seller", heading_xf)
|
1860 |
sheet.write(0, 36, "Total Seller", heading_xf)
|
| 1835 |
sheet_iterator = 1
|
1861 |
sheet_iterator = 1
|
| 1836 |
|
1862 |
|
| 1837 |
competitiveNoInventory = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
1863 |
competitiveNoInventory = session.query(MarketPlaceHistory,FlipkartItem,MarketplaceItems,Item)\
|
| 1838 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
1864 |
.join((FlipkartItem,MarketPlaceHistory.item_id==FlipkartItem.item_id))\
|
| 1839 |
.join((MarketplaceItems,MarketPlaceHistory.item_id==MarketplaceItems.itemId))\
|
1865 |
.join((MarketplaceItems,MarketPlaceHistory.item_id==MarketplaceItems.itemId))\
|
| Line 1854... |
Line 1880... |
| 1854 |
sheet.write(sheet_iterator,4,catItem.brand)
|
1880 |
sheet.write(sheet_iterator,4,catItem.brand)
|
| 1855 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
1881 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
| 1856 |
sheet.write(sheet_iterator,6,catItem.weight)
|
1882 |
sheet.write(sheet_iterator,6,catItem.weight)
|
| 1857 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
1883 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
| 1858 |
sheet.write(sheet_iterator,8,catItem.risky)
|
1884 |
sheet.write(sheet_iterator,8,catItem.risky)
|
| - |
|
1885 |
sheet.write(sheet_iterator,9,mpItem.commission)
|
| - |
|
1886 |
sheet.write(sheet_iterator,10,mpItem.returnProvision)
|
| 1859 |
sheet.write(sheet_iterator,9,mpHistory.ourRating)
|
1887 |
sheet.write(sheet_iterator,11,mpHistory.ourRating)
|
| 1860 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
1888 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
| 1861 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
1889 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
| 1862 |
sheet.write(sheet_iterator,10,mpHistory.ourShippingTime)
|
1890 |
sheet.write(sheet_iterator,12,mpHistory.ourShippingTime)
|
| 1863 |
sheet.write(sheet_iterator,11,mpHistory.ourRank)
|
1891 |
sheet.write(sheet_iterator,13,mpHistory.ourRank)
|
| 1864 |
sheet.write(sheet_iterator,12,mpHistory.ourSellingPrice)
|
1892 |
sheet.write(sheet_iterator,14,mpHistory.ourSellingPrice)
|
| 1865 |
sheet.write(sheet_iterator,13,mpHistory.ourTp)
|
1893 |
sheet.write(sheet_iterator,15,mpHistory.ourTp)
|
| 1866 |
sheet.write(sheet_iterator,14,mpHistory.lowestSellerName)
|
1894 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerName)
|
| 1867 |
sheet.write(sheet_iterator,15,mpHistory.lowestSellerRating)
|
1895 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellerRating)
|
| 1868 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
1896 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
| 1869 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
1897 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
| 1870 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerShippingTime)
|
1898 |
sheet.write(sheet_iterator,18,mpHistory.lowestSellerShippingTime)
|
| 1871 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellingPrice)
|
1899 |
sheet.write(sheet_iterator,19,mpHistory.lowestSellingPrice)
|
| 1872 |
sheet.write(sheet_iterator,18,mpHistory.lowestTp)
|
1900 |
sheet.write(sheet_iterator,20,mpHistory.lowestTp)
|
| 1873 |
sheet.write(sheet_iterator,19,mpHistory.prefferedSellerName)
|
1901 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerName)
|
| 1874 |
sheet.write(sheet_iterator,20,mpHistory.prefferedSellerRating)
|
1902 |
sheet.write(sheet_iterator,22,mpHistory.prefferedSellerRating)
|
| 1875 |
# prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
1903 |
# prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
| 1876 |
# else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
1904 |
# else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
| 1877 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerShippingTime)
|
1905 |
sheet.write(sheet_iterator,23,mpHistory.prefferedSellerShippingTime)
|
| 1878 |
sheet.write(sheet_iterator,22,mpHistory.prefferedSellerSellingPrice)
|
1906 |
sheet.write(sheet_iterator,24,mpHistory.prefferedSellerSellingPrice)
|
| 1879 |
sheet.write(sheet_iterator,23,mpHistory.prefferedSellerTp)
|
1907 |
sheet.write(sheet_iterator,25,mpHistory.prefferedSellerTp)
|
| 1880 |
sheet.write(sheet_iterator,24,mpHistory.ourInventory)
|
1908 |
sheet.write(sheet_iterator,26,mpHistory.ourInventory)
|
| 1881 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
1909 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
| 1882 |
sheet.write(sheet_iterator, 25, 'Info not available')
|
1910 |
sheet.write(sheet_iterator, 27, 'Info not available')
|
| 1883 |
else:
|
1911 |
else:
|
| 1884 |
sheet.write(sheet_iterator, 25, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
1912 |
sheet.write(sheet_iterator, 27, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
| 1885 |
sheet.write(sheet_iterator, 26, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
1913 |
sheet.write(sheet_iterator, 28, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
| 1886 |
sheet.write(sheet_iterator, 27, (itemSaleMap.get(mpHistory.item_id))[3])
|
1914 |
sheet.write(sheet_iterator, 29, (itemSaleMap.get(mpHistory.item_id))[3])
|
| 1887 |
sheet.write(sheet_iterator, 28, mpHistory.ourNlc)
|
1915 |
sheet.write(sheet_iterator, 30, mpHistory.ourNlc)
|
| 1888 |
sheet.write(sheet_iterator, 29, mpHistory.lowestPossibleSp)
|
1916 |
sheet.write(sheet_iterator, 31, mpHistory.lowestPossibleSp)
|
| 1889 |
sheet.write(sheet_iterator, 30, mpHistory.lowestPossibleTp)
|
1917 |
sheet.write(sheet_iterator, 32, mpHistory.lowestPossibleTp)
|
| 1890 |
proposed_sp = max(mpHistory.lowestSellingPrice - max((10, mpHistory.lowestSellingPrice*0.001)), mpHistory.lowestPossibleSp)
|
1918 |
proposed_sp = max(mpHistory.lowestSellingPrice - max((10, mpHistory.lowestSellingPrice*0.001)), mpHistory.lowestPossibleSp)
|
| 1891 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
1919 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
| 1892 |
sheet.write(sheet_iterator, 31, proposed_sp)
|
1920 |
sheet.write(sheet_iterator, 33, proposed_sp)
|
| 1893 |
sheet.write(sheet_iterator, 32, proposed_tp)
|
1921 |
sheet.write(sheet_iterator, 34, proposed_tp)
|
| 1894 |
sheet.write(sheet_iterator, 33, getSalesPotential(mpHistory.lowestPossibleSp,mpHistory.ourNlc))
|
1922 |
sheet.write(sheet_iterator, 35, getSalesPotential(mpHistory.lowestPossibleSp,mpHistory.ourNlc))
|
| 1895 |
sheet.write(sheet_iterator, 34, mpHistory.totalSeller)
|
1923 |
sheet.write(sheet_iterator, 36, mpHistory.totalSeller)
|
| 1896 |
sheet_iterator+=1
|
1924 |
sheet_iterator+=1
|
| 1897 |
|
1925 |
|
| 1898 |
|
1926 |
|
| 1899 |
sheet = wbk.add_sheet('Can Compete-No Inv On FK')
|
1927 |
sheet = wbk.add_sheet('Can Compete-No Inv On FK')
|
| 1900 |
xstr = lambda s: s or ""
|
1928 |
xstr = lambda s: s or ""
|
| Line 1911... |
Line 1939... |
| 1911 |
sheet.write(0, 4, "Brand", heading_xf)
|
1939 |
sheet.write(0, 4, "Brand", heading_xf)
|
| 1912 |
sheet.write(0, 5, "Product Name", heading_xf)
|
1940 |
sheet.write(0, 5, "Product Name", heading_xf)
|
| 1913 |
sheet.write(0, 6, "Weight", heading_xf)
|
1941 |
sheet.write(0, 6, "Weight", heading_xf)
|
| 1914 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
1942 |
sheet.write(0, 7, "Courier Cost", heading_xf)
|
| 1915 |
sheet.write(0, 8, "Risky", heading_xf)
|
1943 |
sheet.write(0, 8, "Risky", heading_xf)
|
| - |
|
1944 |
sheet.write(0, 9, "Commission Rate", heading_xf)
|
| - |
|
1945 |
sheet.write(0, 10, "Return Provision", heading_xf)
|
| 1916 |
sheet.write(0, 9, "Our Rating", heading_xf)
|
1946 |
sheet.write(0, 11, "Our Rating", heading_xf)
|
| 1917 |
sheet.write(0, 10, "Our Shipping Time", heading_xf)
|
1947 |
sheet.write(0, 12, "Our Shipping Time", heading_xf)
|
| 1918 |
sheet.write(0, 11, "Our Rank", heading_xf)
|
1948 |
sheet.write(0, 13, "Our Rank", heading_xf)
|
| 1919 |
sheet.write(0, 12, "Our SP", heading_xf)
|
1949 |
sheet.write(0, 14, "Our SP", heading_xf)
|
| 1920 |
sheet.write(0, 13, "Our TP", heading_xf)
|
1950 |
sheet.write(0, 15, "Our TP", heading_xf)
|
| 1921 |
sheet.write(0, 14, "Lowest Seller", heading_xf)
|
1951 |
sheet.write(0, 16, "Lowest Seller", heading_xf)
|
| 1922 |
sheet.write(0, 15, "Lowest Seller Rating", heading_xf)
|
1952 |
sheet.write(0, 17, "Lowest Seller Rating", heading_xf)
|
| 1923 |
sheet.write(0, 16, "Lowest Seller Shipping Time", heading_xf)
|
1953 |
sheet.write(0, 18, "Lowest Seller Shipping Time", heading_xf)
|
| 1924 |
sheet.write(0, 17, "Lowest Seller SP", heading_xf)
|
1954 |
sheet.write(0, 19, "Lowest Seller SP", heading_xf)
|
| 1925 |
sheet.write(0, 18, "Lowest Seller TP", heading_xf)
|
1955 |
sheet.write(0, 20, "Lowest Seller TP", heading_xf)
|
| 1926 |
sheet.write(0, 19, "Preffered Seller", heading_xf)
|
1956 |
sheet.write(0, 21, "Preffered Seller", heading_xf)
|
| 1927 |
sheet.write(0, 20, "Preffered Seller Rating", heading_xf)
|
1957 |
sheet.write(0, 22, "Preffered Seller Rating", heading_xf)
|
| 1928 |
sheet.write(0, 21, "Preffered Seller Shipping Time", heading_xf)
|
1958 |
sheet.write(0, 23, "Preffered Seller Shipping Time", heading_xf)
|
| 1929 |
sheet.write(0, 22, "Preffer Seller SP", heading_xf)
|
1959 |
sheet.write(0, 24, "Preffer Seller SP", heading_xf)
|
| 1930 |
sheet.write(0, 23, "Preffered Seller TP", heading_xf)
|
1960 |
sheet.write(0, 25, "Preffered Seller TP", heading_xf)
|
| 1931 |
sheet.write(0, 24, "Our Flipkart Inventory", heading_xf)
|
1961 |
sheet.write(0, 26, "Our Flipkart Inventory", heading_xf)
|
| 1932 |
sheet.write(0, 25, "Our Net Availability",heading_xf)
|
1962 |
sheet.write(0, 27, "Our Net Availability",heading_xf)
|
| 1933 |
sheet.write(0, 26, "Last Five Day Sale", heading_xf)
|
1963 |
sheet.write(0, 28, "Last Five Day Sale", heading_xf)
|
| 1934 |
sheet.write(0, 27, "Average Sale", heading_xf)
|
1964 |
sheet.write(0, 29, "Average Sale", heading_xf)
|
| 1935 |
sheet.write(0, 28, "Our NLC", heading_xf)
|
1965 |
sheet.write(0, 30, "Our NLC", heading_xf)
|
| 1936 |
sheet.write(0, 29, "Lowest Possible SP", heading_xf)
|
1966 |
sheet.write(0, 31, "Lowest Possible SP", heading_xf)
|
| 1937 |
sheet.write(0, 30, "Lowest Possible TP", heading_xf)
|
1967 |
sheet.write(0, 32, "Lowest Possible TP", heading_xf)
|
| 1938 |
sheet.write(0, 31, "Target SP", heading_xf)
|
1968 |
sheet.write(0, 33, "Target SP", heading_xf)
|
| 1939 |
sheet.write(0, 32, "Target TP", heading_xf)
|
1969 |
sheet.write(0, 34, "Target TP", heading_xf)
|
| 1940 |
sheet.write(0, 33, "Sales Potential", heading_xf)
|
1970 |
sheet.write(0, 35, "Sales Potential", heading_xf)
|
| 1941 |
sheet.write(0, 34, "Total Seller", heading_xf)
|
1971 |
sheet.write(0, 36, "Total Seller", heading_xf)
|
| 1942 |
sheet_iterator = 1
|
1972 |
sheet_iterator = 1
|
| 1943 |
for item in competitiveNoInventory:
|
1973 |
for item in competitiveNoInventory:
|
| 1944 |
mpHistory = item[0]
|
1974 |
mpHistory = item[0]
|
| 1945 |
flipkartItem = item[1]
|
1975 |
flipkartItem = item[1]
|
| 1946 |
mpItem = item[2]
|
1976 |
mpItem = item[2]
|
| Line 1953... |
Line 1983... |
| 1953 |
sheet.write(sheet_iterator,4,catItem.brand)
|
1983 |
sheet.write(sheet_iterator,4,catItem.brand)
|
| 1954 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
1984 |
sheet.write(sheet_iterator,5,xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color))
|
| 1955 |
sheet.write(sheet_iterator,6,catItem.weight)
|
1985 |
sheet.write(sheet_iterator,6,catItem.weight)
|
| 1956 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
1986 |
sheet.write(sheet_iterator,7,mpItem.courierCost)
|
| 1957 |
sheet.write(sheet_iterator,8,catItem.risky)
|
1987 |
sheet.write(sheet_iterator,8,catItem.risky)
|
| - |
|
1988 |
sheet.write(sheet_iterator,9,mpItem.commission)
|
| - |
|
1989 |
sheet.write(sheet_iterator,10,mpItem.returnProvision)
|
| 1958 |
sheet.write(sheet_iterator,9,mpHistory.ourRating)
|
1990 |
sheet.write(sheet_iterator,11,mpHistory.ourRating)
|
| 1959 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
1991 |
# ourShippingTime= str(flipkartDetails.shippingTimeLowerLimitOur) if flipkartDetails.shippingTimeUpperLimitOur==0\
|
| 1960 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
1992 |
# else str(flipkartDetails.shippingTimeLowerLimitOur)+'-'+str(flipkartDetails.shippingTimeUpperLimitOur)
|
| 1961 |
sheet.write(sheet_iterator,10,mpHistory.ourShippingTime)
|
1993 |
sheet.write(sheet_iterator,12,mpHistory.ourShippingTime)
|
| 1962 |
sheet.write(sheet_iterator,11,mpHistory.ourRank)
|
1994 |
sheet.write(sheet_iterator,13,mpHistory.ourRank)
|
| 1963 |
sheet.write(sheet_iterator,12,mpHistory.ourSellingPrice)
|
1995 |
sheet.write(sheet_iterator,14,mpHistory.ourSellingPrice)
|
| 1964 |
sheet.write(sheet_iterator,13,mpHistory.ourTp)
|
1996 |
sheet.write(sheet_iterator,15,mpHistory.ourTp)
|
| 1965 |
sheet.write(sheet_iterator,14,mpHistory.lowestSellerName)
|
1997 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerName)
|
| 1966 |
sheet.write(sheet_iterator,15,mpHistory.lowestSellerRating)
|
1998 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellerRating)
|
| 1967 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
1999 |
# lowestSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitLowestSeller) if flipkartDetails.shippingTimeUpperLimitLowestSeller==0\
|
| 1968 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
2000 |
# else str(flipkartDetails.shippingTimeLowerLimitLowestSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitLowestSeller)
|
| 1969 |
sheet.write(sheet_iterator,16,mpHistory.lowestSellerShippingTime)
|
2001 |
sheet.write(sheet_iterator,18,mpHistory.lowestSellerShippingTime)
|
| 1970 |
sheet.write(sheet_iterator,17,mpHistory.lowestSellingPrice)
|
2002 |
sheet.write(sheet_iterator,19,mpHistory.lowestSellingPrice)
|
| 1971 |
sheet.write(sheet_iterator,18,mpHistory.lowestTp)
|
2003 |
sheet.write(sheet_iterator,20,mpHistory.lowestTp)
|
| 1972 |
sheet.write(sheet_iterator,19,mpHistory.prefferedSellerName)
|
2004 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerName)
|
| 1973 |
sheet.write(sheet_iterator,20,mpHistory.prefferedSellerRating)
|
2005 |
sheet.write(sheet_iterator,22,mpHistory.prefferedSellerRating)
|
| 1974 |
# prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
2006 |
# prefferedSellerShippingTime= str(flipkartDetails.shippingTimeLowerLimitPrefSeller) if flipkartDetails.shippingTimeUpperLimitPrefSeller==0\
|
| 1975 |
# else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
2007 |
# else str(flipkartDetails.shippingTimeLowerLimitPrefSeller)+'-'+str(flipkartDetails.shippingTimeUpperLimitPrefSeller)
|
| 1976 |
sheet.write(sheet_iterator,21,mpHistory.prefferedSellerShippingTime)
|
2008 |
sheet.write(sheet_iterator,23,mpHistory.prefferedSellerShippingTime)
|
| 1977 |
sheet.write(sheet_iterator,22,mpHistory.prefferedSellerSellingPrice)
|
2009 |
sheet.write(sheet_iterator,24,mpHistory.prefferedSellerSellingPrice)
|
| 1978 |
sheet.write(sheet_iterator,23,mpHistory.prefferedSellerTp)
|
2010 |
sheet.write(sheet_iterator,25,mpHistory.prefferedSellerTp)
|
| 1979 |
sheet.write(sheet_iterator,24,mpHistory.ourInventory)
|
2011 |
sheet.write(sheet_iterator,26,mpHistory.ourInventory)
|
| 1980 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
2012 |
if (not inventoryMap.has_key(mpHistory.item_id)):
|
| 1981 |
sheet.write(sheet_iterator, 25, 'Info not available')
|
2013 |
sheet.write(sheet_iterator, 27, 'Info not available')
|
| 1982 |
else:
|
2014 |
else:
|
| 1983 |
sheet.write(sheet_iterator, 25, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
2015 |
sheet.write(sheet_iterator, 27, getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
| 1984 |
sheet.write(sheet_iterator, 26, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
2016 |
sheet.write(sheet_iterator, 28, getOosString((itemSaleMap.get(mpHistory.item_id))[1]))
|
| 1985 |
sheet.write(sheet_iterator, 27, (itemSaleMap.get(mpHistory.item_id))[3])
|
2017 |
sheet.write(sheet_iterator, 29, (itemSaleMap.get(mpHistory.item_id))[3])
|
| 1986 |
sheet.write(sheet_iterator, 28, mpHistory.ourNlc)
|
2018 |
sheet.write(sheet_iterator, 30, mpHistory.ourNlc)
|
| 1987 |
sheet.write(sheet_iterator, 29, mpHistory.lowestPossibleSp)
|
2019 |
sheet.write(sheet_iterator, 31, mpHistory.lowestPossibleSp)
|
| 1988 |
sheet.write(sheet_iterator, 30, mpHistory.lowestPossibleTp)
|
2020 |
sheet.write(sheet_iterator, 32, mpHistory.lowestPossibleTp)
|
| 1989 |
proposed_sp = max(mpHistory.lowestSellingPrice - max((10, mpHistory.lowestSellingPrice*0.001)), mpHistory.lowestPossibleSp)
|
2021 |
proposed_sp = max(mpHistory.lowestSellingPrice - max((10, mpHistory.lowestSellingPrice*0.001)), mpHistory.lowestPossibleSp)
|
| 1990 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
2022 |
proposed_tp = getTargetTp(proposed_sp,mpItem)
|
| 1991 |
sheet.write(sheet_iterator, 31, proposed_sp)
|
2023 |
sheet.write(sheet_iterator, 33, proposed_sp)
|
| 1992 |
sheet.write(sheet_iterator, 32, proposed_tp)
|
2024 |
sheet.write(sheet_iterator, 34, proposed_tp)
|
| 1993 |
sheet.write(sheet_iterator, 33, getSalesPotential(mpHistory.lowestPossibleSp,mpHistory.ourNlc))
|
2025 |
sheet.write(sheet_iterator, 35, getSalesPotential(mpHistory.lowestPossibleSp,mpHistory.ourNlc))
|
| 1994 |
sheet.write(sheet_iterator, 34, mpHistory.totalSeller)
|
2026 |
sheet.write(sheet_iterator, 36, mpHistory.totalSeller)
|
| 1995 |
sheet_iterator+=1
|
2027 |
sheet_iterator+=1
|
| 1996 |
competitiveNoInventory[:]=[]
|
2028 |
competitiveNoInventory[:]=[]
|
| 1997 |
|
2029 |
|
| 1998 |
# autoPricingItems = session.query(MarketPlaceHistory,Item).join((Item,MarketPlaceHistory.item_id==Item.id)).filter(MarketPlaceHistory.timestamp==timestamp).filter(MarketPlaceHistory.source==OrderSource.FLIPKART).filter(MarketPlaceHistory.decision.in_([1,2,3,4])).all()
|
2030 |
# autoPricingItems = session.query(MarketPlaceHistory,Item).join((Item,MarketPlaceHistory.item_id==Item.id)).filter(MarketPlaceHistory.timestamp==timestamp).filter(MarketPlaceHistory.source==OrderSource.FLIPKART).filter(MarketPlaceHistory.decision.in_([1,2,3,4])).all()
|
| 1999 |
# sheet = wbk.add_sheet('Auto Inc and Dec')
|
2031 |
# sheet = wbk.add_sheet('Auto Inc and Dec')
|
| Line 2098... |
Line 2130... |
| 2098 |
startOffset = startOffset + 20
|
2130 |
startOffset = startOffset + 20
|
| 2099 |
count+=1
|
2131 |
count+=1
|
| 2100 |
#[t.start() for t in threads]
|
2132 |
#[t.start() for t in threads]
|
| 2101 |
#[t.join() for t in threads]
|
2133 |
#[t.join() for t in threads]
|
| 2102 |
#threads = []
|
2134 |
#threads = []
|
| 2103 |
print "terminating while"
|
- |
|
| 2104 |
pool.close()
|
2135 |
pool.close()
|
| 2105 |
pool.join()
|
2136 |
pool.join()
|
| 2106 |
print "joining threads"
|
- |
|
| 2107 |
print "returning offset******"
|
- |
|
| 2108 |
return endOffset
|
2137 |
return endOffset
|
| 2109 |
else:
|
2138 |
else:
|
| 2110 |
count = 0
|
2139 |
count = 0
|
| 2111 |
pool = ThreadPool(5)
|
2140 |
pool = ThreadPool(5)
|
| 2112 |
startOffset = 0
|
2141 |
startOffset = 0
|
| Line 2152... |
Line 2181... |
| 2152 |
<th>Product Name</th>
|
2181 |
<th>Product Name</th>
|
| 2153 |
<th>Old Price</th>
|
2182 |
<th>Old Price</th>
|
| 2154 |
<th>New Price</th>
|
2183 |
<th>New Price</th>
|
| 2155 |
<th>Old Margin</th>
|
2184 |
<th>Old Margin</th>
|
| 2156 |
<th>New Margin</th>
|
2185 |
<th>New Margin</th>
|
| - |
|
2186 |
<th>Commission %</th>
|
| - |
|
2187 |
<th>Return Provision %</th>
|
| 2157 |
<th>Flipkart Inventory</th>
|
2188 |
<th>Flipkart Inventory</th>
|
| 2158 |
<th>Sales History</th>
|
2189 |
<th>Sales History</th>
|
| 2159 |
</tr></thead>
|
2190 |
</tr></thead>
|
| 2160 |
<tbody>"""
|
2191 |
<tbody>"""
|
| 2161 |
for item in successfulAutoDecrease:
|
2192 |
for item in successfulAutoDecrease:
|
| Line 2170... |
Line 2201... |
| 2170 |
<td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
|
2201 |
<td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
|
| 2171 |
<td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
|
2202 |
<td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
|
| 2172 |
<td style="text-align:center">"""+str(math.ceil(item.proposedSellingPrice))+"""</td>
|
2203 |
<td style="text-align:center">"""+str(math.ceil(item.proposedSellingPrice))+"""</td>
|
| 2173 |
<td style="text-align:center">"""+str(round(item.margin))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
|
2204 |
<td style="text-align:center">"""+str(round(item.margin))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
|
| 2174 |
<td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/item.proposedSellingPrice)*100,1))+"%)"+"""</td>
|
2205 |
<td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/item.proposedSellingPrice)*100,1))+"%)"+"""</td>
|
| - |
|
2206 |
<td style="text-align:center">"""+str(mpItem.commission)+"""</td>
|
| - |
|
2207 |
<td style="text-align:center">"""+str(mpItem.returnProvision)+" %"+"""</td>
|
| 2175 |
<td style="text-align:center">"""+str(item.ourInventory)+"""</td>
|
2208 |
<td style="text-align:center">"""+str(item.ourInventory)+" %"+"""</td>
|
| 2176 |
<td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
|
2209 |
<td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
|
| 2177 |
</tr>"""
|
2210 |
</tr>"""
|
| 2178 |
message+="""</tbody></table><h3>Auto Increase Items</h3><table border="1" style="width:100%;">
|
2211 |
message+="""</tbody></table><h3>Auto Increase Items</h3><table border="1" style="width:100%;">
|
| 2179 |
<thead>
|
2212 |
<thead>
|
| 2180 |
<tr><th>Item Id</th>
|
2213 |
<tr><th>Item Id</th>
|
| 2181 |
<th>Product Name</th>
|
2214 |
<th>Product Name</th>
|
| 2182 |
<th>Old Price</th>
|
2215 |
<th>Old Price</th>
|
| 2183 |
<th>New Price</th>
|
2216 |
<th>New Price</th>
|
| 2184 |
<th>Old Margin</th>
|
2217 |
<th>Old Margin</th>
|
| 2185 |
<th>New Margin</th>
|
2218 |
<th>New Margin</th>
|
| - |
|
2219 |
<th>Commission %</th>
|
| - |
|
2220 |
<th>Return Provision %</th>
|
| 2186 |
<th>Flipkart Inventory</th>
|
2221 |
<th>Flipkart Inventory</th>
|
| 2187 |
<th>Sales History</th>
|
2222 |
<th>Sales History</th>
|
| 2188 |
</tr></thead>
|
2223 |
</tr></thead>
|
| 2189 |
<tbody>"""
|
2224 |
<tbody>"""
|
| 2190 |
for item in successfulAutoIncrease:
|
2225 |
for item in successfulAutoIncrease:
|
| Line 2199... |
Line 2234... |
| 2199 |
<td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
|
2234 |
<td style="text-align:center">"""+xstr(it.brand)+" "+xstr(it.model_name)+" "+xstr(it.model_number)+" "+xstr(it.color)+"""</td>
|
| 2200 |
<td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
|
2235 |
<td style="text-align:center">"""+str(item.ourSellingPrice)+"""</td>
|
| 2201 |
<td style="text-align:center">"""+str(math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))+"""</td>
|
2236 |
<td style="text-align:center">"""+str(math.ceil(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))+"""</td>
|
| 2202 |
<td style="text-align:center">"""+str(round((item.margin),1))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
|
2237 |
<td style="text-align:center">"""+str(round((item.margin),1))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
|
| 2203 |
<td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))*100,1))+"%)"+"""</td>
|
2238 |
<td style="text-align:center">"""+str(newMargin)+" ("+str(round((newMargin/(item.ourSellingPrice+max(10,.01*item.ourSellingPrice)))*100,1))+"%)"+"""</td>
|
| - |
|
2239 |
<td style="text-align:center">"""+str(mpItem.commission)+"""</td>
|
| - |
|
2240 |
<td style="text-align:center">"""+str(mpItem.returnProvision)+" %"+"""</td>
|
| 2204 |
<td style="text-align:center">"""+str(item.ourInventory)+"""</td>
|
2241 |
<td style="text-align:center">"""+str(item.ourInventory)+"""</td>
|
| 2205 |
<td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
|
2242 |
<td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
|
| 2206 |
</tr>"""
|
2243 |
</tr>"""
|
| 2207 |
message+="""</tbody></table></body></html>"""
|
2244 |
message+="""</tbody></table></body></html>"""
|
| 2208 |
print message
|
2245 |
print message
|
| Line 2258... |
Line 2295... |
| 2258 |
<th>Current Margin</th>
|
2295 |
<th>Current Margin</th>
|
| 2259 |
<th>Competition TP</th>
|
2296 |
<th>Competition TP</th>
|
| 2260 |
<th>Lowest Possible TP</th>
|
2297 |
<th>Lowest Possible TP</th>
|
| 2261 |
<th>NLC</th>
|
2298 |
<th>NLC</th>
|
| 2262 |
<th>Target NLC</th>
|
2299 |
<th>Target NLC</th>
|
| - |
|
2300 |
<th>Commission %</th>
|
| - |
|
2301 |
<th>Return Provision %</th>
|
| 2263 |
<th>Flipkart Inventory</th>
|
2302 |
<th>Flipkart Inventory</th>
|
| 2264 |
<th>Total Inventory</th>
|
2303 |
<th>Total Inventory</th>
|
| 2265 |
<th>Sales History</th>
|
2304 |
<th>Sales History</th>
|
| 2266 |
</tr></thead>
|
2305 |
</tr></thead>
|
| 2267 |
<tbody>"""
|
2306 |
<tbody>"""
|
| 2268 |
items = session.query(MarketPlaceHistory).filter(MarketPlaceHistory.timestamp==currentTimestamp).filter(MarketPlaceHistory.source==OrderSource.FLIPKART).filter(MarketPlaceHistory.item_id.in_(lost_buy_box)).all()
|
2307 |
items = session.query(MarketPlaceHistory).filter(MarketPlaceHistory.timestamp==currentTimestamp).filter(MarketPlaceHistory.source==OrderSource.FLIPKART).filter(MarketPlaceHistory.item_id.in_(lost_buy_box)).all()
|
| 2269 |
for item in items:
|
2308 |
for item in items:
|
| 2270 |
it = Item.query.filter_by(id=item.item_id).one()
|
2309 |
it = Item.query.filter_by(id=item.item_id).one()
|
| - |
|
2310 |
mpItem = MarketplaceItems.get_by(itemId=item.item_id,source=OrderSource.FLIPKART)
|
| 2271 |
netInventory=''
|
2311 |
netInventory=''
|
| 2272 |
if not inventoryMap.has_key(item.item_id):
|
2312 |
if not inventoryMap.has_key(item.item_id):
|
| 2273 |
netInventory='Info Not Available'
|
2313 |
netInventory='Info Not Available'
|
| 2274 |
else:
|
2314 |
else:
|
| 2275 |
netInventory = str(getNetAvailability(inventoryMap.get(item.item_id)))
|
2315 |
netInventory = str(getNetAvailability(inventoryMap.get(item.item_id)))
|
| Line 2281... |
Line 2321... |
| 2281 |
<td style="text-align:center">"""+str(round(item.margin))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
|
2321 |
<td style="text-align:center">"""+str(round(item.margin))+" ("+str(round((item.margin/item.ourSellingPrice)*100,1))+"%)"+"""</td>
|
| 2282 |
<td style="text-align:center">"""+str(item.lowestTp)+"""</td>
|
2322 |
<td style="text-align:center">"""+str(item.lowestTp)+"""</td>
|
| 2283 |
<td style="text-align:center">"""+str(item.lowestPossibleTp)+"""</td>
|
2323 |
<td style="text-align:center">"""+str(item.lowestPossibleTp)+"""</td>
|
| 2284 |
<td style="text-align:center">"""+str(item.ourNlc)+"""</td>
|
2324 |
<td style="text-align:center">"""+str(item.ourNlc)+"""</td>
|
| 2285 |
<td style="text-align:center">"""+str(item.targetNlc)+"""</td>
|
2325 |
<td style="text-align:center">"""+str(item.targetNlc)+"""</td>
|
| - |
|
2326 |
<td style="text-align:center">"""+str(mpItem.commission)+"""</td>
|
| - |
|
2327 |
<td style="text-align:center">"""+str(mpItem.returnProvision)+" %"+"""</td>
|
| 2286 |
<td style="text-align:center">"""+str(item.ourInventory)+"""</td>
|
2328 |
<td style="text-align:center">"""+str(item.ourInventory)+"""</td>
|
| 2287 |
<td style="text-align:center">"""+netInventory+"""</td>
|
2329 |
<td style="text-align:center">"""+netInventory+"""</td>
|
| 2288 |
<td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
|
2330 |
<td style="text-align:center">"""+getOosString((itemSaleMap.get(item.item_id))[1])+"""</td>
|
| 2289 |
</tr>"""
|
2331 |
</tr>"""
|
| 2290 |
message+="""</tbody></table></body></html>"""
|
2332 |
message+="""</tbody></table></body></html>"""
|
| Line 2507... |
Line 2549... |
| 2507 |
<th>TP</th>
|
2549 |
<th>TP</th>
|
| 2508 |
<th>Lowest Possible SP</th>
|
2550 |
<th>Lowest Possible SP</th>
|
| 2509 |
<th>Lowest Possible TP</th>
|
2551 |
<th>Lowest Possible TP</th>
|
| 2510 |
<th>Margin</th>
|
2552 |
<th>Margin</th>
|
| 2511 |
<th>Margin %</th>
|
2553 |
<th>Margin %</th>
|
| - |
|
2554 |
<th>Commission %</th>
|
| - |
|
2555 |
<th>Return Provision %</th>
|
| 2512 |
<th>Flipkart Inventory</th>
|
2556 |
<th>Flipkart Inventory</th>
|
| 2513 |
<th>Total Inventory</th>
|
2557 |
<th>Total Inventory</th>
|
| 2514 |
<th>Sales History</th>
|
2558 |
<th>Sales History</th>
|
| 2515 |
</tr></thead>
|
2559 |
</tr></thead>
|
| 2516 |
<tbody>"""
|
2560 |
<tbody>"""
|
| Line 2520... |
Line 2564... |
| 2520 |
netInventory=''
|
2564 |
netInventory=''
|
| 2521 |
if not inventoryMap.has_key(mpHistory.item_id):
|
2565 |
if not inventoryMap.has_key(mpHistory.item_id):
|
| 2522 |
netInventory='Info Not Available'
|
2566 |
netInventory='Info Not Available'
|
| 2523 |
else:
|
2567 |
else:
|
| 2524 |
netInventory = str(getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
2568 |
netInventory = str(getNetAvailability(inventoryMap.get(mpHistory.item_id)))
|
| - |
|
2569 |
mpItem = MarketplaceItems.get_by(itemId=mpHistory.item_id,source=OrderSource.FLIPKART)
|
| 2525 |
message+="""<tr>
|
2570 |
message+="""<tr>
|
| 2526 |
<td style="text-align:center">"""+str(mpHistory.item_id)+"""</td>
|
2571 |
<td style="text-align:center">"""+str(mpHistory.item_id)+"""</td>
|
| 2527 |
<td style="text-align:center">"""+xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color)+"""</td>
|
2572 |
<td style="text-align:center">"""+xstr(catItem.brand)+" "+xstr(catItem.model_name)+" "+xstr(catItem.model_number)+" "+xstr(catItem.color)+"""</td>
|
| 2528 |
<td style="text-align:center">"""+str(mpHistory.ourSellingPrice)+"""</td>
|
2573 |
<td style="text-align:center">"""+str(mpHistory.ourSellingPrice)+"""</td>
|
| 2529 |
<td style="text-align:center">"""+str(mpHistory.ourTp)+"""</td>
|
2574 |
<td style="text-align:center">"""+str(mpHistory.ourTp)+"""</td>
|
| 2530 |
<td style="text-align:center">"""+str(mpHistory.lowestPossibleSp)+"""</td>
|
2575 |
<td style="text-align:center">"""+str(mpHistory.lowestPossibleSp)+"""</td>
|
| 2531 |
<td style="text-align:center">"""+str(mpHistory.lowestPossibleTp)+"""</td>
|
2576 |
<td style="text-align:center">"""+str(mpHistory.lowestPossibleTp)+"""</td>
|
| 2532 |
<td style="text-align:center">"""+str(mpHistory.margin)+"""</td>
|
2577 |
<td style="text-align:center">"""+str(mpHistory.margin)+"""</td>
|
| 2533 |
<td style="text-align:center">"""+str(round(mpHistory.margin/mpHistory.ourSellingPrice,2))+"""</td>
|
2578 |
<td style="text-align:center">"""+str(round(mpHistory.margin/mpHistory.ourSellingPrice,2))+" %"+"""</td>
|
| - |
|
2579 |
<td style="text-align:center">"""+str(mpItem.commission)+"""</td>
|
| - |
|
2580 |
<td style="text-align:center">"""+str(mpItem.returnProvision)+" %"+"""</td>
|
| 2534 |
<td style="text-align:center">"""+str(mpHistory.ourInventory)+"""</td>
|
2581 |
<td style="text-align:center">"""+str(mpHistory.ourInventory)+"""</td>
|
| 2535 |
<td style="text-align:center">"""+netInventory+"""</td>
|
2582 |
<td style="text-align:center">"""+netInventory+"""</td>
|
| 2536 |
<td style="text-align:center">"""+getOosString((itemSaleMap.get(mpHistory.item_id))[1])+"""</td>
|
2583 |
<td style="text-align:center">"""+getOosString((itemSaleMap.get(mpHistory.item_id))[1])+"""</td>
|
| 2537 |
</tr>"""
|
2584 |
</tr>"""
|
| 2538 |
message+="""</tbody></table></body></html>"""
|
2585 |
message+="""</tbody></table></body></html>"""
|