コード例 #1
0
        public InvoiceDto GetServiceSale2()
        {
            InvoiceDto dto = new InvoiceDto(TransactionType.Sale, InvoiceLayout.Service);

            dto.Date                = DateTime.Parse("15-Sep-05");
            dto.ContactUid          = this.MrsSmith.Uid;
            dto.Summary             = "Service Sale 2";
            dto.DueOrExpiryDate     = DateTime.Parse("15-Dec-05");
            dto.InvoiceNumber       = "<Auto Number>";
            dto.PurchaseOrderNumber = "PO123456789";

            ServiceInvoiceItemDto item = new ServiceInvoiceItemDto();

            item.Description        = "LINE 1 LINE 1 LINE 1";
            item.AccountUid         = this.IncomeService.Uid;
            item.TaxCode            = TaxCode.SaleExports;
            item.TotalAmountInclTax = 12345.12M;
            dto.Items.Add(item);

            item                    = new ServiceInvoiceItemDto();
            item.Description        = "Testing";
            item.AccountUid         = this.IncomeHardwareSales.Uid;
            item.TaxCode            = TaxCode.SaleAdjustments;
            item.TotalAmountInclTax = -123.9M;
            dto.Items.Add(item);

            item                    = new ServiceInvoiceItemDto();
            item.Description        = "Testing";
            item.AccountUid         = this.IncomeShipping.Uid;
            item.TaxCode            = TaxCode.SaleInclGst;
            item.TotalAmountInclTax = 569.66M;
            dto.Items.Add(item);

            return(dto);
        }
コード例 #2
0
        public InvoiceDto GetUnpaidServiceSale()
        {
            InvoiceDto dto = new InvoiceDto(TransactionType.Sale, InvoiceLayout.Service);

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

            ServiceInvoiceItemDto item = new ServiceInvoiceItemDto();

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

            item                    = new ServiceInvoiceItemDto();
            item.Description        = "Testing";
            item.AccountUid         = this.IncomeMisc.Uid;
            item.TaxCode            = "G1,G3";
            item.TotalAmountInclTax = 11.22M;
            dto.Items.Add(item);

            return(dto);
        }
コード例 #3
0
        private InvoiceDto GetUnpaidServicePurchase(string PONumber = null)
        {
            InvoiceDto dto = new InvoiceDto(TransactionType.Purchase, InvoiceLayout.Service);

            dto.Date                = DateTime.Today.Date;
            dto.ContactUid          = this.MrSmith.Uid;
            dto.Summary             = "Test POST Purchase";
            dto.Notes               = "From REST";
            dto.DueOrExpiryDate     = dto.Date.AddMonths(1);
            dto.Status              = InvoiceStatus.Order;
            dto.PurchaseOrderNumber = "<Auto Number>";

            if (!string.IsNullOrWhiteSpace(PONumber))
            {
                dto.PurchaseOrderNumber = PONumber.Trim();
            }

            ServiceInvoiceItemDto item = new ServiceInvoiceItemDto();

            item.Description        = "Purchase - Line Item 1";
            item.AccountUid         = this.ExpenseOffice.Uid;
            item.TaxCode            = TaxCode.ExpInclGst;
            item.TotalAmountInclTax = 123.45M;
            dto.Items.Add(item);

            item             = new ServiceInvoiceItemDto();
            item.Description = "Purchase - Line Item 2";
            item.AccountUid  = this.ExpenseMisc.Uid;
            // item.TaxCode				= TaxCode.ExpInclGstPrivateNonDeductable;
            item.TotalAmountInclTax = 678.90M;
            dto.Items.Add(item);

            return(dto);
        }
コード例 #4
0
        private InvoiceDto GetServicePurchase()
        {
            var dto = new InvoiceDto(TransactionType.Purchase, InvoiceLayout.Service);

            dto.Date                = DateTime.Today.Date;
            dto.ContactUid          = MrSmith.Uid;
            dto.Summary             = "Test POST Purchase";
            dto.Notes               = "From REST";
            dto.DueOrExpiryDate     = dto.Date.AddMonths(1);
            dto.Status              = InvoiceStatus.Order;
            dto.PurchaseOrderNumber = "<Auto Number>";

            var item = new ServiceInvoiceItemDto();

            item.Description        = "Purchase - Line Item 1";
            item.AccountUid         = ExpenseOffice.Uid;
            item.TaxCode            = TaxCode.ExpInclGst;
            item.TotalAmountInclTax = 123.45M;
            dto.Items.Add(item);

            item             = new ServiceInvoiceItemDto();
            item.Description = "Purchase - Line Item 2";
            item.AccountUid  = ExpenseMisc.Uid;
            // item.TaxCode				= TaxCode.ExpInclGstPrivateNonDeductable;
            item.TotalAmountInclTax = 678.90M;
            dto.Items.Add(item);

            return(dto);
        }
コード例 #5
0
        protected static void AssertEqual(ServiceInvoiceItemDto expected, ServiceInvoiceItemDto actual, int index)
        {
            string msg = "Item index: " + index.ToString() + ". Different ";

            Assert.AreEqual(expected.Description, actual.Description, msg + "description.");
            Assert.AreEqual(expected.AccountUid, actual.AccountUid, msg + "account uid.");
            Assert.AreEqual(expected.TaxCode, actual.TaxCode, msg + "tax code.");
            Assert.AreEqual(expected.TotalAmountInclTax, actual.TotalAmountInclTax, msg + "totalAmountInclTax.");
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        public InvoiceDto GetServiceSale()
        {
            var dto = new InvoiceDto(TransactionType.Sale, InvoiceLayout.Service);

            dto.Date                = DateTime.Parse("30-Sep-05");
            dto.ContactUid          = 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;

            var item = new ServiceInvoiceItemDto();

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

            return(dto);
        }