|
@@ -309,7 +309,12 @@ public class SaleStatementServiceImpl implements SaleStatementService {
|
|
|
|
|
|
profitSettlementVo.setGrossProfit(totalIncome.subtract(totalExpenses));
|
|
|
|
|
|
- profitSettlementVo.setGrossProfitMargin(totalExpenses.divide(totalIncome, RoundingMode.HALF_UP));
|
|
|
+ if (totalIncome.equals(BigDecimal.ZERO)) {
|
|
|
+ profitSettlementVo.setGrossProfitMargin(BigDecimal.ZERO);
|
|
|
+ } else {
|
|
|
+ profitSettlementVo.setGrossProfitMargin(totalExpenses.divide(totalIncome, RoundingMode.HALF_UP));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|