Ejemplo n.º 1
0
		private void LoadItems()
		{
			DataClass clsDataClass = new DataClass();

			TransferInItem clsTransferInItem = new TransferInItem();
			lstItem.DataSource = clsDataClass.DataReaderToDataTable(clsTransferInItem.List(Convert.ToInt64(lblTransferInID.Text), "TransferInItemID",SortOption.Ascending)).DefaultView;
			lstItem.DataBind();
			clsTransferInItem.CommitAndDispose();
		}
Ejemplo n.º 2
0
		private void LoadItems()
		{
			DataClass clsDataClass = new DataClass();

			TransferInItem clsTransferInItem = new TransferInItem();
			lstItem.DataSource = clsTransferInItem.ListAsDataTable(Convert.ToInt64(lblTransferInID.Text)).DefaultView;
			lstItem.DataBind();
			clsTransferInItem.CommitAndDispose();
            lstItemFixCssClass();
		}
Ejemplo n.º 3
0
        private void UpdateItemReceiveStatus(long TransferInItemID, TransferInItemReceivedStatus clsTransferInItemReceivedStatus, decimal ReceivedQuantity)
        {

            TransferInItem clsTransferInItem = new TransferInItem();
            clsTransferInItem.UpdateReceiveStatus(TransferInItemID, clsTransferInItemReceivedStatus, ReceivedQuantity);
            clsTransferInItem.CommitAndDispose();

        }
Ejemplo n.º 4
0
        private void LoadItem(string stID)
        {
            TransferInItem clsTransferInItem = new TransferInItem();
            TransferInItemDetails clsTransferInItemDetails = clsTransferInItem.Details(Convert.ToInt64(stID));
            clsTransferInItem.CommitAndDispose();

            cboProductCode.Items.Clear();
            cboVariation.Items.Clear();
            cboProductUnit.Items.Clear();

            txtProductCode.Text = clsTransferInItemDetails.BarCode;
            cmdProductCode_Click(null, null);

            cboProductCode.SelectedIndex = cboProductCode.Items.IndexOf(new ListItem(clsTransferInItemDetails.ProductCode, clsTransferInItemDetails.ProductID.ToString()));

            if (clsTransferInItemDetails.VariationMatrixID == 0)
            { cboVariation.Items.Add(new ListItem("No Variation", "0")); cboVariation.SelectedIndex = 0; }
            else
            { cboVariation.SelectedIndex = cboVariation.Items.IndexOf(new ListItem(clsTransferInItemDetails.MatrixDescription, clsTransferInItemDetails.VariationMatrixID.ToString())); }

            if (clsTransferInItemDetails.ProductUnitID == 0)
            { cboProductUnit.Items.Add(new ListItem("No Unit", "0")); cboProductUnit.SelectedIndex = 0; }
            else
            {
                cboProductUnit.SelectedIndex = cboProductUnit.Items.IndexOf(new ListItem(clsTransferInItemDetails.ProductUnitCode, clsTransferInItemDetails.ProductUnitID.ToString()));
            }

            txtQuantity.Text = clsTransferInItemDetails.Quantity.ToString("###0.##0");
            txtPrice.Text = clsTransferInItemDetails.UnitCost.ToString("###0.##0");
            txtDiscount.Text = clsTransferInItemDetails.DiscountApplied.ToString("###0.##0");

            if (clsTransferInItemDetails.DiscountType == DiscountTypes.Percentage)
                chkInPercent.Checked = true;
            else
            {
                chkInPercent.Checked = false;
            }
            txtAmount.Text = clsTransferInItemDetails.Amount.ToString("###0.##0");
            txtRemarks.Text = clsTransferInItemDetails.Remarks;
            lblTransferInItemID.Text = stID;
            chkIsTaxable.Checked = clsTransferInItemDetails.IsVatable;

            //Added Jan 1, 2010 4:20PM : For selling information
            txtSellingQuantity.Text = "1";
            try
            { txtMargin.Text = decimal.Parse(Convert.ToString(((clsTransferInItemDetails.SellingPrice - clsTransferInItemDetails.UnitCost) / clsTransferInItemDetails.UnitCost) * 100)).ToString("###0.##0"); }
            catch { txtMargin.Text = "0.00"; }
            txtSellingPrice.Text = clsTransferInItemDetails.SellingPrice.ToString("###0.##0");
            txtVAT.Text = clsTransferInItemDetails.SellingVAT.ToString("###0.##0");
            txtEVAT.Text = clsTransferInItemDetails.SellingEVAT.ToString("###0.##0");
            txtLocalTax.Text = clsTransferInItemDetails.SellingLocalTax.ToString("###0.##0");

            //Added April 28, 2010 4:20PM : For selling information
            txtOldSellingPrice.Text = clsTransferInItemDetails.OldSellingPrice.ToString("###0.##0");

            // Aug 9, 2011 : Lemu
            // For Required Inventory Days
            //txtRID.Text = clsTransferInItemDetails.RID.ToString();

            txtProductCode.Focus();
            ShowCommandButtons(true);
        }
