Example #1
0
 private Itm2 GetItm2(GST_TRN_OFFLINE_INVOICE_DATAITEM Inv2invoice)
 {
     return(new Itm2 {
         num = 12, itm_det = new ItmDet2 {
             csamt = (int?)Inv2invoice.CessAmt, iamt = (int?)Inv2invoice.IGSTAmt, rt = Inv2invoice.GST_TRN_OFFLINE_INVOICE_RATE == null ? null : (int?)Inv2invoice.GST_TRN_OFFLINE_INVOICE_RATE.RATE, txval = (int?)Inv2invoice.TotalTaxableValue
         }
     });                                                                                                                                                                                                                                                                                          //Convert.ToInt32(Inv2invoice.GST_TRN_OFFLINE_INVOICE_RATE.RATE)
 }
Example #2
0
        protected void lv_B2CS_ItemUpdating(object sender, ListViewUpdateEventArgs e)
        {
            try
            {
                LinkButton lkbUpdate = (lv_B2CS.Items[e.ItemIndex].FindControl("lkbUpdate")) as LinkButton;
                if (lkbUpdate.CommandName == "Update")
                {
                    int  id = Convert.ToInt32(lkbUpdate.CommandArgument);
                    byte Rate;
                    GST_TRN_OFFLINE_INVOICE_DATAITEM invoice = unitOfwork.OfflineinvoicedataitemRepository.Filter(x => x.OfflineDataID == id).SingleOrDefault();
                    if (invoice != null)
                    {
                        DropDownList ddlType = (lv_B2CS.Items[e.ItemIndex].FindControl("ddlType")) as DropDownList;
                        if (ddlType != null)
                        {
                            invoice.GST_TRN_OFFLINE_INVOICE.Type = Convert.ToByte(ddlType.SelectedValue);
                        }
                        uc_SupplyType_B2CS uc_SupplyTypeB2Cs = (uc_SupplyType_B2CS)lv_B2CS.Items[e.ItemIndex].FindControl("uc_SupplyType_B2CS");

                        invoice.GST_TRN_OFFLINE_INVOICE.PlaceofSupply = Convert.ToByte(uc_SupplyTypeB2Cs.ddlPos_SelectedValue);

                        invoice.TotalTaxableValue = Convert.ToDecimal(uc_SupplyTypeB2Cs.TotalTaxable_Value);
                        if (uc_SupplyTypeB2Cs.ddlSupplyType_SelectedIndex > 0)
                        {
                            invoice.GST_TRN_OFFLINE_INVOICE.SupplyType = Convert.ToByte(uc_SupplyTypeB2Cs.ddlSupplyType_SelectedValue);
                        }
                        invoice.RateId  = Convert.ToInt32(uc_SupplyTypeB2Cs.ddlRate_SelectedValue);
                        invoice.IGSTAmt = Convert.ToDecimal(uc_SupplyTypeB2Cs.IntegratedTax);

                        invoice.CGSTAmt = Convert.ToDecimal(uc_SupplyTypeB2Cs.CentralTax);

                        invoice.SGSTAmt = Convert.ToDecimal(uc_SupplyTypeB2Cs.StateTax);

                        invoice.CessAmt = Convert.ToDecimal(uc_SupplyTypeB2Cs.Cess);

                        TextBox txtECommerce = (lv_B2CS.Items[e.ItemIndex].FindControl("txtECommerce")) as TextBox;
                        if (txtECommerce.Text != null || txtECommerce.Text != "")
                        {
                            invoice.GST_TRN_OFFLINE_INVOICE.ECommerce_GSTIN = txtECommerce.Text;
                        }
                    }
                    //viveksinha-start
                    invoice.GST_TRN_OFFLINE_INVOICE.UserID = Common.LoggedInUserID();
                    invoice.UpdatedBy   = Common.LoggedInUserID();
                    invoice.UpdatedDate = DateTime.Now;
                    //end
                    unitOfwork.OfflineinvoicedataitemRepository.Update(invoice);
                    unitOfwork.Save();
                }
                lv_B2CS.EditIndex = -1;
                BindItems(ReturnType);
            }
            catch (Exception ex)
            {
                cls_ErrorLog ob = new cls_ErrorLog();
                cls_ErrorLog.LogError(ex, Common.LoggedInUserID());
            }
        }
