Ejemplo n.º 1
0
        private void dataNomorAkunDetailForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            Button[] arrButton = new Button[2];

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_PENGATURAN_NO_AKUN, gUtil.getUserGroupID());

            if (originModuleID == globalConstants.NEW_AKUN)
            {
                if (userAccessOption != 2 && userAccessOption != 6)
                {
                    gUtil.setReadOnlyAllControls(this);
                }
            }
            else if (originModuleID == globalConstants.EDIT_AKUN)
            {
                if (userAccessOption != 4 && userAccessOption != 6)
                {
                    gUtil.setReadOnlyAllControls(this);
                }
            }

            arrButton[0] = saveButton;
            arrButton[1] = ResetButton;
            gUtil.reArrangeButtonPosition(arrButton, arrButton[0].Top, this.Width);

            gUtil.reArrangeTabOrder(this);
        }
        private void dataCabangDetailForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            Button[] arrButton = new Button[2];

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_MANAJEMEN_CABANG, gUtil.getUserGroupID());

            if (originModuleID == globalConstants.NEW_BRANCH)
            {
                if (userAccessOption != 2 && userAccessOption != 6)
                {
                    gUtil.setReadOnlyAllControls(this);
                }
            }
            else if (originModuleID == globalConstants.EDIT_BRANCH)
            {
                if (userAccessOption != 4 && userAccessOption != 6)
                {
                    gUtil.setReadOnlyAllControls(this);
                }
            }

            arrButton[0] = saveButton;
            arrButton[1] = ResetButton;
            gUtil.reArrangeButtonPosition(arrButton, arrButton[0].Top, this.Width);

            gUtil.reArrangeTabOrder(this);
            branchNameTextBox.Select();
        }
Ejemplo n.º 3
0
        private void dataKategoriProdukDetailForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            Button[] arrButton = new Button[2];
            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_KATEGORI, gutil.getUserGroupID());

            if (originModuleID == globalConstants.NEW_CATEGORY)
            {
                if (userAccessOption != 2 && userAccessOption != 6)
                {
                    gutil.setReadOnlyAllControls(this);
                }
            }
            else if (originModuleID == globalConstants.EDIT_CATEGORY)
            {
                if (userAccessOption != 4 && userAccessOption != 6)
                {
                    gutil.setReadOnlyAllControls(this);
                }
            }

            arrButton[0] = saveButton;
            arrButton[1] = button1;
            gutil.reArrangeButtonPosition(arrButton, saveButton.Top, this.Width);

            gutil.reArrangeTabOrder(this);
            categoryNameTextBox.Select();
        }
        private void dataPenerimaanBarangForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            Button[] arrButton = new Button[2];

            PODtPicker_1.CustomFormat = globalUtilities.CUSTOM_DATE_FORMAT;
            PODtPicker_2.CustomFormat = globalUtilities.CUSTOM_DATE_FORMAT;
            fillInSupplierCombo();

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_PENERIMAAN_BARANG, gUtil.getUserGroupID());

            if (userAccessOption == 1)
            {
                newButton.Visible = true;
            }
            else
            {
                newButton.Visible = false;
            }

            //arrButton[0] = displayButton;
            //arrButton[1] = newButton;
            //gUtil.reArrangeButtonPosition(arrButton, arrButton[0].Top, this.Width);

            gUtil.reArrangeTabOrder(this);

            noPOInvoiceTextBox.Select();
        }
Ejemplo n.º 5
0
        public dataPelangganForm(int moduleID)
        {
            int userAccessOption = 0;

            InitializeComponent();

            originModuleID = moduleID;

            if (originModuleID == globalConstants.RETUR_PENJUALAN_STOCK_ADJUSTMENT)
            {
                unknownCustomerButton.Visible = true;
            }

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_PELANGGAN, gutil.getUserGroupID());

            if (userAccessOption == 2 || userAccessOption == 6)
            {
                newButton.Visible = true;
            }
            else
            {
                newButton.Visible = false;
            }

            if (originModuleID == globalConstants.RETUR_PENJUALAN_STOCK_ADJUSTMENT || originModuleID == globalConstants.PEMBAYARAN_PIUTANG)
            {
                newButton.Visible = false;
            }
        }
