Ejemplo n.º 1
0
        public frmOGReportrpt(string sTransactionDate, SqlConnection conn)
        {
            InitializeComponent();

            if (Convert.ToString(ApplicationSettings.Terminal.StoreName) != string.Empty)
            {
                sStoreName = Convert.ToString(ApplicationSettings.Terminal.StoreName);
            }
            if (Convert.ToString(ApplicationSettings.Terminal.StoreAddress) != string.Empty)
            {
                sStoreAddress = Convert.ToString(ApplicationSettings.Terminal.StoreAddress);
            }
            if (!string.IsNullOrEmpty(Convert.ToString(ApplicationSettings.Terminal.StorePhone)))
            {
                sStorePhNo = Convert.ToString(ApplicationSettings.Terminal.StorePhone);
            }

            connection = conn;
            if (!string.IsNullOrEmpty(sTransactionDate))
            {
                dtTransDate = Convert.ToDateTime(sTransactionDate);
            }
            if (connection.State == ConnectionState.Closed)
            {
                connection.Open();
            }

            sCompanyName = oBlank.GetCompanyName(conn);//aded on 14/04/2014 R.Hossain
        }
        public frmR_ProductAdvanceReceipt(IPosTransaction posTransaction, SqlConnection conn, string _sTransId, string _sAmt, string sTerminalId, string sGiftCardItemName = "", string sGiftCardNo = "", int iIsAdvRefund = 0, int iLanguage = 0)
        {
            InitializeComponent();
            sTerminal = sTerminalId;

            #region [Param Info]
            RetailTransaction retailTrans = posTransaction as RetailTransaction;
            if (retailTrans != null)
            {
                iInvLang = iLanguage;
                if (Convert.ToString(retailTrans.Customer.Name) != string.Empty)
                {
                    sCustName = Convert.ToString(retailTrans.Customer.Name);
                }
                if (!string.IsNullOrEmpty(Convert.ToString(retailTrans.Customer.CustomerId)))
                {
                    sCustId = Convert.ToString(retailTrans.Customer.CustomerId);
                }
                if (Convert.ToString(retailTrans.Customer.Address) != string.Empty)  //PrimaryAddress
                {
                    sCustAddress = Convert.ToString(retailTrans.Customer.Address);
                }
                if (Convert.ToString(retailTrans.Customer.PostalCode) != string.Empty)
                {
                    sCPinCode = Convert.ToString(retailTrans.Customer.PostalCode);
                }
                if (Convert.ToString(retailTrans.Customer.Email) != string.Empty)
                {
                    sCustEmail = Convert.ToString(retailTrans.Customer.Email);
                }

                //if(Convert.ToString(retailTrans.Customer.MobilePhone) != string.Empty)
                //    sContactNo = Convert.ToString(retailTrans.Customer.MobilePhone);

                if (!string.IsNullOrEmpty(retailTrans.Customer.Telephone))
                {
                    sContactNo = Convert.ToString(retailTrans.Customer.Telephone);
                }

                //sCPanNo

                //-------
                if (Convert.ToString(retailTrans.TransactionId) != string.Empty)
                {
                    sReceiptNo        = _sTransId;// Convert.ToString(retailTrans.TransactionId);
                    sReceiptVoucherNo = retailTrans.ReceiptId;
                }


                sInvoiceNo = sReceiptNo;

                if (retailTrans.EndDateTime != null)
                {
                    sInvDt = retailTrans.EndDateTime.ToShortDateString();
                }

                if (retailTrans.EndDateTime != null)
                {
                    sTime = retailTrans.EndDateTime.ToString("hh:mm tt"); //("HH:mm")
                }
                //if(retailTrans.BeginDateTime != null)
                //    sReceiptDate = retailTrans.BeginDateTime.ToShortDateString();

                sAmount = oBlank.Amtinwds(Convert.ToDouble(_sAmt));

                sAmtinwdsArabic = oBlank.AmtinwdsInArabic(Convert.ToDouble(_sAmt));

                if (iInvLang == 2)
                {
                    sAmount = sAmtinwdsArabic;
                }
                else if (iInvLang == 3)
                {
                    sAmount = sAmount + System.Environment.NewLine + "" + sAmtinwdsArabic;
                }


                sCurrencySymbol = oBlank.GetCurrencySymbol();
                string sAdJustItem = AdjustmentItemID();
                string ItemTaxCode = getTaxGropCode(sAdJustItem);

                dTaxPct = getTaxPctValue(ItemTaxCode);                                                    //getItemTaxPercentage();// ;
                decimal dAmt = decimal.Round(Convert.ToDecimal(_sAmt), 2, MidpointRounding.AwayFromZero); //Convert.ToDecimal(_sAmt);
                dTaxAmt       = decimal.Round(Convert.ToDecimal(dAmt * dTaxPct / (100 + dTaxPct)), 2, MidpointRounding.AwayFromZero);
                dExcludTaxAmt = dAmt - dTaxAmt;


                if (string.IsNullOrEmpty(sGiftCardItemName))
                {
                    sFooterText  = "Request to handover Advance Receipt at the time of billing";
                    sRTitle      = "Advance Receipt" + "  " + "وصل بالدفعة المسبقة";
                    sDetailsLine = "Received with thanks from " + "" + sCustName + "                                                                         " + sCurrencySymbol + " " + _sAmt;
                }
                else if (iIsAdvRefund == 1)
                {
                    sFooterText  = "";
                    sRTitle      = "Advance Refund";
                    sDetailsLine = "Advance Refund" + "                                                                                                                " + sCurrencySymbol + " " + _sAmt;
                }
                else
                {
                    sFooterText  = "";
                    sRTitle      = "GIFT CARD RECEIPT";
                    sDetailsLine = sGiftCardItemName + "            " + sGiftCardNo + "                                                                         " + sCurrencySymbol + " " + _sAmt;
                }
                //----------store Info

                //if(Convert.ToString(retailTrans.StoreName) != string.Empty)
                //    sStoreName = Convert.ToString(retailTrans.StoreName);
                //if(Convert.ToString(retailTrans.StoreAddress) != string.Empty)
                //    sStoreAddress = Convert.ToString(retailTrans.StoreAddress);

                //if (! string.IsNullOrEmpty(Convert.ToString(retailTrans.StorePhone)))
                //    sStorePhNo = Convert.ToString(retailTrans.StorePhone);

                if (Convert.ToString(ApplicationSettings.Terminal.StoreName) != string.Empty)
                {
                    sStoreName = Convert.ToString(ApplicationSettings.Terminal.StoreName);
                }
                if (Convert.ToString(ApplicationSettings.Terminal.StoreAddress) != string.Empty)
                {
                    sStoreAddress = Convert.ToString(ApplicationSettings.Terminal.StoreAddress);
                }
                if (!string.IsNullOrEmpty(Convert.ToString(ApplicationSettings.Terminal.StorePhone)))
                {
                    sStorePhNo = Convert.ToString(ApplicationSettings.Terminal.StorePhone);
                }

                if (Convert.ToString(retailTrans.OperatorId) != string.Empty)
                {
                    sOperatorId = getStaffName(Convert.ToString(retailTrans.OperatorId));
                }

                sDataAreaId = Convert.ToString(ApplicationSettings.Database.DATAAREAID);

                // if (Convert.ToString(retailTrans.InventLocationId) != string.Empty)

                sInventLocationId = ApplicationSettings.Terminal.InventLocationId; //Convert.ToString(retailTrans.InventLocationId);
            }
            connection = conn;
            if (connection.State == ConnectionState.Closed)
            {
                connection.Open();
            }
            GetStoreInfo(ref sStorePhNo, ref sInvoiceFooter, ref sCINNo);

            //sCINNo = oBlank.getValue("select CINNO  from RETAILSTORETABLE where STORENUMBER ='" + Convert.ToString(ApplicationSettings.Terminal.StoreId) + "'");
            sCompanyName = oBlank.GetCompanyName(conn);//aded on 14/04/2014 R.Hossain

            if (iIsAdvRefund == 1)
            {
                sRefRceiptNo = GetRefReciptId(retailTrans.TransactionId);
            }

            sRemarks = getTransactionRemarks(retailTrans.TransactionId, retailTrans.TerminalId);

            sStorePhNo = getStoreEmailAndFax("PRIMARYCONTACTPHONE");

            sStoreEmail = getStoreEmailAndFax("PrimaryContactEmail");

            sStoreFax = getStoreEmailAndFax("PrimaryContactFax"); // PrimaryContactEmail/PrimaryContactFax

            sTRN = GetCompanyTRN();
            //sCurrencySymbol = ApplicationSettings.Terminal.StoreCurrency;

            #endregion
        }
