public PartialViewResult _printBillAgain(int Id) { VendorBillingMaster Outletvendor = vendor.getOldBill(Id); //var vendordetail = vendor.getOutletVwendor(Outletvendor.VendorId); //ViewBag.TinNo = vendordetail.tblOutlet.TinNo; //ViewBag.ServiceTaxNo = vendordetail.tblOutlet.ServiceTaxNo; //ViewBag.ContactA = vendordetail.tblOutlet.ContactA; //ViewBag.Address = vendordetail.tblOutlet.Address; return(PartialView(Outletvendor)); }
public void DispatchOrder(VendorBillingModel model) { VendorBillingMaster tb = new VendorBillingMaster(); int OutletId = getOutletId(); if (model.ChequeDate != null) { tb.ChequeDate = Convert.ToDateTime(model.ChequeDate); } else { tb.ChequeDate = null; } tb.ChequeNo = model.ChequeNo; tb.NetAmount = model.NetAmount; tb.OutletId = OutletId; tb.PaymentMethod = model.PaymentMethod; tb.remainingAmount = model.remainingAmount; tb.ServiceChargeAmount = model.ServiceChargeAmount; tb.ServicTaxAmount = model.ServicTaxAmount; tb.TotalAmount = model.Totalamount; tb.VatAmount = model.VatAmount; tb.VendorId = model.VendorId; if (model.PaymentMethod == "Cash" || model.PaymentMethod == "Card" || model.PaymentMethod == "Cash&Card") { tb.DepositAmount = model.NetAmount; UpdateMainBalance(OutletId, model.VendorId, model.NetAmount, model.NetAmount); } else { if (model.DepositAmount == 0) { tb.DepositAmount = model.NetAmount; } else { tb.DepositAmount = model.DepositAmount; } UpdateMainBalance(OutletId, model.VendorId, model.NetAmount, model.DepositAmount); } tb.BillDate = DateTime.Now; entities.VendorBillingMasters.Add(tb); entities.SaveChanges(); saveBillingItem(model.VendorId, tb.OrderId); deletefromTemp(model.VendorId); }
public VendorBillingMaster getOldBill(int ID) { VendorBillingMaster tb = entities.VendorBillingMasters.Find(ID); return(tb); }