Example #3
0
        private Itm7 GetItm7(GST_TRN_OFFLINE_INVOICE_DATAITEM data)
        {
            Itm7 itm7 = new Itm7();

            itm7.csamt = (int?)data.CessAmt;
            itm7.iamt  = (int?)data.IGSTAmt;
            itm7.rt    = data.GST_TRN_OFFLINE_INVOICE_RATE == null ? null : (int?)data.GST_TRN_OFFLINE_INVOICE_RATE.RATE;
            return(itm7);
        }
Example #4
0
        public ItmDet2 GetItmDet2(GST_TRN_OFFLINE_INVOICE_DATAITEM ItmDet2Invoice)
        {
            ItmDet2 invDet2 = new ItmDet2();

            invDet2.csamt = (int?)ItmDet2Invoice.CessAmt;
            invDet2.iamt  = (int?)ItmDet2Invoice.IGSTAmt;
            invDet2.rt    = ItmDet2Invoice.GST_TRN_OFFLINE_INVOICE_RATE == null ? null : (int?)ItmDet2Invoice.GST_TRN_OFFLINE_INVOICE_RATE.RATE;
            invDet2.txval = (int?)ItmDet2Invoice.TotalTaxableValue;
            return(invDet2);
        }
Example #5
0
        private Itm6 GetItem6(GST_TRN_OFFLINE_INVOICE_DATAITEM data)
        {
            Itm6 itm6data = new Itm6();

            itm6data.num     = 12;
            itm6data.itm_det = new ItmDet4 {
                csamt = (int?)data.CessAmt, iamt = (int?)data.IGSTAmt, txval = (int?)data.TotalTaxableValue, rt = data.GST_TRN_OFFLINE_INVOICE_RATE == null ? null : (int?)data.GST_TRN_OFFLINE_INVOICE_RATE.RATE
            };
            return(itm6data);
        }
Example #6
0
        public Itm5 GetItem5(GST_TRN_OFFLINE_INVOICE_DATAITEM item5Invoice)
        {
            Itm5 itm5data = new Itm5();

            itm5data.itm_det = new ItmDet3();
            itm5data.num     = 12;
            itm5data.itm_det = new ItmDet3 {
                csamt = (int?)item5Invoice.CessAmt, iamt = (int?)item5Invoice.IGSTAmt, txval = (int?)item5Invoice.TotalTaxableValue, rt = item5Invoice.GST_TRN_OFFLINE_INVOICE_RATE != null ? (int?)item5Invoice.GST_TRN_OFFLINE_INVOICE_RATE.RATE : null
            };
            return(itm5data);
        }
Example #7
0
        public Inv2 GetInv2(GST_TRN_OFFLINE_INVOICE_DATAITEM Inv2invoice)
        {
            Inv2 inv2data = new Inv2();

            inv2data.itms = new List <Itm2>();
            inv2data.etin = "tinno";
            inv2data.idt  = "idt";
            inv2data.inum = Inv2invoice.GST_TRN_OFFLINE_INVOICE.InvoiceNo;
            inv2data.val  = Convert.ToDouble(Inv2invoice.TotalValue);
            inv2data.itms.Add(GetItm2(Inv2invoice));
            return(inv2data);
        }
