public async Task <IActionResult> DeleteAccountReceivableFee([FromBody] AccountReceivableFeeView view) { AccountReceivableFeeModule invMod = new AccountReceivableFeeModule(); AccountReceivableFee accountReceivableFee = await invMod.AccountReceivableFee.Query().MapToEntity(view); invMod.AccountReceivableFee.DeleteAccountReceivableFee(accountReceivableFee).Apply(); return(Ok(view)); }
public override void MapAcctRecFeeEntity(ref AccountReceivableFee acctRecFee, AccountReceivableFlatView view) { //public decimal? FeeAmount { get; set; } acctRecFee.PaymentDueDate = view.PaymentDueDate; acctRecFee.CustomerId = view.CustomerId; acctRecFee.DocNumber = view.DocNumber ?? 0; acctRecFee.AcctRecDocType = view.AcctRecDocType; acctRecFee.AccountReceivableId = view.AccountReceivableId ?? 0; }
public async Task <IActionResult> AddAccountReceivableFee([FromBody] AccountReceivableFeeView view) { AccountReceivableFeeModule invMod = new AccountReceivableFeeModule(); NextNumber nnAccountReceivableFee = await invMod.AccountReceivableFee.Query().GetNextNumber(); view.AccountReceivableFeeNumber = nnAccountReceivableFee.NextNumberValue; AccountReceivableFee accountReceivableFee = await invMod.AccountReceivableFee.Query().MapToEntity(view); invMod.AccountReceivableFee.AddAccountReceivableFee(accountReceivableFee).Apply(); AccountReceivableFeeView newView = await invMod.AccountReceivableFee.Query().GetViewByNumber(view.AccountReceivableFeeNumber); return(Ok(newView)); }
public async Task TestAddUpdatDelete() { AddressBook addressBook = null; AccountReceivableFeeModule AccountReceivableFeeMod = new AccountReceivableFeeModule(); Customer customer = await AccountReceivableFeeMod.Customer.Query().GetEntityById(3); if (customer != null) { addressBook = await AccountReceivableFeeMod.AddressBook.Query().GetEntityById(customer.AddressId); } AccountReceivable accountReceivable = await AccountReceivableFeeMod.AccountReceivable.Query().GetEntityById(12); AccountReceivableFeeView view = new AccountReceivableFeeView() { FeeAmount = 25M, PaymentDueDate = DateTime.Parse("12/7/2019"), CustomerId = customer.CustomerId, CustomerName = addressBook?.Name, DocNumber = 12, AcctRecDocType = "INV", AccountReceivableId = accountReceivable.AccountReceivableId }; NextNumber nnNextNumber = await AccountReceivableFeeMod.AccountReceivableFee.Query().GetNextNumber(); view.AccountReceivableFeeNumber = nnNextNumber.NextNumberValue; AccountReceivableFee accountReceivableFee = await AccountReceivableFeeMod.AccountReceivableFee.Query().MapToEntity(view); AccountReceivableFeeMod.AccountReceivableFee.AddAccountReceivableFee(accountReceivableFee).Apply(); AccountReceivableFee newAccountReceivableFee = await AccountReceivableFeeMod.AccountReceivableFee.Query().GetEntityByNumber(view.AccountReceivableFeeNumber); Assert.NotNull(newAccountReceivableFee); newAccountReceivableFee.AcctRecDocType = "INV2"; AccountReceivableFeeMod.AccountReceivableFee.UpdateAccountReceivableFee(newAccountReceivableFee).Apply(); AccountReceivableFeeView updateView = await AccountReceivableFeeMod.AccountReceivableFee.Query().GetViewById(newAccountReceivableFee.AccountReceivableFeeId); Assert.Same(updateView.AcctRecDocType, "INV2"); AccountReceivableFeeMod.AccountReceivableFee.DeleteAccountReceivableFee(newAccountReceivableFee).Apply(); AccountReceivableFee lookupAccountReceivableFee = await AccountReceivableFeeMod.AccountReceivableFee.Query().GetEntityById(view.AccountReceivableFeeId); Assert.Null(lookupAccountReceivableFee); }
public IFluentAccountReceivableFee CreateLateFee(AccountReceivableFlatView view) { try { AccountReceivableFee acctRecFee = new AccountReceivableFee(); applicationViewFactory.MapAcctRecFeeEntity(ref acctRecFee, view); Task <Udc> feeUDCTask = unitOfWork.udcRepository.GetUdc("FEES", "TWO_WEEK_LATE"); Task.WaitAll(feeUDCTask); acctRecFee.FeeAmount = Decimal.Parse(feeUDCTask.Result.Value); AddAccountReceivableFee(acctRecFee); return(this as IFluentAccountReceivableFee); } catch (Exception ex) { throw new Exception("CreateLateFee", ex); } }
public IFluentAccountReceivableFee DeleteAccountReceivableFee(AccountReceivableFee deleteObject) { unitOfWork.accountReceivableFeeRepository.DeleteObject(deleteObject); this.processStatus = CreateProcessStatus.Delete; return(this as IFluentAccountReceivableFee); }
public IFluentAccountReceivableFee AddAccountReceivableFee(AccountReceivableFee newObject) { unitOfWork.accountReceivableFeeRepository.AddObject(newObject); this.processStatus = CreateProcessStatus.Insert; return(this as IFluentAccountReceivableFee); }
public abstract void MapAcctRecFeeEntity(ref AccountReceivableFee acctRecFee, AccountReceivableFlatView view);