예제 #1
0
        private void cmdAddMenu_Click(object sender, RoutedEventArgs e)
        {
            String name = (sender as MenuItem).Name;

            String qtype = "1";

            if (name.Equals("mnuDetail"))
            {
                qtype = "2";
            }

            String caption = (sender as MenuItem).Header.ToString();

            if (!CHelper.VerifyAccessRight("SALE_QUOTATION_ADD"))
            {
                return;
            }

            WinAddEditQuotation w = new WinAddEditQuotation("A", itemSources, null, docType, qtype);

            w.Caption = CLanguage.getValue("add") + " " + caption;
            w.ShowDialog();
            if (w.IsPreviewNeed)
            {
                WinFormPrinting wp = new WinFormPrinting("grpPurchasePO", getDocumentObject(w.CreatedID));
                wp.ShowDialog();
            }
        }
예제 #2
0
        private void cmdPreview_Click(object sender, RoutedEventArgs e)
        {
            String          group = "grpPurchasePO";
            WinFormPrinting w     = new WinFormPrinting(group, vw);

            w.ShowDialog();
        }
예제 #3
0
        private void cmdTaxReport_Click(object sender, RoutedEventArgs e)
        {
            bool result = CHelper.ValidateTextBox(lblEmployeeTax, txtTaxYear, false);

            if (!result)
            {
                return;
            }

            MEmployee emp = vw as MEmployee;

            CTable dat = emp.GetDbObject().CloneAll();

            dat.SetFieldValue("TAX_YEAR", txtTaxYear.Text);
            dat.SetFieldValue("EMPLOYEE_ID", emp.EmployeeID);
            CTable    obj = OnixWebServiceAPI.SubmitObjectAPI("GetEmployeeTaxYearSummary", dat);
            ArrayList arr = obj.GetChildArray("EMPLOYEE_YEARLY_SUMMARY");

            emp.EmployeeTax.TaxYear = txtTaxYear.Text;
            if (arr.Count > 0)
            {
                CTable o = (CTable)arr[0];

                emp.EmployeeTax.TaxAmount             = o.GetFieldValue("DEDUCT_TAX");
                emp.EmployeeTax.RevenueAmount         = o.GetFieldValue("RECEIVE_AMOUNT");
                emp.EmployeeTax.SocialInsuranceAmount = o.GetFieldValue("DEDUCT_SOCIAL_SECURITY");
            }

            WinFormPrinting w = new WinFormPrinting("grpHRTax", emp);

            w.ShowDialog();
        }
예제 #4
0
        private void CmdLeave_Click(object sender, RoutedEventArgs e)
        {
            MEmployeeLeave  mv = GetEmployeeLeaveInfo();
            WinFormPrinting w  = new WinFormPrinting("grpHRLeave", mv);

            w.ShowDialog();
        }
예제 #5
0
        private void cmdPreview_Click(object sender, RoutedEventArgs e)
        {
            String group = "grpChequePayment";

            if (loadParam.GenericType.Equals("2"))
            {
                WinFormPrinting w = new WinFormPrinting(group, vw);
                w.ShowDialog();
            }
        }
예제 #6
0
        private void cmdPreview_Click(object sender, RoutedEventArgs e)
        {
            String group = "grpInventoryBorrow";

            if (dt == InventoryDocumentType.InvDocReturn)
            {
                group = "grpInventoryReturn";
            }

            WinFormPrinting w = new WinFormPrinting(group, vw);

            w.ShowDialog();
        }
        private void cmdPreview_Click(object sender, RoutedEventArgs e)
        {
            String group = "grpSaleArReceipt";

            if (dt == AccountDocumentType.AcctDocApReceipt)
            {
                group = "grpPurchaseApReceipt";
            }

            WinFormPrinting w = new WinFormPrinting(group, vw);

            w.ShowDialog();
        }
