| Line 260... |
Line 260... |
| 260 |
days_of_stock_rule = "Min Prices not Available";
|
260 |
days_of_stock_rule = "Min Prices not Available";
|
| 261 |
}
|
261 |
}
|
| 262 |
else{
|
262 |
else{
|
| 263 |
percent_diff = getPercentageDifferenceFromMinimumPrice(latest_snapshot);
|
263 |
percent_diff = getPercentageDifferenceFromMinimumPrice(latest_snapshot);
|
| 264 |
if(latest_snapshot.getSalePrice() <= latest_snapshot.getMinFbaPrice() && latest_snapshot.getSalePrice() <= latest_snapshot.getMinMfnPrice()){
|
264 |
if(latest_snapshot.getSalePrice() <= latest_snapshot.getMinFbaPrice() && latest_snapshot.getSalePrice() <= latest_snapshot.getMinMfnPrice()){
|
| 265 |
if(percent_diff >= 0 && latest_snapshot.getSalePrice()<=asp_total){
|
265 |
if(percent_diff >= 0 && latest_snapshot.getSalePrice()<=asp_total ){
|
| 266 |
days_of_stock = 15;
|
266 |
days_of_stock = 15;
|
| 267 |
days_of_stock_rule = "Cheapest 15 days";
|
267 |
days_of_stock_rule = "Cheapest 15 days";
|
| 268 |
style.setFillForegroundColor(HSSFColor.GREEN.index);
|
268 |
style.setFillForegroundColor(HSSFColor.GREEN.index);
|
| 269 |
///GREEN
|
269 |
///GREEN
|
| 270 |
}
|
270 |
}
|
| 271 |
else if(percent_diff >= 0 && latest_snapshot.getSalePrice()>asp_total){
|
271 |
else if(percent_diff >= 0 && latest_snapshot.getSalePrice()>asp_total && asp_total!=0){
|
| 272 |
days_of_stock = 7;
|
272 |
days_of_stock = 7;
|
| 273 |
days_of_stock_rule = "Cheapest Price Increased 7 days";
|
273 |
days_of_stock_rule = "Cheapest Price Increased 7 days";
|
| 274 |
style.setFillForegroundColor(HSSFColor.GREEN.index);
|
274 |
style.setFillForegroundColor(HSSFColor.GREEN.index);
|
| 275 |
///GREEN
|
275 |
///GREEN
|
| 276 |
}
|
276 |
}
|
| - |
|
277 |
else if(percent_diff >= 0 && latest_snapshot.getSalePrice()>asp_total){
|
| - |
|
278 |
days_of_stock = 0;
|
| - |
|
279 |
days_of_stock_rule = "Cheapest but no Sale";
|
| - |
|
280 |
style.setFillForegroundColor(HSSFColor.RED.index);
|
| - |
|
281 |
///RED
|
| - |
|
282 |
}
|
| 277 |
}
|
283 |
}
|
| 278 |
else if(latest_snapshot.getSalePrice() > latest_snapshot.getMinFbaPrice() && latest_snapshot.getSalePrice() > latest_snapshot.getMinMfnPrice()){
|
284 |
else if(latest_snapshot.getSalePrice() > latest_snapshot.getMinFbaPrice() && latest_snapshot.getSalePrice() > latest_snapshot.getMinMfnPrice()){
|
| 279 |
if(percent_diff > -1 && percent_diff < 0){
|
285 |
if(percent_diff > -1 && percent_diff < 0){
|
| 280 |
days_of_stock = 4;
|
286 |
days_of_stock = 4;
|
| 281 |
days_of_stock_rule = "Slightly Expensive (diff 0% to 1 %) 4 days";
|
287 |
days_of_stock_rule = "Slightly Expensive (diff 0% to 1 %) 4 days";
|
| Line 439... |
Line 445... |
| 439 |
//String[] sendTo = new String[]{ "vikram.raghav@shop2020.in"};
|
445 |
//String[] sendTo = new String[]{ "vikram.raghav@shop2020.in"};
|
| 440 |
String emailSubjectTxt = "FBA Stock Estimation Sheet";
|
446 |
String emailSubjectTxt = "FBA Stock Estimation Sheet";
|
| 441 |
|
447 |
|
| 442 |
try {
|
448 |
try {
|
| 443 |
GmailUtils mailer = new GmailUtils();
|
449 |
GmailUtils mailer = new GmailUtils();
|
| 444 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt, "", emailFromAddress, password, "/home/vikram/FBA-Stock-File.xls");
|
450 |
mailer.sendSSLMessage(sendTo, emailSubjectTxt, "", emailFromAddress, password, AMAZON_FBA_SHEET);
|
| 445 |
}
|
451 |
}
|
| 446 |
catch (Exception ex) {
|
452 |
catch (Exception ex) {
|
| 447 |
ex.printStackTrace();
|
453 |
ex.printStackTrace();
|
| 448 |
}
|
454 |
}
|
| 449 |
|
455 |
|