| Line 1438... |
Line 1438... |
| 1438 |
pdfModel.setAuther("SmartDukaan");
|
1438 |
pdfModel.setAuther("SmartDukaan");
|
| 1439 |
pdfModel.setInvoiceDate(FormattingUtils.formatDate(fofoOrder.getCreateTimestamp()));
|
1439 |
pdfModel.setInvoiceDate(FormattingUtils.formatDate(fofoOrder.getCreateTimestamp()));
|
| 1440 |
|
1440 |
|
| 1441 |
// insurance calculation
|
1441 |
// insurance calculation
|
| 1442 |
List<InsurancePolicy> insurancePolicies = insurancePolicyRepository.selectByRetailerIdInvoiceNumber(fofoOrder.getInvoiceNumber());
|
1442 |
List<InsurancePolicy> insurancePolicies = insurancePolicyRepository.selectByRetailerIdInvoiceNumber(fofoOrder.getInvoiceNumber());
|
| 1443 |
List<CustomInsurancePolicy> customInsurancePolicies = new ArrayList<>();
|
- |
|
| 1444 |
final float totalInsuranceTaxRate = 18;
|
- |
|
| 1445 |
for (InsurancePolicy insurancePolicy : insurancePolicies) {
|
- |
|
| 1446 |
float taxableInsurancePrice = insurancePolicy.getSaleAmount() / (1 + totalInsuranceTaxRate / 100);
|
- |
|
| 1447 |
CustomInsurancePolicy customInsurancePolicy = new CustomInsurancePolicy();
|
- |
|
| 1448 |
customInsurancePolicy.setDescription(insurancePolicy.getPolicyPlan() + " for Device #" + insurancePolicy.getSerialNumber() + "\n Plan Reference - " + insurancePolicy.getPolicyNumber());
|
- |
|
| 1449 |
customInsurancePolicy.setHsnCode("998716");
|
- |
|
| 1450 |
customInsurancePolicy.setRate(taxableInsurancePrice);
|
- |
|
| 1451 |
customInsurancePolicy.setIgstRate(18);
|
- |
|
| 1452 |
customInsurancePolicy.setIgstAmount(taxableInsurancePrice * 18 / 100);
|
- |
|
| 1453 |
customInsurancePolicy.setCgstRate(9);
|
- |
|
| 1454 |
customInsurancePolicy.setCgstAmount(taxableInsurancePrice * 9 / 100);
|
- |
|
| 1455 |
customInsurancePolicy.setSgstRate(9);
|
- |
|
| 1456 |
customInsurancePolicy.setSgstAmount(taxableInsurancePrice * 9 / 100);
|
- |
|
| 1457 |
customInsurancePolicy.setNetAmount(insurancePolicy.getSaleAmount());
|
- |
|
| 1458 |
customInsurancePolicies.add(customInsurancePolicy);
|
- |
|
| 1459 |
}
|
- |
|
| 1460 |
pdfModel.setInsurancePolicies(customInsurancePolicies);
|
1443 |
pdfModel.setInsurancePolicies(InsuranceInvoiceLine.from(insurancePolicies));
|
| 1461 |
|
1444 |
|
| 1462 |
Retailer retailer = retailerRepository.selectById(fofoOrder.getFofoId());
|
1445 |
Retailer retailer = retailerRepository.selectById(fofoOrder.getFofoId());
|
| 1463 |
User user = userRepository.selectById(userAccountRepository.selectUserIdByRetailerId(retailer.getId()));
|
1446 |
User user = userRepository.selectById(userAccountRepository.selectUserIdByRetailerId(retailer.getId()));
|
| 1464 |
FofoStore fofoStoreForGst = fofoStoreRepository.selectByRetailerId(retailer.getId());
|
1447 |
FofoStore fofoStoreForGst = fofoStoreRepository.selectByRetailerId(retailer.getId());
|
| 1465 |
CustomRetailer customRetailer = new CustomRetailer();
|
1448 |
CustomRetailer customRetailer = new CustomRetailer();
|