Ejemplo n.º 1
0
        void CreateInventoryReport()
        {
            var ds = new StockMaster().GetDististinctItemsInStockMaster(); 
            int i = 0;
            var bl = new BlItemMaster();
            var stk = new StockMaster();
            var bls = new SalesManger();
            foreach (DataRow stockmasterRow in ds.Rows)
            {
                var dr = (Ledgers.InventoryVariationRow)  dt.NewRow();
                dr[0] = i++;
                var itm = stockmasterRow["ITEMNO"].ToString();
                dr.ITEMNO = itm;
                dr.ITEMNAME = bl.GetItemname(itm);
                dr.OPENING = bls.GetOpeningQty(itm);
                dr.RECEIVE = bls.GetReceivedQty(itm);
                dr.RETURN = bls.GetReturnQty(itm);
                dr.SALES = bls.GetSoldQty(itm);
                dr.TRANSFER = bls.GetTransferedQty(itm);
                dr.ADJQTY = bls.GetAdjQty(itm);
                dr.ACTUAL = (dr.OPENING + dr.ADJQTY  + dr.RECEIVE + (-1* dr.RETURN)) - (dr.SALES + dr.TRANSFER);
                dr.INSTOCK = stk.GetAvailableQty(itm);
              //  dr.STOCKID = int.Parse(stockmasterRow["STOCKID"].ToString());
                dt.Rows.Add(dr);
            }
            inventoryVariationBindingSource.DataSource = dt;
            fixstkdiff = false;
            

        }
Ejemplo n.º 2
0
 private void SalesInvListLoad(object sender, EventArgs e)
 {
     //dateEdit1.EditValue = null;
     //dateEdit2.EditValue = null;
     //var bl = new VIRETAILDAL.Sales.SalesManger().GetSalesReport();
     //salesInvListBindingSource.DataSource = bl;
     dateEdit1.EditValue = DateTime.Now;
     dateEdit2.EditValue = DateTime.Now;
     var bl = new SalesManger().GetSalesReportByDate(dateEdit1.DateTime.Date, dateEdit2.DateTime.Date);
     salesInvListBindingSource.DataSource = bl;
     imageComboBoxEdit1.SelectedIndex = 0;
     Utils.PrintSlipPrinter = 0;
     //  salesInvListBindingSource.Sort = "SINVNO ASC";
 }
