예제 #1
0
 public double CalculateVAT(Customer customer, Supllier supllier)
 {
     if (supllier.IsVAT_TaxPayer)
     {
         if (customer.IsInEU)
         {
             if (!customer.IsVAT_TaxPayer && !(customer.Country2DigitCode == supllier.Country2DigitCode))
             {
                 VAT = GetVAT_Rate(customer.Country2DigitCode);
             }
             else if (customer.Country2DigitCode == supllier.Country2DigitCode)
             {
                 VAT = GetVAT_Rate(customer.Country2DigitCode);
             }
             else
             {
                 VAT = 0;
             }
         }
         else
         {
             VAT = 0;
         }
     }
     else
     {
         VAT = 0;
     }
     return(VAT);
 }
예제 #2
0
        public Invoice GetInvoice(Customer customer, Supllier supllier, double amount, VATService vatService)
        {
            _vatService = vatService;

            invoice = new Invoice()
            {
                VAT      = _vatService.CalculateVAT(customer, supllier),
                Amount   = amount,
                customer = customer,
                supllier = supllier
            };
            return(invoice);
        }