public PaymentBuilder WithId(long id) { IdType idType = new IdType(); idType.Value = id.ToString(); _payment.Id = idType; return this; }
public ItemBuilder WithId(long id) { IdType idType = new IdType(); idType.Value = id.ToString(); _item.Id = idType; return this; }
public ItemBuilder() { _item = new Item(); _item.Name = "Pencils"; _item.Desc = "Pencils HB"; _item.Taxable = true; _item.TaxableSpecified = true; Money unitPrice = new Money(); unitPrice.Amount = decimal.Parse("2"); unitPrice.AmountSpecified = true; _item.UnitPrice = unitPrice; AccountRef incomeAccountRef = new AccountRef(); IdType accountId = new IdType(); accountId.Value = "30"; incomeAccountRef.AccountId = accountId; _item.IncomeAccountRef = incomeAccountRef; _item.PurchaseDesc = "500 pencils purchased"; Money purchaseCost = new Money(); purchaseCost.Amount = Decimal.Parse("1"); purchaseCost.AmountSpecified = true; _item.PurchaseCost = purchaseCost; AccountRef expenseAccountRef = new AccountRef(); IdType expenseAccountId = new IdType(); expenseAccountId.Value = "30"; expenseAccountRef.AccountId = expenseAccountId; _item.ExpenseAccountRef = expenseAccountRef; }
public InvoiceBuilder() { _invoice = new Invoice(); InvoiceHeader invoiceHeader = new InvoiceHeader(); invoiceHeader.DocNumber = "000101"; invoiceHeader.Msg = "No Black Ink Pens"; invoiceHeader.Note = "Blue Ink pens only"; IdType customerId = new IdType(); customerId.Value = "5"; invoiceHeader.CustomerId = customerId; invoiceHeader.SubTotalAmt = decimal.Parse("200.00"); invoiceHeader.SubTotalAmtSpecified = true; invoiceHeader.TotalAmt = decimal.Parse("298.75"); invoiceHeader.TotalAmtSpecified = true; invoiceHeader.BillEmail = "*****@*****.**"; invoiceHeader.ItemElementName = ItemChoiceType2.DiscountAmt; invoiceHeader.Item = decimal.Parse("-1.25"); invoiceHeader.TxnDate = DateTime.Parse("2010-08-07"); invoiceHeader.TxnDateSpecified = true; invoiceHeader.DueDate = DateTime.Parse("2010-08-16"); invoiceHeader.DueDateSpecified = true; _invoice.Header = invoiceHeader; InvoiceLine invoiceLine = new InvoiceLine(); invoiceLine.Desc = "Pens"; invoiceLine.Amount = decimal.Parse("200.00"); invoiceLine.AmountSpecified = true; invoiceLine.Taxable = true; invoiceLine.TaxableSpecified = true; IdType itemId = new IdType(); itemId.Value = "4"; object[] items = new object[3]; ItemsChoiceType2[] elementNames = new ItemsChoiceType2[3]; elementNames[0] = ItemsChoiceType2.ItemId; items[0] = itemId; elementNames[1] = ItemsChoiceType2.UnitPrice; items[1] = decimal.Parse("100"); ; elementNames[2] = ItemsChoiceType2.Qty; items[2] = decimal.Parse("4"); invoiceLine.ItemsElementName = elementNames; invoiceLine.Items = items; List<InvoiceLine> lines = new List<InvoiceLine>(); lines.Add(invoiceLine); _invoice.Line = lines.ToArray(); }
public PaymentBuilder() { _payment = new Payment(); PaymentHeader paymentHeader = new PaymentHeader(); paymentHeader.DocNumber = "54"; paymentHeader.Note = "Payment against Invoice"; IdType customerId = new IdType(); customerId.Value = "5"; paymentHeader.CustomerId = customerId; IdType depositAccountId = new IdType(); depositAccountId.Value = "41"; paymentHeader.DepositToAccountId = depositAccountId; IdType paymentMethodId = new IdType(); paymentMethodId.Value = "1"; paymentHeader.PaymentMethodId = paymentMethodId; paymentHeader.TotalAmt = decimal.Parse("20.00"); paymentHeader.TotalAmtSpecified = true; paymentHeader.ProcessPayment = false; paymentHeader.ProcessPaymentSpecified = true; paymentHeader.TxnDate = DateTime.Parse("2010-08-09"); paymentHeader.TxnDateSpecified = true; _payment.Header = paymentHeader; PaymentLine paymentLine = new PaymentLine(); IdType txnId = new IdType(); txnId.Value = "8"; paymentLine.TxnId = txnId; paymentLine.Amount = decimal.Parse("20.00"); paymentLine.AmountSpecified = true; List<PaymentLine> lines = new List<PaymentLine>(); lines.Add(paymentLine); _payment.Line = lines.ToArray(); }
public CustomerBuilder() { _customer = new Customer(); _customer.TypeOf = partyType.Person; _customer.Name = "John Doe"; _customer.FamilyName = "Doe"; _customer.GivenName = "John"; _customer.MiddleName = "J"; WebSiteAddress webSiteAddress = new WebSiteAddress(); webSiteAddress.URI = "http://www.digitalinsight.mint.com/"; List<WebSiteAddress> websites = new List<WebSiteAddress>(); websites.Add(webSiteAddress); _customer.WebSite = websites.ToArray(); _customer.DBAName = "Mint"; IdType salesTermId = new IdType(); salesTermId.Value = "5"; _customer.SalesTermId = salesTermId; EmailAddress emailAddress = new EmailAddress(); emailAddress.Address = "*****@*****.**"; List<EmailAddress> emails = new List<EmailAddress>(); emails.Add(emailAddress); _customer.Email = emails.ToArray(); PhysicalAddress address = new PhysicalAddress(); address.Line1 = "Park Avenue"; address.City = "Woodland Hills"; address.CountrySubDivisionCode = "CA"; address.PostalCode = "91367"; List<PhysicalAddress> addresses = new List<PhysicalAddress>(); addresses.Add(address); _customer.Address = addresses.ToArray(); }
public InvoiceBuilder WithId(long id) { IdType idType = new IdType(); idType.Value = id.ToString(); _invoice.Id = idType; return this; }
public InvoiceBuilder WithSalesTaxCodeId(string salesTaxCodeId) { IdType salesTaxCodeIdType = new IdType(); salesTaxCodeIdType.Value = salesTaxCodeId; salesTaxCodeIdType.idDomain = idDomainEnum.QBO; _invoice.Header.SalesTaxCodeId = salesTaxCodeIdType; return this; }
public CustomerBuilder WithId(long id) { IdType idType = new IdType(); idType.Value = id.ToString(); _customer.Id = idType; return this; }