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 ItemBuilder WithUnitPrice(decimal unitPriceValue) { Money unitPrice = new Money(); unitPrice.Amount = unitPriceValue; unitPrice.AmountSpecified = true; _item.UnitPrice = unitPrice; return this; }