| Line 981... |
Line 981... |
| 981 |
"UPHRD130/1299", "UPHRD130/456", "UPHRD130/634", "UPLKO063/897", "UPMRT149/54", "UPSJP119/748",
|
981 |
"UPHRD130/1299", "UPHRD130/456", "UPHRD130/634", "UPLKO063/897", "UPMRT149/54", "UPSJP119/748",
|
| 982 |
"UPSJP119/980", "UPSTP065/1218", "UPSTP065/2039", "UPSTP090/437", "UPSTP120/164");
|
982 |
"UPSJP119/980", "UPSTP065/1218", "UPSTP065/2039", "UPSTP090/437", "UPSTP120/164");
|
| 983 |
|
983 |
|
| 984 |
int totalAmount = 0;
|
984 |
int totalAmount = 0;
|
| 985 |
float saleAmount = 0;
|
985 |
float saleAmount = 0;
|
| - |
|
986 |
float schemeReverseAmount = 0;
|
| 986 |
for(String invoiceNumber : invoiceNumbers) {
|
987 |
for(String invoiceNumber : invoiceNumbers) {
|
| 987 |
List<FofoOrder> orders = fofoOrderRepository.selectByInvoiceNumberLike(invoiceNumber);
|
988 |
List<FofoOrder> orders = fofoOrderRepository.selectByInvoiceNumberLike(invoiceNumber);
|
| 988 |
orders = orders.stream().skip(1).collect(Collectors.toList());
|
989 |
orders = orders.stream().skip(1).collect(Collectors.toList());
|
| 989 |
for (FofoOrder fofoOrder : orders) {
|
990 |
for (FofoOrder fofoOrder : orders) {
|
| 990 |
LOGGER.info("Invoice {}", invoiceNumber);
|
991 |
LOGGER.info("Invoice {}", invoiceNumber);
|
| Line 1010... |
Line 1011... |
| 1010 |
totalAmount += userWalletHistory.stream().collect(Collectors.summingInt(y->y.getAmount()));
|
1011 |
totalAmount += userWalletHistory.stream().collect(Collectors.summingInt(y->y.getAmount()));
|
| 1011 |
/*walletService.rollbackAmountFromWallet(fofoOrder.getFofoId(), totalAmount, fofoOrder.getId(), WalletReferenceType.SCHEME_OUT,
|
1012 |
/*walletService.rollbackAmountFromWallet(fofoOrder.getFofoId(), totalAmount, fofoOrder.getId(), WalletReferenceType.SCHEME_OUT,
|
| 1012 |
"Same order for Invoice-"+ invoiceNumber + "created twice, duplicate invoice rollback", fofoOrder.getCancelledTimestamp());*/
|
1013 |
"Same order for Invoice-"+ invoiceNumber + "created twice, duplicate invoice rollback", fofoOrder.getCancelledTimestamp());*/
|
| 1013 |
List<SchemeInOut> schemeInOuts = schemeInOutRepository.selectByInventoryItemIds(new HashSet<>(Arrays.asList(inventoryItemId)));
|
1014 |
List<SchemeInOut> schemeInOuts = schemeInOutRepository.selectByInventoryItemIds(new HashSet<>(Arrays.asList(inventoryItemId)));
|
| 1014 |
for(SchemeInOut sio : schemeInOuts) {
|
1015 |
for(SchemeInOut sio : schemeInOuts) {
|
| - |
|
1016 |
if(Math.abs(sio.getCreateTimestamp().getMinute() - fofoOrder.getCreateTimestamp().getMinute()) <= 1) {
|
| 1015 |
LOGGER.info(sio);
|
1017 |
LOGGER.info(sio);
|
| - |
|
1018 |
schemeReverseAmount += sio.getAmount();
|
| - |
|
1019 |
}
|
| 1016 |
}
|
1020 |
}
|
| 1017 |
|
1021 |
|
| 1018 |
}
|
1022 |
}
|
| 1019 |
//Remove order id
|
1023 |
//Remove order id
|
| 1020 |
//Remove order item Id
|
1024 |
//Remove order item Id
|