Zbiór zmian 262
- Data:
- 2009-01-28 17:28:37 (17 years ago)
- Lokalizacja:
- trunk
- Pliki:
-
- 4 zmodyfikowane
-
BazaReklam/FacturesForm.Designer.cs (zmodyfikowane) (9 diffs)
-
BazaReklam/FacturesFormNEW.cs (zmodyfikowane) (4 diffs)
-
BazaReklam/ZamowieniaForm.cs (zmodyfikowane) (3 diffs)
-
SQL/Views/VIEW_ZESTAWIENIE_FAKTUR_NOWE.txt (zmodyfikowane) (3 diffs)
Legenda:
- Bez zmian
- Dodane
- Usunięte
-
trunk/BazaReklam/FacturesForm.Designer.cs
r261 r262 49 49 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); 50 50 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); 51 System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); 51 52 this.bindingNavigator1 = new System.Windows.Forms.BindingNavigator(this.components); 52 53 this.zestawienieFakturBindingSource = new System.Windows.Forms.BindingSource(this.components); … … 111 112 this.vATDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); 112 113 this.bRUTTODataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); 114 this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); 113 115 this.sumazaplatDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); 114 116 this.dataWplaty = new System.Windows.Forms.DataGridViewTextBoxColumn(); … … 567 569 this.vATDataGridViewTextBoxColumn, 568 570 this.bRUTTODataGridViewTextBoxColumn, 571 this.dataGridViewTextBoxColumn2, 569 572 this.sumazaplatDataGridViewTextBoxColumn, 570 573 this.dataWplaty, … … 722 725 this.bRUTTODataGridViewTextBoxColumn.Width = 60; 723 726 // 727 // dataGridViewTextBoxColumn2 728 // 729 this.dataGridViewTextBoxColumn2.DataPropertyName = "waluta_brutto"; 730 dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; 731 dataGridViewCellStyle14.Format = "N2"; 732 dataGridViewCellStyle14.NullValue = null; 733 this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle14; 734 this.dataGridViewTextBoxColumn2.HeaderText = "Waluta brutto"; 735 this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; 736 this.dataGridViewTextBoxColumn2.Width = 88; 737 // 724 738 // sumazaplatDataGridViewTextBoxColumn 725 739 // 726 740 this.sumazaplatDataGridViewTextBoxColumn.DataPropertyName = "suma_zaplat"; 727 dataGridViewCellStyle1 4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;728 dataGridViewCellStyle1 4.Format = "C2";729 this.sumazaplatDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle1 4;741 dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; 742 dataGridViewCellStyle15.Format = "C2"; 743 this.sumazaplatDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle15; 730 744 this.sumazaplatDataGridViewTextBoxColumn.HeaderText = "Zap³ata"; 731 745 this.sumazaplatDataGridViewTextBoxColumn.Name = "sumazaplatDataGridViewTextBoxColumn"; … … 736 750 this.dataWplaty.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; 737 751 this.dataWplaty.DataPropertyName = "dataWplaty"; 738 dataGridViewCellStyle1 5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;739 dataGridViewCellStyle1 5.Format = "d";740 dataGridViewCellStyle1 5.NullValue = null;741 this.dataWplaty.DefaultCellStyle = dataGridViewCellStyle1 5;752 dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; 753 dataGridViewCellStyle16.Format = "d"; 754 dataGridViewCellStyle16.NullValue = null; 755 this.dataWplaty.DefaultCellStyle = dataGridViewCellStyle16; 742 756 this.dataWplaty.HeaderText = "Data wp³aty"; 743 757 this.dataWplaty.Name = "dataWplaty"; … … 747 761 this.wplata_brutto.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; 748 762 this.wplata_brutto.DataPropertyName = "wplata_brutto"; 749 dataGridViewCellStyle1 6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;750 dataGridViewCellStyle1 6.Format = "C";751 this.wplata_brutto.DefaultCellStyle = dataGridViewCellStyle1 6;763 dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; 764 dataGridViewCellStyle17.Format = "C"; 765 this.wplata_brutto.DefaultCellStyle = dataGridViewCellStyle17; 752 766 this.wplata_brutto.HeaderText = "Wp³ata"; 753 767 this.wplata_brutto.Name = "wplata_brutto"; … … 757 771 this.waluta_brutto.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; 758 772 this.waluta_brutto.DataPropertyName = "wplata_waluta_brutto"; 759 dataGridViewCellStyle1 7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight;760 dataGridViewCellStyle1 7.Format = "N2";761 dataGridViewCellStyle1 7.NullValue = null;762 this.waluta_brutto.DefaultCellStyle = dataGridViewCellStyle1 7;773 dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; 774 dataGridViewCellStyle18.Format = "N2"; 775 dataGridViewCellStyle18.NullValue = null; 776 this.waluta_brutto.DefaultCellStyle = dataGridViewCellStyle18; 763 777 this.waluta_brutto.HeaderText = "Wp³ata w walucie"; 764 778 this.waluta_brutto.Name = "waluta_brutto"; … … 768 782 this.wplata_waluta_miano.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; 769 783 this.wplata_waluta_miano.DataPropertyName = "wplata_waluta_miano"; 770 dataGridViewCellStyle1 8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;771 this.wplata_waluta_miano.DefaultCellStyle = dataGridViewCellStyle1 8;784 dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; 785 this.wplata_waluta_miano.DefaultCellStyle = dataGridViewCellStyle19; 772 786 this.wplata_waluta_miano.HeaderText = "Waluta"; 773 787 this.wplata_waluta_miano.Name = "wplata_waluta_miano"; … … 868 882 private System.Windows.Forms.DataGridViewTextBoxColumn vATDataGridViewTextBoxColumn; 869 883 private System.Windows.Forms.DataGridViewTextBoxColumn bRUTTODataGridViewTextBoxColumn; 884 private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2; 870 885 private System.Windows.Forms.DataGridViewTextBoxColumn sumazaplatDataGridViewTextBoxColumn; 871 886 private System.Windows.Forms.DataGridViewTextBoxColumn dataWplaty; -
trunk/BazaReklam/FacturesFormNEW.cs
r218 r262 10 10 public partial class FacturesFormNEW : Form 11 11 { 12 string query = "SELECT top 2000 * from VIEW_ZESTAWIENIE_FAKTUR_NOWE ";12 private const string query = "SELECT top 2000 * from VIEW_ZESTAWIENIE_FAKTUR_NOWE "; 13 13 14 14 private static FacturesFormNEW fakturesForm; 15 private SqlCommand command;16 private SqlDataAdapter sqlDataAdapter;15 private readonly SqlCommand command; 16 private readonly SqlDataAdapter sqlDataAdapter; 17 17 18 18 private bool commandExecuted; … … 26 26 } 27 27 28 private FacturesFormNEW( MDIBazaReklam parent)28 private FacturesFormNEW(Form parent) 29 29 { 30 30 InitializeComponent(); … … 72 72 private void generateNodes() 73 73 { 74 TreeNode node; 75 76 node = new TreeNode("Wp³aty - ksiêgowoæ"); 74 TreeNode node = new TreeNode("Wp³aty - ksiêgowoæ"); 77 75 node.Name = "WplatyKsiegowosc"; 78 76 treeView1.Nodes.Add(node); … … 555 553 DataRowView row = (DataRowView)VIEW_ZESTAWIENIE_FAKTUR_NOWEBindingSource.Current; 556 554 REKLAMADataSet.VIEW_ZESTAWIENIE_FAKTUR_NOWERow f = (REKLAMADataSet.VIEW_ZESTAWIENIE_FAKTUR_NOWERow)row.Row; 557 558 PaymentForm2 pf2; 559 560 if (f.IsidWplatyNull()) 561 { 562 pf2 = new PaymentForm2(0,f.ID_FAKTURY); 563 } 564 else 565 { 566 pf2 = new PaymentForm2(f.idWplaty, f.ID_FAKTURY); 567 } 555 556 PaymentForm2 pf2 = f.IsidWplatyNull() ? new PaymentForm2(0,f.ID_FAKTURY) : new PaymentForm2(f.idWplaty, f.ID_FAKTURY); 568 557 569 558 if (pf2.ShowDialog() == DialogResult.OK) -
trunk/BazaReklam/ZamowieniaForm.cs
r227 r262 453 453 if (naglowekFaktury.Iswaluta_mianoNull() && klient.Country.ToUpper() == "POLSKA") 454 454 { 455 fakturaDetailsRow.UPUST_NETTO = 456 Math.Round(Convert.ToDecimal(reklama.RABAT)*fakturaDetailsRow.CENA_JEDN, 2); 455 fakturaDetailsRow.UPUST_NETTO = Convert.ToDecimal(reklama.RABAT) * fakturaDetailsRow.CENA_JEDN; 457 456 fakturaDetailsRow.UPUST_PR = reklama.RABAT; 458 decimal netto = (1 - Convert.ToDecimal(reklama.RABAT)) *fakturaDetailsRow.CENA_JEDN;457 decimal netto = (1 - Convert.ToDecimal(reklama.RABAT)) * fakturaDetailsRow.CENA_JEDN; 459 458 460 459 if (reklama.wyroznienie) 461 { 462 netto = Math.Round(Convert.ToDecimal(1 + reklama.wyroznienie_procent)*netto, 2); 463 } 464 465 fakturaDetailsRow.NETTO = Math.Round(netto, 2); 460 netto = Convert.ToDecimal(1 + reklama.wyroznienie_procent) * netto; 461 462 fakturaDetailsRow.NETTO = netto; 466 463 fakturaDetailsRow.S_VAT = reklama.VAT; 467 464 decimal VAT = Convert.ToDecimal(reklama.VAT); 468 fakturaDetailsRow.VAT = Convert.ToDecimal( Math.Round(VAT*netto, 2));469 fakturaDetailsRow.BRUTTO = Convert.ToDecimal( Math.Round((1 + VAT) * netto, 2));465 fakturaDetailsRow.VAT = Convert.ToDecimal(VAT * netto); 466 fakturaDetailsRow.BRUTTO = Convert.ToDecimal((1 + VAT) * netto); 470 467 } 471 468 else if(naglowekFaktury.Iswaluta_mianoNull() && klient.Country.ToUpper() != "POLSKA") … … 474 471 decimal netto = (1 - Convert.ToDecimal(reklama.RABAT)) * fakturaDetailsRow.CENA_JEDN; 475 472 if (reklama.wyroznienie) 476 { 477 netto = Math.Round(Convert.ToDecimal(1 + reklama.wyroznienie_procent) * netto, 2); 478 } 479 fakturaDetailsRow.NETTO = Math.Round(netto, 2); 473 netto = Convert.ToDecimal(1 + reklama.wyroznienie_procent) * netto; 474 fakturaDetailsRow.NETTO = netto; 480 475 fakturaDetailsRow.S_VAT = reklama.VAT; 481 fakturaDetailsRow.BRUTTO = Convert.ToDecimal( Math.Round((1 + VAT) * netto, 2));476 fakturaDetailsRow.BRUTTO = Convert.ToDecimal((1 + VAT) * netto); 482 477 483 478 decimal brutto = fakturaDetailsRow.BRUTTO; 484 479 485 fakturaDetailsRow.VAT = Convert.ToDecimal( Math.Round(VAT * brutto / (1 + VAT), 2));486 487 fakturaDetailsRow.UPUST_PR = Math.Round(reklama.RABAT, 2);480 fakturaDetailsRow.VAT = Convert.ToDecimal(VAT * brutto / (1 + VAT)); 481 482 fakturaDetailsRow.UPUST_PR = reklama.RABAT; 488 483 if (fakturaDetailsRow.UPUST_PR != 0) 489 { 490 fakturaDetailsRow.UPUST_NETTO = Math.Round(netto / Convert.ToDecimal(reklama.RABAT) - netto, 2); 491 } 484 fakturaDetailsRow.UPUST_NETTO = netto/(Convert.ToDecimal(reklama.RABAT) - netto); 492 485 else 493 {494 486 fakturaDetailsRow.UPUST_NETTO = 0; 495 }496 487 497 488 fakturaDetailsRow.CENA_JEDN = Convert.ToDecimal(netto + fakturaDetailsRow.UPUST_NETTO); … … 504 495 decimal VAT = Convert.ToDecimal(reklama.VAT); 505 496 decimal brutto = fakturaDetailsRow.BRUTTO; 506 fakturaDetailsRow.VAT = Convert.ToDecimal( Math.Round(VAT * brutto / (1 + VAT), 2));497 fakturaDetailsRow.VAT = Convert.ToDecimal(VAT * brutto / (1 + VAT)); 507 498 decimal netto = brutto - fakturaDetailsRow.VAT; 508 fakturaDetailsRow.NETTO = Math.Round(netto, 2);509 510 fakturaDetailsRow.UPUST_PR = Math.Round(reklama.RABAT, 2);499 fakturaDetailsRow.NETTO = netto; 500 501 fakturaDetailsRow.UPUST_PR = reklama.RABAT; 511 502 if (fakturaDetailsRow.UPUST_PR != 0) 512 503 { 513 fakturaDetailsRow.UPUST_NETTO = Math.Round(netto / Convert.ToDecimal(reklama.RABAT) - netto, 2);504 fakturaDetailsRow.UPUST_NETTO = netto / Convert.ToDecimal(reklama.RABAT) - netto; 514 505 } 515 506 else -
trunk/SQL/Views/VIEW_ZESTAWIENIE_FAKTUR_NOWE.txt
r246 r262 20 20 -- jesli zostala wystawiona faktura korekta, wyswietl wartosc brutto po korekcie 21 21 BRUTTO = CASE 22 WHEN (T.KorektaBrutto IS NULL) THEN T. BRUTTO23 ELSE T.Korekta Brutto22 WHEN (T.KorektaBrutto IS NULL) THEN T.NETTO * (1 + T.S_VAT) 23 ELSE T.KorektaNetto * (1 + T.KorektaVat) 24 24 END, 25 25 T.suma_zaplat, … … 60 60 dbo.FAKTURY.ID_FK_KOR, Wplaty.brutto as wplata_brutto, Wplaty.waluta_brutto as wplata_waluta_brutto, 61 61 dbo.FAKTURY.SPOSOB_ZAPLATY AS SposobZaplaty, 62 COALESCE(Korekta.S_VAT, NULL) AS KorektaVat, 62 63 COALESCE(Korekta.Netto, NULL) AS KorektaNetto, 63 64 COALESCE(Korekta.Brutto, NULL) AS KorektaBrutto, … … 80 81 dbo.FAKTURY.ID_FK_KOR, Wplaty.brutto, Wplaty.waluta_brutto, 81 82 dbo.FAKTURY.SPOSOB_ZAPLATY, 82 Korekta. Netto, Korekta.Brutto, Korekta.waluta_brutto83 Korekta.S_VAT, Korekta.Netto, Korekta.Brutto, Korekta.waluta_brutto 83 84 ) AS T LEFT OUTER JOIN 84 85 (SELECT idFaktury, round(SUM(netto),2) AS sumaNettoZEmisji, count(id) as ilEmisji
