|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|