| Line 5... |
Line 5... |
| 5 |
import com.razorpay.Payment;
|
5 |
import com.razorpay.Payment;
|
| 6 |
import com.smartdukaan.cron.itelImeiActivation.ItelImeiActivationNewService;
|
6 |
import com.smartdukaan.cron.itelImeiActivation.ItelImeiActivationNewService;
|
| 7 |
import com.smartdukaan.cron.itelImeiActivation.ItelImeiActivationService;
|
7 |
import com.smartdukaan.cron.itelImeiActivation.ItelImeiActivationService;
|
| 8 |
import com.smartdukaan.cron.itelImeiActivation.TecnoImeiActivation;
|
8 |
import com.smartdukaan.cron.itelImeiActivation.TecnoImeiActivation;
|
| 9 |
import com.smartdukaan.cron.scheduled.runnables.PurchaseMigration;
|
9 |
import com.smartdukaan.cron.scheduled.runnables.PurchaseMigration;
|
| 10 |
import com.spice.profitmandi.common.enumuration.ActivationType;
|
- |
|
| 11 |
import com.spice.profitmandi.common.enumuration.MessageType;
|
10 |
import com.spice.profitmandi.common.enumuration.*;
|
| 12 |
import com.spice.profitmandi.common.enumuration.RechargeStatus;
|
- |
|
| 13 |
import com.spice.profitmandi.common.enumuration.ReporticoProject;
|
- |
|
| 14 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
11 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 15 |
import com.spice.profitmandi.common.model.*;
|
12 |
import com.spice.profitmandi.common.model.*;
|
| 16 |
import com.spice.profitmandi.common.services.ReporticoService;
|
13 |
import com.spice.profitmandi.common.services.ReporticoService;
|
| 17 |
import com.spice.profitmandi.common.services.mandii.AccountStatusResponseOut;
|
14 |
import com.spice.profitmandi.common.services.mandii.AccountStatusResponseOut;
|
| 18 |
import com.spice.profitmandi.common.services.mandii.EligibilityStatusEnum;
|
15 |
import com.spice.profitmandi.common.services.mandii.EligibilityStatusEnum;
|
| Line 22... |
Line 19... |
| 22 |
import com.spice.profitmandi.common.util.PdfUtils;
|
19 |
import com.spice.profitmandi.common.util.PdfUtils;
|
| 23 |
import com.spice.profitmandi.common.util.Utils;
|
20 |
import com.spice.profitmandi.common.util.Utils;
|
| 24 |
import com.spice.profitmandi.common.util.Utils.Attachment;
|
21 |
import com.spice.profitmandi.common.util.Utils.Attachment;
|
| 25 |
import com.spice.profitmandi.common.web.client.RestClient;
|
22 |
import com.spice.profitmandi.common.web.client.RestClient;
|
| 26 |
import com.spice.profitmandi.dao.Interface.Campaign;
|
23 |
import com.spice.profitmandi.dao.Interface.Campaign;
|
| - |
|
24 |
import com.spice.profitmandi.dao.cart.CartService;
|
| 27 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
25 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 28 |
import com.spice.profitmandi.dao.entity.auth.PartnerCollectionRemark;
|
26 |
import com.spice.profitmandi.dao.entity.auth.PartnerCollectionRemark;
|
| 29 |
import com.spice.profitmandi.dao.entity.catalog.FocusedModel;
|
27 |
import com.spice.profitmandi.dao.entity.catalog.FocusedModel;
|
| 30 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
28 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 31 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
29 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
| Line 36... |
Line 34... |
| 36 |
import com.spice.profitmandi.dao.entity.dtr.*;
|
34 |
import com.spice.profitmandi.dao.entity.dtr.*;
|
| 37 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
35 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
| 38 |
import com.spice.profitmandi.dao.entity.inventory.*;
|
36 |
import com.spice.profitmandi.dao.entity.inventory.*;
|
| 39 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
37 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
| 40 |
import com.spice.profitmandi.dao.entity.user.*;
|
38 |
import com.spice.profitmandi.dao.entity.user.*;
|
| - |
|
39 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseInventoryItem;
|
| 41 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseInvoiceItem;
|
40 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseInvoiceItem;
|
| - |
|
41 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseScan;
|
| 42 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseSupplierInvoice;
|
42 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseSupplierInvoice;
|
| 43 |
import com.spice.profitmandi.dao.enumuration.auth.CollectionRemark;
|
43 |
import com.spice.profitmandi.dao.enumuration.auth.CollectionRemark;
|
| 44 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
44 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 45 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
45 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 46 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
46 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
| 47 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
47 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
| 48 |
import com.spice.profitmandi.dao.enumuration.fofo.PaymentStatus;
|
48 |
import com.spice.profitmandi.dao.enumuration.fofo.PaymentStatus;
|
| - |
|
49 |
import com.spice.profitmandi.dao.enumuration.fofo.ReturnType;
|
| 49 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
50 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| 50 |
import com.spice.profitmandi.dao.enumuration.inventory.VendorCatalogPricingStatus;
|
51 |
import com.spice.profitmandi.dao.enumuration.inventory.VendorCatalogPricingStatus;
|
| 51 |
import com.spice.profitmandi.dao.enumuration.transaction.CreditRisk;
|
52 |
import com.spice.profitmandi.dao.enumuration.transaction.CreditRisk;
|
| 52 |
import com.spice.profitmandi.dao.enumuration.transaction.LoanReferenceType;
|
53 |
import com.spice.profitmandi.dao.enumuration.transaction.LoanReferenceType;
|
| 53 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
54 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
| Line 82... |
Line 83... |
| 82 |
import com.spice.profitmandi.service.serviceConfig.ServiceConfigService;
|
83 |
import com.spice.profitmandi.service.serviceConfig.ServiceConfigService;
|
| 83 |
import com.spice.profitmandi.service.transaction.CreditNoteService;
|
84 |
import com.spice.profitmandi.service.transaction.CreditNoteService;
|
| 84 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
85 |
import com.spice.profitmandi.service.transaction.SDCreditService;
|
| 85 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
86 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 86 |
import com.spice.profitmandi.service.user.RetailerService;
|
87 |
import com.spice.profitmandi.service.user.RetailerService;
|
| - |
|
88 |
import com.spice.profitmandi.service.wallet.CommonPaymentService;
|
| 87 |
import com.spice.profitmandi.service.wallet.WalletService;
|
89 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 88 |
import com.spice.profitmandi.service.warehouse.PurchaseOrderService;
|
90 |
import com.spice.profitmandi.service.warehouse.PurchaseOrderService;
|
| - |
|
91 |
import com.spice.profitmandi.service.warehouse.WarehouseInventoryService;
|
| 89 |
import in.shop2020.model.v1.order.OrderStatus;
|
92 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 90 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
93 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
| - |
|
94 |
import in.shop2020.payments.PaymentService;
|
| 91 |
import okhttp3.OkHttpClient;
|
95 |
import okhttp3.OkHttpClient;
|
| 92 |
import okhttp3.Request;
|
96 |
import okhttp3.Request;
|
| 93 |
import okhttp3.Response;
|
97 |
import okhttp3.Response;
|
| 94 |
import org.apache.commons.io.output.ByteArrayOutputStream;
|
98 |
import org.apache.commons.io.output.ByteArrayOutputStream;
|
| 95 |
import org.apache.commons.lang.StringUtils;
|
99 |
import org.apache.commons.lang.StringUtils;
|
| Line 1001... |
Line 1005... |
| 1001 |
} catch (Throwable e) {
|
1005 |
} catch (Throwable e) {
|
| 1002 |
throw new Exception(e);
|
1006 |
throw new Exception(e);
|
| 1003 |
}
|
1007 |
}
|
| 1004 |
}
|
1008 |
}
|
| 1005 |
|
1009 |
|
| - |
|
1010 |
@Autowired
|
| - |
|
1011 |
PurchaseReturnService purchaseReturnService;
|
| - |
|
1012 |
|
| 1006 |
public void test() throws Exception {
|
1013 |
public void test() throws Exception {
|
| - |
|
1014 |
//Create return
|
| - |
|
1015 |
Map<Integer, Set<String>> fofoIdImeiReturnMap = new HashMap<>();
|
| - |
|
1016 |
//fofoIdImeiReturnMap.put(175139463, new HashSet<>(Arrays.asList("869916067368297", "350923626635949", "350923626636269", "350923626690902", "866807064687750", "864848068046108", "864848068051546", "861784060309637", "862027063792071", "867158060967690", "866132064917630", "864288065020691", "861025062454157", "860398063432170", "863653063902490", "863653063902938", "863653065416358", "866726067460694", "866726067914955", "862628065654159", "864647062834471")));
|
| - |
|
1017 |
fofoIdImeiReturnMap.put(175138674, new HashSet<>(Arrays.asList("866807064015176","861831062447822","869916067520632","869916067520178","865753069672200","865753067320703","864920066684790","868905064555858")));
|
| - |
|
1018 |
for (Entry<Integer, Set<String>> fofoIdImeiReturnEntry : fofoIdImeiReturnMap.entrySet()) {
|
| - |
|
1019 |
int fofoId = fofoIdImeiReturnEntry.getKey();
|
| - |
|
1020 |
Set<String> imeis = fofoIdImeiReturnEntry.getValue();
|
| - |
|
1021 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectByFofoIdSerialNumbers(fofoId, imeis, true);
|
| - |
|
1022 |
for (InventoryItem inventoryItem : inventoryItems) {
|
| - |
|
1023 |
//inventoryItem.getId();
|
| - |
|
1024 |
purchaseReturnService.returnInventoryItem(fofoId, true, inventoryItem.getId(), ReturnType.GOOD);
|
| - |
|
1025 |
//Approve return
|
| - |
|
1026 |
PurchaseReturnItem purchaseReturnItem = purchaseReturnItemRepository.selectByInventoryItemId(inventoryItem.getId());
|
| - |
|
1027 |
purchaseReturnItem.setStatus(PurchaseReturnStatus.APPROVED);
|
| - |
|
1028 |
purchaseReturnItem.setApproveTimestamp(LocalDateTime.now());
|
| - |
|
1029 |
}
|
| - |
|
1030 |
Map<Purchase, List<InventoryItem>> purchaseInventoryItemsMap = purchaseReturnService.getPurchaseMapForApprovedReturns(fofoId);
|
| - |
|
1031 |
int walletAmount = walletService.getWalletAmount(fofoId);
|
| - |
|
1032 |
List<DebitNote> debitNotes = purchaseReturnService.generateDebitNotes(purchaseInventoryItemsMap);
|
| - |
|
1033 |
int walletDiff = walletAmount - walletService.getWalletAmount(fofoId);
|
| - |
|
1034 |
if (walletDiff > 0) {
|
| - |
|
1035 |
int reference = walletService.getManualReference(WalletReferenceType.OTHERS);
|
| - |
|
1036 |
walletService.addAmountToWallet(fofoId, reference, WalletReferenceType.ADVANCE_AMOUNT, "Sytematically added for internal PO", (float) walletDiff, LocalDateTime.now());
|
| - |
|
1037 |
}
|
| 1007 |
|
1038 |
|
| - |
|
1039 |
for (DebitNote debitNote : debitNotes) {
|
| - |
|
1040 |
debitNote.setCreateTimestamp(LocalDate.of(2023, Month.SEPTEMBER, 30).atStartOfDay());
|
| - |
|
1041 |
//Try to refund amount per debit note
|
| - |
|
1042 |
this.refundDnAmount(debitNote);
|
| - |
|
1043 |
}
|
| 1008 |
|
1044 |
|
| - |
|
1045 |
//List<DebitNotePdfModel> debitNotePdfModels = purchaseReturnService.generateDebitNotes(purchaseInventoryMap, warehouseId);
|
| - |
|
1046 |
}
|
| - |
|
1047 |
|
| - |
|
1048 |
//transactionService.billOrder(Arrays.asList(1800765), )
|
| 1009 |
purchaseMigration.migrateDebitNote();
|
1049 |
//purchaseMigration.migrateDebitNote();
|
| 1010 |
//this.sendMailForSamsungRebilling();
|
1050 |
//this.sendMailForSamsungRebilling();
|
| 1011 |
/*List<PurchaseReturnItem> purchaseReturnItems = purchaseReturnItemRepository.selectPurchaseReturnByStatuses(Arrays.asList(PurchaseReturnStatus.DEBIT_NOTE_CREATED));
|
1051 |
/*List<PurchaseReturnItem> purchaseReturnItems = purchaseReturnItemRepository.selectPurchaseReturnByStatuses(Arrays.asList(PurchaseReturnStatus.DEBIT_NOTE_CREATED));
|
| 1012 |
Map<Integer, List<PurchaseReturnItem>> inventoryItemsMap = purchaseReturnItems.stream().collect(Collectors.groupingBy(x -> x.getDebitNoteId()));
|
1052 |
Map<Integer, List<PurchaseReturnItem>> inventoryItemsMap = purchaseReturnItems.stream().collect(Collectors.groupingBy(x -> x.getDebitNoteId()));
|
| 1013 |
for (Map.Entry<Integer, List<PurchaseReturnItem>> debitNotePurcahseReturnMap : inventoryItemsMap.entrySet()) {
|
1053 |
for (Map.Entry<Integer, List<PurchaseReturnItem>> debitNotePurcahseReturnMap : inventoryItemsMap.entrySet()) {
|
| 1014 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectAllByIds(debitNotePurcahseReturnMap.getValue().stream().map(x -> x.getInventoryItemId()).collect(Collectors.toList()));
|
1054 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectAllByIds(debitNotePurcahseReturnMap.getValue().stream().map(x -> x.getInventoryItemId()).collect(Collectors.toList()));
|
| Line 1019... |
Line 1059... |
| 1019 |
//System.out.println(brandRegionMappingRepository.getAvailabilityToVendorWarehouse(Arrays.asList(33353), 7720));
|
1059 |
//System.out.println(brandRegionMappingRepository.getAvailabilityToVendorWarehouse(Arrays.asList(33353), 7720));
|
| 1020 |
|
1060 |
|
| 1021 |
}
|
1061 |
}
|
| 1022 |
|
1062 |
|
| 1023 |
@Autowired
|
1063 |
@Autowired
|
| - |
|
1064 |
CartService cartService;
|
| - |
|
1065 |
@Autowired
|
| - |
|
1066 |
UserRepository userRepository;
|
| - |
|
1067 |
|
| - |
|
1068 |
@Autowired
|
| - |
|
1069 |
WarehouseScanRepository warehouseScanRepository;
|
| - |
|
1070 |
|
| - |
|
1071 |
@Autowired
|
| - |
|
1072 |
WarehouseInventoryService warehouseInventoryService;
|
| - |
|
1073 |
|
| - |
|
1074 |
@Autowired
|
| - |
|
1075 |
CommonPaymentService commonPaymentService;
|
| - |
|
1076 |
|
| - |
|
1077 |
//Also create order
|
| - |
|
1078 |
private void refundDnAmount(DebitNote debitNote) throws ProfitMandiBusinessException {
|
| - |
|
1079 |
List<Integer> inventoryItemIds = purchaseReturnItemRepository.selectAllByDebitNoteId(debitNote.getId()).stream().map(x -> x.getInventoryItemId()).collect(Collectors.toList());
|
| - |
|
1080 |
Map<Integer, Long> inventoryItemCountMap = inventoryItemIds.stream().collect(Collectors.groupingBy(x -> x, Collectors.counting()));
|
| - |
|
1081 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectAllByIds(new ArrayList<>(inventoryItemCountMap.keySet()));
|
| - |
|
1082 |
Purchase purchase = purchaseRepository.selectById(inventoryItems.get(0).getPurchaseId());
|
| - |
|
1083 |
String invoice = purchase.getPurchaseReference();
|
| - |
|
1084 |
List<Order> orders = orderRepository.selectByInvoiceNumber(invoice);
|
| - |
|
1085 |
Set<Integer> orderIds = orders.stream().map(x -> x.getId()).collect(Collectors.toSet());
|
| - |
|
1086 |
Order order = orders.get(0);
|
| - |
|
1087 |
float totalAmount = 0;
|
| - |
|
1088 |
float walletTotalAmount = 0;
|
| - |
|
1089 |
int totalQty = 0;
|
| - |
|
1090 |
Map<Integer, CartItem> itemIdCartItemMap = new HashMap<>();
|
| - |
|
1091 |
|
| - |
|
1092 |
List<CartItem> cartItems = new ArrayList<>();
|
| - |
|
1093 |
for (InventoryItem inventoryItem : inventoryItems) {
|
| - |
|
1094 |
TagListing tagListing = tagListingRepository.selectByItemId(inventoryItem.getItemId());
|
| - |
|
1095 |
long quantity = inventoryItemCountMap.get(inventoryItem.getId());
|
| - |
|
1096 |
totalAmount += inventoryItem.getUnitPrice() * quantity;
|
| - |
|
1097 |
walletTotalAmount += tagListing.getSellingPrice() * quantity;
|
| - |
|
1098 |
totalQty += quantity;
|
| - |
|
1099 |
if (!itemIdCartItemMap.containsKey(inventoryItem.getItemId())) {
|
| - |
|
1100 |
CartItem cartItem = new CartItem();
|
| - |
|
1101 |
cartItem.setItemId(inventoryItem.getItemId());
|
| - |
|
1102 |
cartItem.setSellingPrice(tagListing.getSellingPrice());
|
| - |
|
1103 |
cartItems.add(cartItem);
|
| - |
|
1104 |
itemIdCartItemMap.put(inventoryItem.getItemId(), cartItem);
|
| - |
|
1105 |
}
|
| - |
|
1106 |
CartItem cartItem = itemIdCartItemMap.get(inventoryItem.getItemId());
|
| - |
|
1107 |
cartItem.setQuantity((int) quantity + cartItem.getQuantity());
|
| - |
|
1108 |
}
|
| - |
|
1109 |
String rollbackDescription = String.format("Refunded against DN %s, %d pc(s)", debitNote.getDebitNoteNumber(), totalQty);
|
| - |
|
1110 |
walletService.addAmountToWallet(debitNote.getFofoId(), order.getTransactionId(), WalletReferenceType.PURCHASE, rollbackDescription, totalAmount, LocalDateTime.now());
|
| - |
|
1111 |
//Before creating order lets try to in the stock
|
| - |
|
1112 |
|
| - |
|
1113 |
//All scans pertaining to specific Invoices
|
| - |
|
1114 |
List<WarehouseScan> warehouseScans = warehouseScanRepository.selectAllByOrderIds(new ArrayList<>(orderIds));
|
| - |
|
1115 |
Map<Integer, Integer> inventoryItemIdOrderIdMap = warehouseScans.stream().collect(Collectors.toMap(x -> x.getInventoryItemId(), x -> x.getQuantity()));
|
| - |
|
1116 |
List<Integer> warehouseInventoryItemIds = warehouseScans.stream().filter(x -> !(x.getType().equals(in.shop2020.warehouse.ScanType.SALE_RET) || x.getType().equals(in.shop2020.warehouse.ScanType.SALE_RET_UNUSABLE)))
|
| - |
|
1117 |
.map(x -> x.getInventoryItemId()).collect(Collectors.toList());
|
| - |
|
1118 |
List<WarehouseInventoryItem> warehouseInventoryItems = warehouseInventoryItemRepository.selectAllByIds(warehouseInventoryItemIds);
|
| - |
|
1119 |
|
| - |
|
1120 |
Map<String, WarehouseInventoryItem> serialNumberWarehouseInventoryItemMap = warehouseInventoryItems.stream().filter(x -> StringUtils.isNotBlank(x.getSerialNumber())).collect(Collectors.toMap(x -> x.getSerialNumber(), x -> x));
|
| - |
|
1121 |
Map<Integer, List<WarehouseInventoryItem>> itemIdWarehouseInventoryItemsMap = warehouseInventoryItems.stream().filter(x -> StringUtils.isBlank(x.getSerialNumber())).collect(Collectors.groupingBy(x -> x.getItemId(), Collectors.toList()));
|
| - |
|
1122 |
|
| - |
|
1123 |
for (InventoryItem inventoryItem : inventoryItems) {
|
| - |
|
1124 |
if (StringUtils.isBlank(inventoryItem.getSerialNumber())) {
|
| - |
|
1125 |
//As of now this should be happening as dn are specifically for serialized devices
|
| - |
|
1126 |
/*int returnQty = inventoryItemCountMap.get(inventoryItem.getId()).intValue();
|
| - |
|
1127 |
List<WarehouseInventoryItem> warehouseInventoryItemList = itemIdWarehouseInventoryItemsMap.get(inventoryItem.getItemId());
|
| - |
|
1128 |
warehouseInventoryService.returnNonSerializedQty(warehouseInventoryItem)*/
|
| - |
|
1129 |
} else if (StringUtils.isNotBlank(inventoryItem.getSerialNumber())) {
|
| - |
|
1130 |
String serialNumber = inventoryItem.getSerialNumber();
|
| - |
|
1131 |
WarehouseInventoryItem warehouseInventoryItem = serialNumberWarehouseInventoryItemMap.get(serialNumber);
|
| - |
|
1132 |
warehouseInventoryItem.setLastScanType(in.shop2020.warehouse.ScanType.SALE_RET);
|
| - |
|
1133 |
warehouseInventoryService.addQuantity(warehouseInventoryItem.getId(), 1);
|
| - |
|
1134 |
WarehouseScan warehouseScan = new WarehouseScan();
|
| - |
|
1135 |
warehouseScan.setInventoryItemId(warehouseInventoryItem.getId());
|
| - |
|
1136 |
warehouseScan.setQuantity(1);
|
| - |
|
1137 |
warehouseScan.setOrderId(inventoryItemIdOrderIdMap.get(warehouseInventoryItem.getItemId()));
|
| - |
|
1138 |
warehouseScan.setScannedAt(LocalDateTime.now());
|
| - |
|
1139 |
warehouseScan.setType(in.shop2020.warehouse.ScanType.SALE_RET);
|
| - |
|
1140 |
warehouseScanRepository.persist(warehouseScan);
|
| - |
|
1141 |
|
| - |
|
1142 |
}
|
| - |
|
1143 |
}
|
| - |
|
1144 |
|
| - |
|
1145 |
//Create Order as well
|
| - |
|
1146 |
com.spice.profitmandi.dao.entity.user.User user = userRepository.selectById(debitNote.getFofoId());
|
| - |
|
1147 |
cartService.clearCart(user.getActiveCartId());
|
| - |
|
1148 |
cartService.addItemsToCart(user.getActiveCartId(), cartItems);
|
| - |
|
1149 |
|
| - |
|
1150 |
UserCart userCart = new UserCart();
|
| - |
|
1151 |
userCart.setCartId(user.getActiveCartId());
|
| - |
|
1152 |
userCart.setUserId(user.getId());
|
| - |
|
1153 |
|
| - |
|
1154 |
int transactionId = transactionService.createTransactionInternally(userCart, walletTotalAmount, order.getWarehouseId());
|
| - |
|
1155 |
commonPaymentService.payThroughWallet(transactionId);
|
| - |
|
1156 |
transactionService.processTransaction(transactionId);
|
| - |
|
1157 |
}
|
| - |
|
1158 |
|
| - |
|
1159 |
@Autowired
|
| 1024 |
WarehouseDebitNoteRepository warehouseDebitNoteRepository;
|
1160 |
WarehouseDebitNoteRepository warehouseDebitNoteRepository;
|
| 1025 |
@Autowired
|
1161 |
@Autowired
|
| 1026 |
WarehouseDebitNoteLineRepository warehouseDebitNoteLineRepository;
|
1162 |
WarehouseDebitNoteLineRepository warehouseDebitNoteLineRepository;
|
| 1027 |
|
1163 |
|
| 1028 |
@Autowired
|
1164 |
@Autowired
|