コード例 #1
0
        public WinAddEditDrCrNoteApproved(String md, AccountDocumentType docType, ObservableCollection <MBaseModel> pItems, MAccountDoc actView)
        {
            dt = docType;

            actualView        = actView;
            parentItemsSource = pItems;
            Mode = md;

            vw         = new MAccountDoc(new CTable(""));
            vw.VATType = CGlobalVariable.GetGlobalVariableValue("DEFAULT_VAT_TYPE_SALE");

            if (md.Equals("A") && (actView != null))
            {
                //use actView as default value
                vw.BranchId   = actView.BranchId;
                vw.BranchCode = actView.BranchCode;
                vw.BranchName = actView.BranchName;

                vw.EntityId   = actView.EntityId;
                vw.EntityCode = actView.EntityCode;
                vw.EntityName = actView.EntityName;
            }

            DataContext     = vw;
            vw.DocumentType = ((int)dt).ToString();

            InitializeComponent();
        }
コード例 #2
0
        private void filterDrCrAmount(CTable o)
        {
            double revExp = CUtil.StringToDouble(o.GetFieldValue("REVENUE_EXPENSE_AMT"));
            double vatAmt = CUtil.StringToDouble(o.GetFieldValue("VAT_AMT"));
            double whAmt  = CUtil.StringToDouble(o.GetFieldValue("WH_TAX_AMT"));
            double amt    = CUtil.StringToDouble(o.GetFieldValue("CASH_RECEIPT_AMT"));

            int factor = 1;

            AccountDocumentType dt = (AccountDocumentType)CUtil.StringToInt(o.GetFieldValue("DOCUMENT_TYPE"));

            if ((dt == AccountDocumentType.AcctDocDrNote) || (dt == AccountDocumentType.AcctDocDrNotePurchase))
            {
                factor = 1;
            }
            else if ((dt == AccountDocumentType.AcctDocCrNotePurchase) || (dt == AccountDocumentType.AcctDocCrNote))
            {
                factor = -1;
            }

            vatAmt = factor * Math.Abs(vatAmt);
            whAmt  = factor * Math.Abs(whAmt);
            amt    = factor * Math.Abs(amt);
            revExp = factor * Math.Abs(revExp);

            o.SetFieldValue("PRIMARY_REVENUE_EXPENSE_AMT", revExp.ToString());
            o.SetFieldValue("VAT_AMT", vatAmt.ToString());
            o.SetFieldValue("WH_TAX_AMT", whAmt.ToString());
            o.SetFieldValue("CASH_RECEIPT_AMT", amt.ToString());
        }
コード例 #3
0
        public WinAddEditDrCrNote(String md, AccountDocumentType docType, ObservableCollection <MBaseModel> pItems, MAccountDoc actView)
        {
            dt = docType;

            actualView        = actView;
            parentItemsSource = pItems;
            Mode = md;

            vw         = new MAccountDoc(new CTable(""));
            vw.VATType = CGlobalVariable.GetGlobalVariableValue("DEFAULT_VAT_TYPE_SALE");

            //บางครั้งการรับเงินจากลูกค้าล่วงหน้า จะให้ตรงนี้เป็น false แต่ว่าต้องไปรับเข้าเงินสดเองเพื่อให้บัญชี balance
            //รายการตรงนี้ จะไม่ถูกดึงไปคิด ตอนทำภาษีหัก ณ ที่จ่าย หรือ vat เพราะว่า ไม่ได้เป็นส่วนของรายรับ/จ่าย
            vw.ForExpenseRevenue = true;

            if (md.Equals("A") && (actView != null))
            {
                //use actView as default value
                vw.BranchId   = actView.BranchId;
                vw.BranchCode = actView.BranchCode;
                vw.BranchName = actView.BranchName;

                vw.EntityId   = actView.EntityId;
                vw.EntityCode = actView.EntityCode;
                vw.EntityName = actView.EntityName;
            }

            DataContext       = vw;
            vw.IsVatClaimable = true;
            vw.DocumentType   = ((int)dt).ToString();

            InitializeComponent();
        }