Example #8
0
 protected void lkbSave_Click(object sender, EventArgs e)
 {
     try
     {
         GST_TRN_OFFLINE_INVOICE_DATAITEM dataitem;
         foreach (var items in lv_CreditCdnr_Gstr1.Items)
         {
             TextBox TotalTaxable_Value = (TextBox)items.FindControl("txt_TaxableValue");
             TextBox IGST = (TextBox)items.FindControl("txtIGST");
             TextBox Cess = (TextBox)items.FindControl("txtCess");
             // Label Rate = (Label)items.FindControl("lblRate");
             HiddenField OfflineDataId  = (HiddenField)items.FindControl("hdnOfflineDataId");
             int         RateId         = Convert.ToInt32(lv_CreditCdnr_Gstr1.DataKeys[items.DisplayIndex].Value);
             int         ExistingDataId = Convert.ToInt32(OfflineDataId.Value);
             if (ExistingDataId <= 0)
             {
                 dataitem = new GST_TRN_OFFLINE_INVOICE_DATAITEM();
                 if (Convert.ToDecimal(TotalTaxable_Value.Text) > 0)
                 {
                     dataitem.CessAmt           = Convert.ToDecimal(Cess.Text);
                     dataitem.IGSTAmt           = Convert.ToDecimal(IGST.Text);
                     dataitem.TotalTaxableValue = Convert.ToDecimal(TotalTaxable_Value.Text);
                     dataitem.ValueID           = Convert.ToInt32(Session["ValueId"]);
                     dataitem.RateId            = RateId;
                     unitOfwork.OfflineinvoicedataitemRepository.Create(dataitem);
                     unitOfwork.Save();
                 }
             }
             else
             {
                 var dataitemexist = unitOfwork.OfflineinvoicedataitemRepository.Filter(x => x.OfflineDataID == ExistingDataId).SingleOrDefault();
                 if (Convert.ToDecimal(TotalTaxable_Value.Text) > 0)
                 {
                     dataitemexist.CessAmt           = Convert.ToDecimal(Cess.Text);
                     dataitemexist.IGSTAmt           = Convert.ToDecimal(IGST.Text);
                     dataitemexist.TotalTaxableValue = Convert.ToDecimal(TotalTaxable_Value.Text);
                     unitOfwork.OfflineinvoicedataitemRepository.Update(dataitemexist);
                     unitOfwork.Save();
                 }
             }
         }
         uc_sucess.Visible        = true;
         uc_sucess.SuccessMessage = "Data Saved Successfully";
     }
     catch (Exception ex)
     {
         cls_ErrorLog ob = new cls_ErrorLog();
         cls_ErrorLog.LogError(ex, Common.LoggedInUserID());
     }
 }
Example #9
0
        private Itm GetItm(GST_TRN_OFFLINE_INVOICE_DATAITEM dataitem)
        {
            Itm Item = new Itm();

            Item.num = 12;
            ItmDet ItemDetail = new ItmDet();

            ItemDetail.csamt = (int?)dataitem.CessAmt;
            ItemDetail.iamt  = (int?)dataitem.IGSTAmt;
            ItemDetail.rt    = dataitem.GST_TRN_OFFLINE_INVOICE_RATE == null ? null : (int?)dataitem.GST_TRN_OFFLINE_INVOICE_RATE.RATE;
            ItemDetail.txval = (int?)dataitem.TotalTaxableValue;
            Item.itm_det     = ItemDetail;

            return(Item);
        }
Example #10
0
        public Nt GetNt(GST_TRN_OFFLINE_INVOICE_DATAITEM ntInvoice)
        {
            Nt ntdata = new Nt();

            ntdata.itms   = new List <Itm5>();
            ntdata.idt    = Convert.ToString(ntInvoice.GST_TRN_OFFLINE_INVOICE.InvoiceDate);
            ntdata.inum   = ntInvoice.GST_TRN_OFFLINE_INVOICE.InvoiceNo;
            ntdata.nt_dt  = Convert.ToString(ntInvoice.GST_TRN_OFFLINE_INVOICE.Voucher_date);
            ntdata.nt_num = ntInvoice.GST_TRN_OFFLINE_INVOICE.Voucher_No;
            ntdata.ntty   = Convert.ToString(ntInvoice.GST_TRN_OFFLINE_INVOICE.NoteType);
            ntdata.p_gst  = Convert.ToString(ntInvoice.GST_TRN_OFFLINE_INVOICE.Pre_GST);
            ntdata.rsn    = Convert.ToString(ntInvoice.GST_TRN_OFFLINE_INVOICE.Issuing_Note);
            ntdata.val    = Convert.ToInt32(ntInvoice.GST_TRN_OFFLINE_INVOICE.Voucher_Value);
            ntdata.itms.Add(GetItem5(ntInvoice));
            return(ntdata);
        }
