コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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;
        }