Esempio n. 1
0
        private void barButtonItem3_ItemClick(object sender, ItemClickEventArgs e)
        {
            Application.DoEvents();
            progressPanel1.Visible = true;
            var b = new YearEndClass();
            var ds = b.GetClosingYear();
            int cyear = 0;
            if (ds.Rows.Count == 0)
            {
                var f1 = new YearCloseProcess();
                f1.ShowDialog();
                cyear = f1._ClosingYear;
            }
            else
            {
                cyear = int.Parse(ds.Rows[0]["CYEAR"].ToString());
            }
            if(cyear==0) return;

            var f = new TxtFileRead();
            f.ValidateYearEnd(cyear);
            f.ShowDialog();
            if (f.iSvalid)
            {
              DownLoadFiles(f.Fname, f.Machineno, f.Inventoryby, f.Closingperiod);
             _fname=f.Fname;
            _fMachineno =f.Machineno;
            _fInventoryby= f.Inventoryby;
            _fClosingperiod = f.Closingperiod;
             SaveDataToInventoryYear(f.Closingperiod);
             barButtonItem4.Enabled = true;
            }
            progressPanel1.Visible =false;
        }
Esempio n. 2
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            //1.Check for sales Closing
            //2.Check holded sales,purchase
            //3.check for holded transfers
            //4.Check for dayclose
            //5.Check for inventory adjusted

            _ClosingYear = 0;
            if (spinEdit1.EditValue == null)
            {
                XtraMessageBox.Show("Please enter the year", "POS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (spinEdit1.EditValue.ToString().Length < 4)
                {
                    XtraMessageBox.Show("Please enter the year in yyyy format", "POS", MessageBoxButtons.OK,
                                        MessageBoxIcon.Information);
                    return;
                }
             var cl = new YearEndClass();
             var cnt = cl.CheckYearClosed(int.Parse(spinEdit1.EditValue.ToString()));
             if(cnt > 0)
                {
                    XtraMessageBox.Show("Year Closed already", "POS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
            //SELECT COUNT(*) from SALESMAIN where HOLDNO > 0
            //SELECT COUNT(*) FROM SALESMAIN WHERE POSTED =1 AND DAILYCLOSED=0
            //SELECT COUNT(*) FROM PURINVMAIN WHERE HOLD = 1 
            //SELECT COUNT(*) FROM ITEMTRANSFERMAIN WHERE HOLD = 1
            if(new YearEndClass().ValidateYearClosed(1))
            {
                XtraMessageBox.Show("Please un-hold sales before processing year end", "POS", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                return; 
            }
            if(cl.ValidateYearClosed(2))
            {
                XtraMessageBox.Show("Please do daily close before processing year end", "POS", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                return; 
            }
            if (cl.ValidateYearClosed(3))
            {
                XtraMessageBox.Show("Please un-hold the purhcase invoice before processing year end", "POS", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                return;
            }
            if (cl.ValidateYearClosed(4))
            {
                XtraMessageBox.Show("Please un-hold the transfers before processing year end", "POS", MessageBoxButtons.OK,
                                    MessageBoxIcon.Information);
                return;
            }
            if(MessageBox.Show("Are you sure to close the year","POS",MessageBoxButtons.YesNo,MessageBoxIcon.Question)==DialogResult.Yes)
            {
                if (cl.CheckYearCloseProcessStart(int.Parse(spinEdit1.EditValue.ToString())))
                {
                    _ClosingYear = int.Parse(spinEdit1.EditValue.ToString());
                    Dispose();
                }
                if (cl.DoCreateYearClosed(int.Parse(spinEdit1.EditValue.ToString())) == "1")
               {
                   XtraMessageBox.Show("System ready for physical inventory", "POS", MessageBoxButtons.OK,
                                  MessageBoxIcon.Information);
                   _ClosingYear = int.Parse(spinEdit1.EditValue.ToString());
                   Dispose();
               }
               else
               {
                   XtraMessageBox.Show("Error", "POS", MessageBoxButtons.OK,
                                 MessageBoxIcon.Information);
               }
            }
        }
Esempio n. 3
0
 void  SaveDataToInventoryYear(int clo)
 {
   var t =  new YearEndClass().SaveDataToInventoryYear(_dsyearend);
   if (t == "1")
   {
       var b = new YearEndClass();
      _dsyearend = b.LoadYearEndInventory(clo);
       yearEndInventoryBindingSource.DataSource = _dsyearend;
       //gridControl1.DataSource = _dsyearend;
   }
 }
Esempio n. 4
0
 private void barButtonItem11_ItemClick(object sender, ItemClickEventArgs e){
     progressPanel1.Visible = true;
     foreach (DataRow dr in _dsyearend.Rows)
     {
         if (dr["ISADDED"].ToString()== bool.TrueString)
         {
             dr["INSTOCK"] = new YearEndClass().GetInStockFromBackUp(dr["itemno"].ToString(), _fClosingperiod);
             var dt = new YearEndClass().GetMaxExpirtyDt(dr["itemno"].ToString(), _fClosingperiod);
             if (!String.IsNullOrEmpty(dt))
             {
                 DateTime ndt = DateTime.Parse(dt);
                 dr["EXPDATE"] = ndt;
               //  txtexpdate.Text = ndt.Month + " - " + ndt.Year;
             }
             
         }
     }
     progressPanel1.Visible = false;
 }
Esempio n. 5
0
 private void barButtonItem8_ItemClick(object sender, ItemClickEventArgs e)
 {
     yearEndInventoryBindingSource.RemoveFilter();
     if(dateEdit1.EditValue==null)
     {
         XtraMessageBox.Show("Please select the opening year" ,"POS",MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
    var bl = new YearEndClass();
    if(bl.GetCountNonTrasfered() > 0)
    {
        XtraMessageBox.Show("Some items not transfered please check and close the year", "POS",
                            MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    else
    {
        Application.DoEvents();
        progressPanel1.Visible = true;
        var ret = bl.DoUpdateOpeningStock(dateEdit1.DateTime, _fClosingperiod);
        if (ret == "1")
        {
            XtraMessageBox.Show("Inventory updated", "POS",MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        else
        {
         XtraMessageBox.Show(ret, "POS",MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        progressPanel1.Visible = false;
    }
 }
Esempio n. 6
0
        void UpLoadInventory()
        {
            var whid = lookupfrom.EditValue.ToString();
            var s = new StoreManager().GetStoreType(whid);
            string storetype = "S";
            if (s.IndexOf("S") == -1)
            {
                storetype = "P";
            }
            var s1 = new YearEndClass().DoUpdateInventory(_dsyearend, storetype, whid);
            if (s1 == "1")
            {

                XtraMessageBox.Show("Inventory Updated", "POS", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                XtraMessageBox.Show(s1, "POS", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 7
0
 private void YearEndProcess_Load(object sender, EventArgs e)
 {
     var ds = ClsGetData.GetItemGroup();
     repositoryItemLookUpEdit1.DataSource = ds;
     var dsW = ClsGetData.GetStoreList();
     var bsW = new BindingSource(dsW, "") { Filter = "COMPANY = '" + Utils.Company + "'" };
     lookupfrom.Properties.DataSource = bsW;
     var b = new YearEndClass();
     var ds1 = b.GetClosingYear();
     if (ds1.Rows.Count > 0)
     {
         if (_fClosingperiod == 0)
             _fClosingperiod = int.Parse(ds1.Rows[0]["CYEAR"].ToString());
         _dsyearend = b.LoadYearEndInventory(int.Parse(ds1.Rows[0]["CYEAR"].ToString())); 
     }
     _GridHeading = "Physical Inventory Report";
     yearEndInventoryBindingSource.DataSource = _dsyearend;// gridControl1.DataSource = _dsyearend;
     txtstock.Properties.Mask.EditMask = "\\d+";
     txtstock.Properties.Mask.MaskType = MaskType.RegEx;
 }