コード例 #4
0
        private void filterDrCrAmount(CTable o)
        {
            double vatAmt = CUtil.StringToDouble(o.GetFieldValue("VAT_AMT"));
            double amt    = CUtil.StringToDouble(o.GetFieldValue("REVENUE_EXPENSE_FOR_VAT_AMT"));
            double arap   = CUtil.StringToDouble(o.GetFieldValue("AR_AP_AMT"));

            int factor = 1;

            AccountDocumentType dt = (AccountDocumentType)CUtil.StringToInt(o.GetFieldValue("DOCUMENT_TYPE"));

            if ((dt == AccountDocumentType.AcctDocDrNote) || (dt == AccountDocumentType.AcctDocDrNotePurchase))
            {
                factor = 1;
            }
            else if ((dt == AccountDocumentType.AcctDocCrNotePurchase) || (dt == AccountDocumentType.AcctDocCrNote))
            {
                factor = -1;
            }

            vatAmt = factor * Math.Abs(vatAmt);
            amt    = factor * Math.Abs(amt);
            arap   = factor * Math.Abs(arap);

            o.SetFieldValue("VAT_AMT", vatAmt.ToString());
            o.SetFieldValue("REVENUE_EXPENSE_FOR_VAT_AMT", amt.ToString());
            o.SetFieldValue("AR_AP_AMT", arap.ToString());
        }
コード例 #5
0
        private void filterDrCrAmount(CTable o)
        {
            int factor = 1;

            String docType         = o.GetFieldValue("DOCUMENT_TYPE");
            AccountDocumentType dt = (AccountDocumentType)CUtil.StringToInt(docType);

            if ((dt == AccountDocumentType.AcctDocDrNote) || (dt == AccountDocumentType.AcctDocDrNotePurchase))
            {
                factor = 1;
            }
            else if ((dt == AccountDocumentType.AcctDocCrNotePurchase) || (dt == AccountDocumentType.AcctDocCrNote))
            {
                factor = -1;
            }

            ArrayList temps = new ArrayList {
                "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "TOTAL"
            };

            for (int i = 0; i <= 12; i++)
            {
                String mm  = (String)temps[i];
                double amt = CUtil.StringToDouble(o.GetFieldValue(mm));

                amt = factor * Math.Abs(amt);
                o.SetFieldValue(mm, amt.ToString());
            }

            o.SetFieldValue("DOC_TYPE_DESC", CLanguage.getValue("doc_" + docType));
        }
        public WinAddEditAccountPurchaseDocApproved(String md, AccountDocumentType docType, ObservableCollection <MBaseModel> pItems, MAccountDoc actView)
        {
            dt = docType;

            actualView        = actView;
            parentItemsSource = pItems;
            Mode = md;

            vw = new MAccountDoc(new CTable(""));
            vw.DocumentType = ((int)dt).ToString();
            DataContext     = vw;

            InitializeComponent();
        }
コード例 #7
0
        public WinAddEditAccountSaleDoc(String md, AccountDocumentType docType, ObservableCollection <MBaseModel> pItems, MLogImportIssue actView)
        {
            dt = docType;

            isBillCorrection = true;
            logImportIssue   = actView;
            Mode             = md;

            CTable o = new CTable("");

            o.SetFieldValue("LOG_IMPORT_ISSUE_ID", logImportIssue.LogImportIssueID);

            vw = new MAccountDoc(o);
            vw.DocumentType = ((int)dt).ToString();
            DataContext     = vw;

            InitializeComponent();
        }
コード例 #8
0
        private void ShowEditWindow()
        {
            MAccountDoc ad = new MAccountDoc(new CTable(""));

            ad.DocumentType = currentViewObj.DocumentType;
            ad.AccountDocId = currentViewObj.DocumentID;

            AccountDocumentType dt      = (AccountDocumentType)CUtil.StringToInt(ad.DocumentType);
            AccountDocumentType docType = (AccountDocumentType)CUtil.StringToInt(vw.DocumentType);

            if (docType == AccountDocumentType.AcctDocApReceipt)
            {
                CCriteriaAccountDocPurchase.ShowEditWindowEx(dt, ad, null);
            }
            else
            {
                CCriteriaAccountDocSale.ShowEditWindowEx(dt, ad, null);
            }
        }
