public InvoiceLineType AddTax(TaxTypeCodeType taxTypeCode, double taxRate) { if (this.TaxesOutputs == null) { this.TaxesOutputs = new InvoiceLineTypeTax[] { } } ; var taxableBase = this.UnitPriceWithoutTax.Value * this.Quantity; var tax = new InvoiceLineTypeTax(); tax.TaxTypeCode = taxTypeCode; tax.TaxRate = new DoubleTwoDecimalType(taxRate); tax.TaxableBase = new AmountType() { TotalAmount = new DoubleTwoDecimalType(taxableBase) }; tax.TaxAmount = new AmountType() { TotalAmount = new DoubleTwoDecimalType(taxableBase * taxRate / 100) }; this.TaxesOutputs = this.TaxesOutputs.Concat(new InvoiceLineTypeTax[] { tax }).ToArray(); return(this); }
public InvoiceLineType GiveTax(double taxRate) { if (this.TaxesOutputs == null) { this.TaxesOutputs = new List <InvoiceLineTypeTax>(); } var tax = new InvoiceLineTypeTax { TaxTypeCode = TaxTypeCodeType.Item01 , TaxRate = taxRate }; this.TaxesOutputs.Add(tax); return(this); }
public InvoiceLineType AddTax(TaxTypeCodeType taxTypeCode, double taxRate) { if (this.TaxesOutputs == null) this.TaxesOutputs = new InvoiceLineTypeTax[] { }; var taxableBase = this.UnitPriceWithoutTax.Value * this.Quantity; var tax = new InvoiceLineTypeTax(); tax.TaxTypeCode = taxTypeCode; tax.TaxRate = new DoubleTwoDecimalType(taxRate); tax.TaxableBase = new AmountType() { TotalAmount = new DoubleTwoDecimalType(taxableBase) }; tax.TaxAmount = new AmountType() { TotalAmount = new DoubleTwoDecimalType(taxableBase * taxRate / 100) }; this.TaxesOutputs = this.TaxesOutputs.Concat(new InvoiceLineTypeTax[] { tax }).ToArray(); return this; }
public InvoiceLineType GiveTax(double taxRate) { if (this.TaxesOutputs == null) { this.TaxesOutputs = new List<InvoiceLineTypeTax>(); } var tax = new InvoiceLineTypeTax { TaxTypeCode = TaxTypeCodeType.Item01 , TaxRate = taxRate }; this.TaxesOutputs.Add(tax); return this; }