Ejemplo n.º 6
0
        private void dataProdukForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_TAMBAH_PRODUK, gutil.getUserGroupID());

            if (userAccessOption == 2 || userAccessOption == 6)
            {
                newButton.Visible = true;
            }
            else
            {
                newButton.Visible = false;
            }

            if (originModuleID == globalConstants.CASHIER_MODULE || originModuleID == globalConstants.PENERIMAAN_BARANG ||
                originModuleID == globalConstants.NEW_PURCHASE_ORDER || originModuleID == globalConstants.MUTASI_BARANG ||
                originModuleID == globalConstants.NEW_REQUEST_ORDER || originModuleID == globalConstants.RETUR_PENJUALAN ||
                originModuleID == globalConstants.RETUR_PENJUALAN_STOCK_ADJUSTMENT || originModuleID == globalConstants.RETUR_PEMBELIAN
                )
            {
                newButton.Visible             = false;
                produknonactiveoption.Visible = false;
            }

            gutil.reArrangeTabOrder(this);

            kodeProductTextBox.Select();
        }
        private void dataSalesInvoice_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            Button[] arrButton = new Button[2];

            PODtPicker_1.CustomFormat = globalUtilities.CUSTOM_DATE_FORMAT;
            PODtPicker_2.CustomFormat = globalUtilities.CUSTOM_DATE_FORMAT;
            fillInCustomerCombo();

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_SALES_QUOTATION, gUtil.getUserGroupID());

            if (userAccessOption == 1)
            {
                newInvoiceButton.Visible = true;
            }
            else
            {
                newInvoiceButton.Visible = false;
            }

            if (originModuleID == globalConstants.DELIVERY_ORDER || originModuleID == globalConstants.COPY_DELIVERY_ORDER)
            {
                newInvoiceButton.Visible = false;
            }

            arrButton[0] = displayButton;
            arrButton[1] = newInvoiceButton;
            gUtil.reArrangeButtonPosition(arrButton, arrButton[0].Top, this.Width);

            gUtil.reArrangeTabOrder(this);
        }