Ejemplo n.º 3
0
 private void SimpleButton2Click(object sender, EventArgs e)
 {
     if (dateEdit1.EditValue == null || dateEdit2.EditValue == null)
     {
         XtraMessageBox.Show("Please select dates", "POS", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         return;
     }
     // gridView1.ApplyColumnsFilter();
     var bl = new SalesManger().GetSalesReportByDate(dateEdit1.DateTime.Date, dateEdit2.DateTime.Date);
     salesInvListBindingSource.DataSource = bl;
 }
Ejemplo n.º 4
0
        public string DoSave()
        {
            string retval = "0";
            SqlTransaction tran = null;
            try
            {
                var cn = new SqlConnection { ConnectionString = _constr };
                cn.Open();
                tran = cn.BeginTransaction(IsolationLevel.ReadUncommitted);
                var dm = new DataManager();
                var dt = new Ledgers.APARMAINDataTable();
                var ta = new LedgersTableAdapters.APARMAINTableAdapter {Connection = {ConnectionString = _constr}};
                ta.Fill(dt);
                var taleder = new LedgersTableAdapters.LEDGERSTableAdapter();
                taleder.AssignConnection(cn,tran);
                ta.AssignConnection(cn, tran);

                var tasalesamtdetails = new LedgersTableAdapters.SalesAmountDetailsTableAdapter();

                tasalesamtdetails.AssignConnection(cn, tran);

                
                var autoid =  dm.GetAutoId(17);
                autoid++;
                Utils.CustomerReceipt = dm.CreateFormatedAutoNo(autoid);
                ta.Update(AparmainData);
                var bl = new SalesManger().GetInvoiceNo(17);
                taleder.Insert("C", customerno, trandate,
                                    trandate, Utils.CustomerReceipt,
                                    Utils.CustomerReceipt,0 , AppliedAmt, 17, Utils.Company,
                                    Utils.Userid, "Customer Receipt");
                tasalesamtdetails.Insert(trandate, null, customerno, "C", amountype, AppliedAmt, shiftcode, false, Utils.Company,userid, false, null);

                tran.Commit();
                retval = "1";
            }
            catch (Exception ex)
            {
                retval = ex.ToString();
                if (tran != null) tran.Rollback();
            }
            return retval;

        }
Ejemplo n.º 5
0
        public void PrintInsuranceSalesInvioce(string sinvno)
        {
            var bl = new SalesManger().GetSalesReport(sinvno);
            var rpt = new RptSalesInsurance();
            decimal compshare = 0;
            decimal patshare = 0;
            decimal netamt = 0;
            string _Cashier = string.Empty;
            string _Doctorname = string.Empty;
            string cmpname = Utils.Companyname;
            foreach (DsReports.SalesInvListRow dr in bl.Rows)
            {
                netamt = dr.NETAMT;
                patshare = dr.CARDDISC;
                compshare = dr.CUSTOMERFIXDISC;
                _Cashier = new BLUserinfo().GetUserinfoByUserid(dr.SALESMAN);
                if (dr.DOCTOR > 0)
                    _Doctorname = new BLUserinfo().GetUserinfoByUserid(dr.DOCTOR);
                if (dr.CUSTNAME.ToUpper().IndexOf("BUPA") != -1)
                {
                    cmpname = "Exceer";
                }
	
            }
            var amtaf = netamt * (compshare / 100);
            var psh = (netamt - amtaf) * (patshare / 100);
            rpt.compshare = amtaf.ToString("##.##");
            rpt.patshare = psh.ToString("N2");
            if (Utils.Company=="01")
                rpt.company = cmpname;
            else
                rpt.company = Utils.Companyname;
            rpt.doctorname = _Doctorname;
            rpt.DataSource = bl;
            try
            {
                rpt.Print();
            }
            catch (Exception ex)
            {
                var stri = ex.ToString();
            }
        }
Ejemplo n.º 6
0
        public void PrintUCF(string sinvno,bool bgimag=false){
            var bl = new SalesManger().GetSalesReport(sinvno);
            var rpt = new RptUcfa();
         //   var dssal =   bl.Copy();
            if (bl.Rows.Count < 5)
            {
                for (int i = 0; i < 4 - bl.Rows.Count; i++)
                {
                    var dr = bl.NewRow();
                    bl.Rows.Add(dr);
                }
            }


            rpt.DataSource = bl;
            try
            {
                if (bgimag)
                {
                    rpt.Watermark.ImageTransparency = 1500;
                 //   rpt.Watermark.Image = Bitmap.FromFile("watermark.gif");
                  
                }

                rpt.Print();
            }
            catch (Exception ex)
            {
                var stri = ex.ToString();
                rpt.Print();
            }

        }
Ejemplo n.º 7
0
 public string UpdateDetails(DsInventory.SALESINVDETAILDataTable salesinvdetail)
 {
     var retval = new SalesManger().UpdateSalesInvDetail(salesinvdetail);
     return retval;
 }
Ejemplo n.º 8
0
 public string DoSave()
 {
     var bl = new SalesManger { salesinvdetailData = Salesinvdetail, salesmainRow = SalesmainRow, SalesAmount = SalesAmount };
     return bl.DoSave();
 }
Ejemplo n.º 9
0
 public void GetNonSaleInv()
 {
     var bl = new SalesManger();
     bl.GetNonSaleInv();
     SalesmainRow = bl.salesmainRow;
     Salesinvdetail = bl.salesinvdetailData;
 }
Ejemplo n.º 10
0
 public void GetSalesInvDetail(string sinvno)
 {
     var bl = new SalesManger();
     bl.GetSalesInvDetails(sinvno);
     Salesinvdetail = bl.salesinvdetailData;
 }