コード例 #9
0
        public override void Initialize(string keyword)
        {
            Hashtable maps = new Hashtable();

            maps["mnuDebitNOteP"]     = AccountDocumentType.AcctDocDrNotePurchase;
            maps["mnuCreditNoteP"]    = AccountDocumentType.AcctDocCrNotePurchase;
            maps["mnuAPReceipt"]      = AccountDocumentType.AcctDocApReceipt;
            maps["mnuCashDepositAp"]  = AccountDocumentType.AcctDocCashDepositAp;
            maps["mnuPurchaseByCash"] = AccountDocumentType.AcctDocCashPurchase;
            maps["mnuPurchaseByDebt"] = AccountDocumentType.AcctDocDebtPurchase;
            maps["mnuPurchaseMisc"]   = AccountDocumentType.AcctDocMiscExpense;

            if (maps.ContainsKey(keyword))
            {
                AccountDocumentType dt = (AccountDocumentType)maps[keyword];
                SetDocumentType(dt);
                Init("");
            }
        }
コード例 #10
0
        private void filterDrCrAmount(CTable o)
        {
            double whAmt = CUtil.StringToDouble(o.GetFieldValue("WH_TAX_AMT"));
            double amt   = CUtil.StringToDouble(o.GetFieldValue("REVENUE_EXPENSE_AMT"));
            double arap  = CUtil.StringToDouble(o.GetFieldValue("AR_AP_AMT"));

            int factor = 1;

            String refDt = o.GetFieldValue("REF_DOCUMENT_TYPE");

            if (refDt.Equals(""))
            {
                //ซื้อสด
                refDt = o.GetFieldValue("DOCUMENT_TYPE");
            }
            else
            {
                //จ่ายชำระหนี้
                //Do nothing
            }

            AccountDocumentType dt = (AccountDocumentType)CUtil.StringToInt(refDt);

            if ((dt == AccountDocumentType.AcctDocDrNote) || (dt == AccountDocumentType.AcctDocDrNotePurchase))
            {
                factor = 1;
            }
            else if ((dt == AccountDocumentType.AcctDocCrNotePurchase) || (dt == AccountDocumentType.AcctDocCrNote))
            {
                factor = -1;
            }

            whAmt = factor * Math.Abs(whAmt);
            amt   = factor * Math.Abs(amt);
            arap  = factor * Math.Abs(arap);
            double total = arap - whAmt; //ยอดหลังหัก

            o.SetFieldValue("WH_TAX_AMT", whAmt.ToString());
            o.SetFieldValue("REVENUE_EXPENSE_AMT", amt.ToString());
            o.SetFieldValue("AR_AP_AMT", arap.ToString());
            o.SetFieldValue("REMAIN_AMT", total.ToString());
        }
コード例 #11
0
        public override void Initialize(string keyword)
        {
            Hashtable maps = new Hashtable();

            maps["mnuCashSelling"]   = AccountDocumentType.AcctDocCashSale;
            maps["mnuSaleOrder"]     = AccountDocumentType.AcctDocSaleOrder;
            maps["mnuDebtSelling"]   = AccountDocumentType.AcctDocDebtSale;
            maps["mnuDebitNOte"]     = AccountDocumentType.AcctDocDrNote;
            maps["mnuCreditNote"]    = AccountDocumentType.AcctDocCrNote;
            maps["mnuARReceipt"]     = AccountDocumentType.AcctDocArReceipt;
            maps["mnuBillSummary"]   = AccountDocumentType.AcctDocBillSummary;
            maps["mnuCashDepositAr"] = AccountDocumentType.AcctDocCashDepositAr;
            maps["mnuSaleMisc"]      = AccountDocumentType.AcctDocMiscRevenue;

            if (maps.ContainsKey(keyword))
            {
                AccountDocumentType dt = (AccountDocumentType)maps[keyword];
                SetDocumentType(dt);
                Init("");
            }
        }