예제 #8
0
        private void CmdPreview_Click(object sender, RoutedEventArgs e)
        {
            MVPayrollDocumentItem di = new MVPayrollDocumentItem(mv.GetDbObject().CloneAll());
            MVPayrollDocument     pd = new MVPayrollDocument(mvParent.GetDbObject().CloneAll());

            String temp = pd.PayrollAccountNo;

            pd.PayrollAccountNo = temp; //Refresh AccountNo Digit

            pd.PayrollItems.Clear();
            pd.AddPayrollDocItem(di);

            WinFormPrinting w = new WinFormPrinting("grpHRSlip", pd);

            w.ShowDialog();
        }
예제 #9
0
        private void mnuContextMenu_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mnu  = (sender as MenuItem);
            string   name = mnu.Name;

            if (name.Equals("mnuEdit"))
            {
                ShowEditWindowEx(docType, (MAccountDoc)currentObj, printPreview);
            }
            else if (name.Equals("mnuCopy") || name.Equals("mnuCopyHead"))
            {
                CTable t = currentObj.GetDbObject();
                CUtil.EnableForm(false, ParentControl);

                t.SetFieldValue("IS_ONLY_HEAD", "N");
                if (name.Equals("mnuCopyHead"))
                {
                    t.SetFieldValue("IS_ONLY_HEAD", "Y");
                }

                CTable newobj = OnixWebServiceAPI.CopyAccountDoc(t);

                if (newobj != null)
                {
                    MAccountDoc ivd = new MAccountDoc(newobj);
                    ItemAddedEvent(ivd, e);
                }
                else
                {
                    //Error here
                    CHelper.ShowErorMessage(OnixWebServiceAPI.GetLastErrorDescription(), "ERROR_USER_ADD", null);
                }

                CUtil.EnableForm(true, ParentControl);
            }
            else if (name.Equals("mnuPrint"))
            {
                CUtil.EnableForm(false, ParentControl);

                WinFormPrinting wp = new WinFormPrinting(docTypeToReportGroup(docType), getAccountDocObject((currentObj as MAccountDoc).AccountDocId));
                wp.ShowDialog();

                CUtil.EnableForm(true, ParentControl);
            }
        }
        private void cmdPreview_Click(object sender, RoutedEventArgs e)
        {
            String group = "grpSaleByCashInvoice";

            if (dt == AccountDocumentType.AcctDocDebtSale)
            {
                group = "grpSaleByDebtInvoice";
            }
            else if (dt == AccountDocumentType.AcctDocSaleOrder)
            {
                group = "grpSaleOrder";
            }

            vw.ConstructWhDefinitionFromDocItem();

            WinFormPrinting w = new WinFormPrinting(group, vw);

            w.ShowDialog();
        }
예제 #11
0
        private void cmdAdd_Click(object sender, RoutedEventArgs e)
        {
            String caption = CLanguage.getValue("purchase_po");

            if (!CHelper.VerifyAccessRight("PURCHASE_PO_ADD"))
            {
                return;
            }

            WinAddEditPurchaseOrder w = new WinAddEditPurchaseOrder("A", itemSources, null, docType);

            w.Caption = (String)(sender as Button).Content + " " + caption;
            w.ShowDialog();
            if (w.IsPreviewNeed)
            {
                WinFormPrinting wp = new WinFormPrinting("grpPurchasePO", getPurchaseOrderObject(w.CreatedID));
                wp.ShowDialog();
            }
        }
예제 #12
0
        private void showEditWindow()
        {
            String caption = CLanguage.getValue("sale_quotation");

            if (!CHelper.VerifyAccessRight("SALE_QUOTATION_VIEW"))
            {
                return;
            }

            MAuxilaryDoc v = (MAuxilaryDoc)currentObj;

            WinAddEditQuotation w = new WinAddEditQuotation("E", itemSources, v, docType, "2");

            w.Caption = CLanguage.getValue("edit") + " " + caption;
            w.ShowDialog();

            if (w.IsPreviewNeed)
            {
                WinFormPrinting wp = new WinFormPrinting("grpSaleQuotation", getDocumentObject(w.CreatedID));
                wp.ShowDialog();
            }
        }
