|
|
@ -19,6 +19,7 @@ import com.dxhy.erp.service.BaseIReceiptInvoiceService; |
|
|
|
import com.dxhy.erp.service.IReceiptOutService; |
|
|
|
import com.dxhy.erp.service.IReceiptOutService; |
|
|
|
import com.dxhy.erp.utils.JsonUtils; |
|
|
|
import com.dxhy.erp.utils.JsonUtils; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
@ -152,10 +153,19 @@ public class ReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutDao, |
|
|
|
} |
|
|
|
} |
|
|
|
/*全部转出 */ |
|
|
|
/*全部转出 */ |
|
|
|
if (JxszcZtEnum.QBZC.getZcztDm().equals(condVO.getOutStatus())) { |
|
|
|
if (JxszcZtEnum.QBZC.getZcztDm().equals(condVO.getOutStatus())) { |
|
|
|
|
|
|
|
if (record.getOutTaxAmount() != null && record.getOutTaxAmount().compareTo(BigDecimal.ZERO)>0){ |
|
|
|
|
|
|
|
throw new RuntimeException("累计转出税额不能大于发票税额"); |
|
|
|
|
|
|
|
} |
|
|
|
// 转出金额
|
|
|
|
// 转出金额
|
|
|
|
condRecord.setOutInvoiceAmout(record.getInvoiceAmount()); |
|
|
|
condRecord.setOutInvoiceAmout(record.getInvoiceAmount()); |
|
|
|
// 转出税额
|
|
|
|
// 转出税额
|
|
|
|
condRecord.setOutTaxAmount(record.getDkTaxAmount()); |
|
|
|
condRecord.setOutTaxAmount(record.getDkTaxAmount()); |
|
|
|
|
|
|
|
if (condRecord.getOutTaxAmount() == null){ |
|
|
|
|
|
|
|
condRecord.setOutTaxAmount(new BigDecimal(condVO.getOutTax())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (condRecord.getOutTaxAmount().compareTo(record.getTaxAmount()) > 0){ |
|
|
|
|
|
|
|
throw new RuntimeException("转出税额不能大于发票税额"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/*部分转出 */ |
|
|
|
/*部分转出 */ |
|
|
|
if (JxszcZtEnum.BFZC.getZcztDm().equals(condVO.getOutStatus())) { |
|
|
|
if (JxszcZtEnum.BFZC.getZcztDm().equals(condVO.getOutStatus())) { |
|
|
@ -221,10 +231,19 @@ public class ReceiptOutServiceImpl extends MpBaseServiceImpl<BaseReceiptOutDao, |
|
|
|
|
|
|
|
|
|
|
|
/* 全部转出 */ |
|
|
|
/* 全部转出 */ |
|
|
|
if (JxszcZtEnum.QBZC.getZcztDm().equals(condVO.getOutStatus())) { |
|
|
|
if (JxszcZtEnum.QBZC.getZcztDm().equals(condVO.getOutStatus())) { |
|
|
|
|
|
|
|
if (invoice.getOutTaxAmount() != null && invoice.getOutTaxAmount().compareTo(BigDecimal.ZERO)>0){ |
|
|
|
|
|
|
|
throw new RuntimeException("累计转出税额不能大于发票税额"); |
|
|
|
|
|
|
|
} |
|
|
|
// 转出金额
|
|
|
|
// 转出金额
|
|
|
|
record.setOutInvoiceAmout(invoice.getInvoiceAmount()); |
|
|
|
record.setOutInvoiceAmout(invoice.getInvoiceAmount()); |
|
|
|
// 转出税额
|
|
|
|
// 转出税额
|
|
|
|
record.setOutTaxAmount(invoice.getDkTaxAmount()); |
|
|
|
record.setOutTaxAmount(invoice.getDkTaxAmount()); |
|
|
|
|
|
|
|
if (record.getOutTaxAmount() == null){ |
|
|
|
|
|
|
|
record.setOutTaxAmount(new BigDecimal(condVO.getOutTax())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (record.getOutTaxAmount().compareTo(invoice.getTaxAmount()) > 0){ |
|
|
|
|
|
|
|
throw new RuntimeException("转出税额不能大于发票税额"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/* 部分转出 */ |
|
|
|
/* 部分转出 */ |
|
|
|
if (JxszcZtEnum.BFZC.getZcztDm().equals(condVO.getOutStatus())) { |
|
|
|
if (JxszcZtEnum.BFZC.getZcztDm().equals(condVO.getOutStatus())) { |
|
|
|