Ejemplo n.º 5
0
		private bool DeleteItems()
		{
            bool boRetValue = false;
            string stIDs = "";

            foreach (DataListItem item in lstItem.Items)
            {
                HtmlInputCheckBox chkList = (HtmlInputCheckBox)item.FindControl("chkList");
                if (chkList != null)
                {
                    if (chkList.Checked == true)
                    {
                        stIDs += chkList.Value + ",";
                        boRetValue = true;
                    }
                }
            }
            if (boRetValue)
            {
                TransferInItem clsTransferInItem = new TransferInItem();
                clsTransferInItem.Delete(stIDs.Substring(0, stIDs.Length - 1));

                TransferIn clsTransferIn = new TransferIn(clsTransferInItem.Connection, clsTransferInItem.Transaction);
                clsTransferIn.SynchronizeAmount(Convert.ToInt64(lblTransferInID.Text));

                TransferInDetails clsTransferInDetails = clsTransferIn.Details(Convert.ToInt64(lblTransferInID.Text));

                clsTransferInItem.CommitAndDispose();

                UpdateFooter(clsTransferInDetails);
            }

            return boRetValue;
		}
Ejemplo n.º 6
0
		private void SaveRecord()
		{
			TransferInItemDetails clsDetails = new TransferInItemDetails();

			Products clsProducts = new Products();
            ProductDetails clsProductDetails = clsProducts.Details1(Constants.BRANCH_ID_MAIN, Convert.ToInt64(cboProductCode.SelectedItem.Value));
			
			Terminal clsTerminal = new Terminal(clsProducts.Connection, clsProducts.Transaction);
            TerminalDetails clsTerminalDetails = clsTerminal.Details(Int32.Parse(Session["BranchID"].ToString()), Session["TerminalNo"].ToString());
			clsProducts.CommitAndDispose();

            clsDetails.TransferInID = Convert.ToInt64(lblTransferInID.Text);
            clsDetails.ProductID = Convert.ToInt64(cboProductCode.SelectedItem.Value);
            clsDetails.ProductCode = clsProductDetails.ProductCode;
            clsDetails.BarCode = clsProductDetails.BarCode;
            clsDetails.Description = clsProductDetails.ProductDesc;
            clsDetails.ProductUnitID = Convert.ToInt32(cboProductUnit.SelectedItem.Value);
            clsDetails.ProductUnitCode = cboProductUnit.SelectedItem.Text;
            clsDetails.Quantity = Convert.ToDecimal(txtQuantity.Text);
            clsDetails.UnitCost = Convert.ToDecimal(txtPrice.Text);
            clsDetails.Discount = getItemTotalDiscount();
            clsDetails.DiscountApplied = Convert.ToDecimal(txtDiscount.Text);
            if (clsDetails.DiscountApplied == 0)
            {
                clsDetails.DiscountType = DiscountTypes.NotApplicable;
            }
            else
            {
                if (chkInPercent.Checked == true)
                    clsDetails.DiscountType = DiscountTypes.Percentage;
                else
                    clsDetails.DiscountType = DiscountTypes.FixedValue;
            }

            clsDetails.IsVatable = chkIsTaxable.Checked;
            clsDetails.Amount = ComputeItemAmount();

            if (clsDetails.IsVatable)
            {
                clsDetails.VatableAmount = clsDetails.Amount;
                clsDetails.EVatableAmount = clsDetails.Amount;
                clsDetails.LocalTax = clsDetails.Amount;

                if (clsTerminalDetails.IsVATInclusive == false)
                {
                    if (clsDetails.VatableAmount < clsDetails.Discount) clsDetails.VatableAmount = 0;
                    if (clsDetails.EVatableAmount < clsDetails.Discount) clsDetails.EVatableAmount = 0;
                    if (clsDetails.LocalTax < clsDetails.Discount) clsDetails.LocalTax = 0;
                }
                else
                {
                    if (clsDetails.VatableAmount >= clsDetails.Discount) clsDetails.VatableAmount = (clsDetails.VatableAmount) / (1 + (clsTerminalDetails.VAT / 100)); else clsDetails.VatableAmount = 0;
                    if (clsDetails.EVatableAmount >= clsDetails.Discount) clsDetails.EVatableAmount = (clsDetails.EVatableAmount) / (1 + (clsTerminalDetails.VAT / 100)); else clsDetails.EVatableAmount = 0;
                    if (clsDetails.LocalTax >= clsDetails.Discount) clsDetails.LocalTax = (clsDetails.LocalTax) / (1 + (clsTerminalDetails.LocalTax / 100)); else clsDetails.LocalTax = 0;
                }

                clsDetails.VAT = clsDetails.VatableAmount * (clsTerminalDetails.VAT / 100);
                clsDetails.EVAT = clsDetails.EVatableAmount * (clsTerminalDetails.EVAT / 100);
                clsDetails.LocalTax = clsDetails.LocalTax * (clsTerminalDetails.LocalTax / 100);

                //if (!clsTerminalDetails.IsVATInclusive) clsDetails.Amount += (clsDetails.VAT + clsDetails.LocalTax);
                //if (!clsTerminalDetails.EnableEVAT) clsDetails.Amount += clsDetails.EVAT;
            }
            else
            {
                clsDetails.VAT = 0;
                clsDetails.VatableAmount = 0;
                clsDetails.EVAT = 0;
                clsDetails.EVatableAmount = 0;
                clsDetails.LocalTax = 0;
            }

            clsDetails.isVATInclusive = clsTerminalDetails.IsVATInclusive;
            clsDetails.VariationMatrixID = Convert.ToInt64(cboVariation.SelectedItem.Value);
            if (clsDetails.VariationMatrixID != 0)
                clsDetails.MatrixDescription = cboVariation.SelectedItem.Text;
            clsDetails.ProductGroup = clsProductDetails.ProductGroupCode;
            clsDetails.ProductSubGroup = clsProductDetails.ProductSubGroupCode;
            clsDetails.Remarks = txtRemarks.Text;

            // Added jan 1, 2010 4:20PM : for selling information
            clsDetails.SellingPrice = decimal.Parse(txtSellingPrice.Text);
            clsDetails.SellingVAT = decimal.Parse(txtVAT.Text);
            clsDetails.SellingEVAT = decimal.Parse(txtEVAT.Text);
            clsDetails.SellingLocalTax = decimal.Parse(txtLocalTax.Text);
            clsDetails.OldSellingPrice = decimal.Parse(txtOldSellingPrice.Text);

            // Aug 9, 2011 : Lemu
            // For Required Inventory Days
            //clsDetails.RID = long.Parse(txtRID.Text);

            TransferInItem clsTransferInItem = new TransferInItem();
            if (lblTransferInItemID.Text != "0")
            {
                clsDetails.TransferInItemID = Convert.ToInt64(lblTransferInItemID.Text);
                clsTransferInItem.Update(clsDetails);
            }
            else
                clsTransferInItem.Insert(clsDetails);

            TransferInDetails clsTransferInDetails = new TransferInDetails();
            clsTransferInDetails.TransferInID = clsDetails.TransferInID;
            clsTransferInDetails.DiscountApplied = Convert.ToDecimal(txtTransferInDiscountApplied.Text);
            clsTransferInDetails.DiscountType = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboTransferInDiscountType.SelectedItem.Value);

            clsTransferInDetails.Discount2Applied = Convert.ToDecimal(txtTransferInDiscount2Applied.Text);
            clsTransferInDetails.Discount2Type = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboTransferInDiscount2Type.SelectedItem.Value);

            clsTransferInDetails.Discount3Applied = Convert.ToDecimal(txtTransferInDiscount3Applied.Text);
            clsTransferInDetails.Discount3Type = (DiscountTypes)Enum.Parse(typeof(DiscountTypes), cboTransferInDiscount3Type.SelectedItem.Value);

            TransferIn clsTransferIn = new TransferIn(clsTransferInItem.Connection, clsTransferInItem.Transaction);
            clsTransferIn.UpdateDiscount(clsDetails.TransferInID, clsTransferInDetails.DiscountApplied, clsTransferInDetails.DiscountType, clsTransferInDetails.Discount2Applied, clsTransferInDetails.Discount2Type, clsTransferInDetails.Discount3Applied, clsTransferInDetails.Discount3Type);

            clsTransferInDetails = clsTransferIn.Details(clsDetails.TransferInID);
            clsTransferInItem.CommitAndDispose();

            UpdateFooter(clsTransferInDetails);
		}