Ejemplo n.º 3
0
        public frmR_GSSAccStaement(SqlConnection conn, DataSet dsGSSAccSt, string sGSSAcc, string sCName, string sCAdd, string sCId, string sCContactNo)
        {
            InitializeComponent();


            if (!string.IsNullOrEmpty(Convert.ToString(sCName)))
            {
                sCustName = Convert.ToString(sCName);
            }
            if (!string.IsNullOrEmpty(Convert.ToString(sCId)))
            {
                sCustId = Convert.ToString(sCId);
            }
            if (!string.IsNullOrEmpty(sCAdd))
            {
                sCustAddress = Convert.ToString(sCAdd);
            }
            if (!string.IsNullOrEmpty(sCContactNo))
            {
                sContactNo = Convert.ToString(sCContactNo);
            }

            if (Convert.ToString(ApplicationSettings.Terminal.StoreName) != string.Empty)
            {
                sStoreName = Convert.ToString(ApplicationSettings.Terminal.StoreName);
            }
            if (Convert.ToString(ApplicationSettings.Terminal.StoreAddress) != string.Empty)
            {
                sStoreAddress = Convert.ToString(ApplicationSettings.Terminal.StoreAddress);
            }
            if (!string.IsNullOrEmpty(Convert.ToString(ApplicationSettings.Terminal.StorePhone)))
            {
                sStorePhNo = Convert.ToString(ApplicationSettings.Terminal.StorePhone);
            }

            sGSSAccNumber = sGSSAcc;
            connection    = conn;

            if (connection.State == ConnectionState.Closed)
            {
                connection.Open();
            }

            GetGSSAccInfo(sGSSAcc, connection);

            dsGSSAccStatement = new DataSet();
            dsGSSAccStatement = dsGSSAccSt;


            for (int i = 0; i <= dsGSSAccStatement.Tables[0].Rows.Count - 1; i++)
            {
                dTotAmt = dTotAmt + Convert.ToDecimal(dsGSSAccStatement.Tables[0].Rows[i]["Amount"]);
            }



            sAmountInWords = oBlank.Amtinwds(Convert.ToDouble(Math.Abs(dTotAmt)));

            sCompanyName = oBlank.GetCompanyName(conn);//aded on 14/04/2014 R.Hossain
            sGSSDueDays  = Convert.ToString(GSSDueDays());

            GetCustomData(dsGSSAccStatement.Tables[0]);
        }
