示例#1
0
        private void CreateVATTypes()
        {
            VATType vatType = ObjectSpace.FindObject <VATType>(null);

            if (vatType == null)
            {
                CreateVATType("Non-item based sales.", "NoVAT", 0);
                CreateVATType("Old Standard Rate(14.00%)", "OldStandardRate", 0.14);
                CreateVATType("Standard Rate(15.00%)", "StandardRate", 0.15);
                CreateVATType("Standard Rate(Capital Goods)(15.00%)", "StandardRateCapitalGoods", 0.15);
                CreateVATType("Old Standard Rate(Capital Goods)(14.00%)", "OldStandardRateCapitalGoods", 0.14);
                CreateVATType("Zero Rate(00.00%)", "ZeroRate", 0);
                CreateVATType("Zero Rate Export(00.00%)", "ZeroRateExport", 0);
                CreateVATType("Exempt And Non Supplies(14.00%)", "ExemptAndNonSupplies", 0.14);
                CreateVATType("Old Export Of Second Hand Goods(15.00%)", "OldExportOfSecondHandGoods", 0.15);
                CreateVATType("Export Of Second Hand Goods(15.00%)", "ExportOfSecondHandGoods", 0.15);
                CreateVATType("Change In Use(15.00%)", "ChangeInUse", 0.15);
                CreateVATType("Old Change In Use(14.00%)", "OldChangeInUse", 0.14);
                CreateVATType("Goods And Services Imported(100.00%)", "GoodsAndServicesImported", 100);
                CreateVATType("Capital Goods Imported(100.00%)", "CapitalGoodsImported", 100);
                CreateVATType("VAT Adjustments(100.00%)", "VATAdjustments", 100);
                CreateVATType("Manual VAT", "ManualVAT", 0);
                CreateVATType("Manual VAT(Capital Goods)", "ManualVATCapitalGoods", 0);
            }
        }
示例#2
0
 public Product(int productId, string productName, double priceSalesExclusive, VATType taxVATTypeId, bool imported)
 {
     ProductId           = productId;
     ProductName         = productName;
     PriceSalesExclusive = priceSalesExclusive;
     TaxVATTypeId        = taxVATTypeId;
     Imported            = imported;
 }
示例#3
0
        private void CreateVATType(string description, string name, double value)
        {
            VATType vATType = ObjectSpace.CreateObject <VATType>();

            vATType.Description = description;
            vATType.Name        = name;
            vATType.Value       = value;
            vATType.Save();
            vATType.Session.CommitTransaction();
        }
示例#4
0
        /// <summary>
        /// Get the configuration value for a given tax rate
        /// </summary>
        /// <param name="vatType">The tax rate to retrieve the configuration for</param>
        /// <returns></returns>
        public static double GetVATTaxRate(VATType vatType)
        {
            switch (vatType)
            {
            case VATType.Exempt:
                return(SalesTaxesCalculator.Taxes.Default.ExemptTaxRate);

            case VATType.Reduced:
                break;

            case VATType.Basic:
                return(SalesTaxesCalculator.Taxes.Default.BasicTaxRate);
            }

            return(0);
        }
示例#5
0
 protected virtual string GetVATSum(VATType vat)
 {
     return(FormatEuro(invoice.Items.Where(i => i.VATType == vat).Sum(i => i.Amount - i.AmountNet)));
 }
示例#6
0
 protected virtual string GetVATDescription(VATType vat)
 {
     return(Format(string.Format(SalesInvoiceResources.VATDescription, vat.Description)));
 }