Exemplo n.º 1
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Pos_Product pos_Product = new Pos_Product();

        pos_Product = Pos_ProductManager.GetPos_ProductByID(Int32.Parse(Request.QueryString["pos_ProductID"]));
        Pos_Product tempPos_Product = new Pos_Product();

        tempPos_Product.Pos_ProductID = pos_Product.Pos_ProductID;

        tempPos_Product.ProductID                 = Int32.Parse(ddlProduct.SelectedValue);
        tempPos_Product.ReferenceID               = Int32.Parse(ddlReference.SelectedValue);
        tempPos_Product.Pos_ProductTypeID         = Int32.Parse(ddlPos_ProductType.SelectedValue);
        tempPos_Product.Inv_UtilizationDetailsIDs = Int32.Parse(ddlInv_UtilizationDetails.SelectedValue);
        tempPos_Product.ProductStatusID           = Int32.Parse(ddlProductStatus.SelectedValue);
        tempPos_Product.ProductName               = txtProductName.Text;
        tempPos_Product.DesignCode                = txtDesignCode.Text;
        tempPos_Product.Pos_SizeID                = Int32.Parse(ddlPos_Size.SelectedValue);
        tempPos_Product.Pos_BrandID               = Int32.Parse(ddlPos_Brand.SelectedValue);
        tempPos_Product.Inv_QuantityUnitID        = Int32.Parse(ddlInv_QuantityUnit.SelectedValue);
        tempPos_Product.FabricsCost               = Decimal.Parse(txtFabricsCost.Text);
        tempPos_Product.AccesoriesCost            = Decimal.Parse(txtAccesoriesCost.Text);
        tempPos_Product.Overhead           = Decimal.Parse(txtOverhead.Text);
        tempPos_Product.OthersCost         = Decimal.Parse(txtOthersCost.Text);
        tempPos_Product.PurchasePrice      = Decimal.Parse(txtPurchasePrice.Text);
        tempPos_Product.SalePrice          = Decimal.Parse(txtSalePrice.Text);
        tempPos_Product.OldSalePrice       = Decimal.Parse(txtOldSalePrice.Text);
        tempPos_Product.Note               = txtNote.Text;
        tempPos_Product.BarCode            = txtBarCode.Text;
        tempPos_Product.Pos_ColorID        = Int32.Parse(ddlPos_Color.SelectedValue);
        tempPos_Product.Pos_FabricsTypeID  = Int32.Parse(ddlPos_FabricsType.SelectedValue);
        tempPos_Product.StyleCode          = txtStyleCode.Text;
        tempPos_Product.Pic1               = txtPic1.Text;
        tempPos_Product.Pic2               = txtPic2.Text;
        tempPos_Product.Pic3               = txtPic3.Text;
        tempPos_Product.VatPercentage      = Decimal.Parse(txtVatPercentage.Text);
        tempPos_Product.IsVatExclusive     = cbIsVatExclusive.Checked;
        tempPos_Product.DiscountPercentage = Decimal.Parse(txtDiscountPercentage.Text);
        tempPos_Product.DiscountAmount     = Decimal.Parse(txtDiscountAmount.Text);
        tempPos_Product.FabricsNo          = txtFabricsNo.Text;
        tempPos_Product.ExtraField1        = txtExtraField1.Text;
        tempPos_Product.ExtraField2        = txtExtraField2.Text;
        tempPos_Product.ExtraField3        = txtExtraField3.Text;
        tempPos_Product.ExtraField4        = txtExtraField4.Text;
        tempPos_Product.ExtraField5        = txtExtraField5.Text;
        tempPos_Product.ExtraField6        = txtExtraField6.Text;
        tempPos_Product.ExtraField7        = txtExtraField7.Text;
        tempPos_Product.ExtraField8        = txtExtraField8.Text;
        tempPos_Product.ExtraField9        = txtExtraField9.Text;
        tempPos_Product.ExtraField10       = txtExtraField10.Text;
        tempPos_Product.AddedBy            = Int32.Parse(txtAddedBy.Text);
        tempPos_Product.AddedDate          = DateTime.Now;
        tempPos_Product.UpdatedBy          = Int32.Parse(txtUpdatedBy.Text);
        tempPos_Product.UpdatedDate        = txtUpdatedDate.Text;
        tempPos_Product.RowStatusID        = Int32.Parse(ddlRowStatus.SelectedValue);
        bool result = Pos_ProductManager.UpdatePos_Product(tempPos_Product);

        Response.Redirect("AdminPos_ProductDisplay.aspx");
    }
Exemplo n.º 2
0
    protected void lbDelete_Click(object sender, EventArgs e)
    {
        LinkButton linkButton = new LinkButton();

        linkButton = (LinkButton)sender;
        bool result = Pos_ProductManager.DeletePos_Product(Convert.ToInt32(linkButton.CommandArgument));

        showPos_ProductGrid();
    }
