| Line 283... |
Line 283... |
| 283 |
List<FofoLineItem> fofoLineItems = fofoLineItemRepository.selectByOrderId(fofoOrder.getId());
|
283 |
List<FofoLineItem> fofoLineItems = fofoLineItemRepository.selectByOrderId(fofoOrder.getId());
|
| 284 |
CustomerAddress customerAddress = customerAddressRepository.selectById(fofoOrder.getCustomerAddressId());
|
284 |
CustomerAddress customerAddress = customerAddressRepository.selectById(fofoOrder.getCustomerAddressId());
|
| 285 |
Customer customer = customerRepository.selectById(fofoOrder.getCustomerId());
|
285 |
Customer customer = customerRepository.selectById(fofoOrder.getCustomerId());
|
| 286 |
customerAddress.setPhoneNumber(customer.getMobileNumber());
|
286 |
customerAddress.setPhoneNumber(customer.getMobileNumber());
|
| 287 |
List<PaymentOption> paymentOptions = paymentOptionRepository.selectByOrderId(fofoOrder.getId());
|
287 |
List<PaymentOption> paymentOptions = paymentOptionRepository.selectByOrderId(fofoOrder.getId());
|
| 288 |
List<InsurancePolicy> insurancePolicies = insurancePolicyRepository.selectByInvoiceNumber(fofoOrder.getInvoiceNumber());
|
288 |
List<InsurancePolicy> insurancePolicies = insurancePolicyRepository.selectByRetailerInvoiceNumber(fofoOrder.getFofoId(), fofoOrder.getInvoiceNumber());
|
| 289 |
model.addAttribute("fofoOrder", fofoOrder);
|
289 |
model.addAttribute("fofoOrder", fofoOrder);
|
| 290 |
model.addAttribute("fofoLineItems", fofoLineItems);
|
290 |
model.addAttribute("fofoLineItems", fofoLineItems);
|
| 291 |
model.addAttribute("customerBillingAddress", getBillingAddress(customerAddress));
|
291 |
model.addAttribute("customerBillingAddress", getBillingAddress(customerAddress));
|
| 292 |
model.addAttribute("customerBillingAddressObj", customerAddress);
|
292 |
model.addAttribute("customerBillingAddressObj", customerAddress);
|
| 293 |
model.addAttribute("paymentOptions", paymentOptions);
|
293 |
model.addAttribute("paymentOptions", paymentOptions);
|
| Line 312... |
Line 312... |
| 312 |
try{
|
312 |
try{
|
| 313 |
FofoOrder fofoOrder = fofoOrderRepository.selectByFofoIdAndOrderId(fofoDetails.getFofoId(), orderId);
|
313 |
FofoOrder fofoOrder = fofoOrderRepository.selectByFofoIdAndOrderId(fofoDetails.getFofoId(), orderId);
|
| 314 |
List<FofoLineItem> fofoLineItems = fofoLineItemRepository.selectByOrderId(fofoOrder.getId());
|
314 |
List<FofoLineItem> fofoLineItems = fofoLineItemRepository.selectByOrderId(fofoOrder.getId());
|
| 315 |
CustomerAddress customerAddress = customerAddressRepository.selectById(fofoOrder.getCustomerAddressId());
|
315 |
CustomerAddress customerAddress = customerAddressRepository.selectById(fofoOrder.getCustomerAddressId());
|
| 316 |
List<PaymentOption> paymentOptions = paymentOptionRepository.selectByOrderId(fofoOrder.getId());
|
316 |
List<PaymentOption> paymentOptions = paymentOptionRepository.selectByOrderId(fofoOrder.getId());
|
| 317 |
List<InsurancePolicy> insurancePolicies = insurancePolicyRepository.selectByInvoiceNumber(fofoOrder.getInvoiceNumber());
|
317 |
List<InsurancePolicy> insurancePolicies = insurancePolicyRepository.selectByRetailerInvoiceNumber(fofoOrder.getFofoId(), fofoOrder.getInvoiceNumber());
|
| 318 |
model.addAttribute("fofoOrder", fofoOrder);
|
318 |
model.addAttribute("fofoOrder", fofoOrder);
|
| 319 |
model.addAttribute("fofoLineItems", fofoLineItems);
|
319 |
model.addAttribute("fofoLineItems", fofoLineItems);
|
| 320 |
model.addAttribute("customerBillingAddress", getBillingAddress(customerAddress));
|
320 |
model.addAttribute("customerBillingAddress", getBillingAddress(customerAddress));
|
| 321 |
model.addAttribute("customerBillingAddressObj", customerAddress);
|
321 |
model.addAttribute("customerBillingAddressObj", customerAddress);
|
| 322 |
model.addAttribute("paymentOptions", paymentOptions);
|
322 |
model.addAttribute("paymentOptions", paymentOptions);
|
| Line 1016... |
Line 1016... |
| 1016 |
PdfModel pdfModel = new PdfModel();
|
1016 |
PdfModel pdfModel = new PdfModel();
|
| 1017 |
pdfModel.setAuther("profitmandi");
|
1017 |
pdfModel.setAuther("profitmandi");
|
| 1018 |
pdfModel.setTitle("Retailer Invoice");
|
1018 |
pdfModel.setTitle("Retailer Invoice");
|
| 1019 |
|
1019 |
|
| 1020 |
// insurance calculation
|
1020 |
// insurance calculation
|
| 1021 |
List<InsurancePolicy> insurancePolicies = insurancePolicyRepository.selectByInvoiceNumber(fofoOrder.getInvoiceNumber());
|
1021 |
List<InsurancePolicy> insurancePolicies = insurancePolicyRepository.selectByRetailerInvoiceNumber(fofoDetails.getFofoId(), fofoOrder.getInvoiceNumber());
|
| 1022 |
Set<CustomInsurancePolicy> customInsurancePolicies = new HashSet<>();
|
1022 |
Set<CustomInsurancePolicy> customInsurancePolicies = new HashSet<>();
|
| 1023 |
final float totalInsuranceTaxRate = 18;
|
1023 |
final float totalInsuranceTaxRate = 18;
|
| 1024 |
for(InsurancePolicy insurancePolicy : insurancePolicies){
|
1024 |
for(InsurancePolicy insurancePolicy : insurancePolicies){
|
| 1025 |
float taxableInsurancePrice = insurancePolicy.getSaleAmount() / (1 + totalInsuranceTaxRate / 100);
|
1025 |
float taxableInsurancePrice = insurancePolicy.getSaleAmount() / (1 + totalInsuranceTaxRate / 100);
|
| 1026 |
CustomInsurancePolicy customInsurancePolicy = new CustomInsurancePolicy();
|
1026 |
CustomInsurancePolicy customInsurancePolicy = new CustomInsurancePolicy();
|