| Line 128... |
Line 128... |
| 128 |
|
128 |
|
| 129 |
@Autowired
|
129 |
@Autowired
|
| 130 |
SupplierRepository supplierRepository;
|
130 |
SupplierRepository supplierRepository;
|
| 131 |
|
131 |
|
| 132 |
private void validateItemLoaderModel(ItemLoaderModel itemLoaderModel) throws ProfitMandiBusinessException {
|
132 |
private void validateItemLoaderModel(ItemLoaderModel itemLoaderModel) throws ProfitMandiBusinessException {
|
| 133 |
if (itemLoaderModel.getTaxRate() > 28)
|
133 |
if (Utils.compareDouble(itemLoaderModel.getTaxRate(), 28d) > 0)
|
| 134 |
throw new ProfitMandiBusinessException("Tax Rate should not be above 28%", "", "");
|
134 |
throw new ProfitMandiBusinessException("Tax Rate should not be above 28%", "", "");
|
| 135 |
if (itemLoaderModel.getMrp() < itemLoaderModel.getSp())
|
135 |
if (itemLoaderModel.getMrp() < itemLoaderModel.getSp())
|
| 136 |
throw new ProfitMandiBusinessException("Selling Price should not be greater than MRP", "", "");
|
136 |
throw new ProfitMandiBusinessException("Selling Price should not be greater than MRP", "", "");
|
| 137 |
Supplier supplier = supplierRepository.selectById(itemLoaderModel.getPreferredVendor());
|
137 |
Supplier supplier = supplierRepository.selectById(itemLoaderModel.getPreferredVendor());
|
| 138 |
if (supplier == null) throw new ProfitMandiBusinessException("Invalid Supplier", "", "");
|
138 |
if (supplier == null) throw new ProfitMandiBusinessException("Invalid Supplier", "", "");
|