Exemplo n.º 3
0
    protected void btnReceived_Click(object sender, EventArgs e)
    {
        int Pos_TransactionMasterID = int.Parse(Request.QueryString["Pos_TransactionMasterID"]);

        Pos_TransactionMaster pos_TransactionMaster = Pos_TransactionMasterManager.GetPos_TransactionMasterByID(Pos_TransactionMasterID);

        Pos_TransactionType transactionType = Pos_TransactionTypeManager.GetPos_TransactionTypeByID(pos_TransactionMaster.Pos_TransactionTypeID);
        string sql = "Declare @Count int; ";

        sql += "update Pos_TransactionMaster set  ExtraField5='' where Pos_TransactionMasterID=" + Pos_TransactionMasterID + ";";


        List <Pos_Product> items = new List <Pos_Product>();

        items = Pos_ProductManager.GetAllPos_ProductsByTrasactionMasterID(Pos_TransactionMasterID);
        foreach (Pos_Product pos_Transaction in items)
        {
            if (pos_TransactionMaster.WorkSatationID == 1 && transactionType.CentralStockFormula != "0")
            {
                //For head office Central Stock
                sql += "Update Pos_Product set ExtraField1 =(cast(ExtraField1 as decimal(10,2)) + ((" + transactionType.CentralStockFormula + ")*" + pos_Transaction.ExtraField1 + ")) where Pos_ProductID=" + pos_Transaction.Pos_ProductID.ToString() + ";";
            }
            else
            if (pos_TransactionMaster.WorkSatationID != 1 && transactionType.ShowRoomFormula != "0")
            {
                sql += @"
                            set @Count=
                            (
                            select COUNT(*) from Pos_WorkStationStock
                            where ProductID=" + pos_Transaction.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID + @"
                            )

                            if @Count = 0
                            BEGIN
	                            INSERT INTO [Pos_WorkStationStock]
                                        ([WorkStationID]
                                        ,[ProductID]
                                        ,[Stock])
                                        VALUES(" + pos_TransactionMaster.WorkSatationID + @"," + pos_Transaction.Pos_ProductID.ToString() + @"," + pos_Transaction.ExtraField1 + @");
                            END
                            ELSE
                            BEGIN
                                Update Pos_WorkStationStock set Stock += ((+1)*" + pos_Transaction.ExtraField1 + @") where  WorkStationID=" + pos_TransactionMaster.WorkSatationID + @" and  ProductID=" + pos_Transaction.Pos_ProductID.ToString() + @";
                            END;
                            
                                ";
            }
            CommonManager.SQLExec(sql);
        }

        Response.Redirect("TransactionPrint.aspx?Pos_TransactionMasterID=" + Pos_TransactionMasterID);
    }
Exemplo n.º 4
0
    private void showPos_ProductData()
    {
        Pos_Product pos_Product = new Pos_Product();

        pos_Product = Pos_ProductManager.GetPos_ProductByID(Int32.Parse(Request.QueryString["pos_ProductID"]));

        ddlProduct.SelectedValue                = pos_Product.ProductID.ToString();
        ddlReference.SelectedValue              = pos_Product.ReferenceID.ToString();
        ddlPos_ProductType.SelectedValue        = pos_Product.Pos_ProductTypeID.ToString();
        ddlInv_UtilizationDetails.SelectedValue = pos_Product.Inv_UtilizationDetailsIDs.ToString();
        ddlProductStatus.SelectedValue          = pos_Product.ProductStatusID.ToString();
        txtProductName.Text               = pos_Product.ProductName;
        txtDesignCode.Text                = pos_Product.DesignCode;
        ddlPos_Size.SelectedValue         = pos_Product.Pos_SizeID.ToString();
        ddlPos_Brand.SelectedValue        = pos_Product.Pos_BrandID.ToString();
        ddlInv_QuantityUnit.SelectedValue = pos_Product.Inv_QuantityUnitID.ToString();
        txtFabricsCost.Text               = pos_Product.FabricsCost.ToString();
        txtAccesoriesCost.Text            = pos_Product.AccesoriesCost.ToString();
        txtOverhead.Text                 = pos_Product.Overhead.ToString();
        txtOthersCost.Text               = pos_Product.OthersCost.ToString();
        txtPurchasePrice.Text            = pos_Product.PurchasePrice.ToString();
        txtSalePrice.Text                = pos_Product.SalePrice.ToString();
        txtOldSalePrice.Text             = pos_Product.OldSalePrice.ToString();
        txtNote.Text                     = pos_Product.Note;
        txtBarCode.Text                  = pos_Product.BarCode;
        ddlPos_Color.SelectedValue       = pos_Product.Pos_ColorID.ToString();
        ddlPos_FabricsType.SelectedValue = pos_Product.Pos_FabricsTypeID.ToString();
        txtStyleCode.Text                = pos_Product.StyleCode;
        txtPic1.Text                     = pos_Product.Pic1;
        txtPic2.Text                     = pos_Product.Pic2;
        txtPic3.Text                     = pos_Product.Pic3;
        txtVatPercentage.Text            = pos_Product.VatPercentage.ToString();
        cbIsVatExclusive.Checked         = pos_Product.IsFeature;
        txtDiscountPercentage.Text       = pos_Product.DiscountPercentage.ToString();
        txtDiscountAmount.Text           = pos_Product.DiscountAmount.ToString();
        txtFabricsNo.Text                = pos_Product.FabricsNo;
        txtExtraField1.Text              = pos_Product.ExtraField1;
        txtExtraField2.Text              = pos_Product.ExtraField2;
        txtExtraField3.Text              = pos_Product.ExtraField3;
        txtExtraField4.Text              = pos_Product.ExtraField4;
        txtExtraField5.Text              = pos_Product.ExtraField5;
        txtExtraField6.Text              = pos_Product.ExtraField6;
        txtExtraField7.Text              = pos_Product.ExtraField7;
        txtExtraField8.Text              = pos_Product.ExtraField8;
        txtExtraField9.Text              = pos_Product.ExtraField9;
        txtExtraField10.Text             = pos_Product.ExtraField10;
        txtAddedBy.Text                  = pos_Product.AddedBy.ToString();
        txtUpdatedBy.Text                = pos_Product.UpdatedBy.ToString();
        txtUpdatedDate.Text              = pos_Product.UpdatedDate;
        ddlRowStatus.SelectedValue       = pos_Product.RowStatusID.ToString();
    }
    private void loadPos_Product()
    {
        ListItem li = new ListItem("Select Pos_Product...", "0");

        ddlPos_Product.Items.Add(li);

        List <Pos_Product> pos_Products = new List <Pos_Product>();

        pos_Products = Pos_ProductManager.GetAllPos_Products();
        foreach (Pos_Product pos_Product in pos_Products)
        {
            ListItem item = new ListItem(pos_Product.Pos_ProductName.ToString(), pos_Product.Pos_ProductID.ToString());
            ddlPos_Product.Items.Add(item);
        }
    }
 private void showPos_ProductGrid()
 {
     gvPos_Product.DataSource = Pos_ProductManager.GetAllPos_Products();
     gvPos_Product.DataBind();
 }