Example #11
0
        protected void lv_B2CS_ItemInserting(object sender, ListViewInsertEventArgs e)
        {
            try
            {
                byte Rate;
                GST_TRN_OFFLINE_INVOICE_DATAITEM obj = new GST_TRN_OFFLINE_INVOICE_DATAITEM();
                obj.GST_TRN_OFFLINE_INVOICE = new GST_TRN_OFFLINE_INVOICE();
                LinkButton lkbInsert = (e.Item.FindControl("lkbInsert")) as LinkButton;
                if (lkbInsert.CommandName == "Insert")
                {
                    obj.GST_TRN_OFFLINE_INVOICE.ReturnType  = ReturnType;
                    obj.GST_TRN_OFFLINE_INVOICE.SectionType = (byte)EnumConstants.OfflineExcelSection.B2CS;

                    DropDownList ddlType = (e.Item.FindControl("ddlType")) as DropDownList;
                    if (ddlType.SelectedIndex > 0)
                    {
                        obj.GST_TRN_OFFLINE_INVOICE.Type = Convert.ToByte(ddlType.SelectedValue);
                    }

                    uc_SupplyType_B2CS uc_SupplyTypeB2Cs = (uc_SupplyType_B2CS)e.Item.FindControl("uc_SupplyType_B2CS");


                    obj.GST_TRN_OFFLINE_INVOICE.PlaceofSupply = Convert.ToByte(uc_SupplyTypeB2Cs.ddlPos_SelectedValue);

                    obj.TotalTaxableValue = Convert.ToDecimal(uc_SupplyTypeB2Cs.TotalTaxable_Value);
                    if (uc_SupplyTypeB2Cs.ddlSupplyType_SelectedIndex > 0)
                    {
                        obj.GST_TRN_OFFLINE_INVOICE.SupplyType = Convert.ToByte(uc_SupplyTypeB2Cs.ddlSupplyType_SelectedValue);
                    }


                    obj.RateId = Convert.ToInt32(uc_SupplyTypeB2Cs.ddlRate_SelectedValue);


                    obj.IGSTAmt = Convert.ToDecimal(uc_SupplyTypeB2Cs.IntegratedTax);

                    obj.CGSTAmt = Convert.ToDecimal(uc_SupplyTypeB2Cs.CentralTax);

                    obj.SGSTAmt = Convert.ToDecimal(uc_SupplyTypeB2Cs.StateTax);

                    obj.CessAmt = Convert.ToDecimal(uc_SupplyTypeB2Cs.Cess);

                    TextBox txtECommerce = (e.Item.FindControl("txtECommerce")) as TextBox;
                    if (txtECommerce != null)
                    {
                        obj.GST_TRN_OFFLINE_INVOICE.ECommerce_GSTIN = txtECommerce.Text.Trim();
                    }
                }
                //viveksinha-start
                obj.GST_TRN_OFFLINE_INVOICE.UserID = Common.LoggedInUserID();
                obj.CreatedDate = DateTime.Now;
                obj.CreatedBy   = Common.LoggedInUserID();
                //end
                unitOfwork.OfflineinvoicedataitemRepository.Create(obj);
                unitOfwork.Save();
                lv_B2CS.EditIndex = -1;
                //lv_B2CS.EditIndex++;
                BindItems(ReturnType);
                lkbDelete.Visible = true;
            }
            catch (Exception ex)
            {
                cls_ErrorLog ob = new cls_ErrorLog();
                cls_ErrorLog.LogError(ex, Common.LoggedInUserID());
            }
        }
Example #12
0
 private Itm3 GetItm3(GST_TRN_OFFLINE_INVOICE_DATAITEM dataitem)
 {
     return(new Itm3 {
         csamt = (int?)dataitem.CessAmt, iamt = (int?)dataitem.IGSTAmt, rt = dataitem.GST_TRN_OFFLINE_INVOICE_RATE == null ? null : (int?)dataitem.GST_TRN_OFFLINE_INVOICE_RATE.RATE, txval = (int?)dataitem.TotalTaxableValue
     });
 }
