|
@@ -969,21 +969,34 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
tranSettlementReport.setSettlementWeight(tranSettlementReport.getLoadingWeight() > tranSettlementReport.getUnloadingWeight() ? tranSettlementReport.getUnloadingWeight() : tranSettlementReport.getLoadingWeight());
|
|
|
tranSettlementReport.setTransportDamage(tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
}
|
|
|
- //损耗大于结算重量的1‰时=损耗-结算重量x1‰
|
|
|
- if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
+ if(tranSettlementReport.getLossWeight()<0){
|
|
|
+ tranSettlementReport.setActualLoss(0d);
|
|
|
+ tranSettlementReport.setDeductionAmount("0");
|
|
|
+ }
|
|
|
+ //损耗大于结算重量的1‰时
|
|
|
+ else if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
+ //货损=损耗-结算重量x1‰
|
|
|
tranSettlementReport.setCargoDamage(tranSettlementReport.getLossWeight()-tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
+ //实际损耗默认为结算重量的1‰
|
|
|
+ tranSettlementReport.setActualLoss(tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
+ if (tranSettlementReport.getGrainPrice()!=null){
|
|
|
+ tranSettlementReport.setDeductionAmount(String.valueOf(tranSettlementReport.getCargoDamage()*tranSettlementReport.getGrainPrice()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //0<损耗<=结算重量的1‰时
|
|
|
+ else if(tranSettlementReport.getLossWeight()>0&&tranSettlementReport.getLossWeight()<=tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
+ //实际损耗默认为损耗
|
|
|
+ tranSettlementReport.setActualLoss(Double.valueOf(String.valueOf(tranSettlementReport.getLossWeight())));
|
|
|
+ tranSettlementReport.setDeductionAmount("0");
|
|
|
}
|
|
|
if (tranSettlementReport.getTransportPrice()!=null) {
|
|
|
- //扣款
|
|
|
if (tranSettlementReport.getLossWeight() <= (tranSettlementReport.getLoadingWeight() / 1000)) {
|
|
|
- tranSettlementReport.setDeductionAmount("0");
|
|
|
- //应付=单价x结算重量-扣款
|
|
|
+ //应付=单价x结算重量
|
|
|
tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
|
//实付金额
|
|
|
tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranSettlementReport.getTransportPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
- tranSettlementReport.getServiceCharge());
|
|
|
} else {
|
|
|
- tranSettlementReport.setDeductionAmount(String.format("%.2f", (Float.valueOf(tranSettlementReport.getLoadingWeight() - tranSettlementReport.getUnloadingWeight()) - (tranSettlementReport.getLoadingWeight() / 1000)) * Float.valueOf(tranSettlementReport.getTransportPrice())));
|
|
|
//应付=单价x结算重量-扣款
|
|
|
tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight() - Float.valueOf(tranSettlementReport.getDeductionAmount()));
|
|
|
//实付金额
|
|
@@ -1499,6 +1512,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
|
|
|
tranSettlementReport.setId(IdGenerator.generateUUID());
|
|
|
if ("汽运".equals(warehouseInOutInfo.getOutType())) {
|
|
|
+ tranSettlementReport.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
|
|
|
tranSettlementReport.setTranType("汽运");
|
|
|
tranSettlementReport.setTranTypeKey("1");
|
|
|
tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
@@ -2129,6 +2143,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
if (contractManagementInfo1 == null) {
|
|
|
throw new YException(YExceptionEnum.CONTRACT_NO_NOT_EXSITS_ERROR);
|
|
|
}
|
|
|
+ warehouseInOutInfo.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
|
|
|
Wrapper wrapper = new EntityWrapper<TranCarInfo>()
|
|
|
.eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
.eq("car_no", warehouseInOutInfo.getCarNo())
|
|
@@ -2234,6 +2249,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
tranSettlementReport.setId(IdGenerator.generateUUID());
|
|
|
tranSettlementReport.setTranCarNo(warehouseInOutInfo.getTranCarNo());
|
|
|
if ("汽运".equals(warehouseInOutInfo.getOutType())) {
|
|
|
+ tranSettlementReport.setGrainPrice(warehouseInOutInfo.getGrainPrice());
|
|
|
tranSettlementReport.setTranType("汽运");
|
|
|
tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
tranSettlementReport.setServiceCharge(20d);
|
|
@@ -3778,28 +3794,39 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
tranSettlementReport.setSettlementWeight(tranSettlementReport.getLoadingWeight() > tranSettlementReport.getUnloadingWeight() ? tranSettlementReport.getUnloadingWeight() : tranSettlementReport.getLoadingWeight());
|
|
|
tranSettlementReport.setTransportDamage(tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
}
|
|
|
- //损耗大于结算重量的1‰时=损耗-结算重量x1‰
|
|
|
- if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
+ if(tranSettlementReport.getLossWeight()<0){
|
|
|
+ tranSettlementReport.setActualLoss(0d);
|
|
|
+ tranSettlementReport.setDeductionAmount("0");
|
|
|
+ }
|
|
|
+ //损耗大于结算重量的1‰时
|
|
|
+ else if (tranSettlementReport.getLossWeight()>tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
+ //货损=损耗-结算重量x1‰
|
|
|
tranSettlementReport.setCargoDamage(tranSettlementReport.getLossWeight()-tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
+ //实际损耗默认为结算重量的1‰
|
|
|
+ tranSettlementReport.setActualLoss(tranSettlementReport.getSettlementWeight()*0.001);
|
|
|
+ if (tranSettlementReport.getGrainPrice()!=null){
|
|
|
+ tranSettlementReport.setDeductionAmount(String.valueOf(tranSettlementReport.getCargoDamage()*tranSettlementReport.getGrainPrice()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //0<损耗<=结算重量的1‰时
|
|
|
+ else if(tranSettlementReport.getLossWeight()>0&&tranSettlementReport.getLossWeight()<=tranSettlementReport.getSettlementWeight()*0.001){
|
|
|
+ //实际损耗默认为损耗
|
|
|
+ tranSettlementReport.setActualLoss(Double.valueOf(String.valueOf(tranSettlementReport.getLossWeight())));
|
|
|
+ tranSettlementReport.setDeductionAmount("0");
|
|
|
}
|
|
|
if (tranSettlementReport.getTransportPrice() != null) {
|
|
|
- //扣款
|
|
|
if (tranSettlementReport.getLossWeight() <= (tranSettlementReport.getLoadingWeight() / 1000)) {
|
|
|
- tranSettlementReport.setDeductionAmount("0");
|
|
|
- //应付=单价x结算重量-扣款
|
|
|
+ //应付=单价x结算重量
|
|
|
tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight());
|
|
|
+ //实付金额
|
|
|
+ tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranSettlementReport.getTransportPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
+ - tranSettlementReport.getServiceCharge());
|
|
|
} else {
|
|
|
- tranSettlementReport.setDeductionAmount(String.format("%.2f", (Float.valueOf(tranSettlementReport.getLoadingWeight() - tranSettlementReport.getUnloadingWeight()) - (tranSettlementReport.getLoadingWeight() / 1000)) * Float.valueOf(tranSettlementReport.getTransportPrice())));
|
|
|
//应付=单价x结算重量-扣款
|
|
|
tranSettlementReport.setAmountIngPayable(tranSettlementReport.getTransportPrice() * tranSettlementReport.getSettlementWeight() - Float.valueOf(tranSettlementReport.getDeductionAmount()));
|
|
|
- }
|
|
|
- //实付金额
|
|
|
- if(tranSettlementReport.getDeductionAmount() != null){
|
|
|
+ //实付金额
|
|
|
tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranSettlementReport.getTransportPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
- Double.valueOf(tranSettlementReport.getDeductionAmount()) - tranSettlementReport.getServiceCharge());
|
|
|
- }else{
|
|
|
- tranSettlementReport.setAmountActuallyPaid(Double.valueOf(tranSettlementReport.getTransportPrice()) * tranSettlementReport.getSettlementWeight()
|
|
|
- - tranSettlementReport.getServiceCharge());
|
|
|
}
|
|
|
//税点
|
|
|
tranSettlementReport.setTaxPoint(tranSettlementReport.getAmountActuallyPaid()/0.946*0.054);
|
|
@@ -4424,6 +4451,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
|
|
|
tranSettlementReport.setId(IdGenerator.generateUUID());
|
|
|
if ("汽运".equals(warehouseInOutInfo.getOutType())) {
|
|
|
+ tranSettlementReport.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
|
|
|
tranSettlementReport.setTranType("汽运");
|
|
|
tranSettlementReport.setTranTypeKey("1");
|
|
|
tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
@@ -5115,6 +5143,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
if (contractManagementInfo1 == null) {
|
|
|
throw new YException(YExceptionEnum.CONTRACT_NO_NOT_EXSITS_ERROR);
|
|
|
}
|
|
|
+ warehouseInOutInfo.setGrainPrice(contractManagementInfo1.getUnitContractPrice());
|
|
|
Wrapper wrapper = new EntityWrapper<TranCarInfo>()
|
|
|
.eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
.eq("car_no", warehouseInOutInfo.getCarNo())
|
|
@@ -5261,6 +5290,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
tranSettlementReport.setCarId(warehouseInOutInfo.getCarId());
|
|
|
tranSettlementReport.setId(IdGenerator.generateUUID());
|
|
|
if ("汽运".equals(warehouseInOutInfo.getOutType())) {
|
|
|
+ tranSettlementReport.setGrainPrice(warehouseInOutInfo.getGrainPrice());
|
|
|
tranSettlementReport.setTranType("汽运");
|
|
|
tranSettlementReport.setTranTypeKey("1");
|
|
|
tranSettlementReport.setSettlementWeight(Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|