Exemplo n.º 7
0
    protected void btnReceived_Click(object sender, EventArgs e)
    {
        int Pos_TransactionMasterID = int.Parse(Request.QueryString["Pos_TransactionMasterID"]);

        Pos_TransactionMaster pos_TransactionMaster = Pos_TransactionMasterManager.GetPos_TransactionMasterByID(Pos_TransactionMasterID);

        Pos_TransactionType transactionType = Pos_TransactionTypeManager.GetPos_TransactionTypeByID(pos_TransactionMaster.Pos_TransactionTypeID);
        string sql = "Declare @Count int; ";

        sql += "update Pos_TransactionMaster set  ExtraField5='' where Pos_TransactionMasterID=" + Pos_TransactionMasterID + ";";


        List <Pos_Product> items = new List <Pos_Product>();

        items = Pos_ProductManager.GetAllPos_ProductsByTrasactionMasterID(Pos_TransactionMasterID);
        //updated by is the transaction ID
        string accountingEntry = "";

        accountingEntry += @"
                                Declare @JournalMasterID int
                                Declare @ProductID int
                                Declare @FinishedGoodsAmount decimal(18,2)
                                INSERT INTO [ACC_JournalMaster]
                                           ([JournalMasterName]
                                           ,[ExtraField1]
                                           ,[ExtraField2]
                                           ,[ExtraField3]
                                           ,[Note]
                                           ,[JournalDate]
                                           ,[AddedBy]
                                           ,[AddedDate]
                                           ,[UpdatedBy]
                                           ,[UpdatedDate]
                                           ,[RowStatusID])
                                     VALUES
                                           ('1'--<JournalMasterName, nvarchar(50),>
                                           ,''--<ExtraField1, nvarchar(256),>
                                           ,'POS ISSUE'--<ExtraField2, nvarchar(256),>
                                           ,'" + Pos_TransactionMasterID.ToString() + @"'--<ExtraField3, nvarchar(256),>
                                           ,'" + pos_TransactionMaster.ToOrFromName + " " + "Chalan #: " + pos_TransactionMaster.TransactionID + @"'--<Note, nvarchar(256),>
                                           ,GETDATE()--<JournalDate, datetime,>
                                           ," + pos_TransactionMaster.AddedBy.ToString() + @"--<AddedBy, int,>
                                           ,GETDATE()--<AddedDate, datetime,>
                                           ," + pos_TransactionMaster.AddedBy.ToString() + @"--<UpdatedBy, int,>
                                           ,GETDATE()--<UpdatedDate, datetime,>
                                           ,1--<RowStatusID, int,>
                                           );
                                Set @JournalMasterID = SCOPE_IDENTITY();
                                ";
        foreach (Pos_Product pos_Transaction in items)
        {
            //Finished Good(Aseet) -- branch
            accountingEntry += @"
                            Set @ProductID=(Select ProductID from Pos_Product where Pos_ProductID=" + pos_Transaction.Pos_ProductID.ToString() + @")
                            set @FinishedGoodsAmount=(select ([Pos_Product].[FabricsCost] + [Pos_Product].[AccesoriesCost] + [Pos_Product].[Overhead]+[Pos_Product].[OthersCost]+[Pos_Product].[PurchasePrice]) from Pos_Product where Pos_ProductID=" + pos_Transaction.Pos_ProductID.ToString() + @")
                            INSERT INTO [ACC_JournalDetail]
                                   ([JournalMasterID]
                                   ,[ACC_ChartOfAccountLabel4ID]
                                   ,[ACC_ChartOfAccountLabel3ID]
                                   ,[WorkStation]
                                   ,[Debit]
                                   ,[Credit]
                                   ,[ExtraField3]
                                   ,[ExtraField2]
                                   ,[ExtraField1]
                                   ,[AddedBy]
                                   ,[AddedDate]
                                   ,[UpdatedBy]
                                   ,[UpdatedDate]
                                   ,[RowStatusID])
                             VALUES
                                   (@JournalMasterID--<JournalMasterID, int,>
                                   ,@ProductID--<ACC_ChartOfAccountLabel4ID, int,>
                                   ,9--<ACC_ChartOfAccountLabel3ID, int,>
                                   ," + pos_TransactionMaster.ToOrFromID + @"--<WorkStation, int,>
                                   ,(@FinishedGoodsAmount *" + decimal.Parse(pos_Transaction.ExtraField1).ToString("0.00") + @")--<Debit, decimal(20,2),>
                                   ,0--<Credit, decimal(20,2),>
                                   ,'" + pos_Transaction.UpdatedBy + @"'--<ExtraField3, nvarchar(256),>
                                   ,'POS ISSUE'--<ExtraField2, nvarchar(256),>
                                   ,''--<ExtraField1, nvarchar(256),>
                                   ," + pos_TransactionMaster.AddedBy.ToString() + @"--<AddedBy, int,>
                                    ,GETDATE()--<AddedDate, datetime,>
                                    ," + pos_TransactionMaster.AddedBy.ToString() + @"--<UpdatedBy, int,>
                                    ,GETDATE()--<UpdatedDate, datetime,>
                                    ,1--<RowStatusID, int,>
                                   )  ;
                            ";

            //Finished Good(Aseet) -- head office
            accountingEntry += @"
                            Set @ProductID=(Select ProductID from Pos_Product where Pos_ProductID=" + pos_Transaction.Pos_ProductID.ToString() + @")
                            set @FinishedGoodsAmount=(select ([Pos_Product].[FabricsCost] + [Pos_Product].[AccesoriesCost] + [Pos_Product].[Overhead]+[Pos_Product].[OthersCost]+[Pos_Product].[PurchasePrice]) from Pos_Product where Pos_ProductID=" + pos_Transaction.Pos_ProductID.ToString() + @")
                            INSERT INTO [ACC_JournalDetail]
                                   ([JournalMasterID]
                                   ,[ACC_ChartOfAccountLabel4ID]
                                   ,[ACC_ChartOfAccountLabel3ID]
                                   ,[WorkStation]
                                   ,[Debit]
                                   ,[Credit]
                                   ,[ExtraField3]
                                   ,[ExtraField2]
                                   ,[ExtraField1]
                                   ,[AddedBy]
                                   ,[AddedDate]
                                   ,[UpdatedBy]
                                   ,[UpdatedDate]
                                   ,[RowStatusID])
                             VALUES
                                   (@JournalMasterID--<JournalMasterID, int,>
                                   ,@ProductID--<ACC_ChartOfAccountLabel4ID, int,>
                                   ,9--<ACC_ChartOfAccountLabel3ID, int,>
                                   ,1--<WorkStation, int,>
                                   ,0--<Debit, decimal(20,2),>
                                   ,(@FinishedGoodsAmount *" + decimal.Parse(pos_Transaction.ExtraField1).ToString("0.00") + @")--<Credit, decimal(20,2),>
                                   ,'" + pos_Transaction.UpdatedBy + @"'--<ExtraField3, nvarchar(256),>
                                   ,'POS ISSUE'--<ExtraField2, nvarchar(256),>
                                   ,''--<ExtraField1, nvarchar(256),>
                                   ," + pos_TransactionMaster.AddedBy.ToString() + @"--<AddedBy, int,>
                                    ,GETDATE()--<AddedDate, datetime,>
                                    ," + pos_TransactionMaster.AddedBy.ToString() + @"--<UpdatedBy, int,>
                                    ,GETDATE()--<UpdatedDate, datetime,>
                                    ,1--<RowStatusID, int,>
                                   )  ;
                            ";

            if (pos_TransactionMaster.ToOrFromID == 1 && transactionType.CentralStockFormula != "0")
            {
                //For head office Central Stock
                sql += "Update Pos_Product set ExtraField1 =(cast(ExtraField1 as decimal(10,2)) + ((" + transactionType.CentralStockFormula + ")*" + pos_Transaction.ExtraField1 + ")) where Pos_ProductID=" + pos_Transaction.Pos_ProductID.ToString() + ";";
            }
            else
            if (pos_TransactionMaster.ToOrFromID != 1 && transactionType.ShowRoomFormula != "0")
            {
                sql += @"
                            set @Count=
                            (
                            select COUNT(*) from Pos_WorkStationStock
                            where ProductID=" + pos_Transaction.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.ToOrFromID + @"
                            )

                            if @Count = 0
                            BEGIN
	                            INSERT INTO [Pos_WorkStationStock]
                                        ([WorkStationID]
                                        ,[ProductID]
                                        ,[Stock])
                                        VALUES(" + pos_TransactionMaster.ToOrFromID + @"," + pos_Transaction.Pos_ProductID.ToString() + @"," + pos_Transaction.ExtraField1 + @");
                            END
                            ELSE
                            BEGIN
                                Update Pos_WorkStationStock set Stock += ((+1)*" + pos_Transaction.ExtraField1 + @") where  WorkStationID=" + pos_TransactionMaster.ToOrFromID + @" and  ProductID=" + pos_Transaction.Pos_ProductID.ToString() + @";
                            END;
                            
                                ";
            }
        }

        //CommonManager.SQLExec(sql);
        CommonManager.SQLExec(sql + accountingEntry);

        Response.Redirect("DelivaryChalanPrint.aspx?Pos_TransactionMasterID=" + Pos_TransactionMasterID);
    }