Ejemplo n.º 8
0
        private void dataPelangganDetailForm_Load(object sender, EventArgs e)
        {
            int userAccessOption;

            Button[] arrButton = new Button[2];

            dateJoinedDateTimePicked.Format       = DateTimePickerFormat.Custom;
            dateJoinedDateTimePicked.CustomFormat = globalUtilities.CUSTOM_DATE_FORMAT;

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_PELANGGAN, gUtil.getUserGroupID());

            if (originModuleID == globalConstants.NEW_CUSTOMER)
            {
                if (userAccessOption != 2 && userAccessOption != 6)
                {
                    gUtil.setReadOnlyAllControls(this);
                }
            }
            else if (originModuleID == globalConstants.EDIT_CUSTOMER)
            {
                if (userAccessOption != 4 && userAccessOption != 6)
                {
                    gUtil.setReadOnlyAllControls(this);
                }
            }

            loadRegionData();

            arrButton[0] = saveButton;
            arrButton[1] = resetbutton;
            gUtil.reArrangeButtonPosition(arrButton, arrButton[0].Top, this.Width);

            gUtil.reArrangeTabOrder(this);
        }
        private void dataUserDetailForm_Load(object sender, EventArgs e)
        {
            int userAccessOption;

            Button[] arrButton = new Button[2];

            errorLabel.Text = "";

            arrButton[0] = saveButton;
            arrButton[1] = resetbutton;
            gutil.reArrangeButtonPosition(arrButton, arrButton[0].Top, this.Width);

            gutil.reArrangeTabOrder(this);

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_MANAJEMEN_USER, gutil.getUserGroupID());

            if (originModuleID == globalConstants.NEW_USER)
            {
                if (userAccessOption != 2 && userAccessOption != 6)
                {
                    gutil.setReadOnlyAllControls(this);
                }
            }
            else if (originModuleID == globalConstants.EDIT_USER)
            {
                if (userAccessOption != 4 && userAccessOption != 6)
                {
                    gutil.setReadOnlyAllControls(this);
                }
            }
        }
        private void dataNomorAkunDetailForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            Button[] arrButton = new Button[2];

            isLoading = true;
            loadtypeaccount();
            errorLabel.Text = "";
            switch (originModuleID)
            {
            case globalConstants.NEW_AKUN:
                options = gUtil.INS;
                NonactiveCheckbox.Enabled = false;
                break;

            case globalConstants.EDIT_AKUN:
                options = gUtil.UPD;
                NonactiveCheckbox.Enabled = true;
                loadAccountData();
                break;
            }
            kodeTextbox.Select();

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_PENGATURAN_NO_AKUN, gUtil.getUserGroupID());

            if (originModuleID == globalConstants.NEW_AKUN)
            {
                if (userAccessOption != 2 && userAccessOption != 6)
                {
                    gUtil.setReadOnlyAllControls(this);
                }
            }
            else if (originModuleID == globalConstants.EDIT_AKUN)
            {
                if (userAccessOption != 4 && userAccessOption != 6)
                {
                    gUtil.setReadOnlyAllControls(this);
                }
            }

            arrButton[0] = saveButton;
            arrButton[1] = ResetButton;
            gUtil.reArrangeButtonPosition(arrButton, arrButton[0].Top, this.Width);

            gUtil.reArrangeTabOrder(this);

            isLoading = false;
        }
Ejemplo n.º 11
0
        private void dataUserForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            gutil.reArrangeTabOrder(this);

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_MANAJEMEN_USER, gutil.getUserGroupID());

            if (userAccessOption == 2 || userAccessOption == 6)
            {
                newButton.Visible = true;
            }
            else
            {
                newButton.Visible = false;
            }
        }
        private void dataKategoriProdukForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            gutil.reArrangeTabOrder(this);

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_KATEGORI, gutil.getUserGroupID());

            if (userAccessOption == 2 || userAccessOption == 6)
            {
                newButton.Visible = true;
            }
            else
            {
                newButton.Visible = false;
            }
            categoryNameTextBox.Select();
        }
Ejemplo n.º 13
0
        private void dataNomorAkun_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            gutil.reArrangeTabOrder(this);

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_PENGATURAN_NO_AKUN, gutil.getUserGroupID());

            if (userAccessOption == 2 || userAccessOption == 6)
            {
                newButton.Visible = true;
            }
            else
            {
                newButton.Visible = false;
            }

            namaAccountTextbox.Select();
        }
Ejemplo n.º 14
0
        private void dataCabangForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            gutil.reArrangeTabOrder(this);

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_MANAJEMEN_CABANG, gutil.getUserGroupID());

            if (userAccessOption == 2 || userAccessOption == 6)
            {
                newButton.Visible = true;
            }
            else
            {
                newButton.Visible = false;
            }

            namaBranchTextbox.Select();
        }
Ejemplo n.º 15
0
        private void pengaturanProdukForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_VIEW_HPP_PRODUCT, gutil.getUserGroupID());
            if (userAccessOption == 1)
            {
                allowViewHPP = true;
            }
            else
            {
                allowViewHPP = false;
            }

            errorLabel.Text = "";
            inisialisasiInterface();
            dataProdukDataGridView.EditingControlShowing += dataProdukDataGridView_EditingControlShowing;

            gutil.reArrangeTabOrder(this);
        }
