public CashBankAdjustment UnconfirmObject(CashBankAdjustment cashBankAdjustment, ICashMutationService _cashMutationService, ICashBankService _cashBankService)
 {
     if (_validator.ValidUnconfirmObject(cashBankAdjustment, _cashBankService))
     {
         CashBank             cashBank      = _cashBankService.GetObjectById(cashBankAdjustment.CashBankId);
         IList <CashMutation> cashMutations = _cashMutationService.SoftDeleteCashMutationForCashBankAdjustment(cashBankAdjustment, cashBank);
         // cashBank.Amount -= cashBankAdjustment.Amount;
         foreach (var cashMutation in cashMutations)
         {
             _cashMutationService.ReverseCashMutateObject(cashMutation, _cashBankService);
         }
         _repository.UnconfirmObject(cashBankAdjustment);
     }
     return(cashBankAdjustment);
 }
示例#2
0
 public CashBankAdjustment UnconfirmObject(CashBankAdjustment cashBankAdjustment, ICashMutationService _cashMutationService, ICashBankService _cashBankService,
                                           IGeneralLedgerJournalService _generalLedgerJournalService, IAccountService _accountService, IClosingService _closingService)
 {
     if (_validator.ValidUnconfirmObject(cashBankAdjustment, _cashBankService, _closingService))
     {
         CashBank             cashBank      = _cashBankService.GetObjectById(cashBankAdjustment.CashBankId);
         IList <CashMutation> cashMutations = _cashMutationService.SoftDeleteCashMutationForCashBankAdjustment(cashBankAdjustment, cashBank);
         // cashBank.Amount -= cashBankAdjustment.Amount;
         foreach (var cashMutation in cashMutations)
         {
             _cashMutationService.ReverseCashMutateObject(cashMutation, _cashBankService);
         }
         _generalLedgerJournalService.CreateUnconfirmationJournalForCashBankAdjustment(cashBankAdjustment, cashBank, _accountService);
         _repository.UnconfirmObject(cashBankAdjustment);
     }
     return(cashBankAdjustment);
 }