Example #13
0
 protected void lv_HSN_ItemInserting(object sender, ListViewInsertEventArgs e)
 {
     try
     {
         GST_TRN_OFFLINE_INVOICE_DATAITEM obj = new GST_TRN_OFFLINE_INVOICE_DATAITEM();
         obj.GST_TRN_OFFLINE_INVOICE = new GST_TRN_OFFLINE_INVOICE();
         LinkButton lkbInsert = (e.Item.FindControl("lkbInsert")) as LinkButton;
         if (lkbInsert.CommandName == "Insert")
         {
             obj.GST_TRN_OFFLINE_INVOICE.ReturnType  = ReturnType;
             obj.GST_TRN_OFFLINE_INVOICE.SectionType = (byte)EnumConstants.OfflineExcelSection.HSNWiseSummary;
             TextBox txt_HSN = (e.Item.FindControl("txt_HSN")) as TextBox;
             if (txt_HSN.Text != "")
             {
                 obj.GST_TRN_OFFLINE_INVOICE.HSN = txt_HSN.Text.Trim();
             }
             TextBox txt_Description = (e.Item.FindControl("txt_Description")) as TextBox;
             if (txt_Description.Text != "")
             {
                 obj.GST_TRN_OFFLINE_INVOICE.HSNDescription = txt_Description.Text.Trim();
             }
             DropDownList ddl_UQC = (e.Item.FindControl("ddl_UQC")) as DropDownList;
             if (ddl_UQC.SelectedIndex > 0)
             {
                 obj.GST_TRN_OFFLINE_INVOICE.UQC = Convert.ToByte(ddl_UQC.SelectedValue);
             }
             TextBox txt_Quantity = (e.Item.FindControl("txt_Quantity")) as TextBox;
             if (txt_Quantity.Text != "")
             {
                 obj.TotalQuantity = Convert.ToDecimal(txt_Quantity.Text.Trim());
             }
             TextBox txt_Value = (e.Item.FindControl("txt_Value")) as TextBox;
             if (txt_Value.Text != "")
             {
                 obj.TotalValue = Convert.ToDecimal(txt_Value.Text.Trim());
             }
             TextBox txt_Taxable_value = (e.Item.FindControl("txt_Taxable_value")) as TextBox;
             if (txt_Taxable_value.Text != "")
             {
                 obj.TotalTaxableValue = Convert.ToDecimal(txt_Taxable_value.Text.Trim());
             }
             TextBox txt_IGST = (e.Item.FindControl("txt_IGST")) as TextBox;
             if (txt_IGST.Text != "")
             {
                 obj.IGSTAmt = Convert.ToDecimal(txt_IGST.Text.Trim());
             }
             TextBox txt_SGSTUTGST = (e.Item.FindControl("txt_SGSTUTGST")) as TextBox;
             if (txt_SGSTUTGST.Text != "")
             {
                 obj.SGSTAmt = Convert.ToDecimal(txt_SGSTUTGST.Text.Trim());
             }
             TextBox txt_CGST = (e.Item.FindControl("txt_CGST")) as TextBox;
             if (txt_CGST.Text != "")
             {
                 obj.CGSTAmt = Convert.ToDecimal(txt_CGST.Text.Trim());
             }
             TextBox txt_Cess = (e.Item.FindControl("txt_Cess")) as TextBox;
             if (txt_Cess.Text != "")
             {
                 obj.CessAmt = Convert.ToDecimal(txt_Cess.Text.Trim());
             }
         }
         //viveksinha-start
         obj.GST_TRN_OFFLINE_INVOICE.UserID = Common.LoggedInUserID();
         obj.CreatedBy   = Common.LoggedInUserID();
         obj.CreatedDate = DateTime.Now;
         unitOfwork.OfflineinvoicedataitemRepository.Create(obj);
         unitOfwork.Save();
         lv_HSN.EditIndex = -1;
         BindItems(ReturnType);
         lkbDelete.Visible = true;
     }
     catch (Exception ex)
     {
         cls_ErrorLog ob = new cls_ErrorLog();
         cls_ErrorLog.LogError(ex, Common.LoggedInUserID());
     }
 }