Exemplo n.º 8
0
    private void loadData()
    {
        int Pos_TransactionMasterID = int.Parse(Request.QueryString["Pos_TransactionMasterID"]);

        Pos_TransactionMaster pos_TransactionMaster = Pos_TransactionMasterManager.GetPos_TransactionMasterByID(Pos_TransactionMasterID);

        lblPurchaseDate.Text  = pos_TransactionMaster.TransactionDate.ToString("dd-MMM-yyyy");
        lblParticulars.Text   = pos_TransactionMaster.Particulars;
        lblTransactionID.Text = pos_TransactionMaster.TransactionID.ToString() + (pos_TransactionMaster.RowStatusID == 1? (Request.QueryString["Delete"] != null ? " (<a href='TransactionDelete.aspx?Pos_TransactionMasterID=" + Request.QueryString["Pos_TransactionMasterID"] + "'>X</a>)" : ""):"<b style='color:red;'>(Deleted)</b>");
        lblRefferenceIDs.Text = pos_TransactionMaster.Record;
        lblToOrFromName.Text  = pos_TransactionMaster.ToOrFromName;

        if ((pos_TransactionMaster.ToOrFromID.ToString() != getLogin().ExtraField5
             &&
             pos_TransactionMaster.WorkSatationID.ToString() != getLogin().ExtraField5
             ) && getLogin().ExtraField5 != "1")
        {
            showAlartMessage("Your are not allowed to View this Transaction");
            btnReceived.Visible = false;
            return;
        }
        if (pos_TransactionMaster.ExtraField5 == "Pending")
        {
            lblExtraField5.Text = pos_TransactionMaster.ExtraField5;
            if (pos_TransactionMaster.Pos_TransactionTypeID == 12
                &&
                getLogin().ExtraField5 == pos_TransactionMaster.WorkSatationID.ToString()
                )
            {
                lblExtraField5.Visible = true;
                btnReceived.Visible    = true;
            }
            else
            if (getLogin().ExtraField5 == pos_TransactionMaster.ToOrFromID.ToString())
            {
                lblExtraField5.Visible = true;
                btnReceived.Visible    = true;
            }
            else
            {
                lblExtraField5.Visible = false;
                btnReceived.Visible    = false;
            }
        }
        else
        {
            lblExtraField5.Visible = false;
            btnReceived.Visible    = false;
        }


        string NoOfcollum = "9";

        trRefference.Visible = false;
        trToOrFrom.Visible   = false;

        lblVoucherType.Text = Pos_TransactionTypeManager.GetPos_TransactionTypeByID(pos_TransactionMaster.Pos_TransactionTypeID).TransactionTypeName;

        switch (pos_TransactionMaster.Pos_TransactionTypeID)
        {
        case 1:
            break;

        case 2:
            break;

        case 3:
            break;

        case 4:
            break;

        case 5:
            break;

        case 6:
            break;

        case 7:
            break;

        case 8:
            break;

        case 9:
            trToOrFrom.Visible = true;
            break;

        case 10:
            trToOrFrom.Visible = true;
            break;

        case 11:     //Branch Transfer
            trToOrFrom.Visible = true;
            break;

        case 12:     //Branch Transfer
            trToOrFrom.Visible = true;
            break;

        case 25:
            trToOrFrom.Visible = true;
            NoOfcollum         = "10";
            break;

        default:
            break;
        }

        //Item Info
        List <Pos_Product> items = new List <Pos_Product>();

        items = Pos_ProductManager.GetAllPos_ProductsByTrasactionMasterID(Pos_TransactionMasterID);

        string htmlTable = @" <table id='itemList_tbl' style='border:1px solid black;width:100%;' cellpadding='0' cellspacing='0'>
                        <tr id='tableHeader'>
                            <td  style='border-left:0px;'>S/L</td>
                            <td>Product Code</td>
                            <td>Product Name</td>
                            <td>Status</td>
                            <td>Quantity</td>
                            <td>Unit</td>
                            " + (NoOfcollum == "10" ? "<td>Cost</td><td>Total Cost</td>" : "")
                           + @"<td>Sale Price</td>
                            <td>VAT %</td>
                            <td>Amount</td>
                        </tr>";
        int     lastRawMaterialID  = 0;
        decimal Total              = 0;
        decimal Subtotal           = 0;
        decimal TotalAmount        = 0;
        decimal SubtotalAmount     = 0;
        decimal TotalAmountCost    = 0;
        decimal SubtotalAmountCost = 0;
        int     serialNo           = 1;

        foreach (Pos_Product item in items)
        {
            if (item.RowStatusID != 1)
            {
                continue;
            }
            if (lastRawMaterialID != 0 && lastRawMaterialID != item.ProductID)
            {
                htmlTable += @"<tr class='subtotalRow'>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>Sub Total</td>
                            <td>" + Subtotal.ToString("0,0.000000") + @"</td>
                            <td>&nbsp;</td>
                            " + (NoOfcollum == "10" ? "<td>&nbsp;</td><td>" + SubtotalAmountCost.ToString("0,0.000000") + @"</td>" : "")
                             + @"<td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>" + SubtotalAmount.ToString("0,0.000000") + @"</td>
                        </tr>";

                Subtotal           = 0;
                SubtotalAmount     = 0;
                SubtotalAmountCost = 0;
            }

            if (lastRawMaterialID != item.ProductID)
            {
                lastRawMaterialID = item.ProductID;
                htmlTable        += @"<tr>
                            <td colspan='" + NoOfcollum + @"' style='padding-left:50px; border-top:1px solid black;border-bottom:1px solid black;font-weight:bold;'>
                                Item: " + item.ExtraField2 + @"
                            </td>
                        </tr>";
            }

            htmlTable += @"<tr class='itemCss'>
                            <td  style='border-left:0px;'>" + (serialNo++).ToString() + (item.RowStatusID == 1 ? (Request.QueryString["Delete"] != null ? (pos_TransactionMaster.Pos_TransactionTypeID == 13?"": " (<a href='TransactionDelete.aspx?Pos_TransactionID=" + item.ExtraField10 + "&Pos_TransactionMasterID=" + Request.QueryString["Pos_TransactionMasterID"] + "'>X</a>)") : "") : "<b style='color:red;'>(Deleted)</b>") + @"</td>
                            <td>" + item.BarCode + @"</td>
                            <td>" + item.ExtraField2 + @"</td>
                            <td>" + item.ExtraField8 + @"</td>
                            <td style='text-align:right;'>" + decimal.Parse(item.ExtraField1).ToString("0,0.000000") + @"</td>
                            <td >" + item.ExtraField3 + @"</td>
                            " + (NoOfcollum == "10" ? "<td style='text-align:right;'>" + decimal.Parse(item.ExtraField4).ToString("0,0.000000") + @"</td><td>" + (decimal.Parse(item.ExtraField1) * decimal.Parse(item.ExtraField4)).ToString("0,0.000000") + @"</td>" : "")
                         + @"<td style='text-align:right;'>" + item.SalePrice.ToString("0,0.000000") + @"</td>
                            <td style='text-align:right;'>" + item.VatPercentage.ToString("0,0.000000") + @"</td>
                            <td style='text-align:right;'>" + ((decimal.Parse(item.ExtraField1) * item.SalePrice) + ((decimal.Parse(item.ExtraField1) * item.SalePrice) * item.VatPercentage / 100)).ToString("0,0.000000") + @"</td>
                        </tr>";

            Subtotal           += decimal.Parse(item.ExtraField1);
            SubtotalAmount     += ((decimal.Parse(item.ExtraField1) * item.SalePrice) + ((decimal.Parse(item.ExtraField1) * item.SalePrice) * item.VatPercentage / 100));
            SubtotalAmountCost += decimal.Parse(item.ExtraField1) * decimal.Parse(item.ExtraField4);

            Total           += decimal.Parse(item.ExtraField1);
            TotalAmount     += ((decimal.Parse(item.ExtraField1) * item.SalePrice) + ((decimal.Parse(item.ExtraField1) * item.SalePrice) * item.VatPercentage / 100));
            TotalAmountCost += decimal.Parse(item.ExtraField1) * decimal.Parse(item.ExtraField4);
        }

        htmlTable += @"<tr class='subtotalRow'>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Sub Total</td>
                        <td>" + Subtotal.ToString("0,0.000000") + @"</td>
                        <td>&nbsp;</td>
                        " + (NoOfcollum == "10" ? "<td>&nbsp;</td><td>" + SubtotalAmountCost.ToString("0,0.000000") + @"</td>" : "")
                     + @"<td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>" + SubtotalAmount.ToString("0,0.000000") + @"</td>
                    </tr>";

        htmlTable += @"<tr id='lastRow'>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Grand Total</td>
                        <td>" + Total.ToString("0,0.000000") + @"</td>
                        <td>&nbsp;</td>
                        " + (NoOfcollum == "10" ? "<td>&nbsp;</td><td>" + TotalAmountCost.ToString("0,0.000000") + @"</td>" : "")
                     + @"<td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>" + TotalAmount.ToString("0,0.000000") + @"</td>
                    </tr></table>";

        lblItemList.Text = htmlTable;
    }
