1.已归档不能删除

2.发票已关联过的不能再关联
3.永久保存移交年数处理
new
JiilingLee 1 year ago
parent 1a5bd35424
commit feb2dbebb1

@ -75,6 +75,10 @@ public class InvoicesController {
@Operation(summary = "更新发票")
@PreAuthorize("@ss.hasPermission('accounting:invoices:update')")
public CommonResult<Boolean> updateInvoices(@Valid @RequestBody InvoicesUpdateReqVO updateReqVO) {
InvoicesDO invoices = invoicesService.getInvoices(updateReqVO.getId());
if (invoices.getVoucherId() !=null){
return error("该发票已被关联");
}
invoicesService.updateInvoices(updateReqVO);
return success(true);
}

@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.accounting.dal.dataobject.attachment.AttachmentDO
import cn.iocoder.yudao.module.accounting.dal.dataobject.bankslip.BankSlipDO;
import cn.iocoder.yudao.module.accounting.dal.dataobject.flow.FlowDO;
import cn.iocoder.yudao.module.accounting.dal.dataobject.invoices.InvoicesDO;
import cn.iocoder.yudao.module.accounting.enums.AccountingStatusEnum;
import cn.iocoder.yudao.module.accounting.service.attachment.AttachmentService;
import cn.iocoder.yudao.module.accounting.service.bankslip.BankSlipService;
import cn.iocoder.yudao.module.accounting.service.flow.FlowService;
@ -97,6 +98,10 @@ public class VoucherController {
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('accounting:voucher:delete')")
public CommonResult<Boolean> deleteVoucher(@RequestParam("id") Long id) {
VoucherDO voucher = voucherService.getVoucher(id);
if (voucher.getFileStatus().equals(AccountingStatusEnum.LOGFILE.getValue())){
return error("该凭证已归档,请勿删除!");
}
voucherService.deleteVoucher(id);
return success(true);
}

@ -116,6 +116,9 @@ public class CodeRuleServiceImpl implements CodeRuleService {
int year = calendar.get(Calendar.YEAR);
//保管期限
String timeLimit = authenticateDO.getTimeLimit();
if (timeLimit.equals("永久保存")){
timeLimit="30";
}
int year2 = year + Integer.valueOf(timeLimit);
//只有延长保存的
synchronized (this) {

Loading…
Cancel
Save