示例#1
0
 public InvoiceDto(string transactionType, string layout)
 {
     Layout          = layout;
     TransactionType = transactionType;
     TradingTerms    = new TradingTermsDto();
     QuickPayment    = new QuickPaymentDto();
 }
 public InvoiceDto(string transactionType, string layout)
 {
     Layout = layout;
     TransactionType = transactionType;
     TradingTerms = new TradingTermsDto();
     QuickPayment = new QuickPaymentDto();
 }
        public InvoiceDto GetItemSale()
        {
            InvoiceDto dto = new InvoiceDto(TransactionType.Sale, InvoiceLayout.Item);

            dto.Date = DateTime.Parse("6-Oct-05");
            dto.ContactUid = this.MrSmith.Uid;
            dto.Summary = "Test Insert Item Sale";
            dto.Notes = "From REST";
            dto.DueOrExpiryDate = DateTime.Parse("6-Nov-05");
            dto.Layout = InvoiceLayout.Item;
            dto.Status = InvoiceStatus.Invoice;
            dto.InvoiceNumber = "<Auto Number>";
            dto.PurchaseOrderNumber = "PO333";

            ItemInvoiceItemDto item = null;

            item = new ItemInvoiceItemDto();
            item.Quantity = 2;
            item.InventoryItemUid = this.AsusLaptop.Uid;
            item.Description = "Asus Laptop";
            item.TaxCode = TaxCode.SaleInclGst;
            item.UnitPriceInclTax = 1200.75M;
            item.PercentageDiscount = 12.50M;

            dto.Items.Add(item);

            item = new ItemInvoiceItemDto();
            item.Quantity = 5.125M;
            item.InventoryItemUid = this.Cat5Cable.Uid;
            item.Description = "Cat 5 Cable (in meter)";
            item.TaxCode = TaxCode.SaleGstFree;
            item.UnitPriceInclTax = 2.1234M;
            dto.Items.Add(item);

            item = new ItemInvoiceItemDto();
            item.Quantity = 3;
            item.InventoryItemUid = this.Cat5Cable.Uid;
            item.Description = "Cat 5 Cable (in meter)";
            item.TaxCode = TaxCode.SaleExports;
            item.UnitPriceInclTax = 5.125M;
            dto.Items.Add(item);

            QuickPaymentDto payment = new QuickPaymentDto();
            payment.DatePaid = dto.Date;
            payment.BankedToAccountUid = this.StGeorge.Uid;
            payment.Reference = "C-001-023";
            payment.Amount = 222.22M;

            dto.QuickPayment = payment;

            return dto;
        }
        public InvoiceDto GetServiceSale()
        {
            InvoiceDto dto = new InvoiceDto(TransactionType.Sale, InvoiceLayout.Service);

            dto.Date = DateTime.Parse("30-Sep-05");
            dto.ContactUid = this.MrSmith.Uid;
            dto.Summary = "Test POST sale";
            dto.Notes = "From REST";
            dto.DueOrExpiryDate = DateTime.Parse("1-Dec-05");
            dto.Status = "I";
            dto.InvoiceNumber = "<Auto Number>";
            dto.PurchaseOrderNumber = "PO222";
            dto.IsSent = false;

            ServiceInvoiceItemDto item = new ServiceInvoiceItemDto();
            item.Description = "Design & Development of REST WS";
            item.AccountUid = this.IncomeService.Uid;
            item.TaxCode = TaxCode.SaleInclGst;
            item.TotalAmountInclTax = 2132.51M;
            dto.Items.Add(item);

            item = new ServiceInvoiceItemDto();
            item.Description = "Subscription to XYZ";
            item.AccountUid = this.IncomeSubscription.Uid;
            item.TaxCode = TaxCode.SaleInclGst;
            item.TotalAmountInclTax = 11.22M;
            dto.Items.Add(item);

            QuickPaymentDto payment = new QuickPaymentDto();
            payment.DatePaid = dto.Date;
            payment.BankedToAccountUid = this.Westpac.Uid;
            payment.Reference = "CASH";
            payment.Summary = "Quick payment from NUnitTests.";
            payment.Amount = 100;

            dto.QuickPayment = payment;

            return dto;
        }
        public InvoiceDto GetAdjustmentNote()
        {
            InvoiceDto dto = new InvoiceDto(TransactionType.Sale, InvoiceLayout.Service);

            dto.Date = DateTime.Parse("30-Sep-05");
            dto.ContactUid = this.MrSmith.Uid;
            dto.Summary = "Test Adjustment Note";
            dto.Notes = "From REST";
            dto.DueOrExpiryDate = DateTime.Parse("31-Jan-2012");
            // Don't set the status. Use InvoiceType instead. Eventually, InvoiceStatus will be deprecated and replaced with InvoiceType.
            dto.InvoiceType = InvoiceType.AdjustmentNote;
            dto.InvoiceNumber = "<Auto Number>";
            dto.PurchaseOrderNumber = "PO222";
            dto.IsSent = false;

            ServiceInvoiceItemDto item = new ServiceInvoiceItemDto();
            item.Description = "Refund";
            item.AccountUid = this.IncomeService.Uid;
            item.TaxCode = TaxCode.SaleInclGst;
            item.TotalAmountInclTax = -1000M;
            dto.Items.Add(item);

            QuickPaymentDto payment = new QuickPaymentDto();
            payment.DatePaid = dto.Date;
            payment.BankedToAccountUid = this.Westpac.Uid;
            payment.Reference = "CASH";
            payment.Summary = "Quick payment from NUnitTests.";
            payment.Amount = -1000;

            dto.QuickPayment = payment;

            return dto;
        }
        public void InsertServiceSaleWithQuickPayment()
        {
            CrudProxy proxy = new InvoiceProxy();

            InvoiceDto dto1 = this.GetUnpaidServiceSale();
            QuickPaymentDto quickPayment = new QuickPaymentDto();
            quickPayment.DatePaid = DateTime.UtcNow;
            quickPayment.BankedToAccountUid = this.Westpac.Uid;
            quickPayment.Amount = 2143.73M;
            quickPayment.Summary = "Quick payment for sale.";

            dto1.QuickPayment = quickPayment;

            proxy.Insert(dto1);
        }
示例#7
0
 public InvoiceDto()
 {
     TradingTerms = new TradingTermsDto();
     QuickPayment = new QuickPaymentDto();
 }
 public InvoiceDto()
 {
     TradingTerms = new TradingTermsDto();
     QuickPayment = new QuickPaymentDto();
 }