Exemplo n.º 9
0
    private void DeleteSingleTransactionMaster()
    {
        int Pos_TransactionMasterID = int.Parse(Request.QueryString["Pos_TransactionMasterID"]);

        Pos_TransactionMaster pos_TransactionMaster = Pos_TransactionMasterManager.GetPos_TransactionMasterByID(Pos_TransactionMasterID);
        //Item Info
        List <Pos_Product> items = new List <Pos_Product>();

        items = Pos_ProductManager.GetAllPos_ProductsByTrasactionMasterID(Pos_TransactionMasterID);

        string sql = "";

        sql  = "Update Pos_TransactionMaster set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @" where Pos_TransactionMasterID=" + Request.QueryString["Pos_TransactionMasterID"] + ";";
        sql += "Update Pos_Transaction set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @",RowStatusID=3 where Pos_ProductTransactionMasterID=" + Request.QueryString["Pos_TransactionMasterID"] + " and  Pos_TransactionID=" + Request.QueryString["Pos_TransactionID"] + ";";
        bool executionProgramed = false;

        switch (pos_TransactionMaster.Pos_TransactionTypeID)
        {
        case 1:
            break;

        case 2:
            break;

        case 3:
            break;

        case 4:
            break;

        case 5:
            break;

        case 6:
            break;

        case 7:
            break;

        case 8:
            break;

        case 9:     //issue to show room
            executionProgramed = true;
            if (pos_TransactionMaster.ExtraField5 != "Pending")
            {
                foreach (Pos_Product item in items)
                {
                    sql += "Update Pos_WorkStationStock set   Stock -= " + item.ExtraField1 + @" where ProductID=" + item.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + ";";
                    sql += "Update Pos_Product set ExtraField1 =(cast(ExtraField1 as decimal(10,2)) + ((" + "+1" + ")*" + item.ExtraField1 + ")) where Pos_ProductID=" + item.Pos_ProductID.ToString() + ";";

                    sql += "Update ACC_JournalMaster set RowStatusID=3 where ExtraField2='POS ISSUE' and ExtraField3='" + Request.QueryString["Pos_TransactionMasterID"] + @"';";
                    sql += "Update ACC_JournalDetail set RowStatusID=3 where JournalMasterID=(select ACC_JournalMasterID from ACC_JournalMaster where ExtraField2='POS ISSUE' and ExtraField3='" + Request.QueryString["Pos_TransactionMasterID"] + @"');";
                }
            }
            else
            {
                foreach (Pos_Product item in items)
                {
                    sql += "Update Pos_Product set ExtraField1 =(cast(ExtraField1 as decimal(10,2)) + ((" + "+1" + ")*" + item.ExtraField1 + ")) where Pos_ProductID=" + item.Pos_ProductID.ToString() + ";";
                }
            }

            break;

        case 10:    //issue return to show room
            executionProgramed = true;
            if (pos_TransactionMaster.ExtraField5 != "Pending")
            {
                foreach (Pos_Product item in items)
                {
                    sql += "Update Pos_WorkStationStock set   Stock += " + item.ExtraField1 + @" where ProductID=" + item.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + ";";
                    sql += "Update Pos_Product set ExtraField1 =(cast(ExtraField1 as decimal(10,2)) + ((" + "-1" + ")*" + item.ExtraField1 + ")) where Pos_ProductID=" + item.Pos_ProductID.ToString() + ";";
                }
            }
            else
            {
                foreach (Pos_Product item in items)
                {
                    sql += "Update Pos_WorkStationStock set   Stock += " + item.ExtraField1 + @" where ProductID=" + item.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + ";";
                }
            }
            break;

        case 11:     //Send to another Branch
        {
            executionProgramed = true;
            //Sender Delete
            foreach (Pos_Product item in items)
            {
                sql += "Update Pos_WorkStationStock set   Stock += " + item.ExtraField1 + @" where ProductID=" + item.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + ";";
            }

            //Receiver Delete
            Pos_TransactionMasterID++;
            pos_TransactionMaster = Pos_TransactionMasterManager.GetPos_TransactionMasterByID(Pos_TransactionMasterID);
            sql  = "Update Pos_TransactionMaster set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @",RowStatusID=3 where Pos_TransactionMasterID=" + Pos_TransactionMasterID.ToString() + ";";
            sql += "Update Pos_Transaction set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @",RowStatusID=3 where Pos_ProductTransactionMasterID=" + Pos_TransactionMasterID.ToString() + ";";

            //Item Info
            if (pos_TransactionMaster.ExtraField5 != "Pending")
            {
                items = new List <Pos_Product>();
                items = Pos_ProductManager.GetAllPos_ProductsByTrasactionMasterID(Pos_TransactionMasterID);

                foreach (Pos_Product item in items)
                {
                    sql += "Update Pos_WorkStationStock set   Stock -= " + item.ExtraField1 + @" where ProductID=" + item.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + ";";
                }
            }
            break;
        }

        case 12:     //Received from another branch
            showAlartMessage("Please ask the sender branch to delete.");
            break;

        case 13:     //Sales
        {
            executionProgramed = true;

            if (pos_TransactionMaster.UpdatedBy < 0)        //when sales return
            {
                //cencel the sales return
                sql += "Update Pos_TransactionMaster set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @",RowStatusID=3 where Pos_TransactionMasterID=" + (-1 * pos_TransactionMaster.UpdatedBy) + ";";
                sql += "Update Pos_Transaction set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @",RowStatusID=3 where Pos_ProductTransactionMasterID=" + (-1 * pos_TransactionMaster.UpdatedBy) + ";";

                string  returnSales      = "select * from Pos_Transaction where Pos_ProductTransactionMasterID=" + (-1 * pos_TransactionMaster.UpdatedBy) + ";";
                DataSet dsReturnSales    = CommonManager.SQLExec(returnSales);
                bool    masterNotUpdated = true;
                foreach (DataRow dr in dsReturnSales.Tables[0].Rows)
                {
                    if (masterNotUpdated)
                    {
                        //update the sales of which the sales was returned
                        sql += "Update Pos_TransactionMaster set UpdatedDate=GetDate(), Particulars= cast(Particulars as nvarchar(max))+'<hr/>Sales Return Cancelled' where Pos_TransactionMasterID=(Select Pos_ProductTransactionMasterID from Pos_Transaction where  Pos_TransactionID=" + dr["ExtraField4"] + ");";

                        masterNotUpdated = false;
                    }

                    //revercing the sales return
                    sql += "Update Pos_Transaction set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @",ExtraField4= (cast(ExtraField4 as int)-" + decimal.Parse(dr["Quantity"].ToString()).ToString("0") + ") where Pos_TransactionID=" + dr["ExtraField4"] + ";";
                    sql += "update Pos_WorkStationStock set Stock-=" + decimal.Parse(dr["Quantity"].ToString()).ToString("0") + " where WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + " and ProductID=" + dr["Pos_ProductID"] + ";";
                }
            }

            foreach (Pos_Product item in items)
            {
                sql += "Update Pos_WorkStationStock set   Stock += " + item.ExtraField1 + @" where ProductID=" + item.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + ";";
            }

            sql += "Update ACC_JournalMaster set RowStatusID=3 where ExtraField2='POS SALE' and ExtraField3='" + Request.QueryString["Pos_TransactionMasterID"] + @"';";
            sql += "Update ACC_JournalDetail set RowStatusID=3 where JournalMasterID=(select ACC_JournalMasterID from ACC_JournalMaster where ExtraField2='POS SALE' and ExtraField3='" + Request.QueryString["Pos_TransactionMasterID"] + @"');";
        }
        break;

        case 25:    //Purchase
        {
            executionProgramed = true;
            string sql_tmp = @"Select * from Pos_Transaction where Pos_TransactionID=" + Request.QueryString["Pos_TransactionID"]
                             + "; Select * from ACC_JournalMaster where Note='" + "Product Purchase-'+(Select cast(TransactionID as nvarchar) from Pos_TransactionMaster where Pos_TransactionMasterID=" + Request.QueryString["Pos_TransactionMasterID"] + ")";

            DataSet ds = CommonManager.SQLExec(sql_tmp);
            if (pos_TransactionMaster.ExtraField5 != "Pending")
            {
                foreach (Pos_Product item in items)
                {
                    if (ds.Tables[0].Rows[0]["Pos_ProductID"].ToString() == item.Pos_ProductID.ToString())
                    {
                        sql += "; update Pos_Product set pos_Product.RowStatusID = 3 where Pos_ProductID=" + item.Pos_ProductID;
                        sql += "; Update [Pos_Transaction] set [RowStatusID]=3 where Pos_TransactionID=" + Request.QueryString["Pos_TransactionID"];
                        sql += "; Update [ACC_JournalDetail] set [RowStatusID]=3 where [JournalMasterID]=" + ds.Tables[1].Rows[0]["ACC_JournalMasterID"].ToString() + " and ExtraField1='" + item.Pos_ProductID.ToString() + "'";
                        break;
                    }
                }
            }
            else
            {
                foreach (Pos_Product item in items)
                {
                    if (ds.Tables[0].Rows[0]["Pos_ProductID"].ToString() == item.Pos_ProductID.ToString())
                    {
                        sql += "; update Pos_Product set pos_Product.RowStatusID = 3 where Pos_ProductID=" + item.Pos_ProductID;
                        sql += "; Update [Pos_Transaction] set [RowStatusID]=3 where Pos_TransactionID=" + Request.QueryString["Pos_TransactionID"];
                        sql += "; Update [ACC_JournalDetail] set [RowStatusID]=3 where [JournalMasterID]=" + ds.Tables[1].Rows[0]["ACC_JournalMasterID"].ToString() + " and ExtraField1='" + item.Pos_ProductID.ToString() + "'";
                        break;
                    }
                }
            }
        }
        break;

        default:
            break;
        }

        if (executionProgramed)
        {
            try
            {
                CommonManager.SQLExec(sql);
                showAlartMessage("Delete Successfully");
            }
            catch (Exception ex)
            {
                showAlartMessage("Delete Error");
            }
        }
    }