Example #14
0
        protected void lv_HSN_ItemUpdating(object sender, ListViewUpdateEventArgs e)
        {
            try
            {
                LinkButton lkbUpdate = (lv_HSN.Items[e.ItemIndex].FindControl("lkbUpdate")) as LinkButton;
                if (lkbUpdate.CommandName == "Update")
                {
                    int id = Convert.ToInt32(lkbUpdate.CommandArgument);
                    GST_TRN_OFFLINE_INVOICE_DATAITEM invoice = unitOfwork.OfflineinvoicedataitemRepository.Filter(x => x.OfflineDataID == id).SingleOrDefault();
                    if (invoice != null)
                    {
                        TextBox txt_HSN = (lv_HSN.Items[e.ItemIndex].FindControl("txt_HSN")) as TextBox;
                        if (txt_HSN.Text != "" || txt_HSN.Text != null)
                        {
                            invoice.GST_TRN_OFFLINE_INVOICE.HSN = txt_HSN.Text.Trim();
                        }

                        TextBox txt_Description = (lv_HSN.Items[e.ItemIndex].FindControl("txt_Description")) as TextBox;
                        if (txt_Description.Text != "" || txt_Description.Text != null)
                        {
                            invoice.GST_TRN_OFFLINE_INVOICE.HSNDescription = txt_Description.Text.Trim();
                        }

                        DropDownList ddl_UQC = (lv_HSN.Items[e.ItemIndex].FindControl("ddl_UQC")) as DropDownList;
                        if (ddl_UQC.SelectedIndex > 0)
                        {
                            invoice.GST_TRN_OFFLINE_INVOICE.UQC = Convert.ToByte(ddl_UQC.SelectedValue);
                        }

                        TextBox txt_Quantity = (lv_HSN.Items[e.ItemIndex].FindControl("txt_Quantity")) as TextBox;
                        if (txt_Quantity.Text != "" || txt_Quantity.Text != null)
                        {
                            invoice.TotalQuantity = Convert.ToDecimal(txt_Quantity.Text.Trim());
                        }

                        TextBox txt_Value = (lv_HSN.Items[e.ItemIndex].FindControl("txt_Value")) as TextBox;
                        if (txt_Value.Text != "" || txt_Value.Text != null)
                        {
                            invoice.TotalValue = Convert.ToDecimal(txt_Value.Text.Trim());
                        }

                        TextBox txt_Taxable_value = (lv_HSN.Items[e.ItemIndex].FindControl("txt_Taxable_value")) as TextBox;
                        if (txt_Taxable_value.Text != "" || txt_Taxable_value.Text != null)
                        {
                            invoice.TotalTaxableValue = Convert.ToDecimal(txt_Taxable_value.Text.Trim());
                        }

                        TextBox txt_IGST = (lv_HSN.Items[e.ItemIndex].FindControl("txt_IGST")) as TextBox;
                        if (txt_IGST.Text != "" || txt_IGST.Text != null)
                        {
                            invoice.IGSTAmt = Convert.ToDecimal(txt_IGST.Text.Trim());
                        }

                        TextBox txt_SGSTUTGST = (lv_HSN.Items[e.ItemIndex].FindControl("txt_SGSTUTGST")) as TextBox;
                        if (txt_SGSTUTGST.Text != "" || txt_SGSTUTGST.Text != null)
                        {
                            invoice.SGSTAmt = Convert.ToDecimal(txt_SGSTUTGST.Text.Trim());
                        }

                        TextBox txt_CGST = (lv_HSN.Items[e.ItemIndex].FindControl("txt_CGST")) as TextBox;
                        if (txt_CGST.Text != "" || txt_CGST.Text != null)
                        {
                            invoice.CGSTAmt = Convert.ToDecimal(txt_CGST.Text.Trim());
                        }

                        TextBox txt_Cess = (lv_HSN.Items[e.ItemIndex].FindControl("txt_Cess")) as TextBox;
                        if (txt_Cess.Text != "" || txt_Cess != null)
                        {
                            invoice.CessAmt = Convert.ToDecimal(txt_Cess.Text.Trim());
                        }
                    }
                    //viveksinha-start
                    invoice.UpdatedDate = DateTime.Now;
                    invoice.UpdatedBy   = Common.LoggedInUserID();
                    invoice.GST_TRN_OFFLINE_INVOICE.UserID = Common.LoggedInUserID();
                    //end
                    unitOfwork.OfflineinvoicedataitemRepository.Update(invoice);
                    unitOfwork.Save();
                }
                lv_HSN.EditIndex = -1;
                BindItems(ReturnType);
            }
            catch (Exception ex)
            {
                cls_ErrorLog ob = new cls_ErrorLog();
                cls_ErrorLog.LogError(ex, Common.LoggedInUserID());
            }
        }