Ejemplo n.º 16
0
        private void dataPOForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            Button[] arrButton = new Button[2];

            PODtPicker_1.CustomFormat = globalUtilities.CUSTOM_DATE_FORMAT;
            PODtPicker_2.CustomFormat = globalUtilities.CUSTOM_DATE_FORMAT;
            fillInSupplierCombo();

            if (originModuleID == globalConstants.PEMBAYARAN_HUTANG)
            {
                label2.Text = "Jatuh Tempo";
            }

            if (originModuleID == globalConstants.PENERIMAAN_BARANG_DARI_PO || originModuleID == globalConstants.PEMBAYARAN_HUTANG)
            {
                newButton.Visible       = false;
                showAllCheckBox.Visible = false;
            }

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_PURCHASE_ORDER, gUtil.getUserGroupID());

            if (userAccessOption == 2 || userAccessOption == 6)
            {
                newButton.Visible = true;
            }
            else
            {
                newButton.Visible = false;
            }

            //arrButton[0] = displayButton;
            //arrButton[1] = newButton;
            //gUtil.reArrangeButtonPosition(arrButton, arrButton[0].Top, this.Width);

            gUtil.reArrangeTabOrder(this);

            //noPOInvoiceTextBox.Select();
        }
        private void dataPermintaanForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            Button[] arrButton = new Button[3];

            RODtPicker_1.CustomFormat = globalUtilities.CUSTOM_DATE_FORMAT;
            RODtPicker_2.CustomFormat = globalUtilities.CUSTOM_DATE_FORMAT;

            fillInBranchCombo(branchFromCombo, branchFromHiddenCombo);
            fillInBranchCombo(branchToCombo, branchToHiddenCombo);

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_REQUEST_ORDER, gUtil.getUserGroupID());

            if (userAccessOption == 2 || userAccessOption == 6)
            {
                newButton.Visible    = true;
                importButton.Visible = true;
            }
            else
            {
                newButton.Visible    = false;
                importButton.Visible = false;
            }

            if (originModuleID == globalConstants.CEK_DATA_MUTASI)
            {
                newButton.Visible = false;
            }

            //arrButton[0] = displayButton;
            //arrButton[1] = newButton;
            //arrButton[2] = importButton;
            //gUtil.reArrangeButtonPosition(arrButton, arrButton[0].Top, this.Width);

            gUtil.reArrangeTabOrder(this);

            noROInvoiceTextBox.Select();
        }
Ejemplo n.º 18
0
        private void dataMutasiBarangForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            Button[] arrButton = new Button[3];

            PMDtPicker_1.CustomFormat = globalUtilities.CUSTOM_DATE_FORMAT;
            PMDtPicker_2.CustomFormat = globalUtilities.CUSTOM_DATE_FORMAT;

            fillInBranchCombo(branchToCombo, branchToComboHidden);

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_TAMBAH_MUTASI_BARANG, gutil.getUserGroupID());

            if (userAccessOption == 2 || userAccessOption == 6)
            {
                newButton.Visible    = true;
                importButton.Visible = true;
            }
            else
            {
                newButton.Visible    = false;
                importButton.Visible = false;
            }

            if (originModuleID == globalConstants.PENERIMAAN_BARANG)
            {
                newButton.Visible       = false;
                showAllCheckBox.Visible = false;
            }

            arrButton[0] = displayButton;
            arrButton[1] = newButton;
            arrButton[2] = importButton;
            gutil.reArrangeButtonPosition(arrButton, arrButton[0].Top, this.Width);

            gutil.reArrangeTabOrder(this);

            noMutasiTextBox.Select();
        }