예제 #13
0
        private void showEditWindow()
        {
            String caption = CLanguage.getValue("purchase_po");

            if (!CHelper.VerifyAccessRight("PURCHASE_PO_VIEW"))
            {
                return;
            }

            MAuxilaryDoc v = (MAuxilaryDoc)currentObj;

            WinAddEditPurchaseOrder w = new WinAddEditPurchaseOrder("E", itemSources, v, docType);

            w.Caption = CLanguage.getValue("edit") + " " + caption;
            w.ShowDialog();

            if (w.IsPreviewNeed)
            {
                WinFormPrinting wp = new WinFormPrinting("grpPurchasePO", getPurchaseOrderObject(w.CreatedID));
                wp.ShowDialog();
            }
        }
예제 #14
0
        private void mnuContextMenu_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mnu  = (sender as MenuItem);
            string   name = mnu.Name;

            if (name.Equals("mnuEdit"))
            {
                showEditWindow();
            }
            else if (name.Equals("mnuCopy"))
            {
                CTable t = currentObj.GetDbObject();
                //t.SetFieldValue("IS_ONLY_HEAD", "Y");
                CUtil.EnableForm(false, ParentControl);
                CTable newobj = OnixWebServiceAPI.CopyAuxilaryDoc(t);

                if (newobj != null)
                {
                    MAuxilaryDoc ivd = new MAuxilaryDoc(newobj);
                    ItemAddedEvent(ivd, e);
                }
                else
                {
                    //Error here
                    CHelper.ShowErorMessage(OnixWebServiceAPI.GetLastErrorDescription(), "ERROR_USER_ADD", null);
                }

                CUtil.EnableForm(true, ParentControl);
            }
            else if (name.Equals("mnuPrint"))
            {
                CUtil.EnableForm(false, ParentControl);

                WinFormPrinting wp = new WinFormPrinting("grpSaleQuotation", getDocumentObject((currentObj as MAuxilaryDoc).AuxilaryDocID));
                wp.ShowDialog();

                CUtil.EnableForm(true, ParentControl);
            }
        }