コード例 #12
0
        public WinAddEditAccountSaleDoc(String md, AccountDocumentType docType, ObservableCollection <MBaseModel> pItems, MAccountDoc actView, Boolean isPromotion)
        {
            dt = docType;
            isPromotionMode = isPromotion;

            actualView        = actView;
            parentItemsSource = pItems;
            Mode = md;

            if (md.Equals("A") && (actualView != null))
            {
                vw = actualView;
            }
            else
            {
                vw = new MAccountDoc(new CTable(""));
            }
            vw.IsVatClaimable = true;
            DataContext       = vw;

            InitializeComponent();
        }
コード例 #13
0
        protected override ArrayList createPageParam()
        {
            MAccountDoc         ad = (MAccountDoc)dataSource;
            AccountDocumentType dt = (AccountDocumentType)CUtil.StringToInt(ad.DocumentType);

            int itemPerPage = CUtil.StringToInt(rptCfg.GetConfigValue("ItemPerPage"));

            ArrayList arr1 = null;

            if ((dt == AccountDocumentType.AcctDocApReceipt) || (dt == AccountDocumentType.AcctDocArReceipt))
            {
                //arr1 = createPageParamEasy(ad.ReceiptItems, itemPerPage);
                arr1 = createPageParamComplex(ad.ReceiptItems, itemPerPage);
            }
            else
            {
                //arr1 = createPageParamEasy(ad.AccountPoItems, itemPerPage);
                arr1 = createPageParamComplex(ad.AccountPoItems, itemPerPage);
            }

            return(arr1);
        }
コード例 #14
0
        private static String docTypeToReportGroup(AccountDocumentType docType)
        {
            String rptGroup = "";

            if (docType == AccountDocumentType.AcctDocCashSale)
            {
                rptGroup = "grpSaleByCashInvoice";
            }
            else if (docType == AccountDocumentType.AcctDocDebtSale)
            {
                rptGroup = "grpSaleByDebtInvoice";
            }
            else if (docType == AccountDocumentType.AcctDocArReceipt)
            {
                rptGroup = "grpSaleArReceipt";
            }
            else if (docType == AccountDocumentType.AcctDocMiscRevenue)
            {
                rptGroup = "grpSaleByCashInvoice";
            }

            return(rptGroup);
        }
コード例 #15
0
        private void cmdCR_Click(object sender, RoutedEventArgs e)
        {
            Boolean result = CHelper.ValidateLookup(lblCustomer, uCustomer, false);

            if (!result)
            {
                return;
            }

            AccountDocumentType crdrDt = AccountDocumentType.AcctDocCrNote;

            if (dt == AccountDocumentType.AcctDocApReceipt)
            {
                crdrDt = AccountDocumentType.AcctDocCrNotePurchase;
            }

            ObservableCollection <MBaseModel> itemSources = new ObservableCollection <MBaseModel>();

            WinAddEditDrCrNote w = new WinAddEditDrCrNote("A", crdrDt, itemSources, vw);

            w.Caption = (String)(sender as Button).Content;
            w.ShowDialog();
        }
コード例 #16
0
        private static String docTypeToReportGroup(AccountDocumentType dt)
        {
            String rptGroup = "";

            if (dt == AccountDocumentType.AcctDocCashPurchase)
            {
                rptGroup = "grpPurchaseByCashInvoice";
            }
            else if (dt == AccountDocumentType.AcctDocDebtPurchase)
            {
                rptGroup = "grpPurchaseByDebtInvoice";
            }
            else if (dt == AccountDocumentType.AcctDocApReceipt)
            {
                rptGroup = "grpPurchaseApReceipt";
            }
            else if (dt == AccountDocumentType.AcctDocMiscExpense)
            {
                rptGroup = "grpPurchaseByCashInvoice";
            }

            return(rptGroup);
        }
