release
路明慧 2 years ago
parent f3d5fddaba
commit fb986f0a29
  1. 13
      dxhy-erp/src/main/java/com/dxhy/erp/controller/InterfaceController.java
  2. 19
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/ReceiptOutServiceImpl.java

@ -1464,7 +1464,18 @@ public class InterfaceController extends AbstractController {
es.setZMESSAGE("操作成功"); es.setZMESSAGE("操作成功");
log.info("进项税转出成功"); log.info("进项税转出成功");
return JsonUtils.getInstance().toJsonString(es); return JsonUtils.getInstance().toJsonString(es);
}catch (Exception e){ }catch(RuntimeException e){
e.printStackTrace();
log.error("error", e.getMessage());
OutPut outPut = new OutPut();
EsOutPutResp es = new EsOutPutResp();
es.setBSKEY(erpInvoiceData.getIS_INPUT().getBSKEY());
es.setSAPKEY(erpInvoiceData.getIS_INPUT().getSAPKEY());
es.setZTYPE("E");
es.setZMESSAGE(e.getMessage());
outPut.setES_OUTPUT(es);
return JsonUtils.getInstance().toJsonString(outPut);
} catch (Exception e){
e.printStackTrace(); e.printStackTrace();
log.error("error", e.getMessage()); log.error("error", e.getMessage());
OutPut outPut = new OutPut(); OutPut outPut = new OutPut();

@ -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())) {

Loading…
Cancel
Save