예제 #15
0
        private void cmdAdd_Click(object sender, RoutedEventArgs e)
        {
            int    type    = 1;
            String caption = "";

            if (docType == AccountDocumentType.AcctDocCashSale)
            {
                caption = CLanguage.getValue("sale_cash_saling");
                if (!CHelper.VerifyAccessRight("SALE_BYCASH_ADD"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocDebtSale)
            {
                caption = CLanguage.getValue("sale_debt_saling");
                if (!CHelper.VerifyAccessRight("SALE_BYCREDIT_ADD"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocDrNote)
            {
                type    = 2;
                caption = CLanguage.getValue("sale_debit_note");
                if (!CHelper.VerifyAccessRight("SALE_DRNOTE_ADD"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocCrNote)
            {
                type    = 2;
                caption = CLanguage.getValue("sale_credit_note");
                if (!CHelper.VerifyAccessRight("SALE_CRNOTE_ADD"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocBillSummary)
            {
                type    = 6;
                caption = CLanguage.getValue("bill_summary");
                if (!CHelper.VerifyAccessRight("SALE_BILLSUM_ADD"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocArReceipt)
            {
                type    = 3;
                caption = CLanguage.getValue("sale_ar_receipt");
                if (!CHelper.VerifyAccessRight("SALE_RECEIPT_ADD"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocMiscRevenue)
            {
                type    = 4;
                caption = CLanguage.getValue("sale_misc");
                if (!CHelper.VerifyAccessRight("SALE_MISC_ADD"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocCashDepositAr)
            {
                type    = 5;
                caption = CLanguage.getValue("cash_deposit_ar");
                if (!CHelper.VerifyAccessRight("SALE_DEPOSIT_ADD"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocSaleOrder)
            {
                type    = 1;
                caption = CLanguage.getValue("sale_order");
                if (!CHelper.VerifyAccessRight("SALE_ORDER_ADD"))
                {
                    return;
                }
            }

            if (type == 1)
            {
                MAccountDoc ad = null;

                Boolean isPromotion = false;
                String  cpt         = caption;

                if (sender is MenuItem)
                {
                    MenuItem mnu = (MenuItem)sender;

                    if (mnu.Name.Equals("mnuAddWithPromotion"))
                    {
                        isPromotion = true;
                        cpt         = (String)mnu.Header + caption;
                    }
                    else if (mnu.Name.Equals("mnuAddFromQuotation"))
                    {
                        //Create from Quotation
                        ad = createSaleOrderFromQuotation();
                        if (ad == null)
                        {
                            return;
                        }

                        cpt = caption;
                    }
                    else if (mnu.Name.Equals("mnuAddWithSaleOrder"))
                    {
                        //Create from SaleOrder
                        ad = createInvoiceFromSaleOrder();
                        if (ad == null)
                        {
                            return;
                        }

                        cpt = caption;
                    }
                }

                WinAddEditAccountSaleDoc w = new WinAddEditAccountSaleDoc("A", docType, itemSources, ad, isPromotion);
                w.Caption = cpt;
                w.ShowDialog();
                w.ItemAddedHandler = ItemAddedEvent;
                if (w.IsPreviewNeed)
                {
                    WinFormPrinting wp = new WinFormPrinting(docTypeToReportGroup(docType), getAccountDocObject(w.CreatedID));
                    wp.ShowDialog();
                }
            }
            else if (type == 2)
            {
                WinAddEditDrCrNote w = new WinAddEditDrCrNote("A", docType, itemSources, null);
                w.Caption = (String)(sender as Button).Content + " " + caption;
                w.ShowDialog();
            }
            else if (type == 3)
            {
                WinAddEditReceiptDoc w = new WinAddEditReceiptDoc("A", docType, itemSources, (MAccountDoc)null);
                w.Caption = (String)(sender as Button).Content + " " + caption;
                w.ShowDialog();
                //w.ItemAddedHandler = ItemAddedEvent;
                if (w.IsPreviewNeed)
                {
                    WinFormPrinting wp = new WinFormPrinting(docTypeToReportGroup(docType), getAccountDocObject(w.CreatedID));
                    wp.ShowDialog();
                }
            }
            else if (type == 4)
            {
                WinAddEditAccountMiscDoc w = new WinAddEditAccountMiscDoc("A", docType, itemSources, (MAccountDoc)null);
                w.Caption = (String)(sender as Button).Content + " " + caption;
                w.ShowDialog();

                if (w.IsPreviewNeed)
                {
                    WinFormPrinting wp = new WinFormPrinting(docTypeToReportGroup(docType), getAccountDocObject(w.CreatedID));
                    wp.ShowDialog();
                }
            }
            else if (type == 5)
            {
                WinAddEditCashDeposit w = new WinAddEditCashDeposit("A", docType, itemSources, (MAccountDoc)null);
                //w.Caption = (String)(sender as Button).Content + " " + caption;
                w.ShowDialog();
            }
            else if (type == 6)
            {
                WinAddEditBillSummary w = new WinAddEditBillSummary("A", docType, itemSources, (MAccountDoc)null);
                w.Caption = (String)(sender as Button).Content + " " + caption;
                w.ShowDialog();
                //if (w.IsPreviewNeed)
                //{
                //    WinFormPrinting wp = new WinFormPrinting(docTypeToReportGroup(docType), getAccountDocObject(w.CreatedID));
                //    wp.ShowDialog();
                //}
            }
        }
예제 #16
0
        private static void printPreview(MAccountDoc doc, String id, AccountDocumentType dt)
        {
            WinFormPrinting wp = new WinFormPrinting(docTypeToReportGroup(dt), getAccountDocObject(id));

            wp.ShowDialog();
        }
예제 #17
0
        private void CmdPreview_Click(object sender, RoutedEventArgs e)
        {
            WinFormPrinting w = new WinFormPrinting("grpHRSlip", mv);

            w.ShowDialog();
        }
예제 #18
0
        private void mnuReportFilter_Click(object sender, RoutedEventArgs e)
        {
            WinFormPrinting w = new WinFormPrinting("", null);

            w.ShowDialog();
        }