Index: branches/Abonament/BazaReklam/ZamowieniaForm.cs
===================================================================
--- branches/Abonament/BazaReklam/ZamowieniaForm.cs (revision 754)
+++ branches/Abonament/BazaReklam/ZamowieniaForm.cs (revision 760)
@@ -304,5 +304,7 @@
                 }
 
-                List<IProduct> subscriptionsToInvoice = GetSubscriptionsToInvoice(productsWithOrder);
+                InvoicingType invoicingType = GetInvoicingType(zamowienie);
+
+                List<IProduct> subscriptionsToInvoice = GetSubscriptionsToInvoice(productsWithOrder, invoicingType);
 
                 WystawFakture(zamowienie, klient, subscriptionsToInvoice, false);
@@ -317,4 +319,18 @@
             {
                 Cursor = Cursors.Default;
+            }
+        }
+
+        private static InvoicingType GetInvoicingType(REKLAMADataSet.zamowieniaRow zamowienie)
+        {
+            switch (zamowienie.rodzajFakturowania)
+            {
+                case 0:
+                    return InvoicingType.OneMonth;
+                case 1:
+                    return InvoicingType.ThreeMonths;
+                default:
+                    return InvoicingType.All;
+
             }
         }
@@ -1399,5 +1415,7 @@
             try
             {
-                List<IProduct> subscriptionsToInvoice = GetSubscriptionsToInvoice(productsWithOrder);
+                InvoicingType invoicingType = GetInvoicingType(zamowienie);
+
+                List<IProduct> subscriptionsToInvoice = GetSubscriptionsToInvoice(productsWithOrder, invoicingType);
 
                 id = WystawFakture(zamowienie, klient, subscriptionsToInvoice, true);
@@ -1426,5 +1444,5 @@
         }
 
-        private List<IProduct> GetSubscriptionsToInvoice(List<IProduct> products)
+        private List<IProduct> GetSubscriptionsToInvoice(List<IProduct> products, InvoicingType invoicingType)
         {
             ProductRepository productRepository = new ProductRepository(ConnString.getConnString().Value);
@@ -1434,5 +1452,5 @@
             
             DateTime date = productRepository.FindFirstDateForInvoice(subscriptions);
-            List<IProduct> subscriptionsToInvoice = productRepository.FindProductsToInvoice(subscriptions, InvoicingType.ThreeMonths, date);
+            List<IProduct> subscriptionsToInvoice = productRepository.FindProductsToInvoice(subscriptions, invoicingType, date);
             return subscriptionsToInvoice;
         }
Index: branches/Abonament/BazaReklam/Classes/Repositories/ProductRepository.cs
===================================================================
--- branches/Abonament/BazaReklam/Classes/Repositories/ProductRepository.cs (revision 705)
+++ branches/Abonament/BazaReklam/Classes/Repositories/ProductRepository.cs (revision 760)
@@ -41,5 +41,5 @@
         public List<IProduct> FindProductsToInvoice(List<IProduct> products, InvoicingType invoicingType, DateTime date)
         {
-            string query = "SELECT PD.Id, P.Id, PD.Price, PD.PricePLN, PD.Vat, PD.InvoiceId, [Year], [Month] FROM SubscriptionDetail PD "
+            string query = "SELECT PD.Id, P.Id, PD.Price, PD.PricePLN, P.Vat, PD.InvoiceId, [Year], [Month] FROM SubscriptionDetail PD "
                            + "INNER JOIN Subscription P ON P.Id=PD.SubscriptionId "
                            + "WHERE PD.InvoiceId IS NULL ";
Index: branches/Abonament/BazaReklam/Classes/Repositories/CustomerRepository.cs
===================================================================
--- branches/Abonament/BazaReklam/Classes/Repositories/CustomerRepository.cs (revision 706)
+++ branches/Abonament/BazaReklam/Classes/Repositories/CustomerRepository.cs (revision 760)
@@ -3,5 +3,4 @@
 using System.Data;
 using System.Data.SqlClient;
-using System.Diagnostics;
 using Baza_Reklam.Classes.Interfaces;
 using Baza_Reklam.Classes.Model;
@@ -45,6 +44,6 @@
                                  + "SELECT SCOPE_IDENTITY();";
 
-            const string insertSubscriptionDetailQuery = "INSERT INTO SubscriptionDetail(SubscriptionId, Price, PricePln, Vat, [Year], [Month]) "
-                                                         + "VALUES(@subscriptionId, @price, @pricePln, @vat, @year, @month) "
+            const string insertSubscriptionDetailQuery = "INSERT INTO SubscriptionDetail(SubscriptionId, Price, PricePln, [Year], [Month]) "
+                                                         + "VALUES(@subscriptionId, @price, @pricePln, @year, @month) "
                                                          + "SELECT SCOPE_IDENTITY();";
 
@@ -91,5 +90,4 @@
                         sqlCommand.Parameters.AddWithValue("@price", subscriptionDetail.Price);
                         sqlCommand.Parameters.AddWithValue("@pricePln", subscriptionDetail.PricePln);
-                        sqlCommand.Parameters.AddWithValue("@vat", subscriptionDetail.Vat);
                         sqlCommand.Parameters.AddWithValue("@year", subscriptionDetail.Year);
                         sqlCommand.Parameters.AddWithValue("@month", subscriptionDetail.Month);
Index: branches/Abonament/BazaReklam/Classes/Model/Subscription.cs
===================================================================
--- branches/Abonament/BazaReklam/Classes/Model/Subscription.cs (revision 706)
+++ branches/Abonament/BazaReklam/Classes/Model/Subscription.cs (revision 760)
@@ -35,35 +35,8 @@
         }
 
