public ActionResult Details(int id)
        {
            CODReceiptVM vm        = new CODReceiptVM();
            var          branchid  = Convert.ToInt32(Session["CurrentBranchID"]);
            var          companyid = Convert.ToInt32(Session["CurrentCompanyID"]);

            vm.ReceiptDetails = new List <CODReceiptDetailVM>();
            if (id > 0)
            {
                var receipt = db.CODReceipts.Find(id);
                vm.ReceiptID    = receipt.ReceiptID;
                vm.ReceiptDate  = receipt.ReceiptDate;
                vm.ReceiptNo    = receipt.ReceiptNo;
                vm.Remarks      = receipt.Remarks;
                vm.ManifestID   = receipt.ManifestID;
                vm.CurrencyID   = receipt.CurrencyID;
                vm.EXRate       = receipt.EXRate;
                vm.AchHeadID    = receipt.AchHeadID;
                vm.AcHeadName   = db.AcHeads.Find(receipt.AchHeadID).AcHead1;
                vm.CurrencyName = db.CurrencyMasters.Find(receipt.CurrencyID).CurrencyName;
                vm.Amount       = receipt.Amount;
                vm.AgentID      = receipt.AgentID;
                vm.AgentName    = db.AgentMasters.Find(vm.AgentID).Name;
                List <CODReceiptDetailVM> receiptdetails = (from c in db.CODReceiptDetails
                                                            join ins in db.InScanMasters on c.InScanId equals ins.InScanID
                                                            join i in db.ExportShipments on c.ManifestID equals i.ID

                                                            where c.ReceiptID == vm.ReceiptID
                                                            select new CODReceiptDetailVM
                {
                    InScanId = c.InScanId,
                    ManifestID = c.ManifestID,
                    ManifestNumber = i.ManifestNumber,
                    AWBNo = c.AWBNo,
                    AWBDate = ins.TransactionDate,
                    Consignee = c.Consignee,
                    ConsigneePhone = c.ConsigneePhone,
                    CourierCharge = c.CourierCharge,
                    OtherCharge = c.OtherCharge,
                    TotalCharge = c.TotalCharge,
                    AmountAllocate = c.AmountAllocate,
                    Discount = c.Discount
                }).ToList();

                vm.ReceiptDetails = receiptdetails;
            }


            return(View(vm));
        }
 public JsonResult GetManifestID(CODReceiptVM ship)
 {
     ship.ManifestID = "";
     if (ship.SelectedValues != null)
     {
         foreach (var item in ship.SelectedValues)
         {
             if (ship.ManifestID == "")
             {
                 ship.ManifestID = item.ToString();
             }
             else
             {
                 ship.ManifestID = ship.ManifestID + "," + item.ToString();
             }
         }
     }
     return(Json(new { manifestids = ship.ManifestID }, JsonRequestBehavior.AllowGet));
 }