Beispiel #1
0
        public async Task <IActionResult> DeleteAccountReceivableInterest([FromBody] AccountReceivableInterestView view)
        {
            AccountReceivableInterestModule invMod = new AccountReceivableInterestModule();
            AccountReceivableInterest       accountReceivableInterest = await invMod.AccountReceivableInterest.Query().MapToEntity(view);

            invMod.AccountReceivableInterest.DeleteAccountReceivableInterest(accountReceivableInterest).Apply();

            return(Ok(view));
        }
Beispiel #2
0
        public async Task TestAddUpdatDelete()
        {
            AddressBook addressBook = null;
            AccountReceivableInterestModule AccountReceivableInterestMod = new AccountReceivableInterestModule();
            Customer customer = await AccountReceivableInterestMod.Customer.Query().GetEntityById(3);

            AccountReceivable accountReceivable = await AccountReceivableInterestMod.AccountReceivable.Query().GetEntityById(12);

            if (customer != null)
            {
                addressBook = await AccountReceivableInterestMod.AddressBook.Query().GetEntityById(customer.AddressId);
            }

            AccountReceivableInterestView view = new AccountReceivableInterestView()
            {
                Amount              = 1M,
                InterestRate        = .035M,
                InterestFromDate    = DateTime.Parse("11/1/2019"),
                InterestToDate      = DateTime.Parse("12/7/2019"),
                DocNumber           = 12,
                PaymentTerms        = "Monthly",
                PaymentDueDate      = DateTime.Parse("12/31/2019"),
                CustomerId          = customer.CustomerId,
                CustomerName        = addressBook?.Name,
                AccountReceivableId = accountReceivable.AccountReceivableId,
                AcctRecDocType      = accountReceivable.AcctRecDocType
            };
            NextNumber nnNextNumber = await AccountReceivableInterestMod.AccountReceivableInterest.Query().GetNextNumber();

            view.AccountReceivableInterestNumber = nnNextNumber.NextNumberValue;

            AccountReceivableInterest accountReceivableInterest = await AccountReceivableInterestMod.AccountReceivableInterest.Query().MapToEntity(view);

            AccountReceivableInterestMod.AccountReceivableInterest.AddAccountReceivableInterest(accountReceivableInterest).Apply();

            AccountReceivableInterest newAccountReceivableInterest = await AccountReceivableInterestMod.AccountReceivableInterest.Query().GetEntityByNumber(view.AccountReceivableInterestNumber);

            Assert.NotNull(newAccountReceivableInterest);

            newAccountReceivableInterest.PaymentTerms = "Weekly";

            AccountReceivableInterestMod.AccountReceivableInterest.UpdateAccountReceivableInterest(newAccountReceivableInterest).Apply();

            AccountReceivableInterestView updateView = await AccountReceivableInterestMod.AccountReceivableInterest.Query().GetViewById(newAccountReceivableInterest.AcctRecInterestId);

            Assert.Same(updateView.PaymentTerms, "Weekly");
            AccountReceivableInterestMod.AccountReceivableInterest.DeleteAccountReceivableInterest(newAccountReceivableInterest).Apply();
            AccountReceivableInterest lookupAccountReceivableInterest = await AccountReceivableInterestMod.AccountReceivableInterest.Query().GetEntityById(view.AcctRecInterestId);

            Assert.Null(lookupAccountReceivableInterest);
        }
Beispiel #3
0
        public async Task <IActionResult> UpdateAccountReceivableInterest([FromBody] AccountReceivableInterestView view)
        {
            AccountReceivableInterestModule invMod = new AccountReceivableInterestModule();

            AccountReceivableInterest accountReceivableInterest = await invMod.AccountReceivableInterest.Query().MapToEntity(view);


            invMod.AccountReceivableInterest.UpdateAccountReceivableInterest(accountReceivableInterest).Apply();

            AccountReceivableInterestView retView = await invMod.AccountReceivableInterest.Query().GetViewById(accountReceivableInterest.AcctRecInterestId);


            return(Ok(retView));
        }
Beispiel #4
0
        public async Task <IActionResult> AddAccountReceivableInterest([FromBody] AccountReceivableInterestView view)
        {
            AccountReceivableInterestModule invMod = new AccountReceivableInterestModule();

            NextNumber nnAccountReceivableInterest = await invMod.AccountReceivableInterest.Query().GetNextNumber();

            view.AccountReceivableInterestNumber = nnAccountReceivableInterest.NextNumberValue;

            AccountReceivableInterest accountReceivableInterest = await invMod.AccountReceivableInterest.Query().MapToEntity(view);

            invMod.AccountReceivableInterest.AddAccountReceivableInterest(accountReceivableInterest).Apply();

            AccountReceivableInterestView newView = await invMod.AccountReceivableInterest.Query().GetViewByNumber(view.AccountReceivableInterestNumber);


            return(Ok(newView));
        }
Beispiel #5
0
 public IFluentAccountReceivableInterest DeleteAccountReceivableInterest(AccountReceivableInterest deleteObject)
 {
     unitOfWork.accountReceivableInterestRepository.DeleteObject(deleteObject);
     this.processStatus = CreateProcessStatus.Delete;
     return(this as IFluentAccountReceivableInterest);
 }
Beispiel #6
0
 public IFluentAccountReceivableInterest AddAccountReceivableInterest(AccountReceivableInterest newObject)
 {
     unitOfWork.accountReceivableInterestRepository.AddObject(newObject);
     this.processStatus = CreateProcessStatus.Insert;
     return(this as IFluentAccountReceivableInterest);
 }