Пример #1
0
        private GST_MST_PURCHASE_DATA PurchaseData(GST_TRN_INVOICE_DATA itemData)
        {
            GST_MST_PURCHASE_DATA PD = new GST_MST_PURCHASE_DATA();

            //// PD.PurchaseDataID = TODO
            PD.LineID             = Convert.ToString(itemData.LineID);
            PD.Item_ID            = itemData.Item_ID;
            PD.Qty                = itemData.Qty;
            PD.Rate               = itemData.Rate;
            PD.TotalAmount        = itemData.TotalAmount;
            PD.Discount           = itemData.Discount;
            PD.TaxableAmount      = itemData.TaxableAmount;
            PD.TotalAmountWithTax = itemData.TotalAmountWithTax;
            PD.IGSTRate           = itemData.IGSTRate;
            PD.IGSTAmt            = itemData.IGSTAmt;
            PD.CGSTRate           = Convert.ToString(itemData.CGSTRate);
            PD.CGSTAmt            = itemData.CGSTAmt;
            PD.SGSTRate           = itemData.SGSTRate;
            PD.SGSTAmt            = itemData.SGSTAmt;
            PD.UGSTRate           = itemData.UGSTRate;
            PD.UGSTAmt            = itemData.UGSTAmt;
            PD.CessRate           = itemData.CessRate;
            PD.CGSTAmt            = itemData.CGSTAmt;
            //PD.InvoiceDataStatus=TODO;
            PD.Status      = itemData.Status;
            PD.CreatedBy   = itemData.CreatedBy;
            PD.CreatedDate = DateTime.Now;

            return(PD);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="itemData"></param>
        /// <returns></returns>
        private GST_TRN_CRDR_NOTE_DATA ItemData(GST_TRN_INVOICE_DATA itemData)
        {
            GST_TRN_CRDR_NOTE_DATA item = new GST_TRN_CRDR_NOTE_DATA();

            //// PD.PurchaseDataID = TODO
            item.LineID             = itemData.LineID;
            item.Item_ID            = itemData.Item_ID;
            item.Qty                = itemData.Qty;
            item.Rate               = itemData.Rate;
            item.TotalAmount        = itemData.TotalAmount;
            item.Discount           = itemData.Discount;
            item.TaxableAmount      = itemData.TaxableAmount;
            item.TotalAmountWithTax = itemData.TotalAmountWithTax;
            item.IGSTRate           = itemData.IGSTRate;
            item.IGSTAmt            = itemData.IGSTAmt;
            item.CGSTRate           = itemData.CGSTRate;
            item.CGSTAmt            = itemData.CGSTAmt;
            item.SGSTRate           = itemData.SGSTRate;
            item.SGSTAmt            = itemData.SGSTAmt;
            item.UGSTRate           = itemData.UGSTRate;
            item.UGSTAmt            = itemData.UGSTAmt;
            item.CessRate           = itemData.CessRate;
            item.CGSTAmt            = itemData.CGSTAmt;
            //PD.InvoiceDataStatus=TODO;
            item.Status = itemData.Status;
            //PD.CreatedBy = Common.LoggedInUserID();
            item.CreatedDate = DateTime.Now;

            return(item);
        }
Пример #3
0
        private Itm7 GetItm7(GST_TRN_INVOICE_DATA data)
        {
            Itm7 itm7 = new Itm7();

            itm7.csamt = (int?)data.CessAmt;
            itm7.iamt  = (int?)data.IGSTAmt;
            itm7.rt    = (int?)data.Rate;
            return(itm7);
        }
Пример #4
0
 private Itm3 GetItm3(GST_TRN_INVOICE_DATA dataitem)
 {
     return(new Itm3
     {
         csamt = (int?)dataitem.CessAmt,
         iamt = (int?)dataitem.IGSTAmt,
         rt = dataitem.Rate == null ? null : (int?)dataitem.Rate,
         txval = (int?)dataitem.TotalAmountWithTax
     });
 }
Пример #5
0
        public ItmDet2 GetItmDet2(GST_TRN_INVOICE_DATA ItmDet2Invoice)
        {
            ItmDet2 invDet2 = new ItmDet2();

            invDet2.csamt = (int?)ItmDet2Invoice.CessAmt;
            invDet2.iamt  = (int?)ItmDet2Invoice.IGSTAmt;
            invDet2.rt    = ItmDet2Invoice.Rate == null ? null : (int?)ItmDet2Invoice.Rate;
            invDet2.txval = (int?)ItmDet2Invoice.TotalAmountWithTax;
            return(invDet2);
        }
Пример #6
0
        public Inv2 GetInv2(GST_TRN_INVOICE_DATA Inv2invoice)
        {
            Inv2 inv2data = new Inv2();

            inv2data.itms = new List <Itm2>();
            inv2data.etin = "tinno";
            inv2data.idt  = "idt";
            inv2data.inum = Inv2invoice.GST_TRN_INVOICE.InvoiceNo;
            inv2data.val  = Convert.ToDouble(Inv2invoice.TotalAmountWithTax);
            inv2data.itms.Add(GetItm2(Inv2invoice));
            return(inv2data);
        }
Пример #7
0
 private Itm2 GetItm2(GST_TRN_INVOICE_DATA Inv2invoice)
 {
     return(new Itm2
     {
         num = 12,
         itm_det = new ItmDet2
         {
             csamt = (int?)Inv2invoice.CessAmt,
             iamt = (int?)Inv2invoice.IGSTAmt,
             rt = Inv2invoice.Rate == null ? null : (int?)Inv2invoice.Rate,
             txval = (int?)Inv2invoice.TotalAmountWithTax
         }
     });//Convert.ToInt32(Inv2invoice.GST_TRN_OFFLINE_INVOICE_RATE.RATE)
 }
Пример #8
0
        private Itm GetItm(GST_TRN_INVOICE_DATA 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.Rate == null ? null : (int?)dataitem.Rate;
            ItemDetail.txval = (int?)dataitem.TotalAmountWithTax;
            Item.itm_det     = ItemDetail;

            return(Item);
        }
Пример #9
0
        private Datum GetDatum(GST_TRN_INVOICE_DATA data)
        {
            Datum datumSource = new Datum();

            datumSource.desc   = (string)data.GST_MST_ITEM.Description;
            datumSource.uqc    = "ABC";
            datumSource.hsn_sc = (string)data.GST_MST_ITEM.ItemCode;
            datumSource.num    = 12;
            //if (data.Count > 0)
            //{
            datumSource.samt  = (int)data.SGSTAmt;
            datumSource.camt  = (int)data.CGSTAmt;
            datumSource.csamt = (int)data.CessAmt;
            datumSource.qty   = (double?)data.Qty;
            datumSource.txval = (double?)data.TotalAmountWithTax;
            datumSource.iamt  = (double?)data.IGSTAmt;
            datumSource.val   = (double?)data.TotalAmount;
            //}
            return(datumSource);
        }
Пример #10
0
        private List <GST_TRN_INVOICE_DATA> GetGVData()
        {
            List <GST_TRN_INVOICE_DATA> lineCollection = new List <GST_TRN_INVOICE_DATA>();

            foreach (GridViewRow row in gvInvoice_Items.Rows)
            {
                //  GridView gvSizePrice = (GridView)fvProduct.FindControl("gdvSizePrice");
                TextBox txtItemCode     = (TextBox)row.FindControl("txtItemCode");
                TextBox txtGoodService  = (TextBox)row.FindControl("txtGoodService");
                TextBox txtQty          = (TextBox)row.FindControl("txtQty");
                TextBox txtRate         = (TextBox)row.FindControl("txtRate");
                Label   txtTotal        = (Label)row.FindControl("txtTotal");
                TextBox txtDiscount     = (TextBox)row.FindControl("txtDiscount");
                Label   txtTaxableValue = (Label)row.FindControl("txtTaxableValue");

                if (!string.IsNullOrEmpty(txtGoodService.Text.Trim()))
                {
                    GST_TRN_INVOICE_DATA le = new GST_TRN_INVOICE_DATA();
                    le.InvoiceDataID = Convert.ToInt64(gvInvoice_Items.DataKeys[row.RowIndex].Values["InvoiceDataID"].ToString());
                    le.LineID        = row.RowIndex;
                    le.Qty           = Convert.ToDecimal(txtQty.Text.Trim());
                    le.GST_MST_ITEM  = unitOfWork.ItemRepository.Find(f => f.ItemCode == txtItemCode.Text.Trim());
                    le.Rate          = Convert.ToDecimal(txtRate.Text.Trim());
                    le.TotalAmount   = Convert.ToDecimal(txtTotal.Text.Trim());
                    if (!string.IsNullOrEmpty(txtDiscount.Text.Trim()))
                    {
                        le.Discount = Convert.ToDecimal(txtDiscount.Text.Trim());
                    }
                    //le.AmountWithTaxLineIDWise = Convert.ToDecimal(((Label)row.FindControl("txtTaxableValue")).Text.Trim());
                    le.TaxableAmount = Convert.ToDecimal(txtTaxableValue.Text.Trim());
                    // Grand total of all line items
                    // le.TotalAmount += le.TotalAmount;
                    // grand total of all line items with tax
                    /// le.TotalAmountWithTax += le.TotalAmountWithTax;

                    lineCollection.Add(le);
                }
            }
            return(lineCollection);
        }