示例#1
0
        public override bool  RecalcPrice(int parCodeReceipt = 0)
        {
            Parameter[] varParameters = new Parameter[] {
                new Parameter("parIdWorkplace", "parIdWorkplace"),
                new Parameter("parCodePeriod", Global.GetCodePeriod()),
                new Parameter("parDefaultCodeDealer", GlobalVar.varDefaultCodeDealer[0]),
                new Parameter("parCodeReceipt", parCodeReceipt)
            };

            DataTable varDT = this.db.Execute(this.varSqlListPS, varParameters);

            for (int i = 0; i < varDT.Rows.Count; i++)
            {
                //wr.code_wares,  wr.code_unit, w.vat, w.vat_operation, ps.code_ps, ps.priority, psd.type_discount, psd.data, pd.price_dealer, pdd.price_dealer default_price_dealer,
                int varCodeWares = Convert.ToInt32(varDT.Rows[i]["code_wares"]);
                int varCodeUnit  = Convert.ToInt32(varDT.Rows[i]["code_unit"]);
                int varCodePS    = Convert.ToInt32(varDT.Rows[i]["code_ps"]);

                varParameters = new Parameter[] {
                    new Parameter("parIdWorkplace", "parIdWorkplace"),
                    new Parameter("parCodePeriod", Global.GetCodePeriod()),
                    new Parameter("parCodeReceipt", parCodeReceipt),
                    new Parameter("parCodeWares", varCodeWares),
                    new Parameter("parCodeUnit", varCodeUnit),
                    new Parameter("parCodePS", varCodePS),
                    new Parameter("parVatOperation", varWares.varTypeVat),
                    new Parameter("parSum", (varWares.varPrice * varWares.varQuantity) * (1 + varWares.varPercentVat) * varWares.varCoefficient),
                    new Parameter("parSumVat", varWares.varPrice * varWares.varQuantity * varWares.varPercentVat * varWares.varCoefficient)
                };
                this.db.ExecuteNonQuery(this.varSqlUpdatePrice, varParameters);
                RecalcHeadReceipt(varParameters);
            }
            return(true);
        }
示例#2
0
        public override int GetCodeReceipt(int parCodePeriod = 0)
        {
            if (parCodePeriod == 0)
            {
                parCodePeriod = Global.GetCodePeriod();
            }
            ParametersCollection parameters = new ParametersCollection();

            parameters.Add("parIdWorkplace", GlobalVar.varIdWorkPlace, DbType.Int32);
            parameters.Add("parCodePeriod", parCodePeriod, DbType.Int32);



            this.db.ExecuteNonQuery(varSqlUpdateGenWorkPlace, parameters);
            DataTable varS = this.db.Execute(varSqlSelectGenWorkPlace, parameters);

            if (varS == null || varS.Rows.Count == 0)
            {
                this.db.ExecuteNonQuery(varSqlInsertGenWorkPlace, parameters);

                return(1);
            }
            else
            {
                return(Convert.ToInt32(varS.Rows[0][0]));
            }
        }
示例#3
0
        public override int GetCodeReceipt(int parCodePeriod = 0)
        {
            if (parCodePeriod == 0)
            {
                parCodePeriod = Global.GetCodePeriod();
            }
            var varParameters = new Parameter[] { new Parameter {
                                                      ColumnName = "parIdWorkplace", Value = GlobalVar.varIdWorkPlace
                                                  }, new Parameter {
                                                      ColumnName = "parCodePeriod", Value = parCodePeriod
                                                  } };


            this.db.ExecuteNonQuery(varSqlUpdateGenWorkPlace, varParameters);
            DataTable varS = this.db.Execute(varSqlSelectGenWorkPlace, varParameters);

            if (varS == null || varS.Rows.Count == 0)
            {
                this.db.ExecuteNonQuery(varSqlInsertGenWorkPlace, varParameters);

                return(1);
            }
            else
            {
                return(Convert.ToInt32(varS.Rows[0][0]));
            }
        }
示例#4
0
文件: Global.cs 项目: OlehR/UniCS.TM
        public void  SetReceipt(int parCodeReceipt, DateTime parDateReceipt = new DateTime())
        {
            if (parDateReceipt == new DateTime())
            {
                parDateReceipt = DateTime.Today;
            }

            Clear();
            varCodeReceipt = parCodeReceipt;
            varDateReceipt = parDateReceipt;
            varCodePeriod  = Global.GetCodePeriod(parDateReceipt);
            varSort        = 0;
            varCodePattern = GlobalVar.varDefaultCodePatternReceipt;
        }
示例#5
0
        public void  SetReceipt(int parCodeReceipt, DateTime parDateReceipt = new DateTime())
        {
            if (parDateReceipt == new DateTime())
            {
                parDateReceipt = DateTime.Today;
            }

            Clear();
            varCodeReceipt           = parCodeReceipt;
            GlobalVar.varReceipts[0] = parCodeReceipt;           //tmp щоб зберегти глобально номер чека.???
            varDateReceipt           = parDateReceipt;
            varCodePeriod            = Global.GetCodePeriod(parDateReceipt);
            varSort        = 0;
            varCodePattern = GlobalVar.varDefaultCodePatternReceipt;
        }