Ejemplo n.º 19
0
        private void dataProdukDetailForm_Load(object sender, EventArgs e)
        {
            int userAccessOption = 0;

            Button[] arrButton = new Button[2];
            detailLokasiDataGridView.EditingControlShowing += detailLokasiDataGridView_EditingControlShowing;

            errorLabel.Text = "";

            isLoading = true;

            loadProdukData();

            loadProductLocationData();

            loadUnitIDInformation();

            loadProductCategoryData();

            loadKategoriIDInformation();

            isLoading = false;

            switch (originModuleID)
            {
            case globalConstants.NEW_PRODUK:
            case globalConstants.STOK_PECAH_BARANG:
                options = gUtil.INS;
                //kodeProdukTextBox.Enabled = true;
                break;

            case globalConstants.EDIT_PRODUK:
                options = gUtil.UPD;
                //kodeProdukTextBox.Enabled = false;
                break;
            }
            isLoading = false;

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_TAMBAH_PRODUK, gUtil.getUserGroupID());

            if (originModuleID == globalConstants.NEW_PRODUK)
            {
                if (userAccessOption != 2 && userAccessOption != 6)
                {
                    gUtil.setReadOnlyAllControls(this);
                }
            }
            else if (originModuleID == globalConstants.EDIT_PRODUK)
            {
                if (userAccessOption != 4 && userAccessOption != 6)
                {
                    gUtil.setReadOnlyAllControls(this);
                }
            }

            userAccessOption = DS.getUserAccessRight(globalConstants.MENU_VIEW_HPP_PRODUCT, gUtil.getUserGroupID());
            if (userAccessOption != 1)
            {
                label10.Visible    = false;
                hppTextBox.Visible = false;
                allowedViewHPP     = false;
            }
            else
            {
                allowedViewHPP = true;
            }

            arrButton[0] = saveButton;
            arrButton[1] = resetbutton;
            //gUtil.reArrangeButtonPosition(arrButton, arrButton[0].Top, this.Width);

            gUtil.reArrangeTabOrder(this, 1);
        }
