| | |
| | | */ |
| | | private void validateSaleOrderAndOut(CrmInvoiceSaveReqVO reqVO) { |
| | | if (reqVO.getSaleOrderId() == null) { |
| | | return; |
| | | throw exception(INVOICE_CREATE_FAIL_SALE_ORDER_REQUIRED); |
| | | } |
| | | // 1. 销售订单 |
| | | ErpSaleOrderRespDTO saleOrder = saleOrderApi.getSaleOrder(reqVO.getSaleOrderId()).getCheckedData(); |
| | |
| | | formatPrice(orderRemainPrice), formatPrice(orderTotalPrice), formatPrice(orderInvoicedPrice)); |
| | | } |
| | | |
| | | // 2. 销售出库单(可选) |
| | | // 2. 开票申请必须绑定已完成的销售出库单 |
| | | if (reqVO.getSaleOutId() == null) { |
| | | return; |
| | | throw exception(INVOICE_CREATE_FAIL_SALE_OUT_REQUIRED); |
| | | } |
| | | MesWmProductSalesRespDTO saleOut = productSalesApi.getProductSales(reqVO.getSaleOutId()); |
| | | if (saleOut == null) { |