Index: /Baza Reklam 2 - Faktury/FakturowaniePoznanKatowice.resx
===================================================================
--- /Baza Reklam 2 - Faktury/FakturowaniePoznanKatowice.resx (revision 106)
+++ /Baza Reklam 2 - Faktury/FakturowaniePoznanKatowice.resx (revision 106)
@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="rEKLAMADataSet.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="fAKTURYBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>153, 17</value>
+  </metadata>
+  <metadata name="fAKTURYTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>320, 17</value>
+  </metadata>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="usunFaktureButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        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
+        NtcaAI98DQAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <data name="wplataButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        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
+</value>
+  </data>
+  <metadata name="EKSPORT.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <data name="wydrukButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        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
+        gg==
+</value>
+  </data>
+  <metadata name="klienciTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>482, 17</value>
+  </metadata>
+  <metadata name="fakturA_DETAILSTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 54</value>
+  </metadata>
+  <metadata name="agencjeTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>221, 54</value>
+  </metadata>
+  <metadata name="kontaTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>378, 54</value>
+  </metadata>
+  <metadata name="wplatyTableAdapter.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>523, 54</value>
+  </metadata>
+</root>
Index: /Baza Reklam 2 - Faktury/FakturowaniePoznanKatowice.Designer.cs
===================================================================
--- /Baza Reklam 2 - Faktury/FakturowaniePoznanKatowice.Designer.cs (revision 106)
+++ /Baza Reklam 2 - Faktury/FakturowaniePoznanKatowice.Designer.cs (revision 106)
@@ -0,0 +1,357 @@
+namespace Baza_Reklam
+{
+    partial class FakturowaniePoznanKatowice
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FakturowaniePoznanKatowice));
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
+            this.fakturaButton = new System.Windows.Forms.Button();
+            this.korektaButton = new System.Windows.Forms.Button();
+            this.rEKLAMADataSet = new Baza_Reklam.REKLAMADataSet();
+            this.fAKTURYBindingSource = new System.Windows.Forms.BindingSource(this.components);
+            this.fAKTURYTableAdapter = new Baza_Reklam.REKLAMADataSetTableAdapters.FAKTURYTableAdapter();
+            this.groupBox3 = new System.Windows.Forms.GroupBox();
+            this.dtpZmianaDaty = new System.Windows.Forms.DateTimePicker();
+            this.nrTygodniaUpDown = new System.Windows.Forms.NumericUpDown();
+            this.usunFaktureButton = new System.Windows.Forms.Button();
+            this.wplataButton = new System.Windows.Forms.Button();
+            this.fAKTURYDataGridView = new System.Windows.Forms.DataGridView();
+            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewCheckBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.dataGridViewTextBoxColumn29 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn31 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.dataGridViewTextBoxColumn37 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.EKSPORT = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.wydrukButton = new System.Windows.Forms.Button();
+            this.agencjaListBox = new System.Windows.Forms.ListBox();
+            this.klienciTableAdapter = new Baza_Reklam.REKLAMADataSetTableAdapters.KLIENCITableAdapter();
+            this.fakturA_DETAILSTableAdapter = new Baza_Reklam.REKLAMADataSetTableAdapters.FAKTURA_DETAILSTableAdapter();
+            this.agencjeTableAdapter = new Baza_Reklam.SLOWNIKDataSetTableAdapters.AGENCJETableAdapter();
+            this.kontaTableAdapter = new Baza_Reklam.SLOWNIKDataSetTableAdapters.KONTATableAdapter();
+            this.wplatyTableAdapter = new Baza_Reklam.REKLAMADataSetTableAdapters.WplatyTableAdapter();
+            ((System.ComponentModel.ISupportInitialize)(this.rEKLAMADataSet)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.fAKTURYBindingSource)).BeginInit();
+            this.groupBox3.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.nrTygodniaUpDown)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.fAKTURYDataGridView)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // fakturaButton
+            // 
+            this.fakturaButton.Location = new System.Drawing.Point(102, 290);
+            this.fakturaButton.Name = "fakturaButton";
+            this.fakturaButton.Size = new System.Drawing.Size(91, 37);
+            this.fakturaButton.TabIndex = 0;
+            this.fakturaButton.Text = "Wystaw fakturê";
+            this.fakturaButton.UseVisualStyleBackColor = true;
+            this.fakturaButton.Click += new System.EventHandler(this.fakturaButton_Click);
+            // 
+            // korektaButton
+            // 
+            this.korektaButton.Location = new System.Drawing.Point(199, 290);
+            this.korektaButton.Name = "korektaButton";
+            this.korektaButton.Size = new System.Drawing.Size(85, 37);
+            this.korektaButton.TabIndex = 1;
+            this.korektaButton.Text = "Wystaw korektê";
+            this.korektaButton.UseVisualStyleBackColor = true;
+            this.korektaButton.Click += new System.EventHandler(this.korektaButton_Click);
+            // 
+            // rEKLAMADataSet
+            // 
+            this.rEKLAMADataSet.DataSetName = "REKLAMADataSet";
+            this.rEKLAMADataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
+            // 
+            // fAKTURYBindingSource
+            // 
+            this.fAKTURYBindingSource.DataMember = "FAKTURY";
+            this.fAKTURYBindingSource.DataSource = this.rEKLAMADataSet;
+            // 
+            // fAKTURYTableAdapter
+            // 
+            this.fAKTURYTableAdapter.ClearBeforeFill = true;
+            // 
+            // groupBox3
+            // 
+            this.groupBox3.Controls.Add(this.dtpZmianaDaty);
+            this.groupBox3.Controls.Add(this.nrTygodniaUpDown);
+            this.groupBox3.Controls.Add(this.usunFaktureButton);
+            this.groupBox3.Controls.Add(this.wplataButton);
+            this.groupBox3.Controls.Add(this.fakturaButton);
+            this.groupBox3.Controls.Add(this.korektaButton);
+            this.groupBox3.Controls.Add(this.fAKTURYDataGridView);
+            this.groupBox3.Controls.Add(this.wydrukButton);
+            this.groupBox3.Location = new System.Drawing.Point(117, 12);
+            this.groupBox3.Name = "groupBox3";
+            this.groupBox3.Size = new System.Drawing.Size(479, 338);
+            this.groupBox3.TabIndex = 15;
+            this.groupBox3.TabStop = false;
+            this.groupBox3.Text = "Faktury";
+            // 
+            // dtpZmianaDaty
+            // 
+            this.dtpZmianaDaty.Format = System.Windows.Forms.DateTimePickerFormat.Short;
+            this.dtpZmianaDaty.Location = new System.Drawing.Point(15, 314);
+            this.dtpZmianaDaty.Name = "dtpZmianaDaty";
+            this.dtpZmianaDaty.Size = new System.Drawing.Size(80, 20);
+            this.dtpZmianaDaty.TabIndex = 14;
+            // 
+            // nrTygodniaUpDown
+            // 
+            this.nrTygodniaUpDown.Location = new System.Drawing.Point(15, 291);
+            this.nrTygodniaUpDown.Name = "nrTygodniaUpDown";
+            this.nrTygodniaUpDown.Size = new System.Drawing.Size(80, 20);
+            this.nrTygodniaUpDown.TabIndex = 13;
+            // 
+            // usunFaktureButton
+            // 
+            this.usunFaktureButton.Image = ((System.Drawing.Image)(resources.GetObject("usunFaktureButton.Image")));
+            this.usunFaktureButton.Location = new System.Drawing.Point(290, 291);
+            this.usunFaktureButton.Name = "usunFaktureButton";
+            this.usunFaktureButton.Size = new System.Drawing.Size(44, 37);
+            this.usunFaktureButton.TabIndex = 12;
+            this.usunFaktureButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.usunFaktureButton.UseVisualStyleBackColor = true;
+            this.usunFaktureButton.Click += new System.EventHandler(this.usunFaktureButton_Click);
+            // 
+            // wplataButton
+            // 
+            this.wplataButton.Image = ((System.Drawing.Image)(resources.GetObject("wplataButton.Image")));
+            this.wplataButton.Location = new System.Drawing.Point(340, 291);
+            this.wplataButton.Name = "wplataButton";
+            this.wplataButton.Size = new System.Drawing.Size(81, 36);
+            this.wplataButton.TabIndex = 11;
+            this.wplataButton.Text = "Wp³ata";
+            this.wplataButton.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
+            this.wplataButton.UseVisualStyleBackColor = true;
+            // 
+            // fAKTURYDataGridView
+            // 
+            this.fAKTURYDataGridView.AllowUserToAddRows = false;
+            this.fAKTURYDataGridView.AllowUserToDeleteRows = false;
+            dataGridViewCellStyle1.BackColor = System.Drawing.Color.MintCream;
+            this.fAKTURYDataGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
+            this.fAKTURYDataGridView.AutoGenerateColumns = false;
+            this.fAKTURYDataGridView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
+            this.fAKTURYDataGridView.BackgroundColor = System.Drawing.Color.White;
+            this.fAKTURYDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.dataGridViewTextBoxColumn2,
+            this.dataGridViewTextBoxColumn6,
+            this.dataGridViewTextBoxColumn7,
+            this.dataGridViewTextBoxColumn8,
+            this.dataGridViewCheckBoxColumn2,
+            this.dataGridViewTextBoxColumn29,
+            this.dataGridViewTextBoxColumn31,
+            this.dataGridViewTextBoxColumn37,
+            this.EKSPORT});
+            this.fAKTURYDataGridView.DataSource = this.fAKTURYBindingSource;
+            this.fAKTURYDataGridView.Location = new System.Drawing.Point(15, 19);
+            this.fAKTURYDataGridView.MultiSelect = false;
+            this.fAKTURYDataGridView.Name = "fAKTURYDataGridView";
+            this.fAKTURYDataGridView.ReadOnly = true;
+            this.fAKTURYDataGridView.RowHeadersWidth = 10;
+            this.fAKTURYDataGridView.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
+            this.fAKTURYDataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+            this.fAKTURYDataGridView.Size = new System.Drawing.Size(451, 266);
+            this.fAKTURYDataGridView.TabIndex = 8;
+            // 
+            // dataGridViewTextBoxColumn2
+            // 
+            this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.dataGridViewTextBoxColumn2.DataPropertyName = "NUMER";
+            this.dataGridViewTextBoxColumn2.HeaderText = "Nr";
+            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
+            this.dataGridViewTextBoxColumn2.ReadOnly = true;
+            this.dataGridViewTextBoxColumn2.Width = 50;
+            // 
+            // dataGridViewTextBoxColumn6
+            // 
+            this.dataGridViewTextBoxColumn6.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.dataGridViewTextBoxColumn6.DataPropertyName = "NUMER_ROZ";
+            this.dataGridViewTextBoxColumn6.HeaderText = "Agent";
+            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
+            this.dataGridViewTextBoxColumn6.ReadOnly = true;
+            this.dataGridViewTextBoxColumn6.Width = 65;
+            // 
+            // dataGridViewTextBoxColumn7
+            // 
+            this.dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.dataGridViewTextBoxColumn7.DataPropertyName = "NUMER_ROK";
+            this.dataGridViewTextBoxColumn7.HeaderText = "Rok";
+            this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
+            this.dataGridViewTextBoxColumn7.ReadOnly = true;
+            this.dataGridViewTextBoxColumn7.Width = 65;
+            // 
+            // dataGridViewTextBoxColumn8
+            // 
+            this.dataGridViewTextBoxColumn8.DataPropertyName = "DATA_WYSTAWIENIA";
+            this.dataGridViewTextBoxColumn8.HeaderText = "Data wystawienia";
+            this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
+            this.dataGridViewTextBoxColumn8.ReadOnly = true;
+            // 
+            // dataGridViewCheckBoxColumn2
+            // 
+            this.dataGridViewCheckBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.dataGridViewCheckBoxColumn2.DataPropertyName = "ZAPLACONO";
+            this.dataGridViewCheckBoxColumn2.HeaderText = "ZP";
+            this.dataGridViewCheckBoxColumn2.Name = "dataGridViewCheckBoxColumn2";
+            this.dataGridViewCheckBoxColumn2.ReadOnly = true;
+            this.dataGridViewCheckBoxColumn2.Width = 30;
+            // 
+            // dataGridViewTextBoxColumn29
+            // 
+            this.dataGridViewTextBoxColumn29.DataPropertyName = "suma_zaplat";
+            this.dataGridViewTextBoxColumn29.HeaderText = "Suma zap³at";
+            this.dataGridViewTextBoxColumn29.Name = "dataGridViewTextBoxColumn29";
+            this.dataGridViewTextBoxColumn29.ReadOnly = true;
+            // 
+            // dataGridViewTextBoxColumn31
+            // 
+            this.dataGridViewTextBoxColumn31.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.dataGridViewTextBoxColumn31.DataPropertyName = "KOREKTA";
+            this.dataGridViewTextBoxColumn31.HeaderText = "Kor.";
+            this.dataGridViewTextBoxColumn31.Name = "dataGridViewTextBoxColumn31";
+            this.dataGridViewTextBoxColumn31.ReadOnly = true;
+            this.dataGridViewTextBoxColumn31.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.dataGridViewTextBoxColumn31.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.dataGridViewTextBoxColumn31.Width = 25;
+            // 
+            // dataGridViewTextBoxColumn37
+            // 
+            this.dataGridViewTextBoxColumn37.DataPropertyName = "waluta_miano";
+            this.dataGridViewTextBoxColumn37.HeaderText = "Waluta";
+            this.dataGridViewTextBoxColumn37.Name = "dataGridViewTextBoxColumn37";
+            this.dataGridViewTextBoxColumn37.ReadOnly = true;
+            // 
+            // EKSPORT
+            // 
+            this.EKSPORT.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.EKSPORT.DataPropertyName = "EKSPORT";
+            this.EKSPORT.FalseValue = "";
+            this.EKSPORT.HeaderText = "EXP";
+            this.EKSPORT.Name = "EKSPORT";
+            this.EKSPORT.ReadOnly = true;
+            this.EKSPORT.TrueValue = "";
+            this.EKSPORT.Width = 30;
+            // 
+            // wydrukButton
+            // 
+            this.wydrukButton.Image = ((System.Drawing.Image)(resources.GetObject("wydrukButton.Image")));
+            this.wydrukButton.Location = new System.Drawing.Point(427, 291);
+            this.wydrukButton.Name = "wydrukButton";
+            this.wydrukButton.Size = new System.Drawing.Size(39, 36);
+            this.wydrukButton.TabIndex = 7;
+            this.wydrukButton.UseVisualStyleBackColor = true;
+            this.wydrukButton.Click += new System.EventHandler(this.wydrukButton_Click);
+            // 
+            // agencjaListBox
+            // 
+            this.agencjaListBox.FormattingEnabled = true;
+            this.agencjaListBox.Items.AddRange(new object[] {
+            "POZ",
+            "KAT",
+            "D2D"});
+            this.agencjaListBox.Location = new System.Drawing.Point(23, 22);
+            this.agencjaListBox.Name = "agencjaListBox";
+            this.agencjaListBox.Size = new System.Drawing.Size(64, 95);
+            this.agencjaListBox.TabIndex = 16;
+            this.agencjaListBox.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
+            // 
+            // klienciTableAdapter
+            // 
+            this.klienciTableAdapter.ClearBeforeFill = true;
+            // 
+            // fakturA_DETAILSTableAdapter
+            // 
+            this.fakturA_DETAILSTableAdapter.ClearBeforeFill = true;
+            // 
+            // agencjeTableAdapter
+            // 
+            this.agencjeTableAdapter.ClearBeforeFill = true;
+            // 
+            // kontaTableAdapter
+            // 
+            this.kontaTableAdapter.ClearBeforeFill = true;
+            // 
+            // wplatyTableAdapter
+            // 
+            this.wplatyTableAdapter.ClearBeforeFill = true;
+            // 
+            // FakturowaniePoznanKatowice
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(611, 358);
+            this.Controls.Add(this.agencjaListBox);
+            this.Controls.Add(this.groupBox3);
+            this.Name = "FakturowaniePoznanKatowice";
+            this.Text = "Fakturowanie - Poznañ - Katowice";
+            this.Load += new System.EventHandler(this.FakturowaniePoznanKatowice_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.rEKLAMADataSet)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.fAKTURYBindingSource)).EndInit();
+            this.groupBox3.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.nrTygodniaUpDown)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.fAKTURYDataGridView)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button fakturaButton;
+        private System.Windows.Forms.Button korektaButton;
+        private REKLAMADataSet rEKLAMADataSet;
+        private System.Windows.Forms.BindingSource fAKTURYBindingSource;
+        private Baza_Reklam.REKLAMADataSetTableAdapters.FAKTURYTableAdapter fAKTURYTableAdapter;
+        private System.Windows.Forms.GroupBox groupBox3;
+        private System.Windows.Forms.Button usunFaktureButton;
+        private System.Windows.Forms.Button wplataButton;
+        private System.Windows.Forms.DataGridView fAKTURYDataGridView;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn2;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn29;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewTextBoxColumn31;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn37;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn EKSPORT;
+        private System.Windows.Forms.Button wydrukButton;
+        private System.Windows.Forms.ListBox agencjaListBox;
+        private Baza_Reklam.REKLAMADataSetTableAdapters.KLIENCITableAdapter klienciTableAdapter;
+        private Baza_Reklam.REKLAMADataSetTableAdapters.FAKTURA_DETAILSTableAdapter fakturA_DETAILSTableAdapter;
+        private Baza_Reklam.SLOWNIKDataSetTableAdapters.AGENCJETableAdapter agencjeTableAdapter;
+        private Baza_Reklam.SLOWNIKDataSetTableAdapters.KONTATableAdapter kontaTableAdapter;
+        private System.Windows.Forms.NumericUpDown nrTygodniaUpDown;
+        private System.Windows.Forms.DateTimePicker dtpZmianaDaty;
+        private Baza_Reklam.REKLAMADataSetTableAdapters.WplatyTableAdapter wplatyTableAdapter;
+    }
+}
Index: /Baza Reklam 2 - Faktury/FakturowaniePoznanKatowice.cs
===================================================================
--- /Baza Reklam 2 - Faktury/FakturowaniePoznanKatowice.cs (revision 106)
+++ /Baza Reklam 2 - Faktury/FakturowaniePoznanKatowice.cs (revision 106)
@@ -0,0 +1,593 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using System.Globalization;
+using System.Data.SqlClient;
+
+namespace Baza_Reklam
+{
+    public partial class FakturowaniePoznanKatowice : Form
+    {
+        SLOWNIKDataSet.AGENCJERow agencjaPoznan;
+        SLOWNIKDataSet.AGENCJERow agencjaKatowice;
+        SLOWNIKDataSet.AGENCJERow agencjaRedakcja;
+        SLOWNIKDataSet.KONTARow konto;
+
+        REKLAMADataSet.KLIENCIRow klientPoznan;
+        REKLAMADataSet.KLIENCIRow klientKatowice;
+
+        public FakturowaniePoznanKatowice()
+        {
+            InitializeComponent();
+
+            this.fAKTURYTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
+            this.fakturA_DETAILSTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
+            this.klienciTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
+            this.agencjeTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
+            this.kontaTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
+            this.wplatyTableAdapter.Connection.ConnectionString = ConnString.getConnString().Value;
+
+            dtpZmianaDaty.Value = DateTime.Today;
+            dtpZmianaDaty.MaxDate = DateTime.Today;
+
+            nrTygodniaUpDown.Minimum = 1;
+            nrTygodniaUpDown.Maximum = 53;
+
+            CultureInfo ciCurr = CultureInfo.CurrentCulture;
+            int weekNum = ciCurr.Calendar.GetWeekOfYear(DateTime.Today, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
+
+            nrTygodniaUpDown.Value = weekNum;
+        }
+
+        private void FakturowaniePoznanKatowice_Load(object sender, EventArgs e)
+        {
+            agencjaPoznan = (SLOWNIKDataSet.AGENCJERow)this.agencjeTableAdapter.GetDataByIdAgencji(6)[0];
+            agencjaKatowice = (SLOWNIKDataSet.AGENCJERow)this.agencjeTableAdapter.GetDataByIdAgencji(4)[0];
+            agencjaRedakcja = (SLOWNIKDataSet.AGENCJERow)this.agencjeTableAdapter.GetDataByIdAgencji(2)[0];
+
+            konto = (SLOWNIKDataSet.KONTARow)this.kontaTableAdapter.GetDataById(43)[0];
+
+            klientKatowice = (REKLAMADataSet.KLIENCIRow)this.klienciTableAdapter.GetDataByCustomerId(678)[0];
+            klientPoznan = (REKLAMADataSet.KLIENCIRow)this.klienciTableAdapter.GetDataByCustomerId(18845)[0];
+        }
+
+        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (agencjaListBox.SelectedItem != null)
+            {
+                this.fAKTURYTableAdapter.FillByKodAgenta(this.rEKLAMADataSet.FAKTURY,
+                    agencjaListBox.SelectedItem.ToString());
+            }
+        }
+
+        private void fakturaButton_Click(object sender, EventArgs e)
+        {
+            REKLAMADataSet.FAKTURYRow naglowekFaktury = null;
+
+            try
+            {
+                switch (agencjaListBox.SelectedItem.ToString())
+                {
+                    case "POZ":
+                        naglowekFaktury = utworzNaglowekFaktury(klientPoznan, agencjaPoznan);
+                        break;
+                    case "KAT":
+                        naglowekFaktury = utworzNaglowekFaktury(klientKatowice, agencjaKatowice);
+                        break;
+                }
+
+                this.rEKLAMADataSet.FAKTURY.AddFAKTURYRow(naglowekFaktury);
+                utworzPozycjeFaktury(naglowekFaktury);
+                dodajWplate(naglowekFaktury);
+               
+                SqlConnection conn = new SqlConnection(ConnString.getConnString().Value);
+
+                fAKTURYTableAdapter.Connection = conn;
+                fakturA_DETAILSTableAdapter.Connection = conn;
+                wplatyTableAdapter.Connection = conn;
+
+                conn.Open();
+
+                SqlTransaction transaction = conn.BeginTransaction();
+                fAKTURYTableAdapter.AttachTransaction(transaction);
+                fakturA_DETAILSTableAdapter.AttachTransaction(transaction);
+                wplatyTableAdapter.AttachTransaction(transaction);
+
+                try
+                {
+                    fAKTURYTableAdapter.Update(this.rEKLAMADataSet.FAKTURY);
+                    fakturA_DETAILSTableAdapter.Update(this.rEKLAMADataSet.FAKTURA_DETAILS);
+                    wplatyTableAdapter.Update(this.rEKLAMADataSet.Wplaty);
+                    transaction.Commit();
+                    dtpZmianaDaty.Value = DateTime.Today;
+                }
+                catch (Exception e1)
+                {
+                    transaction.Rollback();
+                    conn.Close();
+                    this.rEKLAMADataSet.FAKTURA_DETAILS.Clear();
+                    this.rEKLAMADataSet.FAKTURY.RemoveFAKTURYRow(naglowekFaktury);
+                    this.fAKTURYBindingSource.ResetBindings(false);
+                    this.fAKTURYDataGridView.Refresh();
+                    throw e1;
+                }
+            }
+            catch (Exception e2)
+            {
+                MessageBox.Show("Wyst¹pi³ b³¹d: \n" + e2.ToString());
+            }
+            finally
+            {
+                this.rEKLAMADataSet.FAKTURA_DETAILS.Clear();
+                this.rEKLAMADataSet.Wplaty.Clear();
+                this.fAKTURYBindingSource.ResetBindings(false);
+                this.fAKTURYBindingSource.Sort = "NUMER";
+                this.fAKTURYDataGridView.Refresh();
+            }
+        }
+
+        private void korektaButton_Click(object sender, EventArgs e)
+        {
+              if (fAKTURYBindingSource.Current != null)
+            {
+                this.Cursor = Cursors.WaitCursor;
+
+                DataRowView row = (DataRowView)fAKTURYBindingSource.Current;
+                REKLAMADataSet.FAKTURYRow faktura = (REKLAMADataSet.FAKTURYRow)row.Row;
+                                
+                if (faktura.KOREKTA)
+                {
+                    MessageBox.Show("Nie mo¿na wystawiæ korekty do korekty");
+                    this.Cursor = Cursors.Default;
+                    return;
+                }
+
+                //sprawdzenie czy korekta nie byla juz wystawiona
+                if (!faktura.IsID_FK_KORNull())
+                {
+                    MessageBox.Show("Istnieje ju¿ faktura korekta");
+                 //   return;
+                }
+
+                try
+                {
+                    REKLAMADataSet.FAKTURYRow naglowekKorekty = null;
+
+                    switch (agencjaListBox.SelectedItem.ToString())
+                    {
+                        case "POZ":
+                            naglowekKorekty = utworzNaglowekKorekty(faktura);
+                            break;
+                        case "KAT":
+                            naglowekKorekty = utworzNaglowekKorekty(faktura);
+                            break;
+                    }
+
+                    utworzPozycjeFakturyKorekty(naglowekKorekty);
+
+                    if (!faktura.IsID_FK_KORNull())
+                    {
+                        naglowekKorekty.idFakturyKorekta = faktura.ID_FK_KOR;
+                    }
+            
+                    SqlConnection conn = new SqlConnection(ConnString.getConnString().Value);
+
+                    fAKTURYTableAdapter.Connection = conn;
+                    fakturA_DETAILSTableAdapter.Connection = conn;
+                    
+                    conn.Open();
+
+                    SqlTransaction transaction = conn.BeginTransaction();
+                    fAKTURYTableAdapter.AttachTransaction(transaction);
+                    fakturA_DETAILSTableAdapter.AttachTransaction(transaction);
+                    
+                    try
+                    {
+                        fAKTURYTableAdapter.Update(this.rEKLAMADataSet.FAKTURY);
+
+                        faktura.ID_FK_KOR = naglowekKorekty.ID_FAKTURY;
+                        faktura.EndEdit();
+
+                        fAKTURYTableAdapter.Update(this.rEKLAMADataSet.FAKTURY);
+
+                        fakturA_DETAILSTableAdapter.Update(this.rEKLAMADataSet.FAKTURA_DETAILS);
+                       
+                        transaction.Commit();
+                    }
+                    catch (Exception e1)
+                    {
+                        transaction.Rollback();
+                        conn.Close();
+                        throw e1;
+                    }
+                }
+                catch (Exception e2)
+                {
+                    MessageBox.Show("Wyst¹pi³ b³¹d: \n" + e2.ToString());
+                }
+                finally
+                {
+                    this.rEKLAMADataSet.FAKTURA_DETAILS.Clear();
+                    this.fAKTURYBindingSource.ResetBindings(false);
+                    this.fAKTURYDataGridView.Refresh();
+                }
+            }
+
+            this.Cursor = Cursors.Default;
+        }        
+
+        private REKLAMADataSet.FAKTURYRow utworzNaglowekKorekty(REKLAMADataSet.FAKTURYRow faktura)
+        {
+            REKLAMADataSet.FAKTURYRow naglowekKorekty = this.rEKLAMADataSet.FAKTURY.NewFAKTURYRow();
+            naglowekKorekty.KOREKTA = true;
+            //  naglowekKorekty.EKSPORT = true;
+
+            naglowekKorekty.idFakturyKorekta = faktura.ID_FAKTURY;
+            naglowekKorekty.idFakturyVAT = faktura.ID_FAKTURY;
+
+            naglowekKorekty.NUMER_ROZ = faktura.NUMER_ROZ; ;
+            naglowekKorekty.NUMER = Utils.numerNowejFakturyKorekty(naglowekKorekty.NUMER_ROZ, DateTime.Today.Year);
+            naglowekKorekty.NUMER_ROK = DateTime.Today.Year;
+            naglowekKorekty.DATA_WYSTAWIENIA = DateTime.Today;
+
+            naglowekKorekty.idZamowienia = 148;
+            naglowekKorekty.ID_SPRZEDAWCY = faktura.ID_SPRZEDAWCY;
+
+            naglowekKorekty.MIEJSCOWOSC_WYSTAWIENIA = faktura.MIEJSCOWOSC_WYSTAWIENIA;
+            naglowekKorekty.SPRZEDAWCA_ADRES = faktura.SPRZEDAWCA_ADRES;
+            naglowekKorekty.SPRZEDAWCA_NIP = faktura.SPRZEDAWCA_NIP;
+
+            naglowekKorekty.PODPIS_WYSTAWIL = faktura.PODPIS_WYSTAWIL;
+            naglowekKorekty.DATA_SPRZEDAZY = DateTime.Today;
+
+            naglowekKorekty.ID_NABYWCY = faktura.ID_NABYWCY;
+            naglowekKorekty.NABYWCA_ADRES = faktura.NABYWCA_ADRES;
+            naglowekKorekty.NABYWCA_NIP = faktura.NABYWCA_NIP;
+            naglowekKorekty.TERMIN_ZAPLATY = DateTime.Today.AddDays(30);
+            naglowekKorekty.opis = "rezygnacja z emisji reklamy";
+
+            naglowekKorekty.SPOSOB_ZAPLATY = faktura.SPOSOB_ZAPLATY;
+            
+            naglowekKorekty.ZAPLACONO = false;
+
+            naglowekKorekty.FAKTURA_TYP = 2;
+            naglowekKorekty.FAKTURA_PODTYP = 1;
+
+            naglowekKorekty.ID_KONTA = faktura.ID_KONTA;
+
+            this.rEKLAMADataSet.FAKTURY.AddFAKTURYRow(naglowekKorekty);
+
+            return naglowekKorekty;
+        }
+
+
+
+        private REKLAMADataSet.FAKTURYRow utworzNaglowekFaktury(REKLAMADataSet.KLIENCIRow klientAgencja, SLOWNIKDataSet.AGENCJERow agencja)
+        {
+            REKLAMADataSet.FAKTURYRow naglowekFaktury = (REKLAMADataSet.FAKTURYRow)this.rEKLAMADataSet.FAKTURY.NewRow();
+
+            naglowekFaktury.NUMER_ROZ = agencjaListBox.SelectedItem.ToString();
+            naglowekFaktury.NUMER = Utils.numerNowejFaktury(naglowekFaktury.NUMER_ROZ, DateTime.Today.Year);
+            naglowekFaktury.NUMER_ROK = DateTime.Today.Year;
+            naglowekFaktury.DATA_WYSTAWIENIA = DateTime.Today;
+            
+            if (dtpZmianaDaty.Value != DateTime.Today)
+            {
+                naglowekFaktury.DATA_WYSTAWIENIA = dtpZmianaDaty.Value;
+            }
+
+            naglowekFaktury.idZamowienia = 148;
+            naglowekFaktury.ID_SPRZEDAWCY = agencja.Id_agencji;
+
+            naglowekFaktury.EKSPORT = false;
+            
+            naglowekFaktury.MIEJSCOWOSC_WYSTAWIENIA = agencjaRedakcja.miasto;
+            naglowekFaktury.SPRZEDAWCA_ADRES = agencjaRedakcja.Adres_Fk;
+            naglowekFaktury.SPRZEDAWCA_NIP = agencjaRedakcja.NIP;
+
+            naglowekFaktury.PODPIS_WYSTAWIL = string.Empty;
+            naglowekFaktury.DATA_SPRZEDAZY = naglowekFaktury.DATA_WYSTAWIENIA;
+
+            naglowekFaktury.ID_NABYWCY = klientAgencja.CustomerID;
+            naglowekFaktury.NABYWCA_ADRES = klientAgencja.Adres_Fkatura;
+            naglowekFaktury.NABYWCA_NIP = klientAgencja.Nip;
+            naglowekFaktury.opis = string.Empty;
+
+            naglowekFaktury.SPOSOB_ZAPLATY = "Przelew";
+           
+            naglowekFaktury.TERMIN_ZAPLATY = naglowekFaktury.DATA_SPRZEDAZY.AddDays(30);
+            naglowekFaktury.ZAPLACONO = false;
+
+            naglowekFaktury.FAKTURA_TYP = 2;
+            naglowekFaktury.FAKTURA_PODTYP = 1;
+
+            naglowekFaktury.ID_KONTA = Convert.ToInt16(konto.id);
+
+            naglowekFaktury.EndEdit();
+            return naglowekFaktury;
+        }
+
+        private void utworzPozycjeFaktury(REKLAMADataSet.FAKTURYRow naglowekFaktury)
+        {
+            REKLAMADataSet.FAKTURA_DETAILSDataTable pozycjeFakturDlaKlientow =
+                this.fakturA_DETAILSTableAdapter.GetDataByNrTygodniaWRoku(
+                    dtpZmianaDaty.Value.Year, nrTygodniaUpDown.Value, naglowekFaktury.ID_SPRZEDAWCY);
+                        
+            REKLAMADataSet.FAKTURYDataTable naglowkiFakturDlaKlientow =
+                this.fAKTURYTableAdapter.GetDataByNrTygodniaWRoku(
+                    dtpZmianaDaty.Value.Year, nrTygodniaUpDown.Value, naglowekFaktury.ID_SPRZEDAWCY);
+
+            if (pozycjeFakturDlaKlientow.Rows.Count == 0 || naglowkiFakturDlaKlientow.Rows.Count == 0)
+            {
+                throw new Exception("Nie ma co fakturowaæ");
+            }
+        
+            foreach (REKLAMADataSet.FAKTURA_DETAILSRow pozycjaFaktury in pozycjeFakturDlaKlientow)
+            {
+                REKLAMADataSet.FAKTURA_DETAILSRow fakturaDetailsRow = this.rEKLAMADataSet.FAKTURA_DETAILS.NewFAKTURA_DETAILSRow();
+                REKLAMADataSet.FAKTURYRow faktura = naglowkiFakturDlaKlientow.FindByID_FAKTURY(pozycjaFaktury.ID_FAKTURY);
+
+                fakturaDetailsRow.ROK = pozycjaFaktury.ROK;
+                fakturaDetailsRow.MIESIAC = pozycjaFaktury.MIESIAC;
+                fakturaDetailsRow.TYTUL = pozycjaFaktury.TYTUL;
+                fakturaDetailsRow.NAZWA_USLUGI = faktura != null ? faktura.NUMER + "/" + faktura.NUMER_ROZ + "/" 
+                    + faktura.NUMER_ROK + " | " + pozycjaFaktury.NAZWA_USLUGI : "";
+                fakturaDetailsRow.reklamaId = pozycjaFaktury.reklamaId; 
+                fakturaDetailsRow.NR_WYDANIA = pozycjaFaktury.NR_WYDANIA;
+
+                fakturaDetailsRow.CENA_JEDN = pozycjaFaktury.CENA_JEDN;
+                fakturaDetailsRow.ILOSC = 1;
+                fakturaDetailsRow.JM = "szt.";
+
+                fakturaDetailsRow.UPUST_NETTO = pozycjaFaktury.UPUST_NETTO;
+                fakturaDetailsRow.UPUST_PR = pozycjaFaktury.UPUST_PR;
+                decimal netto = (1 - Convert.ToDecimal(pozycjaFaktury.UPUST_PR))
+                    * pozycjaFaktury.CENA_JEDN;
+                fakturaDetailsRow.NETTO = netto;
+                fakturaDetailsRow.S_VAT = 0.22;
+                decimal VAT = Convert.ToDecimal(0.22);
+                fakturaDetailsRow.VAT = Convert.ToDecimal(Math.Round(VAT * netto, 2));
+                fakturaDetailsRow.BRUTTO = Convert.ToDecimal(Math.Round((1 + VAT) * netto, 2));
+
+                fakturaDetailsRow.TYP = 2;
+                fakturaDetailsRow.PODTYP = 1;
+                fakturaDetailsRow.ID_FAKTURY = naglowekFaktury.ID_FAKTURY;
+
+                if (!pozycjaFaktury.IswyroznienieNull())
+                {
+                    if (pozycjaFaktury.wyroznienie)
+                    {
+                        fakturaDetailsRow.wyroznienie = true;
+                    }
+                }
+                
+                this.rEKLAMADataSet.FAKTURA_DETAILS.AddFAKTURA_DETAILSRow(fakturaDetailsRow);
+            }
+        }
+
+        private void utworzPozycjeFakturyKorekty(REKLAMADataSet.FAKTURYRow naglowekFaktury)
+        {
+
+            REKLAMADataSet.FAKTURA_DETAILSDataTable pozycjeFakturDlaKlientow =
+                this.fakturA_DETAILSTableAdapter.GetDataByNrTygodniaRokZKorekta(
+                    naglowekFaktury.ID_SPRZEDAWCY,dtpZmianaDaty.Value.Year, nrTygodniaUpDown.Value);
+
+            REKLAMADataSet.FAKTURYDataTable naglowkiFakturDlaKlientow =
+                this.fAKTURYTableAdapter.GetDataByNrTygodniaWRokuZKorekta(
+                    naglowekFaktury.ID_SPRZEDAWCY,dtpZmianaDaty.Value.Year, nrTygodniaUpDown.Value);
+
+            if (pozycjeFakturDlaKlientow.Rows.Count == 0 || naglowkiFakturDlaKlientow.Rows.Count == 0)
+            {
+                throw new Exception("Nie ma co fakturowaæ");
+            }
+
+            foreach (REKLAMADataSet.FAKTURA_DETAILSRow pozycjaFaktury in pozycjeFakturDlaKlientow)
+            {
+                REKLAMADataSet.FAKTURA_DETAILSRow fakturaDetailsRow = this.rEKLAMADataSet.FAKTURA_DETAILS.NewFAKTURA_DETAILSRow();
+                REKLAMADataSet.FAKTURYRow faktura = naglowkiFakturDlaKlientow.FindByID_FAKTURY(pozycjaFaktury.ID_FAKTURY);
+
+                fakturaDetailsRow.ROK = pozycjaFaktury.ROK;
+                fakturaDetailsRow.MIESIAC = pozycjaFaktury.MIESIAC;
+                fakturaDetailsRow.TYTUL = pozycjaFaktury.TYTUL;
+                fakturaDetailsRow.NAZWA_USLUGI = faktura != null ? faktura.NUMER + "/" + faktura.NUMER_ROZ + "/"
+                    + faktura.NUMER_ROK + " | " + pozycjaFaktury.NAZWA_USLUGI : "";
+                fakturaDetailsRow.reklamaId = pozycjaFaktury.reklamaId;
+                fakturaDetailsRow.NR_WYDANIA = pozycjaFaktury.NR_WYDANIA;
+
+                fakturaDetailsRow.CENA_JEDN = pozycjaFaktury.CENA_JEDN;
+                fakturaDetailsRow.ILOSC = 1;
+                fakturaDetailsRow.JM = "szt.";
+
+                fakturaDetailsRow.UPUST_NETTO = pozycjaFaktury.UPUST_NETTO;
+                fakturaDetailsRow.UPUST_PR = pozycjaFaktury.UPUST_PR;
+                decimal netto = (1 - Convert.ToDecimal(pozycjaFaktury.UPUST_PR))
+                    * pozycjaFaktury.CENA_JEDN;
+                fakturaDetailsRow.NETTO = netto;
+                fakturaDetailsRow.S_VAT = 0.22;
+                decimal VAT = Convert.ToDecimal(0.22);
+                fakturaDetailsRow.VAT = Convert.ToDecimal(Math.Round(VAT * netto, 2));
+                fakturaDetailsRow.BRUTTO = Convert.ToDecimal(Math.Round((1 + VAT) * netto, 2));
+
+                fakturaDetailsRow.TYP = 2;
+                fakturaDetailsRow.PODTYP = 1;
+                fakturaDetailsRow.ID_FAKTURY = naglowekFaktury.ID_FAKTURY;
+
+                if (!pozycjaFaktury.IswyroznienieNull())
+                {
+                    if (pozycjaFaktury.wyroznienie)
+                    {
+                        fakturaDetailsRow.wyroznienie = true;
+                    }
+                }
+
+                this.rEKLAMADataSet.FAKTURA_DETAILS.AddFAKTURA_DETAILSRow(fakturaDetailsRow);
+            }
+        }
+        
+
+        private void dodajWplate(REKLAMADataSet.FAKTURYRow naglowekFaktury)
+        {
+            REKLAMADataSet.WplatyRow wplata = this.rEKLAMADataSet.Wplaty.NewWplatyRow();
+            wplata.idFaktury = naglowekFaktury.ID_FAKTURY;
+            wplata.idZamowienia = 148;
+            this.rEKLAMADataSet.Wplaty.AddWplatyRow(wplata);
+        }
+
+        private void wydrukButton_Click(object sender, EventArgs e)
+        {
+            if (fAKTURYBindingSource.Current != null)
+            {
+                REKLAMADataSet.FAKTURYRow row =
+                    (REKLAMADataSet.FAKTURYRow)
+                    ((DataRowView)fAKTURYBindingSource.Current).Row;
+
+                if (row.IsidFakturyKorektaNull())
+                {
+                    FactureViewer fv = new FactureViewer(row.ID_FAKTURY, false);
+                    fv.ShowDialog();
+                }
+                else
+                {
+                    FactureViewer fv = new FactureViewer(row.ID_FAKTURY, row.idFakturyVAT, row.idFakturyKorekta);
+                    fv.ShowDialog();
+                }
+
+            }
+        }
+
+        private void usunFaktureButton_Click(object sender, EventArgs e)
+        {
+            if (fAKTURYBindingSource.Current != null)
+            {
+                if (
+                    MessageBox.Show("Czy na pewno chcesz usun¹æ fakturê ?",
+                    "",
+                    MessageBoxButtons.OKCancel,
+                    MessageBoxIcon.Question)
+                    == DialogResult.OK)
+                {
+                    this.Cursor = Cursors.WaitCursor;
+
+                    REKLAMADataSet.FAKTURYRow faktura = (REKLAMADataSet.FAKTURYRow)
+                        ((DataRowView)fAKTURYBindingSource.Current).Row;
+
+                    if (faktura.KOREKTA)
+                    {
+                        int i = fAKTURYBindingSource.Find("idFakturyKorekta", faktura.ID_FAKTURY);
+                        if (i > -1)
+                        {
+                            MessageBox.Show("Nie mo¿na usun¹æ faktury");
+                        }
+                        else
+                        {
+                            usunKorekte(faktura);
+                        }
+                    }
+                    else
+                    {
+                        usunFakture(faktura);
+                    }
+
+                    this.Cursor = Cursors.Default;
+                }
+            }
+        }
+
+        private void usunKorekte(REKLAMADataSet.FAKTURYRow korekta)
+        {
+            int idKorekty = korekta.ID_FAKTURY;
+            int idKorygowanejFaktury = korekta.idFakturyKorekta;
+            int idZam = korekta.idZamowienia;
+
+            int i = fAKTURYBindingSource.Find("ID_FK_KOR", idKorekty);
+
+            REKLAMADataSet.FAKTURYRow korygowanaFaktura = (REKLAMADataSet.FAKTURYRow)
+                ((DataRowView)fAKTURYBindingSource.List[i]).Row;
+
+            int j = fAKTURYBindingSource.Find("ID_FAKTURY", idKorygowanejFaktury);
+
+            if (j > -1 && i != j)
+            {
+                REKLAMADataSet.FAKTURYRow poprzedniaKorekta = (REKLAMADataSet.FAKTURYRow)
+                    ((DataRowView)fAKTURYBindingSource.List[j]).Row;
+
+                korygowanaFaktura.ID_FK_KOR = poprzedniaKorekta.ID_FAKTURY;
+            }
+            else
+            {
+                korygowanaFaktura.SetID_FK_KORNull();
+            }
+
+            fAKTURYBindingSource.EndEdit();
+
+            SqlConnection conn = new SqlConnection(ConnString.getConnString().Value);
+
+            fAKTURYTableAdapter.Connection = conn;
+            fakturA_DETAILSTableAdapter.Connection = conn;
+
+            conn.Open();
+            SqlTransaction transaction = conn.BeginTransaction();
+
+            fAKTURYTableAdapter.AttachTransaction(transaction);
+            fakturA_DETAILSTableAdapter.AttachTransaction(transaction);
+
+            try
+            {
+                fAKTURYTableAdapter.Update(this.rEKLAMADataSet.FAKTURY);
+                fAKTURYTableAdapter.Delete(idKorekty);
+                fakturA_DETAILSTableAdapter.Delete(idKorekty);
+
+                transaction.Commit();
+            }
+            catch (Exception ex)
+            {
+                transaction.Rollback();
+                throw ex;
+            }
+            finally
+            {
+                fAKTURYTableAdapter.FillByIdZamowienia(this.rEKLAMADataSet.FAKTURY, idZam);
+                conn.Close();
+            }
+        }
+
+        private void usunFakture(REKLAMADataSet.FAKTURYRow faktura)
+        {
+            int idFakt = faktura.ID_FAKTURY;
+          
+            SqlConnection conn = new SqlConnection(ConnString.getConnString().Value);
+
+            fAKTURYTableAdapter.Connection = conn;
+            fakturA_DETAILSTableAdapter.Connection = conn;
+            wplatyTableAdapter.Connection = conn;
+
+            conn.Open();
+            SqlTransaction transaction = conn.BeginTransaction();
+
+            fAKTURYTableAdapter.AttachTransaction(transaction);
+            fakturA_DETAILSTableAdapter.AttachTransaction(transaction);
+            wplatyTableAdapter.AttachTransaction(transaction);
+            
+            try
+            {
+                fAKTURYTableAdapter.Delete(idFakt);
+                fakturA_DETAILSTableAdapter.Delete(idFakt);
+                wplatyTableAdapter.Delete(idFakt);
+                
+                transaction.Commit();
+            }
+            catch (Exception e)
+            {
+                transaction.Rollback();
+            }
+            finally
+            {
+                conn.Close();
+            }
+        }
+    }
+}
