|
@@ -108,7 +108,6 @@ public class PurchaseReceiptReportServiceImpl extends ServiceImpl<PurchaseReceip
|
|
|
|
|
|
/**
|
|
|
* 补货结转
|
|
|
- *
|
|
|
* @param purchaseReceiptReport
|
|
|
* @return
|
|
|
*/
|
|
@@ -127,6 +126,79 @@ public class PurchaseReceiptReportServiceImpl extends ServiceImpl<PurchaseReceip
|
|
|
}
|
|
|
return "OK";
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 出纳付款
|
|
|
+ * @param purchaseReceiptReport
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String payMoney(PurchaseReceiptReport purchaseReceiptReport) {
|
|
|
+ List<PurchaseReceiptReport> purchaseReceiptReportList=purchaseReceiptReport.getPurchaseReceiptReportList();
|
|
|
+ Float money = purchaseReceiptReport.getMoney();
|
|
|
+ //付款多条
|
|
|
+ if (!CollectionUtils.isEmpty(purchaseReceiptReportList)){
|
|
|
+ for (PurchaseReceiptReport purchaseReceiptReport1 : purchaseReceiptReportList) {
|
|
|
+ //付款金额大于本次循环未付金额
|
|
|
+ if (money >= purchaseReceiptReport1.getAmountNotPayable()) {
|
|
|
+ money=money-purchaseReceiptReport1.getAmountNotPayable();
|
|
|
+ //全部付款
|
|
|
+ purchaseReceiptReport1.setStatus(StatusEnum.PUR_PAYaLL.getName());
|
|
|
+ purchaseReceiptReport1.setStatusFlag(StatusEnum.PUR_PAYaLL.getFlag());
|
|
|
+ purchaseReceiptReport1.setAmountEdPayable(purchaseReceiptReport1.getAmountEdPayable()+purchaseReceiptReport1.getAmountNotPayable());
|
|
|
+ purchaseReceiptReport1.setAmountNotPayable(0.0f);
|
|
|
+ this.updateById(purchaseReceiptReport1);
|
|
|
+ } else if (money> 0) {
|
|
|
+ Float moneyTmp = money-purchaseReceiptReport1.getAmountNotPayable();
|
|
|
+ //部分付款
|
|
|
+ purchaseReceiptReport1.setStatus(StatusEnum.PUR_PAY.getName());
|
|
|
+ purchaseReceiptReport1.setStatusFlag(StatusEnum.PUR_PAY.getFlag());
|
|
|
+ purchaseReceiptReport1.setAmountEdPayable(purchaseReceiptReport1.getAmountEdPayable()+money);
|
|
|
+ purchaseReceiptReport1.setAmountNotPayable(purchaseReceiptReport1.getAmountNotPayable()-money);
|
|
|
+ this.updateById(purchaseReceiptReport1);
|
|
|
+ money=moneyTmp;
|
|
|
+ } else {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "ok";
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 开发票
|
|
|
+ * @param purchaseReceiptReport
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String openInvoice(PurchaseReceiptReport purchaseReceiptReport) {
|
|
|
+ //查询采购入库报表
|
|
|
+ PurchaseReceiptReport purchaseReceiptReport1=this.selectById(purchaseReceiptReport.getId());
|
|
|
+ if (purchaseReceiptReport1 != null ){
|
|
|
+ //更改已开发票
|
|
|
+ purchaseReceiptReport1.setAlreadyInvoice(purchaseReceiptReport1.getAlreadyInvoice()+purchaseReceiptReport.getAlreadyInvoice());
|
|
|
+ //更改采购入库报表信息
|
|
|
+ this.updateById(purchaseReceiptReport1);
|
|
|
+ return "OK";
|
|
|
+ }
|
|
|
+ return "NG";
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量开发票
|
|
|
+ * @param purchaseReceiptReport
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String openInvoiceList(PurchaseReceiptReport purchaseReceiptReport) {
|
|
|
+ List<PurchaseReceiptReport> purchaseReceiptReportList=purchaseReceiptReport.getPurchaseReceiptReportList();
|
|
|
+ //批量
|
|
|
+ if (!CollectionUtils.isEmpty(purchaseReceiptReportList)){
|
|
|
+ for (PurchaseReceiptReport purchaseReceiptReport1 : purchaseReceiptReportList) {
|
|
|
+ //已开发票金额等于已付金额
|
|
|
+ purchaseReceiptReport1.setAlreadyInvoice(purchaseReceiptReport1.getAmountEdPayable());
|
|
|
+ this.updateById(purchaseReceiptReport1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return "ok";
|
|
|
+ }
|
|
|
|
|
|
|
|
|
private List<String> getResourceIdList() {
|