Subversion Repositories SmartDukaan

Rev

Rev 23596 | Rev 23638 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23596 Rev 23612
Line 428... Line 428...
428
		
428
		
429
		CustomerAddress customerAddress = this.createCustomerAddress(customCustomer.getAddress(), customer.getId());
429
		CustomerAddress customerAddress = this.createCustomerAddress(customCustomer.getAddress(), customer.getId());
430
		
430
		
431
		FofoOrder fofoOrder = this.createAndGetFofoOrder(customer.getId(), customCustomer.getGstNumber(), fofoId, invoiceNumberGenerationSequence, totalAmount, customerAddress.getId());
431
		FofoOrder fofoOrder = this.createAndGetFofoOrder(customer.getId(), customCustomer.getGstNumber(), fofoId, invoiceNumberGenerationSequence, totalAmount, customerAddress.getId());
432
		
432
		
433
		this.createPaymentOptions(fofoOrder.getId(), createOrderRequest.getPaymentOptions());
433
		this.createPaymentOptions(fofoOrder, createOrderRequest.getPaymentOptions());
434
		
434
		
435
		this.processPrebookingOrders(fofoId, fofoOrder.getId(), prebookingOrders, prebookingOrderItemIdQuantityMap, itemIdPrebookingListingMap);
435
		this.processPrebookingOrders(fofoId, fofoOrder.getId(), prebookingOrders, prebookingOrderItemIdQuantityMap, itemIdPrebookingListingMap);
436
		
436
		
437
		int retailerAddressId = retailerRegisteredAddressRepository.selectAddressIdByRetailerId(fofoId);
437
		int retailerAddressId = retailerRegisteredAddressRepository.selectAddressIdByRetailerId(fofoId);
438
		
438
		
Line 1113... Line 1113...
1113
				currentInventorySnapshotRepository.updateAvailabilityByItemIdAndFofoId(itemId, fofoId, currentInventorySnapshot.getAvailability() - quantity);
1113
				currentInventorySnapshotRepository.updateAvailabilityByItemIdAndFofoId(itemId, fofoId, currentInventorySnapshot.getAvailability() - quantity);
1114
			}
1114
			}
1115
		}
1115
		}
1116
	}
1116
	}
1117
	
1117
	
1118
	private void createPaymentOptions(int fofoOrderId, Set<CustomPaymentOption> customPaymentOptions) throws ProfitMandiBusinessException{
1118
	private void createPaymentOptions(FofoOrder fofoOrder, Set<CustomPaymentOption> customPaymentOptions) throws ProfitMandiBusinessException{
1119
		for(CustomPaymentOption customPaymentOption : customPaymentOptions){
1119
		for(CustomPaymentOption customPaymentOption : customPaymentOptions){
1120
			if(customPaymentOption.getAmount() > 0) {
1120
			if(customPaymentOption.getAmount() > 0) {
1121
				PaymentOptionTransaction paymentOptionTransaction = new PaymentOptionTransaction();
1121
				PaymentOptionTransaction paymentOptionTransaction = new PaymentOptionTransaction();
1122
				paymentOptionTransaction.setReferenceId(fofoOrderId);
1122
				paymentOptionTransaction.setReferenceId(fofoOrder.getId());
1123
				paymentOptionTransaction.setPaymentOptionId(customPaymentOption.getPaymentOptionId());
1123
				paymentOptionTransaction.setPaymentOptionId(customPaymentOption.getPaymentOptionId());
1124
				paymentOptionTransaction.setReferenceType(PaymentOptionReferenceType.ORDER);
1124
				paymentOptionTransaction.setReferenceType(PaymentOptionReferenceType.ORDER);
1125
				paymentOptionTransaction.setAmount(customPaymentOption.getAmount());
1125
				paymentOptionTransaction.setAmount(customPaymentOption.getAmount());
-
 
1126
				paymentOptionTransaction.setFofoId(fofoOrder.getFofoId());
1126
				paymentOptionTransactionRepository.persist(paymentOptionTransaction);
1127
				paymentOptionTransactionRepository.persist(paymentOptionTransaction);
1127
			}
1128
			}
1128
		}
1129
		}
1129
	}
1130
	}
1130
	
1131