diff --git a/database/DbOpenRetail.sql b/database/DbOpenRetail.sql index 187a891..2a2d207 100644 --- a/database/DbOpenRetail.sql +++ b/database/DbOpenRetail.sql @@ -1342,6 +1342,22 @@ CREATE TABLE m_golongan ( ALTER TABLE m_golongan OWNER TO postgres; +-- +-- Name: m_harga_grosir; Type: TABLE; Schema: public; Owner: postgres; Tablespace: +-- + +CREATE TABLE m_harga_grosir ( + harga_grosir_id t_guid NOT NULL, + produk_id t_guid, + harga_ke integer, + harga_grosir t_harga, + jumlah_minimal t_jumlah, + diskon t_jumlah +); + + +ALTER TABLE m_harga_grosir OWNER TO postgres; + -- -- Name: m_header_nota; Type: TABLE; Schema: public; Owner: postgres; Tablespace: -- @@ -2283,6 +2299,14 @@ ALTER TABLE ONLY m_golongan ADD CONSTRAINT m_golongan_pkey PRIMARY KEY (golongan_id); +-- +-- Name: m_harga_grosir_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: +-- + +ALTER TABLE ONLY m_harga_grosir + ADD CONSTRAINT m_harga_grosir_pkey PRIMARY KEY (harga_grosir_id); + + -- -- Name: m_header_nota_mini_pos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: -- @@ -2917,6 +2941,14 @@ CREATE TRIGGER tr_update_total_retur_beli_aiud AFTER INSERT OR DELETE OR UPDATE CREATE TRIGGER tr_update_total_retur_produk_aiud AFTER INSERT OR DELETE OR UPDATE ON t_item_retur_jual_produk FOR EACH ROW EXECUTE PROCEDURE f_update_total_retur_produk_aiud(); +-- +-- Name: m_harga_grosir_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY m_harga_grosir + ADD CONSTRAINT m_harga_grosir_fk FOREIGN KEY (produk_id) REFERENCES m_produk(produk_id) ON UPDATE CASCADE ON DELETE CASCADE; + + -- -- Name: m_item_menu_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres -- diff --git a/format file import/File Import Excel/Master Data/data_produk.xlsx b/format file import/File Import Excel/Master Data/data_produk.xlsx index 5114af3..4fd6890 100644 Binary files a/format file import/File Import Excel/Master Data/data_produk.xlsx and b/format file import/File Import Excel/Master Data/data_produk.xlsx differ diff --git a/src/OpenRetail.App/Helper/ColorManagerHelper.cs b/src/OpenRetail.App/Helper/ColorManagerHelper.cs index c80f157..8b61349 100644 --- a/src/OpenRetail.App/Helper/ColorManagerHelper.cs +++ b/src/OpenRetail.App/Helper/ColorManagerHelper.cs @@ -43,7 +43,7 @@ public static void SetTheme(Form frm, Control parent) var frmName = frm.Name; - if (!(frmName == "FrmLogin" || frmName.Substring(0, 10) == "FrmPreview")) + if (!(frmName == "FrmLogin" || frmName == "FrmAbout" || frmName.Substring(0, 10) == "FrmPreview")) { frm.ShowIcon = false; frm.ShowInTaskbar = false; diff --git a/src/OpenRetail.App/Helper/GridListControlHelper.cs b/src/OpenRetail.App/Helper/GridListControlHelper.cs index e4f7e2d..11efa46 100644 --- a/src/OpenRetail.App/Helper/GridListControlHelper.cs +++ b/src/OpenRetail.App/Helper/GridListControlHelper.cs @@ -28,8 +28,8 @@ namespace OpenRetail.App.Helper { public sealed class GridListControlHelper - { - public static void InitializeGridListControl(GridListControl gridControl, IList record, IList oglProperty, bool addRowNumber = true, int rowHeight = 25) + { + public static void InitializeGridListControl(GridListControl gridControl, IList record, IList oglProperty, bool addRowNumber = true, int rowHeight = 25, int additionalRowCount = 0) { gridControl.ShowColumnHeader = true; gridControl.MultiColumn = true; @@ -39,7 +39,7 @@ public static void InitializeGridListControl(GridListControl gridControl, ILi gridControl.FillLastColumn = true; gridControl.BorderStyle = BorderStyle.FixedSingle; gridControl.Grid.GridVisualStyles = GridVisualStyles.Office2010Silver; - gridControl.Grid.Model.RowCount = record.Count; + gridControl.Grid.Model.RowCount = record.Count + additionalRowCount; gridControl.BackColor = Color.White; gridControl.Grid.Model.RowHeights[0] = rowHeight; @@ -182,35 +182,35 @@ public static void InitializeGridListControl(GridControl gridControl, IList(GridListControl gridControl, IList record, T obj, bool isLastRowFocus = true) + public static void AddObject(GridListControl gridControl, IList record, T obj, bool isLastRowFocus = true, int additionalRowCount = 0) { record.Add(obj); - gridControl.Grid.Model.RowCount = record.Count; + gridControl.Grid.Model.RowCount = record.Count + additionalRowCount; gridControl.Refresh(); if (isLastRowFocus) gridControl.SetSelected(gridControl.Grid.RowCount - 1, true); } - public static void AddObjects(GridListControl gridControl, IList record) + public static void AddObjects(GridListControl gridControl, IList record, int additionalRowCount = 0) { - gridControl.Grid.Model.RowCount = record.Count; + gridControl.Grid.Model.RowCount = record.Count + additionalRowCount; gridControl.Refresh(); if (record.Count > 0) - gridControl.SetSelected(0, true); + gridControl.SetSelected(additionalRowCount, true); } - public static void UpdateObject(GridListControl gridControl, IList record, T obj) + public static void UpdateObject(GridListControl gridControl, IList record, T obj, int additionalRowCount = 0) { - record[gridControl.SelectedIndex] = obj; + record[gridControl.SelectedIndex - additionalRowCount] = obj; gridControl.Refresh(); } - public static void RemoveObject(GridListControl gridControl, IList record, T obj) + public static void RemoveObject(GridListControl gridControl, IList record, T obj, int additionalRowCount = 0) { record.Remove(obj); - gridControl.Grid.Model.RowCount = record.Count; + gridControl.Grid.Model.RowCount = record.Count + additionalRowCount; gridControl.Refresh(); @@ -218,13 +218,13 @@ public static void RemoveObject(GridListControl gridControl, IList record, gridControl.SetSelected(gridControl.SelectedIndex - 1, true); } - public static void Refresh(GridListControl gridControl, IList record) + public static void Refresh(GridListControl gridControl, IList record, int additionalRowCount = 0) { - gridControl.Grid.Model.RowCount = record.Count; + gridControl.Grid.Model.RowCount = record.Count + additionalRowCount; gridControl.Refresh(); if (record.Count > 0) - gridControl.SetSelected(0, true); + gridControl.SetSelected(additionalRowCount, true); } diff --git a/src/OpenRetail.App/Referensi/FrmEntryProduk.Designer.cs b/src/OpenRetail.App/Referensi/FrmEntryProduk.Designer.cs index 3067246..adf854b 100644 --- a/src/OpenRetail.App/Referensi/FrmEntryProduk.Designer.cs +++ b/src/OpenRetail.App/Referensi/FrmEntryProduk.Designer.cs @@ -49,7 +49,32 @@ private void InitializeComponent() this.txtMinStokGudang = new OpenRetail.App.UserControl.AdvancedTextbox(); this.label10 = new System.Windows.Forms.Label(); this.txtDiskon = new OpenRetail.App.UserControl.AdvancedTextbox(); + this.label11 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.txtDiskonGrosir1 = new OpenRetail.App.UserControl.AdvancedTextbox(); + this.txtDiskonGrosir2 = new OpenRetail.App.UserControl.AdvancedTextbox(); + this.txtDiskonGrosir3 = new OpenRetail.App.UserControl.AdvancedTextbox(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.txtHargaGrosir1 = new OpenRetail.App.UserControl.AdvancedTextbox(); + this.label18 = new System.Windows.Forms.Label(); + this.txtJumlahMinimalGrosir1 = new OpenRetail.App.UserControl.AdvancedTextbox(); + this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); + this.txtHargaGrosir2 = new OpenRetail.App.UserControl.AdvancedTextbox(); + this.label19 = new System.Windows.Forms.Label(); + this.txtJumlahMinimalGrosir2 = new OpenRetail.App.UserControl.AdvancedTextbox(); + this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel(); + this.txtHargaGrosir3 = new OpenRetail.App.UserControl.AdvancedTextbox(); + this.label20 = new System.Windows.Forms.Label(); + this.txtJumlahMinimalGrosir3 = new OpenRetail.App.UserControl.AdvancedTextbox(); this.tableLayoutPanel3.SuspendLayout(); + this.flowLayoutPanel1.SuspendLayout(); + this.flowLayoutPanel2.SuspendLayout(); + this.flowLayoutPanel3.SuspendLayout(); this.SuspendLayout(); // // tableLayoutPanel3 @@ -60,27 +85,40 @@ private void InitializeComponent() this.tableLayoutPanel3.Controls.Add(this.label1, 0, 2); this.tableLayoutPanel3.Controls.Add(this.label2, 0, 3); this.tableLayoutPanel3.Controls.Add(this.label3, 0, 4); - this.tableLayoutPanel3.Controls.Add(this.label4, 0, 7); - this.tableLayoutPanel3.Controls.Add(this.label5, 0, 5); + this.tableLayoutPanel3.Controls.Add(this.label4, 0, 14); + this.tableLayoutPanel3.Controls.Add(this.label5, 0, 6); this.tableLayoutPanel3.Controls.Add(this.label7, 0, 1); this.tableLayoutPanel3.Controls.Add(this.label6, 0, 0); - this.tableLayoutPanel3.Controls.Add(this.label8, 0, 8); - this.tableLayoutPanel3.Controls.Add(this.label9, 0, 9); + this.tableLayoutPanel3.Controls.Add(this.label8, 0, 15); + this.tableLayoutPanel3.Controls.Add(this.label9, 0, 16); this.tableLayoutPanel3.Controls.Add(this.cmbGolongan, 1, 0); this.tableLayoutPanel3.Controls.Add(this.txtKodeProduk, 1, 1); this.tableLayoutPanel3.Controls.Add(this.txtNamaProduk, 1, 2); this.tableLayoutPanel3.Controls.Add(this.txtSatuan, 1, 3); this.tableLayoutPanel3.Controls.Add(this.txtHargaBeli, 1, 4); - this.tableLayoutPanel3.Controls.Add(this.txtHargaJual, 1, 5); - this.tableLayoutPanel3.Controls.Add(this.txtStok, 1, 7); - this.tableLayoutPanel3.Controls.Add(this.txtStokGudang, 1, 8); - this.tableLayoutPanel3.Controls.Add(this.txtMinStokGudang, 1, 9); - this.tableLayoutPanel3.Controls.Add(this.label10, 0, 6); - this.tableLayoutPanel3.Controls.Add(this.txtDiskon, 1, 6); + this.tableLayoutPanel3.Controls.Add(this.txtHargaJual, 1, 6); + this.tableLayoutPanel3.Controls.Add(this.txtStok, 1, 14); + this.tableLayoutPanel3.Controls.Add(this.txtStokGudang, 1, 15); + this.tableLayoutPanel3.Controls.Add(this.txtMinStokGudang, 1, 16); + this.tableLayoutPanel3.Controls.Add(this.label10, 0, 7); + this.tableLayoutPanel3.Controls.Add(this.txtDiskon, 1, 7); + this.tableLayoutPanel3.Controls.Add(this.label11, 0, 8); + this.tableLayoutPanel3.Controls.Add(this.label12, 0, 9); + this.tableLayoutPanel3.Controls.Add(this.label13, 0, 10); + this.tableLayoutPanel3.Controls.Add(this.label14, 0, 11); + this.tableLayoutPanel3.Controls.Add(this.label15, 0, 12); + this.tableLayoutPanel3.Controls.Add(this.label16, 0, 13); + this.tableLayoutPanel3.Controls.Add(this.label17, 0, 5); + this.tableLayoutPanel3.Controls.Add(this.txtDiskonGrosir1, 1, 9); + this.tableLayoutPanel3.Controls.Add(this.txtDiskonGrosir2, 1, 11); + this.tableLayoutPanel3.Controls.Add(this.txtDiskonGrosir3, 1, 13); + this.tableLayoutPanel3.Controls.Add(this.flowLayoutPanel1, 1, 8); + this.tableLayoutPanel3.Controls.Add(this.flowLayoutPanel2, 1, 10); + this.tableLayoutPanel3.Controls.Add(this.flowLayoutPanel3, 1, 12); this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel3.Location = new System.Drawing.Point(0, 41); this.tableLayoutPanel3.Name = "tableLayoutPanel3"; - this.tableLayoutPanel3.RowCount = 11; + this.tableLayoutPanel3.RowCount = 18; this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); @@ -92,7 +130,14 @@ private void InitializeComponent() this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); - this.tableLayoutPanel3.Size = new System.Drawing.Size(392, 252); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); + this.tableLayoutPanel3.Size = new System.Drawing.Size(487, 427); this.tableLayoutPanel3.TabIndex = 0; // // label1 @@ -101,7 +146,7 @@ private void InitializeComponent() this.label1.Dock = System.Windows.Forms.DockStyle.Fill; this.label1.Location = new System.Drawing.Point(3, 50); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(93, 25); + this.label1.Size = new System.Drawing.Size(97, 25); this.label1.TabIndex = 0; this.label1.Text = "Nama Produk"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -112,7 +157,7 @@ private void InitializeComponent() this.label2.Dock = System.Windows.Forms.DockStyle.Fill; this.label2.Location = new System.Drawing.Point(3, 75); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(93, 25); + this.label2.Size = new System.Drawing.Size(97, 25); this.label2.TabIndex = 0; this.label2.Text = "Satuan"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -123,7 +168,7 @@ private void InitializeComponent() this.label3.Dock = System.Windows.Forms.DockStyle.Fill; this.label3.Location = new System.Drawing.Point(3, 100); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(93, 25); + this.label3.Size = new System.Drawing.Size(97, 25); this.label3.TabIndex = 0; this.label3.Text = "Harga Beli"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -132,9 +177,9 @@ private void InitializeComponent() // this.label4.AutoSize = true; this.label4.Dock = System.Windows.Forms.DockStyle.Fill; - this.label4.Location = new System.Drawing.Point(3, 175); + this.label4.Location = new System.Drawing.Point(3, 350); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(93, 25); + this.label4.Size = new System.Drawing.Size(97, 25); this.label4.TabIndex = 0; this.label4.Text = "Stok Etalase"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -142,13 +187,15 @@ private void InitializeComponent() // label5 // this.label5.AutoSize = true; - this.label5.Dock = System.Windows.Forms.DockStyle.Fill; - this.label5.Location = new System.Drawing.Point(3, 125); + this.label5.Dock = System.Windows.Forms.DockStyle.Right; + this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.ForeColor = System.Drawing.Color.Black; + this.label5.Location = new System.Drawing.Point(22, 150); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(93, 25); + this.label5.Size = new System.Drawing.Size(78, 25); this.label5.TabIndex = 4; - this.label5.Text = "Harga Jual"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label5.Text = "Harga Retail"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // label7 // @@ -156,7 +203,7 @@ private void InitializeComponent() this.label7.Dock = System.Windows.Forms.DockStyle.Fill; this.label7.Location = new System.Drawing.Point(3, 25); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(93, 25); + this.label7.Size = new System.Drawing.Size(97, 25); this.label7.TabIndex = 6; this.label7.Text = "Kode Produk"; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -176,9 +223,9 @@ private void InitializeComponent() // this.label8.AutoSize = true; this.label8.Dock = System.Windows.Forms.DockStyle.Fill; - this.label8.Location = new System.Drawing.Point(3, 200); + this.label8.Location = new System.Drawing.Point(3, 375); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(93, 25); + this.label8.Size = new System.Drawing.Size(97, 25); this.label8.TabIndex = 7; this.label8.Text = "Stok Gudang"; this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -187,9 +234,9 @@ private void InitializeComponent() // this.label9.AutoSize = true; this.label9.Dock = System.Windows.Forms.DockStyle.Fill; - this.label9.Location = new System.Drawing.Point(3, 225); + this.label9.Location = new System.Drawing.Point(3, 400); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(93, 25); + this.label9.Size = new System.Drawing.Size(97, 25); this.label9.TabIndex = 7; this.label9.Text = "Min. Stok Gudang"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -199,10 +246,10 @@ private void InitializeComponent() this.cmbGolongan.Dock = System.Windows.Forms.DockStyle.Fill; this.cmbGolongan.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cmbGolongan.FormattingEnabled = true; - this.cmbGolongan.Location = new System.Drawing.Point(102, 3); + this.cmbGolongan.Location = new System.Drawing.Point(106, 3); this.cmbGolongan.Name = "cmbGolongan"; - this.cmbGolongan.Size = new System.Drawing.Size(287, 21); - this.cmbGolongan.TabIndex = 9; + this.cmbGolongan.Size = new System.Drawing.Size(378, 21); + this.cmbGolongan.TabIndex = 15; this.cmbGolongan.Tag = "ignore"; // // txtKodeProduk @@ -212,7 +259,7 @@ private void InitializeComponent() this.txtKodeProduk.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); this.txtKodeProduk.LeaveFocusColor = System.Drawing.Color.White; this.txtKodeProduk.LetterOnly = false; - this.txtKodeProduk.Location = new System.Drawing.Point(102, 28); + this.txtKodeProduk.Location = new System.Drawing.Point(106, 28); this.txtKodeProduk.Name = "txtKodeProduk"; this.txtKodeProduk.NumericOnly = false; this.txtKodeProduk.SelectionText = false; @@ -229,11 +276,11 @@ private void InitializeComponent() this.txtNamaProduk.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); this.txtNamaProduk.LeaveFocusColor = System.Drawing.Color.White; this.txtNamaProduk.LetterOnly = false; - this.txtNamaProduk.Location = new System.Drawing.Point(102, 53); + this.txtNamaProduk.Location = new System.Drawing.Point(106, 53); this.txtNamaProduk.Name = "txtNamaProduk"; this.txtNamaProduk.NumericOnly = false; this.txtNamaProduk.SelectionText = false; - this.txtNamaProduk.Size = new System.Drawing.Size(287, 20); + this.txtNamaProduk.Size = new System.Drawing.Size(378, 20); this.txtNamaProduk.TabIndex = 1; this.txtNamaProduk.Tag = "nama_produk"; this.txtNamaProduk.ThousandSeparator = false; @@ -245,7 +292,7 @@ private void InitializeComponent() this.txtSatuan.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); this.txtSatuan.LeaveFocusColor = System.Drawing.Color.White; this.txtSatuan.LetterOnly = false; - this.txtSatuan.Location = new System.Drawing.Point(102, 78); + this.txtSatuan.Location = new System.Drawing.Point(106, 78); this.txtSatuan.Name = "txtSatuan"; this.txtSatuan.NumericOnly = false; this.txtSatuan.SelectionText = false; @@ -261,7 +308,7 @@ private void InitializeComponent() this.txtHargaBeli.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); this.txtHargaBeli.LeaveFocusColor = System.Drawing.Color.White; this.txtHargaBeli.LetterOnly = false; - this.txtHargaBeli.Location = new System.Drawing.Point(102, 103); + this.txtHargaBeli.Location = new System.Drawing.Point(106, 103); this.txtHargaBeli.MaxLength = 20; this.txtHargaBeli.Name = "txtHargaBeli"; this.txtHargaBeli.NumericOnly = true; @@ -279,7 +326,7 @@ private void InitializeComponent() this.txtHargaJual.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); this.txtHargaJual.LeaveFocusColor = System.Drawing.Color.White; this.txtHargaJual.LetterOnly = false; - this.txtHargaJual.Location = new System.Drawing.Point(102, 128); + this.txtHargaJual.Location = new System.Drawing.Point(106, 153); this.txtHargaJual.MaxLength = 20; this.txtHargaJual.Name = "txtHargaJual"; this.txtHargaJual.NumericOnly = true; @@ -297,13 +344,13 @@ private void InitializeComponent() this.txtStok.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); this.txtStok.LeaveFocusColor = System.Drawing.Color.White; this.txtStok.LetterOnly = false; - this.txtStok.Location = new System.Drawing.Point(102, 178); + this.txtStok.Location = new System.Drawing.Point(106, 353); this.txtStok.MaxLength = 8; this.txtStok.Name = "txtStok"; this.txtStok.NumericOnly = true; this.txtStok.SelectionText = false; this.txtStok.Size = new System.Drawing.Size(59, 20); - this.txtStok.TabIndex = 6; + this.txtStok.TabIndex = 12; this.txtStok.Text = "0"; this.txtStok.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtStok.ThousandSeparator = false; @@ -315,13 +362,13 @@ private void InitializeComponent() this.txtStokGudang.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); this.txtStokGudang.LeaveFocusColor = System.Drawing.Color.White; this.txtStokGudang.LetterOnly = false; - this.txtStokGudang.Location = new System.Drawing.Point(102, 203); + this.txtStokGudang.Location = new System.Drawing.Point(106, 378); this.txtStokGudang.MaxLength = 8; this.txtStokGudang.Name = "txtStokGudang"; this.txtStokGudang.NumericOnly = true; this.txtStokGudang.SelectionText = false; this.txtStokGudang.Size = new System.Drawing.Size(59, 20); - this.txtStokGudang.TabIndex = 7; + this.txtStokGudang.TabIndex = 13; this.txtStokGudang.Text = "0"; this.txtStokGudang.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtStokGudang.ThousandSeparator = false; @@ -333,13 +380,13 @@ private void InitializeComponent() this.txtMinStokGudang.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); this.txtMinStokGudang.LeaveFocusColor = System.Drawing.Color.White; this.txtMinStokGudang.LetterOnly = false; - this.txtMinStokGudang.Location = new System.Drawing.Point(102, 228); + this.txtMinStokGudang.Location = new System.Drawing.Point(106, 403); this.txtMinStokGudang.MaxLength = 8; this.txtMinStokGudang.Name = "txtMinStokGudang"; this.txtMinStokGudang.NumericOnly = true; this.txtMinStokGudang.SelectionText = false; this.txtMinStokGudang.Size = new System.Drawing.Size(59, 20); - this.txtMinStokGudang.TabIndex = 8; + this.txtMinStokGudang.TabIndex = 14; this.txtMinStokGudang.Text = "0"; this.txtMinStokGudang.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtMinStokGudang.ThousandSeparator = false; @@ -348,13 +395,14 @@ private void InitializeComponent() // label10 // this.label10.AutoSize = true; - this.label10.Dock = System.Windows.Forms.DockStyle.Left; - this.label10.Location = new System.Drawing.Point(3, 150); + this.label10.Dock = System.Windows.Forms.DockStyle.Right; + this.label10.ForeColor = System.Drawing.Color.Black; + this.label10.Location = new System.Drawing.Point(30, 175); this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(40, 25); + this.label10.Size = new System.Drawing.Size(70, 25); this.label10.TabIndex = 9; - this.label10.Text = "Diskon"; - this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label10.Text = "Diskon Retail"; + this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // txtDiskon // @@ -363,7 +411,7 @@ private void InitializeComponent() this.txtDiskon.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); this.txtDiskon.LeaveFocusColor = System.Drawing.Color.White; this.txtDiskon.LetterOnly = false; - this.txtDiskon.Location = new System.Drawing.Point(102, 153); + this.txtDiskon.Location = new System.Drawing.Point(106, 178); this.txtDiskon.MaxLength = 8; this.txtDiskon.Name = "txtDiskon"; this.txtDiskon.NumericOnly = true; @@ -374,17 +422,340 @@ private void InitializeComponent() this.txtDiskon.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtDiskon.ThousandSeparator = false; // + // label11 + // + this.label11.AutoSize = true; + this.label11.Dock = System.Windows.Forms.DockStyle.Right; + this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label11.ForeColor = System.Drawing.Color.Black; + this.label11.Location = new System.Drawing.Point(3, 200); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(97, 25); + this.label11.TabIndex = 10; + this.label11.Text = "Harga Grosir #1"; + this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Dock = System.Windows.Forms.DockStyle.Right; + this.label12.ForeColor = System.Drawing.Color.Black; + this.label12.Location = new System.Drawing.Point(14, 225); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(86, 25); + this.label12.TabIndex = 10; + this.label12.Text = "Diskon Grosir #1"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Dock = System.Windows.Forms.DockStyle.Right; + this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label13.Location = new System.Drawing.Point(3, 250); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(97, 25); + this.label13.TabIndex = 10; + this.label13.Text = "Harga Grosir #2"; + this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Dock = System.Windows.Forms.DockStyle.Right; + this.label14.Location = new System.Drawing.Point(14, 275); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(86, 25); + this.label14.TabIndex = 10; + this.label14.Text = "Diskon Grosir #2"; + this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Dock = System.Windows.Forms.DockStyle.Right; + this.label15.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label15.Location = new System.Drawing.Point(3, 300); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(97, 25); + this.label15.TabIndex = 10; + this.label15.Text = "Harga Grosir #3"; + this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Dock = System.Windows.Forms.DockStyle.Right; + this.label16.Location = new System.Drawing.Point(14, 325); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(86, 25); + this.label16.TabIndex = 10; + this.label16.Text = "Diskon Grosir #3"; + this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Dock = System.Windows.Forms.DockStyle.Fill; + this.label17.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label17.Location = new System.Drawing.Point(3, 125); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(97, 25); + this.label17.TabIndex = 11; + this.label17.Text = "Harga Jual"; + this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtDiskonGrosir1 + // + this.txtDiskonGrosir1.AutoEnter = true; + this.txtDiskonGrosir1.Conversion = OpenRetail.App.UserControl.EConversion.Normal; + this.txtDiskonGrosir1.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); + this.txtDiskonGrosir1.LeaveFocusColor = System.Drawing.Color.White; + this.txtDiskonGrosir1.LetterOnly = false; + this.txtDiskonGrosir1.Location = new System.Drawing.Point(106, 228); + this.txtDiskonGrosir1.MaxLength = 8; + this.txtDiskonGrosir1.Name = "txtDiskonGrosir1"; + this.txtDiskonGrosir1.NumericOnly = true; + this.txtDiskonGrosir1.SelectionText = false; + this.txtDiskonGrosir1.Size = new System.Drawing.Size(40, 20); + this.txtDiskonGrosir1.TabIndex = 7; + this.txtDiskonGrosir1.Text = "0"; + this.txtDiskonGrosir1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtDiskonGrosir1.ThousandSeparator = false; + // + // txtDiskonGrosir2 + // + this.txtDiskonGrosir2.AutoEnter = true; + this.txtDiskonGrosir2.Conversion = OpenRetail.App.UserControl.EConversion.Normal; + this.txtDiskonGrosir2.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); + this.txtDiskonGrosir2.LeaveFocusColor = System.Drawing.Color.White; + this.txtDiskonGrosir2.LetterOnly = false; + this.txtDiskonGrosir2.Location = new System.Drawing.Point(106, 278); + this.txtDiskonGrosir2.MaxLength = 8; + this.txtDiskonGrosir2.Name = "txtDiskonGrosir2"; + this.txtDiskonGrosir2.NumericOnly = true; + this.txtDiskonGrosir2.SelectionText = false; + this.txtDiskonGrosir2.Size = new System.Drawing.Size(40, 20); + this.txtDiskonGrosir2.TabIndex = 9; + this.txtDiskonGrosir2.Text = "0"; + this.txtDiskonGrosir2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtDiskonGrosir2.ThousandSeparator = false; + // + // txtDiskonGrosir3 + // + this.txtDiskonGrosir3.AutoEnter = true; + this.txtDiskonGrosir3.Conversion = OpenRetail.App.UserControl.EConversion.Normal; + this.txtDiskonGrosir3.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); + this.txtDiskonGrosir3.LeaveFocusColor = System.Drawing.Color.White; + this.txtDiskonGrosir3.LetterOnly = false; + this.txtDiskonGrosir3.Location = new System.Drawing.Point(106, 328); + this.txtDiskonGrosir3.MaxLength = 8; + this.txtDiskonGrosir3.Name = "txtDiskonGrosir3"; + this.txtDiskonGrosir3.NumericOnly = true; + this.txtDiskonGrosir3.SelectionText = false; + this.txtDiskonGrosir3.Size = new System.Drawing.Size(40, 20); + this.txtDiskonGrosir3.TabIndex = 11; + this.txtDiskonGrosir3.Text = "0"; + this.txtDiskonGrosir3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtDiskonGrosir3.ThousandSeparator = false; + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Controls.Add(this.txtHargaGrosir1); + this.flowLayoutPanel1.Controls.Add(this.label18); + this.flowLayoutPanel1.Controls.Add(this.txtJumlahMinimalGrosir1); + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel1.Location = new System.Drawing.Point(103, 200); + this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(384, 25); + this.flowLayoutPanel1.TabIndex = 6; + // + // txtHargaGrosir1 + // + this.txtHargaGrosir1.AutoEnter = true; + this.txtHargaGrosir1.Conversion = OpenRetail.App.UserControl.EConversion.Normal; + this.txtHargaGrosir1.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); + this.txtHargaGrosir1.LeaveFocusColor = System.Drawing.Color.White; + this.txtHargaGrosir1.LetterOnly = false; + this.txtHargaGrosir1.Location = new System.Drawing.Point(3, 3); + this.txtHargaGrosir1.MaxLength = 20; + this.txtHargaGrosir1.Name = "txtHargaGrosir1"; + this.txtHargaGrosir1.NumericOnly = true; + this.txtHargaGrosir1.SelectionText = false; + this.txtHargaGrosir1.Size = new System.Drawing.Size(100, 20); + this.txtHargaGrosir1.TabIndex = 0; + this.txtHargaGrosir1.Text = "0"; + this.txtHargaGrosir1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txtHargaGrosir1.ThousandSeparator = true; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Dock = System.Windows.Forms.DockStyle.Fill; + this.label18.Location = new System.Drawing.Point(109, 1); + this.label18.Margin = new System.Windows.Forms.Padding(3, 1, 3, 0); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(78, 25); + this.label18.TabIndex = 5; + this.label18.Text = "Jumlah Minimal"; + this.label18.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtJumlahMinimalGrosir1 + // + this.txtJumlahMinimalGrosir1.AutoEnter = true; + this.txtJumlahMinimalGrosir1.Conversion = OpenRetail.App.UserControl.EConversion.Normal; + this.txtJumlahMinimalGrosir1.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); + this.txtJumlahMinimalGrosir1.LeaveFocusColor = System.Drawing.Color.White; + this.txtJumlahMinimalGrosir1.LetterOnly = false; + this.txtJumlahMinimalGrosir1.Location = new System.Drawing.Point(193, 3); + this.txtJumlahMinimalGrosir1.MaxLength = 8; + this.txtJumlahMinimalGrosir1.Name = "txtJumlahMinimalGrosir1"; + this.txtJumlahMinimalGrosir1.NumericOnly = true; + this.txtJumlahMinimalGrosir1.SelectionText = false; + this.txtJumlahMinimalGrosir1.Size = new System.Drawing.Size(40, 20); + this.txtJumlahMinimalGrosir1.TabIndex = 1; + this.txtJumlahMinimalGrosir1.Text = "0"; + this.txtJumlahMinimalGrosir1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtJumlahMinimalGrosir1.ThousandSeparator = false; + // + // flowLayoutPanel2 + // + this.flowLayoutPanel2.Controls.Add(this.txtHargaGrosir2); + this.flowLayoutPanel2.Controls.Add(this.label19); + this.flowLayoutPanel2.Controls.Add(this.txtJumlahMinimalGrosir2); + this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel2.Location = new System.Drawing.Point(103, 250); + this.flowLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); + this.flowLayoutPanel2.Name = "flowLayoutPanel2"; + this.flowLayoutPanel2.Size = new System.Drawing.Size(384, 25); + this.flowLayoutPanel2.TabIndex = 8; + // + // txtHargaGrosir2 + // + this.txtHargaGrosir2.AutoEnter = true; + this.txtHargaGrosir2.Conversion = OpenRetail.App.UserControl.EConversion.Normal; + this.txtHargaGrosir2.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); + this.txtHargaGrosir2.LeaveFocusColor = System.Drawing.Color.White; + this.txtHargaGrosir2.LetterOnly = false; + this.txtHargaGrosir2.Location = new System.Drawing.Point(3, 3); + this.txtHargaGrosir2.MaxLength = 20; + this.txtHargaGrosir2.Name = "txtHargaGrosir2"; + this.txtHargaGrosir2.NumericOnly = true; + this.txtHargaGrosir2.SelectionText = false; + this.txtHargaGrosir2.Size = new System.Drawing.Size(100, 20); + this.txtHargaGrosir2.TabIndex = 0; + this.txtHargaGrosir2.Text = "0"; + this.txtHargaGrosir2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txtHargaGrosir2.ThousandSeparator = true; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Dock = System.Windows.Forms.DockStyle.Fill; + this.label19.Location = new System.Drawing.Point(109, 1); + this.label19.Margin = new System.Windows.Forms.Padding(3, 1, 3, 0); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(78, 25); + this.label19.TabIndex = 5; + this.label19.Text = "Jumlah Minimal"; + this.label19.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtJumlahMinimalGrosir2 + // + this.txtJumlahMinimalGrosir2.AutoEnter = true; + this.txtJumlahMinimalGrosir2.Conversion = OpenRetail.App.UserControl.EConversion.Normal; + this.txtJumlahMinimalGrosir2.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); + this.txtJumlahMinimalGrosir2.LeaveFocusColor = System.Drawing.Color.White; + this.txtJumlahMinimalGrosir2.LetterOnly = false; + this.txtJumlahMinimalGrosir2.Location = new System.Drawing.Point(193, 3); + this.txtJumlahMinimalGrosir2.MaxLength = 8; + this.txtJumlahMinimalGrosir2.Name = "txtJumlahMinimalGrosir2"; + this.txtJumlahMinimalGrosir2.NumericOnly = true; + this.txtJumlahMinimalGrosir2.SelectionText = false; + this.txtJumlahMinimalGrosir2.Size = new System.Drawing.Size(40, 20); + this.txtJumlahMinimalGrosir2.TabIndex = 1; + this.txtJumlahMinimalGrosir2.Text = "0"; + this.txtJumlahMinimalGrosir2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtJumlahMinimalGrosir2.ThousandSeparator = false; + // + // flowLayoutPanel3 + // + this.flowLayoutPanel3.Controls.Add(this.txtHargaGrosir3); + this.flowLayoutPanel3.Controls.Add(this.label20); + this.flowLayoutPanel3.Controls.Add(this.txtJumlahMinimalGrosir3); + this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel3.Location = new System.Drawing.Point(103, 300); + this.flowLayoutPanel3.Margin = new System.Windows.Forms.Padding(0); + this.flowLayoutPanel3.Name = "flowLayoutPanel3"; + this.flowLayoutPanel3.Size = new System.Drawing.Size(384, 25); + this.flowLayoutPanel3.TabIndex = 10; + // + // txtHargaGrosir3 + // + this.txtHargaGrosir3.AutoEnter = true; + this.txtHargaGrosir3.Conversion = OpenRetail.App.UserControl.EConversion.Normal; + this.txtHargaGrosir3.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); + this.txtHargaGrosir3.LeaveFocusColor = System.Drawing.Color.White; + this.txtHargaGrosir3.LetterOnly = false; + this.txtHargaGrosir3.Location = new System.Drawing.Point(3, 3); + this.txtHargaGrosir3.MaxLength = 20; + this.txtHargaGrosir3.Name = "txtHargaGrosir3"; + this.txtHargaGrosir3.NumericOnly = true; + this.txtHargaGrosir3.SelectionText = false; + this.txtHargaGrosir3.Size = new System.Drawing.Size(100, 20); + this.txtHargaGrosir3.TabIndex = 0; + this.txtHargaGrosir3.Text = "0"; + this.txtHargaGrosir3.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.txtHargaGrosir3.ThousandSeparator = true; + // + // label20 + // + this.label20.AutoSize = true; + this.label20.Dock = System.Windows.Forms.DockStyle.Fill; + this.label20.Location = new System.Drawing.Point(109, 1); + this.label20.Margin = new System.Windows.Forms.Padding(3, 1, 3, 0); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(78, 25); + this.label20.TabIndex = 5; + this.label20.Text = "Jumlah Minimal"; + this.label20.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txtJumlahMinimalGrosir3 + // + this.txtJumlahMinimalGrosir3.AutoEnter = true; + this.txtJumlahMinimalGrosir3.Conversion = OpenRetail.App.UserControl.EConversion.Normal; + this.txtJumlahMinimalGrosir3.EnterFocusColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192))))); + this.txtJumlahMinimalGrosir3.LeaveFocusColor = System.Drawing.Color.White; + this.txtJumlahMinimalGrosir3.LetterOnly = false; + this.txtJumlahMinimalGrosir3.Location = new System.Drawing.Point(193, 3); + this.txtJumlahMinimalGrosir3.MaxLength = 8; + this.txtJumlahMinimalGrosir3.Name = "txtJumlahMinimalGrosir3"; + this.txtJumlahMinimalGrosir3.NumericOnly = true; + this.txtJumlahMinimalGrosir3.SelectionText = false; + this.txtJumlahMinimalGrosir3.Size = new System.Drawing.Size(40, 20); + this.txtJumlahMinimalGrosir3.TabIndex = 1; + this.txtJumlahMinimalGrosir3.Text = "0"; + this.txtJumlahMinimalGrosir3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.txtJumlahMinimalGrosir3.ThousandSeparator = false; + // // FrmEntryProduk // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(392, 334); + this.ClientSize = new System.Drawing.Size(487, 509); this.Controls.Add(this.tableLayoutPanel3); this.Name = "FrmEntryProduk"; this.Text = "FrmEntryProduk"; this.Controls.SetChildIndex(this.tableLayoutPanel3, 0); this.tableLayoutPanel3.ResumeLayout(false); this.tableLayoutPanel3.PerformLayout(); + this.flowLayoutPanel1.ResumeLayout(false); + this.flowLayoutPanel1.PerformLayout(); + this.flowLayoutPanel2.ResumeLayout(false); + this.flowLayoutPanel2.PerformLayout(); + this.flowLayoutPanel3.ResumeLayout(false); + this.flowLayoutPanel3.PerformLayout(); this.ResumeLayout(false); } @@ -412,6 +783,28 @@ private void InitializeComponent() private UserControl.AdvancedTextbox txtMinStokGudang; private System.Windows.Forms.Label label10; private UserControl.AdvancedTextbox txtDiskon; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label label17; + private UserControl.AdvancedTextbox txtDiskonGrosir1; + private UserControl.AdvancedTextbox txtDiskonGrosir2; + private UserControl.AdvancedTextbox txtDiskonGrosir3; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3; + private UserControl.AdvancedTextbox txtHargaGrosir1; + private System.Windows.Forms.Label label18; + private UserControl.AdvancedTextbox txtJumlahMinimalGrosir1; + private UserControl.AdvancedTextbox txtHargaGrosir2; + private System.Windows.Forms.Label label19; + private UserControl.AdvancedTextbox txtJumlahMinimalGrosir2; + private UserControl.AdvancedTextbox txtHargaGrosir3; + private System.Windows.Forms.Label label20; + private UserControl.AdvancedTextbox txtJumlahMinimalGrosir3; } } \ No newline at end of file diff --git a/src/OpenRetail.App/Referensi/FrmEntryProduk.cs b/src/OpenRetail.App/Referensi/FrmEntryProduk.cs index fa041c2..05a752d 100644 --- a/src/OpenRetail.App/Referensi/FrmEntryProduk.cs +++ b/src/OpenRetail.App/Referensi/FrmEntryProduk.cs @@ -29,6 +29,7 @@ using OpenRetail.Bll.Api; using OpenRetail.App.UI.Template; using OpenRetail.App.Helper; +using OpenRetail.App.UserControl; namespace OpenRetail.App.Referensi { @@ -38,6 +39,10 @@ public partial class FrmEntryProduk : FrmEntryStandard private Produk _produk = null; private IList _listOfGolongan; + private IList _listOfTxtHargaGrosir = new List(); + private IList _listOfTxtJumlahGrosir = new List(); + private IList _listOfTxtDiskonGrosir = new List(); + private bool _isNewData = false; public IListener Listener { private get; set; } @@ -56,6 +61,7 @@ public FrmEntryProduk(string header, Golongan golongan, IList listOfGo txtKodeProduk.Text = this._bll.GetLastKodeProduk(); LoadDataGolongan(); + LoadInputGrosir(); if (golongan != null) cmbGolongan.SelectedItem = golongan.nama_golongan; @@ -83,11 +89,50 @@ public FrmEntryProduk(string header, Produk produk, IList listOfGolong txtStokGudang.Text = this._produk.stok_gudang.ToString(); txtMinStokGudang.Text = this._produk.minimal_stok_gudang.ToString(); + LoadInputGrosir(); + LoadDataGolongan(); if (this._produk.Golongan != null) cmbGolongan.SelectedItem = this._produk.Golongan.nama_golongan; } + private void LoadInputGrosir() + { + _listOfTxtHargaGrosir.Add(txtHargaGrosir1); + _listOfTxtHargaGrosir.Add(txtHargaGrosir2); + _listOfTxtHargaGrosir.Add(txtHargaGrosir3); + + _listOfTxtJumlahGrosir.Add(txtJumlahMinimalGrosir1); + _listOfTxtJumlahGrosir.Add(txtJumlahMinimalGrosir2); + _listOfTxtJumlahGrosir.Add(txtJumlahMinimalGrosir3); + + _listOfTxtDiskonGrosir.Add(txtDiskonGrosir1); + _listOfTxtDiskonGrosir.Add(txtDiskonGrosir2); + _listOfTxtDiskonGrosir.Add(txtDiskonGrosir3); + + if (this._produk != null) + { + var listOfHargaGrosir = this._produk.list_of_harga_grosir; + if (listOfHargaGrosir.Count > 0) + { + var index = 0; + foreach (var grosir in listOfHargaGrosir) + { + var txtHargaGrosir = _listOfTxtHargaGrosir[index]; + txtHargaGrosir.Text = grosir.harga_grosir.ToString(); + + var txtJumlahMinGrosir = _listOfTxtJumlahGrosir[index]; + txtJumlahMinGrosir.Text = grosir.jumlah_minimal.ToString(); + + var txtDiskonGrosir = _listOfTxtDiskonGrosir[index]; + txtDiskonGrosir.Text = grosir.diskon.ToString(); + + index++; + } + } + } + } + private void LoadDataGolongan() { cmbGolongan.Items.Clear(); @@ -104,6 +149,45 @@ protected override void Simpan() { if (_isNewData) _produk = new Produk(); + + if (_produk.list_of_harga_grosir.Count == 0) + { + var index = 0; + foreach (var item in _listOfTxtHargaGrosir) + { + var txtHargaGrosir = _listOfTxtHargaGrosir[index]; + var txtJumlahMinGrosir = _listOfTxtJumlahGrosir[index]; + var txtDiskonGrosir = _listOfTxtDiskonGrosir[index]; + + var hargaGrosir = new HargaGrosir + { + harga_ke = index + 1, + harga_grosir = NumberHelper.StringToDouble(txtHargaGrosir.Text), + jumlah_minimal = NumberHelper.StringToDouble(txtJumlahMinGrosir.Text, true), + diskon = NumberHelper.StringToDouble(txtDiskonGrosir.Text, true) + }; + + _produk.list_of_harga_grosir.Add(hargaGrosir); + + index++; + } + } + else + { + var index = 0; + foreach (var item in _produk.list_of_harga_grosir) + { + var txtHargaGrosir = _listOfTxtHargaGrosir[index]; + var txtJumlahMinGrosir = _listOfTxtJumlahGrosir[index]; + var txtDiskonGrosir = _listOfTxtDiskonGrosir[index]; + + item.harga_grosir = NumberHelper.StringToDouble(txtHargaGrosir.Text); + item.jumlah_minimal = NumberHelper.StringToDouble(txtJumlahMinGrosir.Text, true); + item.diskon = NumberHelper.StringToDouble(txtDiskonGrosir.Text, true); + + index++; + } + } var golongan = _listOfGolongan[cmbGolongan.SelectedIndex]; _produk.golongan_id = golongan.golongan_id; diff --git a/src/OpenRetail.App/Referensi/FrmListProdukWithNavigation.cs b/src/OpenRetail.App/Referensi/FrmListProdukWithNavigation.cs index 85a7a73..a4143b9 100644 --- a/src/OpenRetail.App/Referensi/FrmListProdukWithNavigation.cs +++ b/src/OpenRetail.App/Referensi/FrmListProdukWithNavigation.cs @@ -36,6 +36,7 @@ using log4net; using System.IO; using System.Diagnostics; +using Syncfusion.Styles; namespace OpenRetail.App.Referensi { @@ -121,7 +122,7 @@ private void LoadDataProduk(string golonganId = "", int sortIndex = 1) else _listOfProduk = _bll.GetAll(sortIndex, _pageNumber, _pageSize, ref _pagesCount); - GridListControlHelper.Refresh(this.gridList, _listOfProduk); + GridListControlHelper.Refresh(this.gridList, _listOfProduk, additionalRowCount: 1); base.SetInfoHalaman(_pageNumber, _pagesCount); base.SetStateBtnNavigation(_pageNumber, _pagesCount); @@ -141,8 +142,8 @@ private void LoadDataProdukByName(string name, int sortIndex = 1) using (new StCursor(Cursors.WaitCursor, new TimeSpan(0, 0, 0, 0))) { _listOfProduk = _bll.GetByName(name, sortIndex, _pageNumber, _pageSize, ref _pagesCount); - GridListControlHelper.Refresh(this.gridList, _listOfProduk); - + GridListControlHelper.Refresh(this.gridList, _listOfProduk, additionalRowCount: 1); + base.SetInfoHalaman(_pageNumber, _pagesCount); base.SetStateBtnNavigation(_pageNumber, _pagesCount); @@ -168,38 +169,111 @@ private void InitGridList() gridListProperties.Add(new GridListControlProperties { Header = "No", Width = 30 }); gridListProperties.Add(new GridListControlProperties { Header = "Golongan", Width = 130 }); gridListProperties.Add(new GridListControlProperties { Header = "Kode Produk", Width = 130 }); - gridListProperties.Add(new GridListControlProperties { Header = "Nama Produk", Width = 400 }); + gridListProperties.Add(new GridListControlProperties { Header = "Nama Produk", Width = 350 }); gridListProperties.Add(new GridListControlProperties { Header = "Satuan", Width = 100 }); - gridListProperties.Add(new GridListControlProperties { Header = "Harga Beli", Width = 100 }); - gridListProperties.Add(new GridListControlProperties { Header = "Harga Jual", Width = 100 }); + gridListProperties.Add(new GridListControlProperties { Header = "Harga Beli", Width = 70 }); + + gridListProperties.Add(new GridListControlProperties { Header = "Harga Jual", Width = 70 }); + gridListProperties.Add(new GridListControlProperties { Header = "Harga Jual", Width = 70 }); + gridListProperties.Add(new GridListControlProperties { Header = "Harga Jual", Width = 70 }); + gridListProperties.Add(new GridListControlProperties { Header = "Harga Jual", Width = 70 }); + gridListProperties.Add(new GridListControlProperties { Header = "Diskon", Width = 50 }); - gridListProperties.Add(new GridListControlProperties { Header = "Stok Etalase", Width = 90 }); - gridListProperties.Add(new GridListControlProperties { Header = "Stok Gudang", Width = 90 }); + gridListProperties.Add(new GridListControlProperties { Header = "Stok Etalase", Width = 60 }); + gridListProperties.Add(new GridListControlProperties { Header = "Stok Gudang", Width = 60 }); gridListProperties.Add(new GridListControlProperties { Header = "Min. Stok Gudang" }); - GridListControlHelper.InitializeGridListControl(this.gridList, _listOfProduk, gridListProperties, false); + GridListControlHelper.InitializeGridListControl(this.gridList, _listOfProduk, gridListProperties, false, additionalRowCount: 1); + this.gridList.Grid.Model.RowHeights[1] = 25; + this.gridList.Grid.Model.Rows.FrozenCount = 1; + + this.gridList.Grid.PrepareViewStyleInfo += delegate(object sender, GridPrepareViewStyleInfoEventArgs e) + { + var subHeaderHargaJual = new string[] { "Retail", "Grosir 1", "Grosir 2", "Grosir 3" }; + if (e.ColIndex > 6 && e.RowIndex == 1) + { + var colIndex = 7; + + foreach (var header in subHeaderHargaJual) + { + if (colIndex == e.ColIndex) + e.Style.Text = header; + + colIndex++; + } + } + }; if (_listOfProduk.Count > 0) - this.gridList.SetSelected(0, true); + this.gridList.SetSelected(1, true); + + // merge cell + var column = 1; // kolom no + this.gridList.Grid.CoveredRanges.Add(GridRangeInfo.Cells(0, column, 1, column)); + + column = 2; // kolom golongan + this.gridList.Grid.CoveredRanges.Add(GridRangeInfo.Cells(0, column, 1, column)); + + column = 3; // kolom kode + this.gridList.Grid.CoveredRanges.Add(GridRangeInfo.Cells(0, column, 1, column)); + + column = 4; // kolom nama produk + this.gridList.Grid.CoveredRanges.Add(GridRangeInfo.Cells(0, column, 1, column)); + + column = 5; // kolom satuan + this.gridList.Grid.CoveredRanges.Add(GridRangeInfo.Cells(0, column, 1, column)); + + column = 6; // kolom harga beli + this.gridList.Grid.CoveredRanges.Add(GridRangeInfo.Cells(0, column, 1, column)); + + column = 7; // kolom harga jual + this.gridList.Grid.CoveredRanges.Add(GridRangeInfo.Cells(0, column, 0, column + 3)); + + column = 11; // kolom diskon + this.gridList.Grid.CoveredRanges.Add(GridRangeInfo.Cells(0, column, 1, column)); + + column = 12; // kolom stok etalase + this.gridList.Grid.CoveredRanges.Add(GridRangeInfo.Cells(0, column, 1, column)); + + column = 13; // kolom stok gudang + this.gridList.Grid.CoveredRanges.Add(GridRangeInfo.Cells(0, column, 1, column)); + + column = 14; // kolom minimal stok + this.gridList.Grid.CoveredRanges.Add(GridRangeInfo.Cells(0, column, 1, column)); + + var headerStyle = this.gridList.Grid.BaseStylesMap["Column Header"].StyleInfo; + headerStyle.CellType = GridCellTypeName.Header; this.gridList.Grid.QueryCellInfo += delegate(object sender, GridQueryCellInfoEventArgs e) { + if (e.RowIndex == 1) + { + if (e.ColIndex > 6) + { + e.Style.ModifyStyle(headerStyle, StyleModifyType.ApplyNew); + } + + // we handled it, let the grid know + e.Handled = true; + } if (_listOfProduk.Count > 0) - { - if (e.RowIndex > 0) + { + if (e.RowIndex > 1) { - var rowIndex = e.RowIndex - 1; + var rowIndex = e.RowIndex - 2; if (rowIndex < _listOfProduk.Count) { var produk = _listOfProduk[rowIndex]; + var listOfHargaGrosir = produk.list_of_harga_grosir; + var hargaGrosir = 0d; switch (e.ColIndex) { case 1: - var noUrut = (_pageNumber - 1) * _pageSize + e.RowIndex; + var noUrut = (_pageNumber - 1) * _pageSize + e.RowIndex - 1; e.Style.CellValue = noUrut; e.Style.HorizontalAlignment = GridHorizontalAlignment.Center; break; @@ -232,27 +306,48 @@ private void InitGridList() e.Style.HorizontalAlignment = GridHorizontalAlignment.Right; break; - case 7: + case 7: // harga jual ritel e.Style.CellValue = NumberHelper.NumberToString(produk.harga_jual); e.Style.HorizontalAlignment = GridHorizontalAlignment.Right; break; - case 8: + case 8: // harga grosir 1 + hargaGrosir = listOfHargaGrosir.Count > 0 ? listOfHargaGrosir[0].harga_grosir : 0; + + e.Style.CellValue = NumberHelper.NumberToString(hargaGrosir); + e.Style.HorizontalAlignment = GridHorizontalAlignment.Right; + break; + + case 9: // harga grosir 2 + hargaGrosir = listOfHargaGrosir.Count > 1 ? listOfHargaGrosir[1].harga_grosir : 0; + + e.Style.CellValue = NumberHelper.NumberToString(hargaGrosir); + e.Style.HorizontalAlignment = GridHorizontalAlignment.Right; + break; + + case 10: // harga grosir 3 + hargaGrosir = listOfHargaGrosir.Count > 2 ? listOfHargaGrosir[2].harga_grosir : 0; + + e.Style.CellValue = NumberHelper.NumberToString(hargaGrosir); + e.Style.HorizontalAlignment = GridHorizontalAlignment.Right; + break; + + case 11: e.Style.CellValue = produk.diskon; e.Style.HorizontalAlignment = GridHorizontalAlignment.Center; break; - case 9: + case 12: e.Style.CellValue = produk.stok; e.Style.HorizontalAlignment = GridHorizontalAlignment.Center; break; - case 10: + case 13: e.Style.CellValue = produk.stok_gudang; e.Style.HorizontalAlignment = GridHorizontalAlignment.Center; break; - case 11: + case 14: e.Style.CellValue = produk.minimal_stok_gudang; e.Style.HorizontalAlignment = GridHorizontalAlignment.Center; break; @@ -280,11 +375,11 @@ public void Ok(object sender, bool isNewData, object data) if (isNewData) { - GridListControlHelper.AddObject(this.gridList, _listOfProduk, produk); + GridListControlHelper.AddObject(this.gridList, _listOfProduk, produk, additionalRowCount: 1); ResetButton(); } else - GridListControlHelper.UpdateObject(this.gridList, _listOfProduk, produk); + GridListControlHelper.UpdateObject(this.gridList, _listOfProduk, produk, additionalRowCount: 1); } private void txtNamaProduk_KeyPress(object sender, KeyPressEventArgs e) @@ -334,7 +429,7 @@ protected override void Tambah() protected override void Perbaiki() { - var index = this.gridList.SelectedIndex; + var index = this.gridList.SelectedIndex - 1; if (!base.IsSelectedItem(index, this.TabText)) return; @@ -349,7 +444,7 @@ protected override void Perbaiki() protected override void Hapus() { - var index = this.gridList.SelectedIndex; + var index = this.gridList.SelectedIndex - 1; if (!base.IsSelectedItem(index, this.TabText)) return; @@ -361,7 +456,7 @@ protected override void Hapus() var result = _bll.Delete(produk); if (result > 0) { - GridListControlHelper.RemoveObject(this.gridList, _listOfProduk, produk); + GridListControlHelper.RemoveObject(this.gridList, _listOfProduk, produk, additionalRowCount: 1); ResetButton(); } else diff --git a/src/OpenRetail.App/Transaksi/FrmEntryPenjualanProduk.cs b/src/OpenRetail.App/Transaksi/FrmEntryPenjualanProduk.cs index a98e242..e2326b6 100644 --- a/src/OpenRetail.App/Transaksi/FrmEntryPenjualanProduk.cs +++ b/src/OpenRetail.App/Transaksi/FrmEntryPenjualanProduk.cs @@ -271,7 +271,10 @@ private void InitGridControl(GridControl grid) hargaBeli = produk.harga_beli; if (!(hargaJual > 0)) - hargaJual = produk.harga_jual; + { + jumlah = itemJual.jumlah - itemJual.jumlah_retur; + hargaJual = GetHargaJualFix(produk, jumlah, produk.harga_jual); + } } e.Style.CellValue = NumberHelper.NumberToString(hargaJual); @@ -305,11 +308,16 @@ private void InitGridControl(GridControl grid) } if (!(diskon > 0)) - diskon = produk.diskon > 0 ? produk.diskon : produk.Golongan.diskon; - } + { + var diskonProduk = GetDiskonJualFix(produk, jumlah, produk.diskon); + diskon = diskonProduk > 0 ? diskonProduk : produk.Golongan.diskon; + } + } - diskonRupiah = diskon / 100 * produk.harga_jual; - hargaJual = produk.harga_jual - diskonRupiah; + hargaJual = GetHargaJualFix(produk, jumlah, produk.harga_jual); + + diskonRupiah = diskon / 100 * hargaJual; + hargaJual -= diskonRupiah; } } @@ -340,23 +348,26 @@ private double SumGrid(IList listOfItemJual) foreach (var item in _listOfItemJual.Where(f => f.Produk != null)) { double harga = 0; + var jumlah = item.jumlah - item.jumlah_retur; if (item.harga_jual > 0) { - // harga = item.harga_jual; harga = item.harga_setelah_diskon; } else { if (item.Produk != null) { - double diskonRupiah = item.diskon / 100 * item.Produk.harga_jual; + var hargaJual = GetHargaJualFix(item.Produk, jumlah, item.Produk.harga_jual); + var diskon = GetDiskonJualFix(item.Produk, jumlah, item.diskon); + + double diskonRupiah = diskon / 100 * hargaJual; - harga = item.Produk.harga_jual - diskonRupiah; + harga = hargaJual - diskonRupiah; } } - total += harga * (item.jumlah - item.jumlah_retur); + total += harga * jumlah; } if (total > 0) @@ -374,6 +385,52 @@ private void RefreshTotal() lblTotal.Text = NumberHelper.NumberToString(SumGrid(_listOfItemJual)); } + private HargaGrosir GetHargaGrosir(Produk produk, double jumlah) + { + HargaGrosir hargaGrosir = null; + + if (produk.list_of_harga_grosir.Count > 0) + { + hargaGrosir = produk.list_of_harga_grosir + .Where(f => f.produk_id == produk.produk_id && f.jumlah_minimal <= jumlah) + .LastOrDefault(); + } + + return hargaGrosir; + } + + private double GetHargaJualFix(Produk produk, double jumlah, double hargaJualRetail) + { + var result = hargaJualRetail; + + if (jumlah > 1) + { + var grosir = GetHargaGrosir(produk, jumlah); + if (grosir != null) + { + result = grosir.harga_grosir; + } + } + + return result; + } + + private double GetDiskonJualFix(Produk produk, double jumlah, double diskonJualRetail) + { + var result = diskonJualRetail; + + if (jumlah > 1) + { + var grosir = GetHargaGrosir(produk, jumlah); + if (grosir != null) + { + result = grosir.diskon; + } + } + + return result; + } + protected override void Simpan() { if (this._customer == null || txtCustomer.Text.Length == 0) @@ -477,7 +534,7 @@ protected override void Simpan() item.harga_beli = item.Produk.harga_beli; if (!(item.harga_jual > 0)) - item.harga_jual = item.Produk.harga_jual; + item.harga_jual = GetHargaJualFix(item.Produk, item.jumlah - item.jumlah_retur, item.Produk.harga_jual); } if (!_isNewData) // update @@ -637,7 +694,10 @@ public void Ok(object sender, object data) } if (!(diskon > 0)) - diskon = produk.diskon > 0 ? produk.diskon : produk.Golongan.diskon; + { + var diskonProduk = GetDiskonJualFix(produk, 1, produk.diskon); + diskon = diskonProduk > 0 ? diskonProduk : produk.Golongan.diskon; + } SetItemProduk(this.gridControl, _rowIndex, _colIndex + 1, produk, diskon: diskon); this.gridControl.Refresh(); @@ -829,7 +889,10 @@ private void gridControl_CurrentCellKeyDown(object sender, KeyEventArgs e) } if (!(diskon > 0)) - diskon = produk.diskon > 0 ? produk.diskon : produk.Golongan.diskon; + { + var diskonProduk = GetDiskonJualFix(produk, 1, produk.diskon); + diskon = diskonProduk > 0 ? diskonProduk : produk.Golongan.diskon; + } SetItemProduk(grid, rowIndex, colIndex, produk, diskon: diskon); grid.Refresh(); @@ -872,7 +935,10 @@ private void gridControl_CurrentCellKeyDown(object sender, KeyEventArgs e) } if (!(diskon > 0)) - diskon = produk.diskon > 0 ? produk.diskon : produk.Golongan.diskon; + { + var diskonProduk = GetDiskonJualFix(produk, 1, produk.diskon); + diskon = diskonProduk > 0 ? diskonProduk : produk.Golongan.diskon; + } SetItemProduk(grid, rowIndex, colIndex, produk, diskon: diskon); grid.Refresh(); @@ -958,6 +1024,9 @@ private void gridControl_CurrentCellValidated(object sender, EventArgs e) { case 4: // kolom jumlah itemJual.jumlah = NumberHelper.StringToDouble(cc.Renderer.ControlValue.ToString(), true); + + itemJual.diskon = GetDiskonJualFix(produk, itemJual.jumlah, itemJual.diskon); + itemJual.harga_jual = GetHargaJualFix(produk, itemJual.jumlah, itemJual.harga_jual); break; case 5: // kolom diskon @@ -971,7 +1040,7 @@ private void gridControl_CurrentCellValidated(object sender, EventArgs e) default: break; } - + SetItemProduk(grid, cc.RowIndex, cc.ColIndex, produk, itemJual.jumlah, itemJual.harga_jual, itemJual.diskon); grid.Refresh(); diff --git a/src/OpenRetail.App/Transaksi/FrmPreviewLabelNotaPenjualan.cs b/src/OpenRetail.App/Transaksi/FrmPreviewLabelNotaPenjualan.cs index 41f75d0..9d109c1 100644 --- a/src/OpenRetail.App/Transaksi/FrmPreviewLabelNotaPenjualan.cs +++ b/src/OpenRetail.App/Transaksi/FrmPreviewLabelNotaPenjualan.cs @@ -97,6 +97,8 @@ private void SetLabelNota() var kepada1 = _customer.nama_customer; var kepada2 = _customer.alamat; var kepada3 = string.Format("{0} - {1} - {2} - {3}", kecamatan, kelurahan, kota, kodePos); + kepada3 = kepada3.Replace(" - - - ", ""); + var kepada4 = telepon; // info alamat kirim berdasarkan data alamat yang diedit pada saat penjualan diff --git a/src/OpenRetail.App/Transaksi/FrmPreviewNotaPenjualan.cs b/src/OpenRetail.App/Transaksi/FrmPreviewNotaPenjualan.cs index d327bf6..63a5fac 100644 --- a/src/OpenRetail.App/Transaksi/FrmPreviewNotaPenjualan.cs +++ b/src/OpenRetail.App/Transaksi/FrmPreviewNotaPenjualan.cs @@ -96,6 +96,8 @@ private void chkIsSdac_CheckedChanged(object sender, EventArgs e) var kepada1 = _customer.nama_customer; var kepada2 = _customer.alamat; var kepada3 = string.Format("{0} - {1} - {2} - {3}", kecamatan, kelurahan, kota, kodePos); + kepada3 = kepada3.Replace(" - - - ", ""); + var kepada4 = telepon; if (!chk.Checked) diff --git a/src/OpenRetail.Bll.Service.UnitTest/ProdukBllTest.cs b/src/OpenRetail.Bll.Service.UnitTest/ProdukBllTest.cs index 2904cfb..0f5ac26 100644 --- a/src/OpenRetail.Bll.Service.UnitTest/ProdukBllTest.cs +++ b/src/OpenRetail.Bll.Service.UnitTest/ProdukBllTest.cs @@ -51,6 +51,25 @@ public void CleanUp() _bll = null; } + [TestMethod] + public void GetHargaGrosirTest() + { + var obj = _bll.GetByKode("201607000000053"); + + if (obj.list_of_harga_grosir.Count > 0) + { + var jumlah = 9; + var hargaGrosir = obj.list_of_harga_grosir + .Where(f => f.produk_id == obj.produk_id && f.jumlah_minimal <= jumlah) + .OrderByDescending(f => f.harga_ke) + .LastOrDefault(); + + Assert.AreEqual(50000, hargaGrosir.harga_grosir); + Assert.AreEqual(5, hargaGrosir.jumlah_minimal); + Assert.AreEqual(1, hargaGrosir.diskon); + } + } + [TestMethod] public void GetByIDTest() { @@ -194,10 +213,15 @@ public void GetAllTest() [TestMethod] public void SaveTest() { + var listOfHargaGrosir = new List(); + listOfHargaGrosir.Add(new HargaGrosir { harga_ke = 1, harga_grosir = 15000, jumlah_minimal = 5, diskon = 1 }); + listOfHargaGrosir.Add(new HargaGrosir { harga_ke = 2, harga_grosir = 13000, jumlah_minimal = 10, diskon = 1.5 }); + listOfHargaGrosir.Add(new HargaGrosir { harga_ke = 3, harga_grosir = 10000, jumlah_minimal = 15, diskon = 2.5 }); + var obj = new Produk { - kode_produk = "201607000000521", - nama_produk = "Printer Epson L220 Inkjet", + kode_produk = "200111101234", + nama_produk = "Harga dengan grosir", satuan = "", stok = 10, minimal_stok = 5, @@ -207,6 +231,7 @@ public void SaveTest() stok_gudang = 15, minimal_stok_gudang = 5 }; + obj.list_of_harga_grosir = listOfHargaGrosir; var validationError = new ValidationError(); @@ -234,16 +259,18 @@ public void SaveTest() [TestMethod] public void UpdateTest() { - var obj = _bll.GetByID("9864948c-5dbc-42ac-91de-8844f546f47b"); + var obj = _bll.GetByID("53e03588-b9a2-43df-ae59-283e72917f9a"); obj.kode_produk_old = obj.kode_produk; - obj.nama_produk = "Printer Epson L220"; - obj.stok = 1; - obj.minimal_stok = 3; - obj.stok_gudang = 10; - obj.minimal_stok_gudang = 5; - obj.harga_beli = 100000; - obj.harga_jual = 1000000; - obj.golongan_id = "6ae85958-80c6-4f3a-bc01-53a715e25bf1"; + + var index = 0; + foreach (var item in obj.list_of_harga_grosir) + { + obj.list_of_harga_grosir[index].harga_grosir -= 100; + obj.list_of_harga_grosir[index].jumlah_minimal -= 2; + obj.list_of_harga_grosir[index].diskon -= 0.5; + + index++; + } var validationError = new ValidationError(); @@ -253,19 +280,18 @@ public void UpdateTest() Assert.IsTrue(result != 0); var updatedObj = _bll.GetByID(obj.produk_id); - Assert.IsNotNull(updatedObj); - Assert.AreEqual(obj.produk_id, updatedObj.produk_id); - Assert.AreEqual(obj.nama_produk, updatedObj.nama_produk); - Assert.AreEqual(obj.satuan, updatedObj.satuan); - Assert.AreEqual(obj.stok, updatedObj.stok); - Assert.AreEqual(obj.harga_beli, updatedObj.harga_beli); - Assert.AreEqual(obj.harga_jual, updatedObj.harga_jual); - Assert.AreEqual(obj.kode_produk, updatedObj.kode_produk); - Assert.AreEqual(obj.golongan_id, updatedObj.golongan_id); - Assert.AreEqual(obj.minimal_stok, updatedObj.minimal_stok); - Assert.AreEqual(obj.stok_gudang, updatedObj.stok_gudang); + Assert.IsNotNull(updatedObj); + Assert.AreEqual(obj.produk_id, updatedObj.produk_id); + Assert.AreEqual(obj.nama_produk, updatedObj.nama_produk); + Assert.AreEqual(obj.satuan, updatedObj.satuan); + Assert.AreEqual(obj.stok, updatedObj.stok); + Assert.AreEqual(obj.harga_beli, updatedObj.harga_beli); + Assert.AreEqual(obj.harga_jual, updatedObj.harga_jual); + Assert.AreEqual(obj.kode_produk, updatedObj.kode_produk); + Assert.AreEqual(obj.golongan_id, updatedObj.golongan_id); + Assert.AreEqual(obj.minimal_stok, updatedObj.minimal_stok); + Assert.AreEqual(obj.stok_gudang, updatedObj.stok_gudang); Assert.AreEqual(obj.minimal_stok_gudang, updatedObj.minimal_stok_gudang); - } [TestMethod] @@ -273,7 +299,7 @@ public void DeleteTest() { var obj = new Produk { - produk_id = "9864948c-5dbc-42ac-91de-8844f546f47b" + produk_id = "53e03588-b9a2-43df-ae59-283e72917f9a" }; var result = _bll.Delete(obj); diff --git a/src/OpenRetail.Bll.Service/CetakNotaBll.cs b/src/OpenRetail.Bll.Service/CetakNotaBll.cs index f9f4ae6..e4ab1b8 100644 --- a/src/OpenRetail.Bll.Service/CetakNotaBll.cs +++ b/src/OpenRetail.Bll.Service/CetakNotaBll.cs @@ -63,17 +63,17 @@ public IList GetNotaPenjualan(string jualProdukId) foreach (var item in oList) { - item.kecamatan = string.IsNullOrEmpty(item.kecamatan) ? "-" : item.kecamatan; - item.kelurahan = string.IsNullOrEmpty(item.kelurahan) ? "-" : item.kelurahan; - item.kota = string.IsNullOrEmpty(item.kota) ? "-" : item.kota; - item.kode_pos = string.IsNullOrEmpty(item.kode_pos) ? "-" : item.kode_pos; - item.telepon = string.IsNullOrEmpty(item.telepon) ? "-" : item.telepon; + item.kecamatan = string.IsNullOrEmpty(item.kecamatan) ? "" : item.kecamatan; + item.kelurahan = string.IsNullOrEmpty(item.kelurahan) ? "" : item.kelurahan; + item.kota = string.IsNullOrEmpty(item.kota) ? "" : item.kota; + item.kode_pos = string.IsNullOrEmpty(item.kode_pos) ? "" : item.kode_pos; + item.telepon = string.IsNullOrEmpty(item.telepon) ? "" : item.telepon; - item.kirim_kecamatan = string.IsNullOrEmpty(item.kirim_kecamatan) ? "-" : item.kirim_kecamatan; - item.kirim_kelurahan = string.IsNullOrEmpty(item.kirim_kelurahan) ? "-" : item.kirim_kelurahan; - item.kirim_kota = string.IsNullOrEmpty(item.kirim_kota) ? "-" : item.kirim_kota; - item.kirim_kode_pos = string.IsNullOrEmpty(item.kirim_kode_pos) ? "-" : item.kirim_kode_pos; - item.kirim_telepon = string.IsNullOrEmpty(item.kirim_telepon) ? "-" : item.kirim_telepon; + item.kirim_kecamatan = string.IsNullOrEmpty(item.kirim_kecamatan) ? "" : item.kirim_kecamatan; + item.kirim_kelurahan = string.IsNullOrEmpty(item.kirim_kelurahan) ? "" : item.kirim_kelurahan; + item.kirim_kota = string.IsNullOrEmpty(item.kirim_kota) ? "" : item.kirim_kota; + item.kirim_kode_pos = string.IsNullOrEmpty(item.kirim_kode_pos) ? "" : item.kirim_kode_pos; + item.kirim_telepon = string.IsNullOrEmpty(item.kirim_telepon) ? "" : item.kirim_telepon; item.label_dari1 = string.IsNullOrEmpty(item.label_dari1) ? "" : item.label_dari1; item.label_dari2 = string.IsNullOrEmpty(item.label_dari2) ? "" : item.label_dari2; diff --git a/src/OpenRetail.Bll.Service/ImportExportDataProdukBll.cs b/src/OpenRetail.Bll.Service/ImportExportDataProdukBll.cs index c519964..ff43526 100644 --- a/src/OpenRetail.Bll.Service/ImportExportDataProdukBll.cs +++ b/src/OpenRetail.Bll.Service/ImportExportDataProdukBll.cs @@ -74,7 +74,11 @@ public bool IsValidFormat() var colums = new string[] { "GOLONGAN", "KODE PRODUK", "NAMA PRODUK", "SATUAN", - "HARGA BELI", "HARGA JUAL", "DISKON", "STOK ETALASE", "STOK GUDANG", "MINIMAL STOK GUDANG" + "HARGA BELI", "HARGA JUAL (RETAIL)", "DISKON (RETAIL)", + "HARGA GROSIR #1", "JUMLAH MINIMAL GROSIR #1", "DISKON GROSIR #1", + "HARGA GROSIR #2", "JUMLAH MINIMAL GROSIR #2", "DISKON GROSIR #2", + "HARGA GROSIR #3", "JUMLAH MINIMAL GROSIR #3", "DISKON GROSIR #3", + "STOK ETALASE", "STOK GUDANG", "MINIMAL STOK GUDANG" }; for (int i = 0; i < colums.Length; i++) @@ -123,6 +127,10 @@ public bool Import(ref int rowCount) var listOfProduk = new List(); + var hargaGrosir1 = new HargaGrosir(); + var hargaGrosir2 = new HargaGrosir(); + var hargaGrosir3 = new HargaGrosir(); + listOfProduk = supplierTable.DataRange.Rows().Select(row => new Produk { Golongan = new Golongan { nama_golongan = row.Field("GOLONGAN").GetString() }, @@ -130,8 +138,34 @@ public bool Import(ref int rowCount) nama_produk = row.Field("NAMA PRODUK").GetString(), satuan = row.Field("SATUAN").GetString(), harga_beli = row.Field("HARGA BELI").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("HARGA BELI").GetString()), - harga_jual = row.Field("HARGA JUAL").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("HARGA JUAL").GetString()), - diskon = row.Field("DISKON").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("DISKON").GetString()), + harga_jual = row.Field("HARGA JUAL (RETAIL)").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("HARGA JUAL (RETAIL)").GetString()), + diskon = row.Field("DISKON (RETAIL)").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("DISKON (RETAIL)").GetString()), + + list_of_harga_grosir = new List + { + new HargaGrosir + { + harga_ke = 1, + harga_grosir = row.Field("HARGA GROSIR #1").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("HARGA GROSIR #1").GetString()), + jumlah_minimal = row.Field("JUMLAH MINIMAL GROSIR #1").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("JUMLAH MINIMAL GROSIR #1").GetString()), + diskon = row.Field("DISKON GROSIR #1").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("DISKON GROSIR #1").GetString()) + }, + new HargaGrosir + { + harga_ke = 2, + harga_grosir = row.Field("HARGA GROSIR #2").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("HARGA GROSIR #2").GetString()), + jumlah_minimal = row.Field("JUMLAH MINIMAL GROSIR #2").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("JUMLAH MINIMAL GROSIR #2").GetString()), + diskon = row.Field("DISKON GROSIR #2").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("DISKON GROSIR #2").GetString()) + }, + new HargaGrosir + { + harga_ke = 3, + harga_grosir = row.Field("HARGA GROSIR #3").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("HARGA GROSIR #3").GetString()), + jumlah_minimal = row.Field("JUMLAH MINIMAL GROSIR #3").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("JUMLAH MINIMAL GROSIR #3").GetString()), + diskon = row.Field("DISKON GROSIR #3").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("DISKON GROSIR #3").GetString()) + } + }, + stok = row.Field("STOK ETALASE").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("STOK ETALASE").GetString()), stok_gudang = row.Field("STOK GUDANG").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("STOK GUDANG").GetString()), minimal_stok_gudang = row.Field("MINIMAL STOK GUDANG").GetString().Length == 0 ? 0 : Convert.ToDouble(row.Field("MINIMAL STOK GUDANG").GetString()) @@ -149,7 +183,7 @@ public bool Import(ref int rowCount) using (IDapperContext context = new DapperContext()) { IUnitOfWork uow = new UnitOfWork(context, _log); - + foreach (var produk in listOfProduk) { if (produk.nama_produk.Length > 0 && produk.Golongan.nama_golongan.Length > 0) @@ -188,6 +222,19 @@ public bool Import(ref int rowCount) produk.stok = oldProduk.stok; produk.stok_gudang = oldProduk.stok_gudang; + foreach (var grosir in produk.list_of_harga_grosir.OrderBy(f => f.harga_ke)) + { + var oldGrosir = oldProduk.list_of_harga_grosir + .Where(f => f.produk_id == produk.produk_id && f.harga_ke == grosir.harga_ke) + .SingleOrDefault(); + + if (oldGrosir != null) + { + grosir.harga_grosir_id = oldGrosir.harga_grosir_id; + grosir.produk_id = oldGrosir.produk_id; + } + } + result = Convert.ToBoolean(uow.ProdukRepository.Update(produk)); } } @@ -220,11 +267,24 @@ public void Export(IList listOfObject) ws.Cell(1, 4).Value = "NAMA PRODUK"; ws.Cell(1, 5).Value = "SATUAN"; ws.Cell(1, 6).Value = "HARGA BELI"; - ws.Cell(1, 7).Value = "HARGA JUAL"; - ws.Cell(1, 8).Value = "DISKON"; - ws.Cell(1, 9).Value = "STOK ETALASE"; - ws.Cell(1, 10).Value = "STOK GUDANG"; - ws.Cell(1, 11).Value = "MINIMAL STOK GUDANG"; + ws.Cell(1, 7).Value = "HARGA JUAL (RETAIL)"; + ws.Cell(1, 8).Value = "DISKON (RETAIL)"; + + ws.Cell(1, 9).Value = "HARGA GROSIR #1"; + ws.Cell(1, 10).Value = "JUMLAH MINIMAL GROSIR #1"; + ws.Cell(1, 11).Value = "DISKON GROSIR #1"; + + ws.Cell(1, 12).Value = "HARGA GROSIR #2"; + ws.Cell(1, 13).Value = "JUMLAH MINIMAL GROSIR #2"; + ws.Cell(1, 14).Value = "DISKON GROSIR #2"; + + ws.Cell(1, 15).Value = "HARGA GROSIR #3"; + ws.Cell(1, 16).Value = "JUMLAH MINIMAL GROSIR #3"; + ws.Cell(1, 17).Value = "DISKON GROSIR #3"; + + ws.Cell(1, 18).Value = "STOK ETALASE"; + ws.Cell(1, 19).Value = "STOK GUDANG"; + ws.Cell(1, 20).Value = "MINIMAL STOK GUDANG"; var noUrut = 1; foreach (var produk in listOfObject) @@ -237,9 +297,24 @@ public void Export(IList listOfObject) ws.Cell(1 + noUrut, 6).Value = produk.harga_beli; ws.Cell(1 + noUrut, 7).Value = produk.harga_jual; ws.Cell(1 + noUrut, 8).Value = produk.diskon; - ws.Cell(1 + noUrut, 9).Value = produk.stok; - ws.Cell(1 + noUrut, 10).Value = produk.stok_gudang; - ws.Cell(1 + noUrut, 11).Value = produk.minimal_stok_gudang; + + var listOfHargaGrosir = produk.list_of_harga_grosir; + if (listOfHargaGrosir.Count > 0) + { + var column = 9; + foreach (var grosir in listOfHargaGrosir) + { + ws.Cell(1 + noUrut, column).Value = grosir.harga_grosir; + ws.Cell(1 + noUrut, column + 1).Value = grosir.jumlah_minimal; + ws.Cell(1 + noUrut, column + 2).Value = grosir.diskon; + + column += 3; + } + } + + ws.Cell(1 + noUrut, 18).Value = produk.stok; + ws.Cell(1 + noUrut, 19).Value = produk.stok_gudang; + ws.Cell(1 + noUrut, 20).Value = produk.minimal_stok_gudang; noUrut++; } diff --git a/src/OpenRetail.Model/HargaGrosir.cs b/src/OpenRetail.Model/HargaGrosir.cs new file mode 100644 index 0000000..ab8e979 --- /dev/null +++ b/src/OpenRetail.Model/HargaGrosir.cs @@ -0,0 +1,45 @@ +/** + * Copyright (C) 2017 Kamarudin (http://coding4ever.net/) + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + * + * The latest version of this file can be found at https://github.com/rudi-krsoftware/open-retail + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Dapper.Contrib.Extensions; + +namespace OpenRetail.Model +{ + [Table("m_harga_grosir")] + public class HargaGrosir + { + [ExplicitKey] + public string harga_grosir_id { get; set; } + + public string produk_id { get; set; } + + [Write(false)] + public Produk Produk { get; set; } + + public int harga_ke { get; set; } + public double harga_grosir { get; set; } + public double jumlah_minimal { get; set; } + public double diskon { get; set; } + } +} diff --git a/src/OpenRetail.Model/OpenRetail.Model.csproj b/src/OpenRetail.Model/OpenRetail.Model.csproj index a5b225e..9537a30 100644 --- a/src/OpenRetail.Model/OpenRetail.Model.csproj +++ b/src/OpenRetail.Model/OpenRetail.Model.csproj @@ -68,6 +68,7 @@ + diff --git a/src/OpenRetail.Model/Produk.cs b/src/OpenRetail.Model/Produk.cs index fc3ed67..2b94f3a 100644 --- a/src/OpenRetail.Model/Produk.cs +++ b/src/OpenRetail.Model/Produk.cs @@ -31,6 +31,11 @@ namespace OpenRetail.Model [Table("m_produk")] public class Produk { + public Produk() + { + list_of_harga_grosir = new List(); + } + [ExplicitKey] [Display(Name = "produk_id")] public string produk_id { get; set; } @@ -79,6 +84,9 @@ public double asset { get { return (stok + stok_gudang) > 0 ? (stok + stok_gudang) * harga_jual : 0; } } + + [Write(false)] + public IList list_of_harga_grosir { get; set; } } public class ProdukValidator : AbstractValidator diff --git a/src/OpenRetail.Report/RvNotaPenjualanProdukTanpaLabel.rdlc b/src/OpenRetail.Report/RvNotaPenjualanProdukTanpaLabel.rdlc index be9944a..99b12a8 100644 --- a/src/OpenRetail.Report/RvNotaPenjualanProdukTanpaLabel.rdlc +++ b/src/OpenRetail.Report/RvNotaPenjualanProdukTanpaLabel.rdlc @@ -1564,7 +1564,7 @@ - =" " & First(Iif(Fields!is_sdac.Value = False, Fields!kirim_kecamatan.Value, Fields!kecamatan.Value & " - " & Fields!kelurahan.Value & " - " & Fields!kota.Value & " - " & Fields!kode_pos.Value), "NotaPenjualan") + =" " & Replace(First(Iif(Fields!is_sdac.Value = False, Fields!kirim_kecamatan.Value, Fields!kecamatan.Value & " - " & Fields!kelurahan.Value & " - " & Fields!kota.Value & " - " & Fields!kode_pos.Value), "NotaPenjualan"), " - - - ", "")