Ejemplo n.º 20
0
        private void loadDataStockTake()
        {
            string          selectedDate = String.Format(culture, "{0:yyyyMMdd}", Convert.ToDateTime(stockTakeDateTimePicker.Value));
            string          sqlCommand   = "";
            MySqlDataReader rdr;

            //DataTable dt = new DataTable();

            if (detailDataGrid.ColumnCount <= 0)
            {
                return;
            }

            // CHECK WHETHER DATA HAS BEEN SAVED BEFORE OR NOT
            sqlCommand = "SELECT COUNT(1) FROM PRODUCT_DAILY_ADJUSTMENT_HEADER WHERE DATE_FORMAT(PRODUCT_ADJUSTMENT_DATE, '%Y%m%d')  = '" + selectedDate + "'";
            if (Convert.ToInt32(DS.getDataSingleValue(sqlCommand)) > 0)
            {
                int userAccessOption = DS.getUserAccessRight(globalConstants.REVISI_STOCK_TAKE_HARIAN, gUtil.getUserGroupID());

                if (userAccessOption == 1)
                {
                    sqlCommand = "SELECT PRODUCT_ADJUSTMENT_ID FROM PRODUCT_DAILY_ADJUSTMENT_HEADER WHERE DATE_FORMAT(PRODUCT_ADJUSTMENT_DATE, '%Y%m%d')  = '" + selectedDate + "'";
                    globalProductAdjustmentID = DS.getDataSingleValue(sqlCommand).ToString();

                    moduleID = EDIT_DAILY_STOCK_TAKE;

                    sqlCommand           = "SELECT STOCK_TAKE_CLOSED FROM PRODUCT_DAILY_ADJUSTMENT_HEADER WHERE DATE_FORMAT(PRODUCT_ADJUSTMENT_DATE, '%Y%m%d')  = '" + selectedDate + "'";
                    stockTakeCloseStatus = Convert.ToInt32(DS.getDataSingleValue(sqlCommand));

                    if (stockTakeCloseStatus == 1)
                    {
                        allowToEdit             = false;
                        detailDataGrid.ReadOnly = true;
                        label3.Text             = "CLOSED";
                        label3.Visible          = true;
                    }
                    else
                    {
                        allowToEdit = true;
                    }
                }
                else
                {
                    moduleID                = EDIT_DAILY_STOCK_TAKE;
                    allowToEdit             = false;
                    detailDataGrid.ReadOnly = true;
                }
            }

            switch (moduleID)
            {
            case NEW_DAILY_STOCK_TAKE:
                sqlCommand = "SELECT MP.PRODUCT_ID, MP.PRODUCT_NAME AS ROTI, MP.PRODUCT_STOCK_AWAL AS AWAL, (IFNULL(TAB1.TOTAL_RECEIVED, 0)-IFNULL(TAB4.TOTAL_RECEIVED_RETURN, 0)) AS PRODUKSI, '' AS REMARK, '0' AS BS, MP.PRODUCT_STOCK_QTY AS AKHIR, (IFNULL(TAB2.TOTAL_SALES, 0) + IFNULL(TAB_DO.TOTAL_DELIVERED, 0) - IFNULL(TAB3.TOTAL_SALES_RETURN, 0)) AS LAKU, " +
                             "IF(MP.PRODUCT_STOCK_AWAL > 0, MP.PRODUCT_STOCK_QTY - (MP.PRODUCT_STOCK_AWAL+ (IFNULL(TAB1.TOTAL_RECEIVED, 0)-IFNULL(TAB4.TOTAL_RECEIVED_RETURN, 0)) - (IFNULL(TAB2.TOTAL_SALES, 0)-IFNULL(TAB3.TOTAL_SALES_RETURN, 0))), '0') AS PENYESUAIAN, " +
                             "'0' AS RIILQTY " +
                             "FROM MASTER_PRODUCT MP LEFT OUTER JOIN " +
                             "(SELECT PRODUCT_ID, SUM(PRODUCT_ACTUAL_QTY) AS TOTAL_RECEIVED FROM PRODUCTS_RECEIVED_HEADER PRH, PRODUCTS_RECEIVED_DETAIL PRD WHERE PRD.PR_INVOICE = PRH.PR_INVOICE AND DATE_FORMAT(PRH.PR_DATE , '%Y%m%d')  = '" + selectedDate + "' GROUP BY PRODUCT_ID) TAB1 ON TAB1.PRODUCT_ID = MP.PRODUCT_ID ";

                if (gUtil.isServerApp() == 0)
                {
                    sqlCommand = sqlCommand + "LEFT OUTER JOIN (SELECT PRODUCT_ID, SUM(PRODUCT_QTY) AS TOTAL_SALES FROM SALES_HEADER SH, SALES_DETAIL SD WHERE SH.SALES_TOP = 1 AND SD.SALES_INVOICE = SH.SALES_INVOICE AND DATE_FORMAT(SH.SALES_DATE, '%Y%m%d')  = '" + selectedDate + "' GROUP BY PRODUCT_ID) TAB2 ON TAB2.PRODUCT_ID = MP.PRODUCT_ID " +
                                 "LEFT OUTER JOIN (SELECT '0' AS PRODUCT_ID, 0 AS TOTAL_DELIVERED) TAB_DO ON TAB_DO.PRODUCT_ID = MP.PRODUCT_ID ";
                }
                else
                {
                    sqlCommand = sqlCommand + "LEFT OUTER JOIN(SELECT PRODUCT_ID, SUM(PRODUCT_QTY) AS TOTAL_SALES FROM SALES_HEADER SH, SALES_DETAIL SD WHERE SH.SALES_TOP = 1 AND SD.SALES_INVOICE = SH.SALES_INVOICE AND DATE_FORMAT(SH.SALES_DATE, '%Y%m%d') = '" + selectedDate + "' GROUP BY PRODUCT_ID) TAB2 ON TAB2.PRODUCT_ID = MP.PRODUCT_ID " +
                                 "LEFT OUTER JOIN(SELECT DD.PRODUCT_ID, SUM(DD.PRODUCT_QTY) AS TOTAL_DELIVERED FROM DELIVERY_ORDER_HEADER DH, DELIVERY_ORDER_DETAIL DD WHERE DATE_FORMAT(DH.DO_DATE, '%Y%m%d') = '" + selectedDate + "' GROUP BY PRODUCT_ID) TAB_DO ON TAB_DO.PRODUCT_ID = MP.PRODUCT_ID ";
                }

                sqlCommand = sqlCommand + "LEFT OUTER JOIN(SELECT PRODUCT_ID, SUM(PRODUCT_RETURN_QTY) AS TOTAL_SALES_RETURN FROM RETURN_SALES_HEADER RSH, RETURN_SALES_DETAIL RSD WHERE RSD.RS_INVOICE = RSH.RS_INVOICE AND DATE_FORMAT(RSH.RS_DATETIME, '%Y%m%d')  = '" + selectedDate + "' GROUP BY PRODUCT_ID) TAB3 ON TAB3.PRODUCT_ID = MP.PRODUCT_ID " +
                             "LEFT OUTER JOIN(SELECT PRODUCT_ID, SUM(PRODUCT_QTY) AS TOTAL_RECEIVED_RETURN FROM RETURN_PURCHASE_HEADER RPH, RETURN_PURCHASE_DETAIL RPD WHERE RPD.RP_ID = RPH.RP_ID AND DATE_FORMAT(RPH.RP_DATE, '%Y%m%d')  = '" + selectedDate + "' GROUP BY PRODUCT_ID) TAB4 ON TAB4.PRODUCT_ID = MP.PRODUCT_ID " +
                             "WHERE MP.PRODUCT_ACTIVE = 1";
                break;

            case EDIT_DAILY_STOCK_TAKE:
                sqlCommand = "SELECT PAD.PRODUCT_ID, MP.PRODUCT_NAME AS ROTI, PAD.PRODUCT_LAST_STOCK_QTY AS AWAL, PAD.PRODUCT_RECEIVED_QTY AS PRODUKSI, PAD.REMARKS AS REMARK, PAD.PRODUCT_BS_QTY AS BS, PAD.PRODUCT_LEFTOVER_QTY AS AKHIR, PAD.PRODUCT_SOLD_QTY AS LAKU, PAD.PRODUCT_ADJUSTMENT_QTY AS PENYESUAIAN, PAD.PRODUCT_RIIL_QTY AS RIILQTY " +
                             "FROM PRODUCT_DAILY_ADJUSTMENT_HEADER PAH, PRODUCT_DAILY_ADJUSTMENT_DETAIL AS PAD, MASTER_PRODUCT MP " +
                             "WHERE PAD.PRODUCT_ADJUSTMENT_ID = PAH.PRODUCT_ADJUSTMENT_ID AND PAD.PRODUCT_ID = MP.PRODUCT_ID AND DATE_FORMAT(PAH.PRODUCT_ADJUSTMENT_DATE, '%Y%m%d')  = '" + selectedDate + "'";
                break;
            }

            using (rdr = DS.getData(sqlCommand))
            {
                detailDataGrid.Rows.Clear();
                if (rdr.HasRows)
                {
                    while (rdr.Read())
                    {
                        detailDataGrid.Rows.Add(rdr.GetString("PRODUCT_ID"),
                                                detailDataGrid.Rows.Count + 1,
                                                rdr.GetString("ROTI"),
                                                rdr.GetString("AWAL"),
                                                rdr.GetString("PRODUKSI"),
                                                rdr.GetString("LAKU"),
                                                rdr.GetString("PENYESUAIAN"),
                                                rdr.GetString("BS"),
                                                rdr.GetString("AKHIR"),
                                                rdr.GetString("RIILQTY"),
                                                rdr.GetString("REMARK"),
                                                rdr.GetString("AKHIR")
                                                );
                        BSQty.Add(rdr.GetString("BS"));
                        //calculateAkhirValue(detailDataGrid.Rows.Count-1);
                    }
                }
            }
            rdr.Close();
        }