/// <summary> /// Payment Board controller /// </summary> /// <param name="po">Kode PO</param> /// <returns>Model Payment</returns> public ActionResult PaymentBoard(string po) { ViewBag.useIcheck = true; ViewBag.useDataTable = true; ViewBag.po = po; ViewBag.addPayment = false; try { if (User.IsInRole(ADMIN) || User.IsInRole(DEVELOPER)) { ViewBag.addPayment = true; } if (po != null && po != "") { PoTransactions pt = new PoTransactions(po); var model = pt.getPayments(); //if (model.Count > 0) //{ //string dpb = pt.getDpb(); //ViewBag.dpb = dpb; return(View(model)); //} } } catch (Exception e) { Log.Error(e); } ViewBag.noData = true; return(View()); }
/// <summary> /// PO view controller /// </summary> /// <param name="po">kode PO</param> /// <returns>List produk</returns> public ActionResult POBoard(string po) { try { ViewBag.useAjax = true; ViewBag.useIcheck = true; ViewBag.useDataTable = true; ViewBag.useDatePicker = true; ViewBag.po = po; ViewBag.editPoBoard = false; if (po != null && po != "") { PoTransactions pt = new PoTransactions(po); ViewData["poOption"] = pt.getOption(); ViewData["poPayment"] = pt.getPayments(); var model = pt.getProductsAndNotes(); if (model.Count() > 0) { ViewBag.created = pt.getDatePublish(); ViewBag.limited = pt.getDateEnd(); } ViewBag.umDate = pt.getUmDate(); ViewBag.pelDate = pt.getPelaksanaanDate(); ViewBag.pemDate = pt.getPemeliharaanDate(); ViewBag.dpb = pt.getDpb(); double totalBilling = pt.getTotalBilling(); double hasPayment = pt.getHasPayment(); double theTotal = totalBilling - hasPayment; ViewBag.balance = theTotal.ConvertToDot(); if (User.IsInRole(PELAKSANA) || User.IsInRole(DEVELOPER)) { string nDpb = pt.getDpb(); bool isMine = false; string uid = User.Identity.GetUserId(); if (nDpb != null && uid != null) { isMine = pt.isMyPo(nDpb, uid); } if (isMine) { ViewBag.editPoBoard = true; } } return(View(model)); } } catch (Exception e) { Log.Error(e); } ViewBag.noData = true; return(View()); }