Exemplo n.º 10
0
    private void loadData()
    {
        string  inventoryID = Request.QueryString["InventoryID"];
        string  sql         = @"
SELECT Pos_Inventory.[InventoryID]
      ,Pos_Inventory.[WorkStationID]
      ,ACC_ChartOfAccountLabel4.[ChartOfAccountLabel4Text]
      ,Pos_Inventory.[InventoryDate]
      ,Pos_Inventory.[AddedBy]
      ,Pos_Inventory.[AddedDate]
      ,Pos_Inventory.[ExtraField1]
      ,Pos_Inventory.[ExtraField2]
      ,Pos_Inventory.[ExtraField3]
      ,Pos_Inventory.[ExtraField4]
      ,Pos_Inventory.[ExtraField5]
  FROM [Pos_Inventory]
inner join ACC_ChartOfAccountLabel4 on ACC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID=Pos_Inventory.WorkStationID
where InventoryID=" + inventoryID + @"
";
        DataSet ds          = CommonManager.SQLExec(sql);


        lblPurchaseDate.Text = DateTime.Parse(ds.Tables[0].Rows[0]["InventoryDate"].ToString()).ToString("yyyy-MM-dd");
        //lblParticulars.Text = ds.Tables[0].Rows[0]["InventoryDate"].ToString();
        lblTransactionID.Text = ds.Tables[0].Rows[0]["InventoryID"].ToString();// pos_TransactionMaster.TransactionID.ToString() + (pos_TransactionMaster.RowStatusID == 1 ? (Request.QueryString["Delete"] != null ? " (<a href='TransactionDelete.aspx?Pos_TransactionMasterID=" + Request.QueryString["Pos_TransactionMasterID"] + "'>X</a>)" : "") : "<b style='color:red;'>(Deleted)</b>");
        //lblRefferenceIDs.Text = pos_TransactionMaster.Record;
        lblToOrFromName.Text = ds.Tables[0].Rows[0]["ChartOfAccountLabel4Text"].ToString();

        lblExtraField5.Visible = false;
        //btnReceived.Visible = false;

        string NoOfcollum = "9";

        trRefference.Visible = false;
        trToOrFrom.Visible   = false;

        lblVoucherType.Text = "Inventory";


        //Item Info
        List <Pos_Product> items = new List <Pos_Product>();

        items = Pos_ProductManager.GetAllPos_ProductsByInventoryID(int.Parse(inventoryID));

        string htmlTable = @" <table id='itemList_tbl' style='border:1px solid black;width:100%;' cellpadding='0' cellspacing='0'>
                        <tr id='tableHeader'>
                            <td  style='border-left:0px;'>S/L</td>
                            <td>Product Code</td>
                            <td>Product Name</td>
                            <td>Status</td>
                            <td>Quantity</td>
                            <td>Unit</td>
                            " + (NoOfcollum == "10" ? "<td>Cost</td><td>Total Cost</td>" : "")
                           + @"<td>Sale Price</td>
                            <td>VAT %</td>
                            <td>Amount</td>
                        </tr>";
        int     lastRawMaterialID  = 0;
        decimal Total              = 0;
        decimal Subtotal           = 0;
        decimal TotalAmount        = 0;
        decimal SubtotalAmount     = 0;
        decimal TotalAmountCost    = 0;
        decimal SubtotalAmountCost = 0;
        int     serialNo           = 1;

        foreach (Pos_Product item in items)
        {
            if (item.RowStatusID != 1)
            {
                continue;
            }
            if (lastRawMaterialID != 0 && lastRawMaterialID != item.ProductID)
            {
                htmlTable += @"<tr class='subtotalRow'>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>Sub Total</td>
                            <td>" + Subtotal.ToString("0,0.00") + @"</td>
                            <td>&nbsp;</td>
                            " + (NoOfcollum == "10" ? "<td>&nbsp;</td><td>" + SubtotalAmountCost.ToString("0,0.00") + @"</td>" : "")
                             + @"<td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>" + SubtotalAmount.ToString("0,0.00") + @"</td>
                        </tr>";

                Subtotal           = 0;
                SubtotalAmount     = 0;
                SubtotalAmountCost = 0;
            }

            if (lastRawMaterialID != item.ProductID)
            {
                lastRawMaterialID = item.ProductID;
                htmlTable        += @"<tr>
                            <td colspan='" + NoOfcollum + @"' style='padding-left:50px; border-top:1px solid black;border-bottom:1px solid black;font-weight:bold;'>
                                Item: " + item.ExtraField2 + @"
                            </td>
                        </tr>";
            }

            htmlTable += @"<tr class='itemCss'>
                            <td  style='border-left:0px;'>" + (serialNo++).ToString() + (item.RowStatusID == 1 ? (Request.QueryString["Delete"] != null ? (" (<a href='TransactionDelete.aspx?InventoryDetailsID=" + item.ExtraField10 + "&InventoryID=" + Request.QueryString["InventoryID"] + "'>X</a>)") : "") : "<b style='color:red;'>(Deleted)</b>") + @"</td>
                            <td>" + item.BarCode + @"</td>
                            <td>" + item.ExtraField2 + @"</td>
                            <td>" + item.ExtraField8 + @"</td>
                            <td style='text-align:right;'>" + decimal.Parse(item.ExtraField1).ToString("0,0.00") + @"</td>
                            <td >" + item.ExtraField3 + @"</td>
                            " + (NoOfcollum == "10" ? "<td style='text-align:right;'>" + decimal.Parse(item.ExtraField4).ToString("0,0.00") + @"</td><td>" + (decimal.Parse(item.ExtraField1) * decimal.Parse(item.ExtraField4)).ToString("0,0.00") + @"</td>" : "")
                         + @"<td style='text-align:right;'>" + item.SalePrice.ToString("0,0.00") + @"</td>
                            <td style='text-align:right;'>" + item.VatPercentage.ToString("0,0.00") + @"</td>
                            <td style='text-align:right;'>" + ((decimal.Parse(item.ExtraField1) * item.SalePrice) + ((decimal.Parse(item.ExtraField1) * item.SalePrice) * item.VatPercentage / 100)).ToString("0,0.00") + @"</td>
                        </tr>";

            Subtotal           += decimal.Parse(item.ExtraField1);
            SubtotalAmount     += ((decimal.Parse(item.ExtraField1) * item.SalePrice) + ((decimal.Parse(item.ExtraField1) * item.SalePrice) * item.VatPercentage / 100));
            SubtotalAmountCost += decimal.Parse(item.ExtraField1) * decimal.Parse(item.ExtraField4);

            Total           += decimal.Parse(item.ExtraField1);
            TotalAmount     += ((decimal.Parse(item.ExtraField1) * item.SalePrice) + ((decimal.Parse(item.ExtraField1) * item.SalePrice) * item.VatPercentage / 100));
            TotalAmountCost += decimal.Parse(item.ExtraField1) * decimal.Parse(item.ExtraField4);
        }

        htmlTable += @"<tr class='subtotalRow'>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Sub Total</td>
                        <td>" + Subtotal.ToString("0,0.00") + @"</td>
                        <td>&nbsp;</td>
                        " + (NoOfcollum == "10" ? "<td>&nbsp;</td><td>" + SubtotalAmountCost.ToString("0,0.00") + @"</td>" : "")
                     + @"<td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>" + SubtotalAmount.ToString("0,0.00") + @"</td>
                    </tr>";

        htmlTable += @"<tr id='lastRow'>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Grand Total</td>
                        <td>" + Total.ToString("0,0.00") + @"</td>
                        <td>&nbsp;</td>
                        " + (NoOfcollum == "10" ? "<td>&nbsp;</td><td>" + TotalAmountCost.ToString("0,0.00") + @"</td>" : "")
                     + @"<td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>" + TotalAmount.ToString("0,0.00") + @"</td>
                    </tr></table>";

        lblItemList.Text = htmlTable;
    }