コード例 #17
0
        private void filterDrCrAmount(CTable o)
        {
            double vatAmt   = CUtil.StringToDouble(o.GetFieldValue("VAT_TAX_AMT"));
            double whAmt    = CUtil.StringToDouble(o.GetFieldValue("WH_TAX_AMT"));
            double amt      = CUtil.StringToDouble(o.GetFieldValue("REVENUE_EXPENSE_AMT"));
            String receipNo = o.GetFieldValue("RECEIPT_NO");
            String docNO    = o.GetFieldValue("DOCUMENT_NO");

            int factor = 1;

            AccountDocumentType dt = (AccountDocumentType)CUtil.StringToInt(o.GetFieldValue("DOCUMENT_TYPE"));

            if ((dt == AccountDocumentType.AcctDocDrNote) || (dt == AccountDocumentType.AcctDocDrNotePurchase))
            {
                factor = 1;
            }
            else if ((dt == AccountDocumentType.AcctDocCrNotePurchase) || (dt == AccountDocumentType.AcctDocCrNote))
            {
                factor = -1;
            }

            vatAmt = factor * Math.Abs(vatAmt);
            whAmt  = factor * Math.Abs(whAmt);
            amt    = factor * Math.Abs(amt);

            o.SetFieldValue("VAT_TAX_AMT", vatAmt.ToString());
            o.SetFieldValue("WH_TAX_AMT", whAmt.ToString());
            o.SetFieldValue("REVENUE_EXPENSE_AMT", amt.ToString());

            if (receipNo.Equals("") &&
                ((dt == AccountDocumentType.AcctDocCashSale) || (dt == AccountDocumentType.AcctDocCashPurchase) ||
                 (dt == AccountDocumentType.AcctDocMiscExpense) || (dt == AccountDocumentType.AcctDocMiscRevenue)))
            {
                o.SetFieldValue("RECEIPT_NO", docNO);
            }
        }
