public PaymentVoucher UnconfirmObject(PaymentVoucher paymentVoucher, IPaymentVoucherDetailService _paymentVoucherDetailService, ICashBankService _cashBankService, IPayableService _payableService, ICashMutationService _cashMutationService, IGeneralLedgerJournalService _generalLedgerJournalService, IAccountService _accountService, IClosingService _closingService) { if (_validator.ValidUnconfirmObject(paymentVoucher, _closingService)) { IList <PaymentVoucherDetail> details = _paymentVoucherDetailService.GetObjectsByPaymentVoucherId(paymentVoucher.Id); foreach (var detail in details) { detail.Errors = new Dictionary <string, string>(); _paymentVoucherDetailService.UnconfirmObject(detail, this, _payableService); } _repository.UnconfirmObject(paymentVoucher); if (!paymentVoucher.IsGBCH) { CashBank cashBank = _cashBankService.GetObjectById(paymentVoucher.CashBankId); IList <CashMutation> cashMutations = _cashMutationService.SoftDeleteCashMutationForPaymentVoucher(paymentVoucher, cashBank); foreach (var cashMutation in cashMutations) { _cashMutationService.ReverseCashMutateObject(cashMutation, _cashBankService); } _generalLedgerJournalService.CreateUnconfirmationJournalForPaymentVoucher(paymentVoucher, cashBank, _accountService); } } return(paymentVoucher); }