public dynamic DeleteDetail(PaymentVoucherDetail model) { try { if (!AuthenticationModel.IsAllowed("Edit", Core.Constants.Constant.MenuName.PaymentVoucher, Core.Constants.Constant.MenuGroupName.Transaction)) { Dictionary <string, string> Errors = new Dictionary <string, string>(); Errors.Add("Generic", "You are Not Allowed to Edit record"); return(Json(new { Errors }, JsonRequestBehavior.AllowGet)); } var data = _paymentVoucherDetailService.GetObjectById(model.Id); model = _paymentVoucherDetailService.SoftDeleteObject(data); } catch (Exception ex) { LOG.Error("Delete Failed", ex); Dictionary <string, string> Errors = new Dictionary <string, string>(); Errors.Add("Generic", "Error " + ex); return(Json(new { Errors }, JsonRequestBehavior.AllowGet)); } return(Json(new { model.Errors, })); }
public RetailPurchaseInvoice PaidObject(RetailPurchaseInvoice retailPurchaseInvoice, decimal AmountPaid, ICashBankService _cashBankService, IPayableService _payableService, IPaymentVoucherService _paymentVoucherService, IPaymentVoucherDetailService _paymentVoucherDetailService, IContactService _contactService, ICashMutationService _cashMutationService, IGeneralLedgerJournalService _generalLedgerJournalService, IAccountService _accountService, IClosingService _closingService) { retailPurchaseInvoice.AmountPaid = AmountPaid; if (_validator.ValidPaidObject(retailPurchaseInvoice, _cashBankService, _paymentVoucherService)) { CashBank cashBank = _cashBankService.GetObjectById((int)retailPurchaseInvoice.CashBankId.GetValueOrDefault()); retailPurchaseInvoice.IsBank = cashBank.IsBank; if (!retailPurchaseInvoice.IsGBCH) { retailPurchaseInvoice.GBCH_No = null; retailPurchaseInvoice.Description = null; } if (retailPurchaseInvoice.AmountPaid == retailPurchaseInvoice.Total) { retailPurchaseInvoice.IsFullPayment = true; } Payable payable = _payableService.GetObjectBySource(Core.Constants.Constant.PayableSource.RetailPurchaseInvoice, retailPurchaseInvoice.Id); PaymentVoucher paymentVoucher = _paymentVoucherService.CreateObject((int)retailPurchaseInvoice.CashBankId.GetValueOrDefault(), retailPurchaseInvoice.ContactId, DateTime.Now, retailPurchaseInvoice.Total, retailPurchaseInvoice.IsGBCH, (DateTime)retailPurchaseInvoice.DueDate.GetValueOrDefault(), retailPurchaseInvoice.IsBank, _paymentVoucherDetailService, _payableService, _contactService, _cashBankService); PaymentVoucherDetail paymentVoucherDetail = _paymentVoucherDetailService.CreateObject(paymentVoucher.Id, payable.Id, (decimal)retailPurchaseInvoice.AmountPaid.GetValueOrDefault(), "Automatic Payment", _paymentVoucherService, _cashBankService, _payableService); retailPurchaseInvoice = _repository.PaidObject(retailPurchaseInvoice); _paymentVoucherService.ConfirmObject(paymentVoucher, (DateTime)retailPurchaseInvoice.ConfirmationDate.GetValueOrDefault(), _paymentVoucherDetailService, _cashBankService, _payableService, _cashMutationService, _generalLedgerJournalService, _accountService, _closingService); } return(retailPurchaseInvoice); }
public PaymentVoucherDetail CreateObject(PaymentVoucherDetail paymentVoucherDetail, IPaymentVoucherService _paymentVoucherService, ICashBankService _cashBankService, IPayableService _payableService) { paymentVoucherDetail.Errors = new Dictionary <String, String>(); return(_validator.ValidCreateObject(paymentVoucherDetail, _paymentVoucherService, this, _cashBankService, _payableService) ? _repository.CreateObject(paymentVoucherDetail) : paymentVoucherDetail); }
public PaymentVoucherDetail ConfirmObject(PaymentVoucherDetail paymentVoucherDetail, DateTime ConfirmationDate, IPaymentVoucherService _paymentVoucherService, IPayableService _payableService) { paymentVoucherDetail.ConfirmationDate = ConfirmationDate; if (_validator.ValidConfirmObject(paymentVoucherDetail, _payableService)) { PaymentVoucher paymentVoucher = _paymentVoucherService.GetObjectById(paymentVoucherDetail.PaymentVoucherId); Payable payable = _payableService.GetObjectById(paymentVoucherDetail.PayableId); if (paymentVoucher.IsGBCH) { payable.PendingClearanceAmount += paymentVoucherDetail.Amount; } payable.RemainingAmount -= paymentVoucherDetail.Amount; if (payable.RemainingAmount == 0 && payable.PendingClearanceAmount == 0) { payable.IsCompleted = true; payable.CompletionDate = DateTime.Now; } _payableService.UpdateObject(payable); paymentVoucherDetail = _repository.ConfirmObject(paymentVoucherDetail); } return(paymentVoucherDetail); }
public dynamic InsertDetail(PaymentVoucherDetail model) { try { if (!AuthenticationModel.IsAllowed("Edit", Core.Constants.Constant.MenuName.PaymentVoucher, Core.Constants.Constant.MenuGroupName.Transaction)) { Dictionary <string, string> Errors = new Dictionary <string, string>(); Errors.Add("Generic", "You are Not Allowed to Edit record"); return(Json(new { Errors }, JsonRequestBehavior.AllowGet)); } model = _paymentVoucherDetailService.CreateObject(model, _paymentVoucherService, _cashBankService, _payableService ); } catch (Exception ex) { LOG.Error("Insert Failed", ex); Dictionary <string, string> Errors = new Dictionary <string, string>(); Errors.Add("Generic", "Error " + ex); return(Json(new { Errors }, JsonRequestBehavior.AllowGet)); } return(Json(new { model.Errors, })); }
public dynamic GetInfoDetail(int Id) { PaymentVoucherDetail model = new PaymentVoucherDetail(); try { model = _paymentVoucherDetailService.GetObjectById(Id); } catch (Exception ex) { LOG.Error("GetInfo", ex); Dictionary <string, string> Errors = new Dictionary <string, string>(); Errors.Add("Generic", "Error " + ex); return(Json(new { Errors }, JsonRequestBehavior.AllowGet)); } return(Json(new { model.Id, model.Code, model.PayableId, Payable = _payableService.GetObjectById(model.PayableId).Code, model.Amount, model.Description, model.Errors }, JsonRequestBehavior.AllowGet)); }
public PaymentVoucherDetail VHasNotBeenDeleted(PaymentVoucherDetail paymentVoucherDetail) { if (paymentVoucherDetail.IsDeleted) { paymentVoucherDetail.Errors.Add("Generic", "Sudah didelete"); } return(paymentVoucherDetail); }
public PaymentVoucherDetail VHasBeenConfirmed(PaymentVoucherDetail paymentVoucherDetail) { if (!paymentVoucherDetail.IsConfirmed) { paymentVoucherDetail.Errors.Add("Generic", "Belum dikonfirmasi"); } return(paymentVoucherDetail); }
public PaymentVoucherDetail VHasConfirmationDate(PaymentVoucherDetail obj) { if (obj.ConfirmationDate == null) { obj.Errors.Add("ConfirmationDate", "Tidak boleh kosong"); } return(obj); }
public PaymentVoucherDetail VNonNegativeAmount(PaymentVoucherDetail paymentVoucherDetail) { if (paymentVoucherDetail.Amount < 0) { paymentVoucherDetail.Errors.Add("Amount", "Tidak boleh kurang dari 0"); } return(paymentVoucherDetail); }
public PaymentVoucherDetail VHasPayable(PaymentVoucherDetail paymentVoucherDetail, IPayableService _payableService) { Payable payable = _payableService.GetObjectById(paymentVoucherDetail.PayableId); if (payable == null) { paymentVoucherDetail.Errors.Add("PayableId", "Tidak boleh tidak ada"); } return(paymentVoucherDetail); }
public PaymentVoucherDetail VConfirmObject(PaymentVoucherDetail paymentVoucherDetail, IPayableService _payableService) { VHasConfirmationDate(paymentVoucherDetail); if (!isValid(paymentVoucherDetail)) { return(paymentVoucherDetail); } VAmountLessOrEqualPayable(paymentVoucherDetail, _payableService); return(paymentVoucherDetail); }
public PaymentVoucherDetail VDeleteObject(PaymentVoucherDetail paymentVoucherDetail) { VHasNotBeenConfirmed(paymentVoucherDetail); if (!isValid(paymentVoucherDetail)) { return(paymentVoucherDetail); } VHasNotBeenDeleted(paymentVoucherDetail); return(paymentVoucherDetail); }
public PaymentVoucherDetail VPayableHasNotBeenCompleted(PaymentVoucherDetail paymentVoucherDetail, IPayableService _payableService) { Payable payable = _payableService.GetObjectById(paymentVoucherDetail.PayableId); if (payable.IsCompleted) { paymentVoucherDetail.Errors.Add("Generic", "Payable sudah complete"); } return(paymentVoucherDetail); }
public PaymentVoucherDetail VAmountLessOrEqualPayable(PaymentVoucherDetail paymentVoucherDetail, IPayableService _payableService) { Payable payable = _payableService.GetObjectById(paymentVoucherDetail.PayableId); if (paymentVoucherDetail.Amount > payable.Amount) { paymentVoucherDetail.Errors.Add("Amount", "Tidak boleh lebih dari payable"); } return(paymentVoucherDetail); }
public PaymentVoucherDetail VUpdateObject(PaymentVoucherDetail paymentVoucherDetail, IPaymentVoucherService _paymentVoucherService, IPaymentVoucherDetailService _paymentVoucherDetailService, ICashBankService _cashBankService, IPayableService _payableService) { VHasNotBeenConfirmed(paymentVoucherDetail); if (!isValid(paymentVoucherDetail)) { return(paymentVoucherDetail); } VCreateObject(paymentVoucherDetail, _paymentVoucherService, _paymentVoucherDetailService, _cashBankService, _payableService); return(paymentVoucherDetail); }
void PopulatePaymentVouher() { _purchaseInvoiceService.ConfirmObject(pi1, DateTime.Today, _purchaseInvoiceDetailService, _purchaseOrderService, _purchaseReceivalService, _purchaseReceivalDetailService, _payableService); _purchaseInvoiceService.ConfirmObject(pi2, DateTime.Today, _purchaseInvoiceDetailService, _purchaseOrderService, _purchaseReceivalService, _purchaseReceivalDetailService, _payableService); _purchaseInvoiceService.ConfirmObject(pi3, DateTime.Today, _purchaseInvoiceDetailService, _purchaseOrderService, _purchaseReceivalService, _purchaseReceivalDetailService, _payableService); pv = new PaymentVoucher() { ContactId = contact.Id, CashBankId = cashBank.Id, PaymentDate = DateTime.Today.AddDays(14), IsGBCH = true, //IsBank = true, DueDate = DateTime.Today.AddDays(14), TotalAmount = pi1.AmountPayable + pi2.AmountPayable + pi3.AmountPayable }; _paymentVoucherService.CreateObject(pv, _paymentVoucherDetailService, _payableService, _contactService, _cashBankService); pvd1 = new PaymentVoucherDetail() { PaymentVoucherId = pv.Id, PayableId = _payableService.GetObjectBySource(Core.Constants.Constant.PayableSource.PurchaseInvoice, pi1.Id).Id, Amount = pi1.AmountPayable, Description = "Payment buat Purchase Invoice 1" }; _paymentVoucherDetailService.CreateObject(pvd1, _paymentVoucherService, _cashBankService, _payableService); pvd2 = new PaymentVoucherDetail() { PaymentVoucherId = pv.Id, PayableId = _payableService.GetObjectBySource(Core.Constants.Constant.PayableSource.PurchaseInvoice, pi2.Id).Id, Amount = pi2.AmountPayable, Description = "Payment buat Purchase Invoice 2" }; _paymentVoucherDetailService.CreateObject(pvd2, _paymentVoucherService, _cashBankService, _payableService); pvd3 = new PaymentVoucherDetail() { PaymentVoucherId = pv.Id, PayableId = _payableService.GetObjectBySource(Core.Constants.Constant.PayableSource.PurchaseInvoice, pi3.Id).Id, Amount = pi3.AmountPayable, Description = "Payment buat Purchase Invoice 3" }; _paymentVoucherDetailService.CreateObject(pvd3, _paymentVoucherService, _cashBankService, _payableService); _paymentVoucherService.ConfirmObject(pv, DateTime.Today, _paymentVoucherDetailService, _cashBankService, _payableService, _cashMutationService, _generalLedgerJournalService, _accountService, _closingService); _paymentVoucherService.ReconcileObject(pv, DateTime.Today.AddDays(10), _paymentVoucherDetailService, _cashMutationService, _cashBankService, _payableService, _generalLedgerJournalService, _accountService, _closingService); }
public string PrintError(PaymentVoucherDetail obj) { string erroroutput = ""; KeyValuePair <string, string> first = obj.Errors.ElementAt(0); erroroutput += first.Key + "," + first.Value; foreach (KeyValuePair <string, string> pair in obj.Errors.Skip(1)) { erroroutput += Environment.NewLine; erroroutput += pair.Key + "," + pair.Value; } return(erroroutput); }
public PaymentVoucherDetail CreateObject(int paymentVoucherId, int payableId, decimal amount, string description, IPaymentVoucherService _paymentVoucherService, ICashBankService _cashBankService, IPayableService _payableService) { PaymentVoucherDetail paymentVoucherDetail = new PaymentVoucherDetail { PaymentVoucherId = paymentVoucherId, PayableId = payableId, Amount = amount, Description = description, }; return(this.CreateObject(paymentVoucherDetail, _paymentVoucherService, _cashBankService, _payableService)); }
public PaymentVoucherDetail VUniquePayableId(PaymentVoucherDetail paymentVoucherDetail, IPaymentVoucherDetailService _paymentVoucherDetailService, IPayableService _payableService) { IList <PaymentVoucherDetail> paymentVoucherDetails = _paymentVoucherDetailService.GetObjectsByPaymentVoucherId(paymentVoucherDetail.PaymentVoucherId); Payable payable = _payableService.GetObjectById(paymentVoucherDetail.PayableId); foreach (var detail in paymentVoucherDetails) { if (detail.PayableId == paymentVoucherDetail.PayableId && detail.Id != paymentVoucherDetail.Id) { paymentVoucherDetail.Errors.Add("Generic", "PayableId harus unique dibandingkan payment voucher details di dalam satu payment voucher"); return(paymentVoucherDetail); } } return(paymentVoucherDetail); }
public CustomPurchaseInvoice PaidObject(CustomPurchaseInvoice customPurchaseInvoice, decimal AmountPaid, ICashBankService _cashBankService, IPayableService _payableService, IPaymentVoucherService _paymentVoucherService, IPaymentVoucherDetailService _paymentVoucherDetailService, IContactService _contactService, ICashMutationService _cashMutationService, IGeneralLedgerJournalService _generalLedgerJournalService, IAccountService _accountService, IClosingService _closingService) { customPurchaseInvoice.AmountPaid = AmountPaid; if (_validator.ValidPaidObject(customPurchaseInvoice, _cashBankService, _paymentVoucherService, _closingService)) { CashBank cashBank = _cashBankService.GetObjectById((int)customPurchaseInvoice.CashBankId.GetValueOrDefault()); customPurchaseInvoice.IsBank = cashBank.IsBank; if (!customPurchaseInvoice.IsGBCH) { customPurchaseInvoice.GBCH_No = null; customPurchaseInvoice.Description = null; } if (customPurchaseInvoice.AmountPaid == customPurchaseInvoice.Total) { customPurchaseInvoice.IsFullPayment = true; } Payable payable = _payableService.GetObjectBySource(Core.Constants.Constant.PayableSource.CustomPurchaseInvoice, customPurchaseInvoice.Id); payable.AllowanceAmount = customPurchaseInvoice.Allowance; payable.RemainingAmount = payable.Amount - customPurchaseInvoice.Allowance; _payableService.UpdateObject(payable); PaymentVoucher paymentVoucher = _paymentVoucherService.CreateObject((int)customPurchaseInvoice.CashBankId.GetValueOrDefault(), customPurchaseInvoice.ContactId, DateTime.Now, customPurchaseInvoice.AmountPaid.GetValueOrDefault() /*payable.RemainingAmount*/, customPurchaseInvoice.IsGBCH, (DateTime)customPurchaseInvoice.DueDate.GetValueOrDefault(), customPurchaseInvoice.IsBank, _paymentVoucherDetailService, _payableService, _contactService, _cashBankService); PaymentVoucherDetail paymentVoucherDetail = _paymentVoucherDetailService.CreateObject(paymentVoucher.Id, payable.Id, customPurchaseInvoice.AmountPaid.GetValueOrDefault(), "Automatic Payment", _paymentVoucherService, _cashBankService, _payableService); customPurchaseInvoice = _repository.PaidObject(customPurchaseInvoice); _generalLedgerJournalService.CreatePaidJournalForCustomPurchaseInvoice(customPurchaseInvoice, _accountService); _paymentVoucherService.ConfirmObject(paymentVoucher, (DateTime)customPurchaseInvoice.ConfirmationDate.GetValueOrDefault(), _paymentVoucherDetailService, _cashBankService, _payableService, _cashMutationService, _generalLedgerJournalService, _accountService, _closingService); } return(customPurchaseInvoice); }
public PaymentVoucherDetail UnconfirmObject(PaymentVoucherDetail paymentVoucherDetail, IPaymentVoucherService _paymentVoucherService, IPayableService _payableService) { if (_validator.ValidUnconfirmObject(paymentVoucherDetail)) { PaymentVoucher paymentVoucher = _paymentVoucherService.GetObjectById(paymentVoucherDetail.PaymentVoucherId); Payable payable = _payableService.GetObjectById(paymentVoucherDetail.PayableId); if (paymentVoucher.IsGBCH) { payable.PendingClearanceAmount -= paymentVoucherDetail.Amount; } payable.RemainingAmount += paymentVoucherDetail.Amount; if (payable.RemainingAmount != 0 || payable.PendingClearanceAmount != 0) { payable.IsCompleted = false; payable.CompletionDate = null; } _payableService.UpdateObject(payable); paymentVoucherDetail = _repository.UnconfirmObject(paymentVoucherDetail); } return(paymentVoucherDetail); }
public PaymentVoucherDetail VCreateObject(PaymentVoucherDetail paymentVoucherDetail, IPaymentVoucherService _paymentVoucherService, IPaymentVoucherDetailService _paymentVoucherDetailService, ICashBankService _cashBankService, IPayableService _payableService) { VHasPaymentVoucher(paymentVoucherDetail, _paymentVoucherService); if (!isValid(paymentVoucherDetail)) { return(paymentVoucherDetail); } VHasNotBeenConfirmed(paymentVoucherDetail); if (!isValid(paymentVoucherDetail)) { return(paymentVoucherDetail); } VHasNotBeenDeleted(paymentVoucherDetail); if (!isValid(paymentVoucherDetail)) { return(paymentVoucherDetail); } VHasPayable(paymentVoucherDetail, _payableService); if (!isValid(paymentVoucherDetail)) { return(paymentVoucherDetail); } VPayableHasNotBeenCompleted(paymentVoucherDetail, _payableService); if (!isValid(paymentVoucherDetail)) { return(paymentVoucherDetail); } VAmountLessOrEqualPayable(paymentVoucherDetail, _payableService); if (!isValid(paymentVoucherDetail)) { return(paymentVoucherDetail); } VUniquePayableId(paymentVoucherDetail, _paymentVoucherDetailService, _payableService); return(paymentVoucherDetail); }
public CashSalesReturn PaidObject(CashSalesReturn cashSalesReturn, /*decimal Allowance,*/ ICashBankService _cashBankService, IPayableService _payableService, IPaymentVoucherService _paymentVoucherService, IPaymentVoucherDetailService _paymentVoucherDetailService, IContactService _contactService, ICashMutationService _cashMutationService, IGeneralLedgerJournalService _generalLedgerJournalService, IAccountService _accountService, IClosingService _closingService) { if (_validator.ValidPaidObject(cashSalesReturn, _cashBankService)) { CashBank cashBank = _cashBankService.GetObjectById((int)cashSalesReturn.CashBankId.GetValueOrDefault()); //cashSalesReturn.Allowance = Allowance; Payable payable = _payableService.GetObjectBySource(Core.Constants.Constant.PayableSource.CashSalesReturn, cashSalesReturn.Id); payable.AllowanceAmount = cashSalesReturn.Allowance; payable.RemainingAmount = payable.Amount - payable.AllowanceAmount; _payableService.UpdateObject(payable); PaymentVoucher paymentVoucher = _paymentVoucherService.CreateObject((int)cashSalesReturn.CashBankId.GetValueOrDefault(), payable.ContactId, DateTime.Now, payable.RemainingAmount, false, payable.DueDate, cashBank.IsBank, _paymentVoucherDetailService, _payableService, _contactService, _cashBankService); PaymentVoucherDetail paymentVoucherDetail = _paymentVoucherDetailService.CreateObject(paymentVoucher.Id, payable.Id, payable.RemainingAmount, "Automatic Payment", _paymentVoucherService, _cashBankService, _payableService); _paymentVoucherService.ConfirmObject(paymentVoucher, (DateTime)cashSalesReturn.ConfirmationDate.GetValueOrDefault(), _paymentVoucherDetailService, _cashBankService, _payableService, _cashMutationService, _generalLedgerJournalService, _accountService, _closingService); cashSalesReturn = _repository.PaidObject(cashSalesReturn); } return(cashSalesReturn); }
public bool ValidConfirmObject(PaymentVoucherDetail paymentVoucherDetail, IPayableService _payableService) { VConfirmObject(paymentVoucherDetail, _payableService); return(isValid(paymentVoucherDetail)); }
public bool ValidUnconfirmObject(PaymentVoucherDetail paymentVoucherDetail) { VUnconfirmObject(paymentVoucherDetail); return(isValid(paymentVoucherDetail)); }
public PaymentVoucherDetail SoftDeleteObject(PaymentVoucherDetail paymentVoucherDetail) { return(_validator.ValidDeleteObject(paymentVoucherDetail) ? _repository.SoftDeleteObject(paymentVoucherDetail) : paymentVoucherDetail); }
public PaymentVoucherDetail UpdateObject(PaymentVoucherDetail paymentVoucherDetail, IPaymentVoucherService _paymentVoucherService, ICashBankService _cashBankService, IPayableService _payableService) { return(_validator.ValidUpdateObject(paymentVoucherDetail, _paymentVoucherService, this, _cashBankService, _payableService) ? _repository.UpdateObject(paymentVoucherDetail) : paymentVoucherDetail); }
public bool isValid(PaymentVoucherDetail obj) { bool isValid = !obj.Errors.Any(); return(isValid); }
void paymentrequest_validation() { it["validates_paymentrequest"] = () => { d.paymentRequest1.Errors.Count().should_be(0); }; it["paymentrequest_without_contact"] = () => { PaymentRequest nocontact = new PaymentRequest() { RequestedDate = DateTime.Now, Description = "Tanpa Kontak", DueDate = DateTime.Today.AddDays(14), Amount = 200000, }; nocontact = d._paymentRequestService.CreateObject(nocontact, d._contactService); nocontact.Errors.Count().should_not_be(0); }; it["update_without_contact"] = () => { d.paymentRequest1.ContactId = 0; d.paymentRequest1 = d._paymentRequestService.UpdateObject(d.paymentRequest1, d._contactService); d.paymentRequest1.Errors.Count().should_not_be(0); }; context["when_paymentrequest_confirmed"] = () => { before = () => { d._paymentRequestService.ConfirmObject(d.paymentRequest1, DateTime.Now, d._payableService); d.paymentRequest1.Errors.Count().should_be(0); }; it["validates_confirmed_paymentrequest"] = () => { d.paymentRequest1.IsConfirmed.should_be_true(); }; it["update_after_confirmed"] = () => { d.paymentRequest1.Amount = 300000; d.paymentRequest1 = d._paymentRequestService.UpdateObject(d.paymentRequest1, d._contactService); d.paymentRequest1.Errors.Count().should_not_be(0); }; it["delete_after_confirmed"] = () => { d.paymentRequest1 = d._paymentRequestService.SoftDeleteObject(d.paymentRequest1); d.paymentRequest1.Errors.Count().should_not_be(0); }; it["unconfirm_paymentrequest"] = () => { d.paymentRequest1 = d._paymentRequestService.UnconfirmObject(d.paymentRequest1, d._paymentVoucherDetailService, d._payableService); d.paymentRequest1.Errors.Count().should_be(0); }; it["unconfirm_after_payable_have_paymentvoucherdetail"] = () => { PaymentVoucher paymentVoucher = d._paymentVoucherService.CreateObject(d.cashBank1.Id, d.contact.Id, DateTime.Now, d.paymentRequest1.Amount, false, d.paymentRequest1.DueDate, d.cashBank1.IsBank, d._paymentVoucherDetailService, d._payableService, d._contactService, d._cashBankService); Payable payable = d._payableService.GetObjectBySource(Core.Constants.Constant.PayableSource.PaymentRequest, d.paymentRequest1.Id); PaymentVoucherDetail paymentVoucherDetail = d._paymentVoucherDetailService.CreateObject(paymentVoucher.Id, payable.Id, payable.Amount, "Pembayaran Listrik", d._paymentVoucherService, d._cashBankService, d._payableService); d.paymentRequest1 = d._paymentRequestService.UnconfirmObject(d.paymentRequest1, d._paymentVoucherDetailService, d._payableService); d.paymentRequest1.Errors.Count().should_not_be(0); }; }; it["delete_paymentrequest"] = () => { d.paymentRequest1 = d._paymentRequestService.SoftDeleteObject(d.paymentRequest1); d.paymentRequest1.Errors.Count().should_be(0); }; }