Ejemplo n.º 4
0
        public frmR_GSSInstalmentReceipt(IPosTransaction posTransaction, SqlConnection conn, string _sTransId, string _sAmt, string sGSSAccNo, string sTerminalId)
        {
            InitializeComponent();
            sTerminal = sTerminalId;

            #region [Param Info]
            RetailTransaction retailTrans = posTransaction as RetailTransaction;
            if (retailTrans != null)
            {
                if (Convert.ToString(retailTrans.Customer.Name) != string.Empty)
                {
                    sCustName = Convert.ToString(retailTrans.Customer.Name);
                }
                if (!string.IsNullOrEmpty(Convert.ToString(retailTrans.Customer.CustomerId)))
                {
                    sCustId = Convert.ToString(retailTrans.Customer.CustomerId);
                }
                if (Convert.ToString(retailTrans.Customer.Address) != string.Empty)  //PrimaryAddress
                {
                    sCustAddress = Convert.ToString(retailTrans.Customer.Address);
                }
                if (Convert.ToString(retailTrans.Customer.PostalCode) != string.Empty)
                {
                    sCPinCode = Convert.ToString(retailTrans.Customer.PostalCode);
                }
                //if(Convert.ToString(retailTrans.Customer.MobilePhone) != string.Empty)
                //    sContactNo = Convert.ToString(retailTrans.Customer.MobilePhone);

                if (!string.IsNullOrEmpty(retailTrans.Customer.Telephone))
                {
                    sContactNo = Convert.ToString(retailTrans.Customer.Telephone);
                }
                //sCPanNo
                sCurrencySymbol = oBlank.GetCurrencySymbol();
                //-------
                if (Convert.ToString(retailTrans.TransactionId) != string.Empty)
                {
                    sReceiptNo        = _sTransId;// Convert.ToString(retailTrans.TransactionId);
                    sReceiptVoucherNo = retailTrans.ReceiptId;
                }

                if (Convert.ToString(sReceiptVoucherNo) == string.Empty)
                {
                    sReceiptVoucherNo = GetReciptVouNo(_sTransId, conn);
                }

                //if(retailTrans.BeginDateTime != null)
                //    sReceiptDate = retailTrans.BeginDateTime.ToShortDateString();

                sAmount      = oBlank.Amtinwds(Convert.ToDouble(_sAmt));
                sDetailsLine = "Received with thanks from " + "" + sCustName + "                                                                          " + sCurrencySymbol + " " + _sAmt;
                //----------store Info

                GetGSSMaturityDate(sGSSAccNo, conn); // added on 29/03/2014 req by Sailendra da. dev by R.Hossain
                //if(Convert.ToString(retailTrans.StoreName) != string.Empty)
                //    sStoreName = Convert.ToString(retailTrans.StoreName);
                //if(Convert.ToString(retailTrans.StoreAddress) != string.Empty)
                //    sStoreAddress = Convert.ToString(retailTrans.StoreAddress);
                ////if(Convert.ToString(retailTrans.StorePhone) != string.Empty)
                //if (!string.IsNullOrEmpty(Convert.ToString(retailTrans.StorePhone)))
                //    sStorePhNo = Convert.ToString(retailTrans.StorePhone);


                if (Convert.ToString(ApplicationSettings.Terminal.StoreName) != string.Empty)
                {
                    sStoreName = Convert.ToString(ApplicationSettings.Terminal.StoreName);
                }
                if (Convert.ToString(ApplicationSettings.Terminal.StoreAddress) != string.Empty)
                {
                    sStoreAddress = Convert.ToString(ApplicationSettings.Terminal.StoreAddress);
                }
                if (!string.IsNullOrEmpty(Convert.ToString(ApplicationSettings.Terminal.StorePhone)))
                {
                    sStorePhNo = Convert.ToString(ApplicationSettings.Terminal.StorePhone);
                }

                sDataAreaId = Convert.ToString(ApplicationSettings.Database.DATAAREAID);

                //if(Convert.ToString(retailTrans.InventLocationId) != string.Empty)
                //    sInventLocationId = Convert.ToString(retailTrans.InventLocationId);
                sInventLocationId = ApplicationSettings.Terminal.InventLocationId;
            }
            connection = conn;
            if (connection.State == ConnectionState.Closed)
            {
                connection.Open();
            }
            GetStoreInfo(ref sStorePhNo, ref sInvoiceFooter, ref sCINNo);
            sCompanyName  = oBlank.GetCompanyName(conn); //aded on 14/04/2014 R.Hossain
            sGSSAccNumber = sGSSAccNo;                   // added on 18/04/2014
            #endregion
        }