Exemple #1
0
        public ActionResult ProcessRMAInward(RMAHeader rmaHeader)
        {
            if (rmaHeader.rmaDetails == null)
            {
                return(RedirectToAction("Inward"));
            }
            else
            {
                for (var i = 0; i < rmaHeader.rmaDetails.Count; i++)
                {
                    //Comment by krishna 31/08/2017
                    //  var rmaInwardDTO = new InvoiceDetailBO().GetVendorInvoiceDetailBySerialNo(rmaHeader.rmaDetails[i].SerialNo, BRANCH_ID, UTILITY.CONFIG_INVOICETYPE_VENDOR);//CONFIG_INVOICETYPE_CUSTOMER
                    var rmaInwardDTO = new InvoiceDetailBO().GetVendorInvoiceDetailBySerialNo(rmaHeader.rmaDetails[i].SerialNo, BRANCH_ID, UTILITY.CONFIG_INVOICETYPE_CUSTOMER);//CONFIG_INVOICETYPE_CUSTOMER
                    if (rmaInwardDTO != null)
                    {
                        rmaHeader.rmaDetails[i].DocumentNo         = rmaInwardDTO.DocumentNo;
                        rmaHeader.rmaDetails[i].WarrantyExpiryDate = rmaInwardDTO.InvoiceDate.AddMonths(rmaInwardDTO.WarrantyPeriod);
                        rmaHeader.rmaDetails[i].IsValid            = (UTILITY.SINGAPORETIME < rmaHeader.rmaDetails[i].WarrantyExpiryDate);
                    }
                    else
                    {
                        rmaHeader.rmaDetails[i].IsValid = false;
                    }
                }
            }

            ViewBag.countries = new CountryBO().GetList().Select(x => new
            {
                Value = x.CountryCode,
                Text  = x.CountryName
            }).ToList();

            return(View("Inward", rmaHeader));
        }
Exemple #2
0
        public bool UpdateInvoiceDetail(InvoiceDetailBO detailBO)
        {
            try
            {
                string sql = "dbo.fn_update_invoicedetail";
                conn = new NpgsqlConnection(connString);
                conn.Open();

                using (var cmd = new NpgsqlCommand(sql, conn))
                {
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("_invoicekey", NpgsqlTypes.NpgsqlDbType.Uuid, detailBO.InvoiceKey);
                    cmd.Parameters.AddWithValue("_invoicelinekey", NpgsqlTypes.NpgsqlDbType.Uuid, detailBO.InvoiceLineKey);
                    cmd.Parameters.AddWithValue("_itemkey", NpgsqlTypes.NpgsqlDbType.Uuid, detailBO.Itemkey);
                    cmd.Parameters.AddWithValue("_container", NpgsqlTypes.NpgsqlDbType.Varchar, detailBO.Container);
                    cmd.Parameters.AddWithValue("_description", NpgsqlTypes.NpgsqlDbType.Varchar, detailBO.Description);
                    cmd.Parameters.AddWithValue("_unitprice", NpgsqlTypes.NpgsqlDbType.Numeric, detailBO.UnitPrice);
                    cmd.Parameters.AddWithValue("_qty", NpgsqlTypes.NpgsqlDbType.Integer, detailBO.Quantity);
                    cmd.Parameters.AddWithValue("_extamt", NpgsqlTypes.NpgsqlDbType.Numeric, detailBO.Price);

                    var invoicedetailkey = cmd.ExecuteNonQuery();
                }

                return(true);
            }
            catch (Exception msg)
            {
                throw msg;
            }
            finally
            {
                conn.Close();
            }
        }
Exemple #3
0
        public ActionResult FindSerialNoStatus(List <MaterialsEnquiryDetailsDTO> materialsEnquiryDetails)
        {
            if (materialsEnquiryDetails == null)
            {
                return(RedirectToAction("MaterialsEnquiry"));
            }
            else
            {
                for (var i = 0; i < materialsEnquiryDetails.Count; i++)
                {
                    var MaterialSNoDetails = new InvoiceDetailBO().GetDetailBySerialNo(materialsEnquiryDetails[i].SerialNo, BRANCH_ID);

                    if (MaterialSNoDetails != null)
                    {
                        materialsEnquiryDetails[i].VendorExpiryDate   = MaterialSNoDetails.VendorExpiryDate;
                        materialsEnquiryDetails[i].VendorIsValid      = (UTILITY.SINGAPORETIME < MaterialSNoDetails.VendorExpiryDate);
                        materialsEnquiryDetails[i].CustomerExpiryDate = MaterialSNoDetails.CustomerExpiryDate;
                        materialsEnquiryDetails[i].CustomerIsvalid    = (UTILITY.SINGAPORETIME < MaterialSNoDetails.CustomerExpiryDate);
                    }
                    else
                    {
                        materialsEnquiryDetails[i].VendorIsValid = false;
                    }
                }
                return(View("MaterialsEnquiry", materialsEnquiryDetails));
            }
        }
