| Line 133... |
Line 133... |
| 133 |
for (BrandFee fee : brandFee) {
|
133 |
for (BrandFee fee : brandFee) {
|
| 134 |
for (StoreType storeType : StoreType.values()) {
|
134 |
for (StoreType storeType : StoreType.values()) {
|
| 135 |
storeTypeFeePairs.add(Pair.of(storeType, fee));
|
135 |
storeTypeFeePairs.add(Pair.of(storeType, fee));
|
| 136 |
}
|
136 |
}
|
| 137 |
}
|
137 |
}
|
| 138 |
List<BrandCommit> brandCommits = brandCommitRepository.selectAllBrand();
|
138 |
List<BrandCommit> brandCommits = brandCommitRepository.selectAllActiveBrand();
|
| 139 |
List<BusinessType> businessTypes = Arrays.asList(BusinessType.Proprietorship, BusinessType.Partnership, BusinessType.Company);
|
139 |
List<BusinessType> businessTypes = Arrays.asList(BusinessType.Proprietorship, BusinessType.Partnership, BusinessType.Company);
|
| 140 |
model.addAttribute("businessTypes", businessTypes);
|
140 |
model.addAttribute("businessTypes", businessTypes);
|
| 141 |
model.addAttribute("brandCommits", brandCommits);
|
141 |
model.addAttribute("brandCommits", brandCommits);
|
| 142 |
model.addAttribute("storeTypeFeePairs", storeTypeFeePairs);
|
142 |
model.addAttribute("storeTypeFeePairs", storeTypeFeePairs);
|
| 143 |
model.addAttribute("authUsersList", authUsersList);
|
143 |
model.addAttribute("authUsersList", authUsersList);
|
| Line 254... |
Line 254... |
| 254 |
double differanceAmount = brandFee - totatcollectedfee;
|
254 |
double differanceAmount = brandFee - totatcollectedfee;
|
| 255 |
if (totatcollectedfee + brandFeeCollection.getCollectedAmount() <= brandFee) {
|
255 |
if (totatcollectedfee + brandFeeCollection.getCollectedAmount() <= brandFee) {
|
| 256 |
brandFeeCollection.setPaymentStatus(FeePaymentStatus.PENDING);
|
256 |
brandFeeCollection.setPaymentStatus(FeePaymentStatus.PENDING);
|
| 257 |
brandFeeCollection.setLoiFormId(loiId);
|
257 |
brandFeeCollection.setLoiFormId(loiId);
|
| 258 |
brandFeeCollectionRepository.persist(brandFeeCollection);
|
258 |
brandFeeCollectionRepository.persist(brandFeeCollection);
|
| 259 |
loiFormService.sentMailToPaymentApprover(brandFeeCollection, loiForm);
|
259 |
// loiFormService.sentMailToPaymentApprover(brandFeeCollection, loiForm);
|
| 260 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
260 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 261 |
return "response";
|
261 |
return "response";
|
| 262 |
} else {
|
262 |
} else {
|
| 263 |
throw new ProfitMandiBusinessException("You need to add only due brand fee that is Only, " + differanceAmount + " INR", null, "Pay differance amount or less then differance amount");
|
263 |
throw new ProfitMandiBusinessException("You need to add only due brand fee that is Only, " + differanceAmount + " INR", null, "Pay differance amount or less then differance amount");
|
| 264 |
}
|
264 |
}
|
| Line 409... |
Line 409... |
| 409 |
public String updateForm(@RequestBody BrandFeeCollection brandFeeCollection, Model model) throws Exception {
|
409 |
public String updateForm(@RequestBody BrandFeeCollection brandFeeCollection, Model model) throws Exception {
|
| 410 |
BrandFeeCollection brandFeeCollection1 = brandFeeCollectionRepository.selectById(brandFeeCollection.getId());
|
410 |
BrandFeeCollection brandFeeCollection1 = brandFeeCollectionRepository.selectById(brandFeeCollection.getId());
|
| 411 |
LoiForm loiForm = loiFormRepository.selectById(brandFeeCollection1.getLoiFormId());
|
411 |
LoiForm loiForm = loiFormRepository.selectById(brandFeeCollection1.getLoiFormId());
|
| 412 |
brandFeeCollection1.setFeeCollectingTimeStamp(brandFeeCollection.getFeeCollectingTimeStamp());
|
412 |
brandFeeCollection1.setFeeCollectingTimeStamp(brandFeeCollection.getFeeCollectingTimeStamp());
|
| 413 |
brandFeeCollection1.setCollectedAmount(brandFeeCollection.getCollectedAmount());
|
413 |
brandFeeCollection1.setCollectedAmount(brandFeeCollection.getCollectedAmount());
|
| - |
|
414 |
brandFeeCollection1.setPaymentAttachment(brandFeeCollection.getPaymentAttachment());
|
| 414 |
brandFeeCollection1.setPaymentReferenceNo(brandFeeCollection.getPaymentReferenceNo());
|
415 |
brandFeeCollection1.setPaymentReferenceNo(brandFeeCollection.getPaymentReferenceNo());
|
| 415 |
brandFeeCollection1.setPaymentMode(brandFeeCollection.getPaymentMode());
|
416 |
brandFeeCollection1.setPaymentMode(brandFeeCollection.getPaymentMode());
|
| 416 |
double totalCollectedFee = brandFeeCollectionRepository.selectAllByLoiFormId(loiForm.getId()).stream().mapToDouble(x -> x.getCollectedAmount()).sum();
|
417 |
double totalCollectedFee = brandFeeCollectionRepository.selectAllByLoiFormId(loiForm.getId()).stream().mapToDouble(x -> x.getCollectedAmount()).sum();
|
| 417 |
if (totalCollectedFee <= loiForm.getAgreedBrandFees()) {
|
418 |
if (totalCollectedFee <= loiForm.getAgreedBrandFees()) {
|
| 418 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
419 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|