| Line 63... |
Line 63... |
| 63 |
import com.spice.profitmandi.dao.entity.fofo.PurchaseReturnItem;
|
63 |
import com.spice.profitmandi.dao.entity.fofo.PurchaseReturnItem;
|
| 64 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
64 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
| 65 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
65 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
| 66 |
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
|
66 |
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
|
| 67 |
import com.spice.profitmandi.dao.entity.inventory.SaholicInventorySnapshot;
|
67 |
import com.spice.profitmandi.dao.entity.inventory.SaholicInventorySnapshot;
|
| - |
|
68 |
import com.spice.profitmandi.dao.entity.transaction.HdfcPayment;
|
| 68 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
69 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
| 69 |
import com.spice.profitmandi.dao.entity.transaction.LineItemImei;
|
70 |
import com.spice.profitmandi.dao.entity.transaction.LineItemImei;
|
| 70 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
71 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 71 |
import com.spice.profitmandi.dao.entity.transaction.SellerWarehouse;
|
72 |
import com.spice.profitmandi.dao.entity.transaction.SellerWarehouse;
|
| 72 |
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
|
73 |
import com.spice.profitmandi.dao.entity.transaction.UserWallet;
|
| Line 103... |
Line 104... |
| 103 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
104 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
| 104 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
105 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
| 105 |
import com.spice.profitmandi.dao.repository.fofo.SchemeItemRepository;
|
106 |
import com.spice.profitmandi.dao.repository.fofo.SchemeItemRepository;
|
| 106 |
import com.spice.profitmandi.dao.repository.inventory.SaholicInventorySnapshotRepository;
|
107 |
import com.spice.profitmandi.dao.repository.inventory.SaholicInventorySnapshotRepository;
|
| 107 |
import com.spice.profitmandi.dao.repository.inventory.SaholicReservationSnapshotRepository;
|
108 |
import com.spice.profitmandi.dao.repository.inventory.SaholicReservationSnapshotRepository;
|
| - |
|
109 |
import com.spice.profitmandi.dao.repository.transaction.HdfcPaymentRepository;
|
| 108 |
import com.spice.profitmandi.dao.repository.transaction.LineItemImeisRepository;
|
110 |
import com.spice.profitmandi.dao.repository.transaction.LineItemImeisRepository;
|
| 109 |
import com.spice.profitmandi.dao.repository.transaction.LineItemRepository;
|
111 |
import com.spice.profitmandi.dao.repository.transaction.LineItemRepository;
|
| 110 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
112 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 111 |
import com.spice.profitmandi.dao.repository.transaction.ReturnOrderRepository;
|
113 |
import com.spice.profitmandi.dao.repository.transaction.ReturnOrderRepository;
|
| 112 |
import com.spice.profitmandi.dao.repository.transaction.SellerWarehouseRepository;
|
114 |
import com.spice.profitmandi.dao.repository.transaction.SellerWarehouseRepository;
|
| Line 347... |
Line 349... |
| 347 |
}
|
349 |
}
|
| 348 |
|
350 |
|
| 349 |
public void cancelOrder(List<String> invoiceNumbers) throws Exception {
|
351 |
public void cancelOrder(List<String> invoiceNumbers) throws Exception {
|
| 350 |
orderService.cancelOrder(invoiceNumbers);
|
352 |
orderService.cancelOrder(invoiceNumbers);
|
| 351 |
}
|
353 |
}
|
| - |
|
354 |
|
| - |
|
355 |
@Autowired HdfcPaymentRepository hdfcPaymentRepository;
|
| - |
|
356 |
public void addPayment() throws Exception {
|
| - |
|
357 |
List<Integer> paymentIds = Arrays.asList(3767, 3768, 3769, 3770, 3771, 3772, 3773, 3774, 3775, 3776);
|
| - |
|
358 |
for (int hdfcPaymentId : paymentIds) {
|
| - |
|
359 |
HdfcPayment hdfcPayment = hdfcPaymentRepository.selectById(hdfcPaymentId);
|
| - |
|
360 |
String virtualAccount = hdfcPayment.getVirtualAccount();
|
| - |
|
361 |
String retailerIdString = virtualAccount.substring(6);
|
| - |
|
362 |
int retailerId = Integer.parseInt(retailerIdString);
|
| - |
|
363 |
String description = String.format("Advance payment received through %s, Utr# %s",
|
| - |
|
364 |
hdfcPayment.getTransferMode(), hdfcPayment.getUtr());
|
| - |
|
365 |
walletService.addAmountToWallet(retailerId, hdfcPayment.getId(), WalletReferenceType.AUTOMATED_ADVANCE,
|
| - |
|
366 |
description, (float) hdfcPayment.getAmount(), hdfcPayment.getCreditTimestamp());
|
| - |
|
367 |
}
|
| - |
|
368 |
}
|
| 352 |
|
369 |
|
| 353 |
public void migratePurchase() throws Exception {
|
370 |
public void migratePurchase() throws Exception {
|
| 354 |
List<Purchase> purchases = purchaseRepository.selectPurchaseAllPurchasesLessThanZero();
|
371 |
List<Purchase> purchases = purchaseRepository.selectPurchaseAllPurchasesLessThanZero();
|
| 355 |
System.out.printf("Total Purchases count is %s", purchases.size());
|
372 |
System.out.printf("Total Purchases count is %s", purchases.size());
|
| 356 |
for (Purchase purchase : purchases) {
|
373 |
for (Purchase purchase : purchases) {
|