Exemple #4
0
        public List <InvoiceDetailBO> GetInvoiceDetail(string invoicekey)
        {
            try
            {
                var InvDtllist = new List <InvoiceDetailBO>();
                var sql        = "dbo.fn_getinvoicedetail";

                conn = new NpgsqlConnection(connString);
                conn.Open();

                using (var cmd = new NpgsqlCommand(sql, conn))
                {
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("_invoicekey",
                                                NpgsqlTypes.NpgsqlDbType.Uuid, Guid.Parse(invoicekey));
                    var reader = cmd.ExecuteReader();
                    do
                    {
                        while (reader.Read())
                        {
                            var BO = new InvoiceDetailBO
                            {
                                Itemkey     = Utils.CustomParse <Guid>(reader["itemkey"]),
                                Description = Utils.CustomParse <string>(reader["description"]),
                                Container   = Utils.CustomParse <string>(reader["container"]),
                                Price       = Utils.CustomParse <decimal>(reader["price"]),
                                //ItemType = Utils.CustomParse<short>(reader["itemtype"]),
                                Quantity           = Utils.CustomParse <decimal>(reader["quantity"]),
                                InvoiceDescription = reader["description"].ToString(),
                                UnitPrice          = Utils.CustomParse <decimal>(reader["unitprice"]),
                                ExcessAmount       = Utils.CustomParse <decimal>(reader["price"])
                            };
                            InvDtllist.Add(BO);
                        }
                    }while (reader.NextResult());
                    reader.Close();
                }
                return(InvDtllist);
            }
            catch (Exception msg)
            {
                throw msg;
            }
            finally
            {
                conn.Close();
            }
        }
Exemple #5
0
        public List <InvoiceDetailBO> getinvoicedetail(string invoicekey)
        {
            try
            {
                var    invList = new List <InvoiceDetailBO>();
                string sql     = "dbo.fn_getinvoicedetail";

                conn = new NpgsqlConnection(connString);
                conn.Open();

                using (var cmd = new NpgsqlCommand(sql, conn))
                {
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("_invoicekey", NpgsqlTypes.NpgsqlDbType.Uuid, Guid.Parse(invoicekey));
                    var reader = cmd.ExecuteReader();
                    do
                    {
                        while (reader.Read())
                        {
                            var inv = new InvoiceDetailBO();
                            inv.InvoiceKey     = Guid.Parse(invoicekey);
                            inv.InvoiceLineKey = Utils.CustomParse <Guid>(reader["invoicelinekey"]);
                            inv.Itemkey        = Utils.CustomParse <Guid>(reader["itemkey"]);
                            inv.Description    = Utils.CustomParse <string>(reader["description"]);
                            inv.Container      = Utils.CustomParse <string>(reader["container"]);
                            inv.Price          = Utils.CustomParse <decimal>(reader["unitprice"]);
                            inv.Quantity       = Utils.CustomParse <int>(reader["quantity"]);
                            inv.UnitPrice      = Utils.CustomParse <decimal>(reader["price"]);

                            invList.Add(inv);
                        }
                    } while (reader.NextResult());
                    reader.Close();
                }

                return(invList);
            }
            catch (Exception msg)
            {
                throw msg;
            }
            finally
            {
                conn.Close();
            }
        }
Exemple #6
0
        public ActionResult ProcessVendorRMA(VendorRMAHeader vendorRmaHeader)
        {
            if (vendorRmaHeader.VendorRmaDetails == null)
            {
                return(RedirectToAction("VendorRMA"));
            }
            else
            {
                for (var i = 0; i < vendorRmaHeader.VendorRmaDetails.Count; i++)
                {
                    var VendorRmaInwardDTO = new InvoiceDetailBO().GetVendorDetailBySerialNo(vendorRmaHeader.VendorRmaDetails[i].SerialNo, BRANCH_ID, UTILITY.CONFIG_INVOICETYPE_VENDOR);//CONFIG_INVOICETYPE_CUSTOMER

                    if (VendorRmaInwardDTO != null)
                    {
                        vendorRmaHeader.VendorRmaDetails[i].VendorInvoiceNo    = VendorRmaInwardDTO.VendorInvoiceNo;
                        vendorRmaHeader.VendorRmaDetails[i].VendorName         = VendorRmaInwardDTO.VendorName;
                        vendorRmaHeader.VendorRmaDetails[i].DocumentNo         = VendorRmaInwardDTO.DocumentNo;
                        vendorRmaHeader.VendorRmaDetails[i].WarrantyExpiryDate = VendorRmaInwardDTO.CustomerWarrantyExpiryDate;
                        vendorRmaHeader.VendorRmaDetails[i].IsValid            = (UTILITY.SINGAPORETIME < vendorRmaHeader.VendorRmaDetails[i].WarrantyExpiryDate);
                        if (VendorRmaInwardDTO.VendorWarrantyExpiryDate != null)
                        {
                            vendorRmaHeader.VendorRmaDetails[i].RMAIsValid = (UTILITY.SINGAPORETIME < VendorRmaInwardDTO.VendorWarrantyExpiryDate);
                            vendorRmaHeader.VendorRmaDetails[i].VendorWarrantyExpiryDate = VendorRmaInwardDTO.VendorWarrantyExpiryDate;
                        }
                    }
                    else
                    {
                        vendorRmaHeader.VendorRmaDetails[i].IsValid = false;
                    }
                }
                ViewBag.countries = new CountryBO().GetList().Select(x => new
                {
                    Value = x.CountryCode,
                    Text  = x.CountryName
                }).ToList();
                return(View("VendorRMA", vendorRmaHeader));
            }
        }