コード例 #18
0
        public static void ShowEditWindowEx(AccountDocumentType docType, MAccountDoc v, GenericAccountDocCallback printCallBack)
        {
            int type = 1;

            String caption = "";

            if (docType == AccountDocumentType.AcctDocCashSale)
            {
                caption = CLanguage.getValue("sale_cash_saling");
                if (!CHelper.VerifyAccessRight("SALE_BYCASH_VIEW"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocDebtSale)
            {
                caption = CLanguage.getValue("sale_debt_saling");
                if (!CHelper.VerifyAccessRight("SALE_BYCREDIT_VIEW"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocDrNote)
            {
                type = 2;

                caption = CLanguage.getValue("sale_debit_note");
                if (!CHelper.VerifyAccessRight("SALE_DRNOTE_VIEW"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocCrNote)
            {
                type = 2;

                caption = CLanguage.getValue("sale_credit_note");
                if (!CHelper.VerifyAccessRight("SALE_CRNOTE_VIEW"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocArReceipt)
            {
                type    = 3;
                caption = CLanguage.getValue("sale_ar_receipt");
                if (!CHelper.VerifyAccessRight("SALE_RECEIPT_VIEW"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocBillSummary)
            {
                type    = 6;
                caption = CLanguage.getValue("bill_summary");
                if (!CHelper.VerifyAccessRight("SALE_BILLSUM_VIEW"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocMiscRevenue)
            {
                type    = 4;
                caption = CLanguage.getValue("sale_misc");
                if (!CHelper.VerifyAccessRight("SALE_MISC_VIEW"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocCashDepositAr)
            {
                type    = 5;
                caption = CLanguage.getValue("cash_deposit_ar");
                if (!CHelper.VerifyAccessRight("SALE_DEPOSIT_VIEW"))
                {
                    return;
                }
            }
            else if (docType == AccountDocumentType.AcctDocSaleOrder)
            {
                type    = 1;
                caption = CLanguage.getValue("sale_order");
                if (!CHelper.VerifyAccessRight("SALE_ORDER_VIEW"))
                {
                    return;
                }
            }

            if (type == 1)
            {
                WinAddEditAccountSaleDoc w = new WinAddEditAccountSaleDoc("E", docType, null, v, v.IsPromotionMode);
                w.Caption = CLanguage.getValue("edit") + " " + caption;
                w.ShowDialog();

                if (w.IsPreviewNeed)
                {
                    printCallBack?.Invoke(v, w.CreatedID, docType);
                }
            }
            else if (type == 2)
            {
                WinAddEditDrCrNote w = new WinAddEditDrCrNote("E", docType, null, v);
                w.Caption = CLanguage.getValue("edit") + " " + caption;
                w.ShowDialog();
            }
            else if (type == 3)
            {
                WinAddEditReceiptDoc w = new WinAddEditReceiptDoc("E", docType, null, v);
                w.Caption = CLanguage.getValue("edit") + " " + caption;
                w.ShowDialog();

                if (w.IsPreviewNeed)
                {
                    printCallBack?.Invoke(v, w.CreatedID, docType);
                }
            }
            else if (type == 4)
            {
                WinAddEditAccountMiscDoc w = new WinAddEditAccountMiscDoc("E", docType, null, v);
                w.Caption = CLanguage.getValue("edit") + " " + caption;
                w.ShowDialog();

                if (w.IsPreviewNeed)
                {
                    printCallBack?.Invoke(v, w.CreatedID, docType);
                }
            }
            else if (type == 5)
            {
                WinAddEditCashDeposit w = new WinAddEditCashDeposit("E", docType, null, v);
                //w.Caption = CLanguage.getValue("edit") + " " + caption;
                w.ShowDialog();

                if (w.IsPreviewNeed)
                {
                    printCallBack?.Invoke(v, w.CreatedID, docType);
                }
            }
            else if (type == 6)
            {
                WinAddEditBillSummary w = new WinAddEditBillSummary("E", docType, null, v);
                w.Caption = CLanguage.getValue("edit") + " " + caption;
                w.ShowDialog();

                //if (w.IsPreviewNeed)
                //{
                //    printCallBack?.Invoke(v, w.CreatedID, docType);
                //}
            }
        }
コード例 #19
0
 public void SetDocumentType(AccountDocumentType dt)
 {
 }
コード例 #20
0
        private void calculateReceiptTotal()
        {
            ObservableCollection <MAccountDocReceipt> items = vw.ReceiptItems;
            double amtTotal            = 0.00;
            double whTotal             = 0.00;
            double vatTotal            = 0.00;
            double revExpTotal         = 0.00;
            double revExpForWhTotal    = 0.00;
            double revExpForVatTotal   = 0.00;
            double finalDiscountTotal  = 0.00;
            double pricingAmtTotal     = 0.00;
            double cashReceiptAmtTotal = 0.00;

            foreach (MAccountDocReceipt mr in items)
            {
                if (mr.ExtFlag.Equals("D"))
                {
                    continue;
                }

                int factor             = 1;
                int docType            = CUtil.StringToInt(mr.DocumentType);
                AccountDocumentType dt = (AccountDocumentType)docType;

                if ((dt == AccountDocumentType.AcctDocCrNote) || (dt == AccountDocumentType.AcctDocCrNotePurchase))
                {
                    factor = -1;
                }

                double amt            = factor * Math.Abs(CUtil.StringToDouble(mr.ArApAmt));
                double wh             = factor * Math.Abs(CUtil.StringToDouble(mr.WHTaxAmt));
                double vatAmt         = factor * Math.Abs(CUtil.StringToDouble(mr.VatAmt));
                double revExp         = factor * Math.Abs(CUtil.StringToDouble(mr.RevenueExpenseAmt));
                double revExpForWh    = factor * Math.Abs(CUtil.StringToDouble(mr.RevenueExpenseForWhAmt));
                double revExpForVat   = factor * Math.Abs(CUtil.StringToDouble(mr.RevenueExpenseForVatAmt));
                double finalDiscount  = factor * Math.Abs(CUtil.StringToDouble(mr.FinalDiscount));
                double pricingAmt     = factor * Math.Abs(CUtil.StringToDouble(mr.PricingAmt));
                double cashReceiptAmt = factor * Math.Abs(CUtil.StringToDouble(mr.CashReceiptAmt));

                revExpTotal         = revExpTotal + revExp;
                revExpForWhTotal    = revExpForWhTotal + revExpForWh;
                revExpForVatTotal   = revExpForVatTotal + revExpForVat;
                amtTotal            = amtTotal + amt;
                whTotal             = whTotal + wh;
                vatTotal            = vatTotal + vatAmt;
                finalDiscountTotal  = finalDiscountTotal + finalDiscount;
                pricingAmtTotal     = pricingAmtTotal + pricingAmt;
                cashReceiptAmtTotal = cashReceiptAmtTotal + cashReceiptAmt;

                mr.WHTaxAmt          = wh.ToString();
                mr.ArApAmt           = amt.ToString();
                mr.VatAmt            = vatAmt.ToString();
                mr.RevenueExpenseAmt = revExp.ToString();
                mr.FinalDiscount     = finalDiscount.ToString();
                mr.PricingAmt        = pricingAmt.ToString();
                mr.CashReceiptAmt    = cashReceiptAmt.ToString();
            }

            double total = amtTotal - whTotal;

            vw.CashActualReceiptAmt = total.ToString();
            vw.CashReceiptAmt       = total.ToString();
            vw.ArApAmt                 = amtTotal.ToString();
            vw.WHTaxAmt                = whTotal.ToString();
            vw.VatAmt                  = vatTotal.ToString();
            vw.RevenueExpenseAmt       = revExpTotal.ToString();
            vw.RevenueExpenseForWhAmt  = revExpForWhTotal.ToString();
            vw.RevenueExpenseForVatAmt = revExpForVatTotal.ToString();
            vw.FinalDiscount           = finalDiscountTotal.ToString();
            vw.PricingAmt              = pricingAmtTotal.ToString();
        }
コード例 #21
0
 public void SetDocumentType(AccountDocumentType dt)
 {
     docType = dt;
 }
コード例 #22
0
        public static void ShowEditApprovedWindowEx(AccountDocumentType dt, MAccountDoc actDoc, GenericAccountDocCallback printCallBack)
        {
            int type = 1;

            String caption = "";

            if (dt == AccountDocumentType.AcctDocCashPurchase)
            {
                caption = CLanguage.getValue("purchase_cash");
                if (!CHelper.VerifyAccessRight("PURCHASE_BYCASH_VIEW"))
                {
                    return;
                }
            }
            else if (dt == AccountDocumentType.AcctDocDebtPurchase)
            {
                caption = CLanguage.getValue("purchase_debt");
                if (!CHelper.VerifyAccessRight("PURCHASE_BYCREDIT_VIEW"))
                {
                    return;
                }
            }
            else if (dt == AccountDocumentType.AcctDocDrNotePurchase)
            {
                type = 2;

                caption = CLanguage.getValue("purchase_debit_note");
                if (!CHelper.VerifyAccessRight("PURCHASE_DRNOTE_VIEW"))
                {
                    return;
                }
            }
            else if (dt == AccountDocumentType.AcctDocCrNotePurchase)
            {
                type = 2;

                caption = CLanguage.getValue("purchase_credit_note");
                if (!CHelper.VerifyAccessRight("PURCHASE_CRNOTE_VIEW"))
                {
                    return;
                }
            }
            else if (dt == AccountDocumentType.AcctDocApReceipt)
            {
                caption = CLanguage.getValue("purchase_ap_receipt");
                if (!CHelper.VerifyAccessRight("PURCHASE_RECEIPT_VIEW"))
                {
                    return;
                }
            }
            else if (dt == AccountDocumentType.AcctDocMiscExpense)
            {
                caption = CLanguage.getValue("purchase_misc");
                if (!CHelper.VerifyAccessRight("PURCHASE_MISC_VIEW"))
                {
                    return;
                }
            }

            MAccountDoc v = (MAccountDoc)actDoc;

            if (type == 1)
            {
                WinAddEditAccountPurchaseDocApproved w = new WinAddEditAccountPurchaseDocApproved("E", dt, null, v);
                w.Caption = CLanguage.getValue("edit") + " " + caption;
                w.ShowDialog();
            }
            else if (type == 2)
            {
                WinAddEditDrCrNoteApproved w = new WinAddEditDrCrNoteApproved("E", dt, null, v);
                w.Caption = CLanguage.getValue("edit") + " " + caption;
                w.ShowDialog();
            }
        }
コード例 #23
0
        private static void printPreview(MAccountDoc doc, String id, AccountDocumentType dt)
        {
            WinFormPrinting wp = new WinFormPrinting(docTypeToReportGroup(dt), getAccountDocObject(id));

            wp.ShowDialog();
        }