-        public Subscription(int id, Guid guid, int customerId, int titleId, int subscriptionTypeId, int subscriptionItems, decimal basePrice, decimal totalPrice, decimal discount, decimal vat, string currency, int orderId, DateTime createdOn, int createdBy, DateTime updatedOn, int updatedBy, DateTime startDate)
-        {
-            _id = id;
-            _titleId = titleId;
-            _startDate = startDate;
-            _updatedBy = updatedBy;
-            _updatedOn = updatedOn;
-            _createdBy = createdBy;
-            _createdOn = createdOn;
-            _orderId = orderId;
-            _currency = currency;
-            _basePrice = basePrice;
-            _totalPrice = totalPrice;
-            _vat = vat;
-            _discount = discount;
-            _subscriptionItems = subscriptionItems;
-            _subscriptionTypeId = subscriptionTypeId;
-            _customerId = customerId;
-            _guid = guid;
-        }
-
         public int Id
         {
             get { return _id; }
             //set { _id = value; }
-        }
-
-        public int TitleId
-        {
-            get { return _titleId; }
-            set { _titleId = value; }
         }
 
Index: branches/Abonament/BazaReklam/Classes/Model/SubscriptionDetail.cs
===================================================================
--- branches/Abonament/BazaReklam/Classes/Model/SubscriptionDetail.cs (revision 703)
+++ branches/Abonament/BazaReklam/Classes/Model/SubscriptionDetail.cs (revision 760)
@@ -1,6 +1,2 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
 namespace Baza_Reklam.Classes.Model
 {
@@ -11,20 +7,6 @@
         private decimal _price;
         private decimal _pricePln;
-        private decimal _vat;
         private int _year;
         private int _month;
-
-        public SubscriptionDetail () { }
-
-        public SubscriptionDetail(int id, int subscriptionId, decimal price, decimal pricePln, decimal vat, int year, int month)
-        {
-            _id = id;
-            _month = month;
-            _year = year;
-            _vat = vat;
-            _pricePln = pricePln;
-            _price = price;
-            _subscriptionId = subscriptionId;
-        }
 
         public int Id
@@ -51,10 +33,4 @@
         }
 
-        public decimal Vat
-        {
-            get { return _vat; }
-            set { _vat = value; }
-        }
-
         public int Year
         {
Index: branches/Abonament/BazaReklam/SubscriptionForm.cs
===================================================================
--- branches/Abonament/BazaReklam/SubscriptionForm.cs (revision 706)
+++ branches/Abonament/BazaReklam/SubscriptionForm.cs (revision 760)
@@ -133,8 +133,7 @@
             subscription.Guid = Guid.NewGuid();
             subscription.SubscriptionTypeId = CurrentSubscriptionType.Id;
-            subscription.TitleId = CurrentSubscriptionType.TitleId;
             subscription.SubscriptionItems = (int)numSubscriptionCount.Value;
-
-            subscription.BasePrice = cbCurrency.SelectedItem.ToString() == "PLN"
+            subscription.Currency = cbCurrency.SelectedItem.ToString();
+            subscription.BasePrice = subscription.Currency == "PLN"
                                           ? Decimal.Parse(txtPricePln.Text)
                                           : Decimal.Parse(txtPriceEur.Text);
@@ -146,9 +145,8 @@
                                           : (decimal) VatHelper.EU00;
 
-            subscription.TotalPrice = cbCurrency.SelectedItem.ToString() == "PLN"
+            subscription.TotalPrice = subscription.Currency == "PLN"
                                           ? Decimal.Parse(txtTotalPricePln.Text)
                                           : Decimal.Parse(txtTotalPriceEur.Text);
 
-            subscription.Currency = cbCurrency.SelectedItem.ToString();
             subscription.CreatedBy = User.Instance().Id;
             subscription.CreatedOn = DateTime.Now;
@@ -164,7 +162,4 @@
                 subscriptionDetail.Price = subscription.BasePrice * (1 - subscription.Discount);
                 subscriptionDetail.PricePln = Decimal.Parse(txtPricePln.Text) * (1 - subscription.Discount);
-
-                subscriptionDetail.Vat = subscription.Vat;
-
                 subscription.AddSubscriptionDetail(subscriptionDetail);
             }
