public ActionResult UpdateInvoicePaidStatus(int id, bool isPaid)
        {
            //if (!isPaid) throw new Exception("I'm sorry Dave. I can't do that.");

            AdministrationServices.UpdateInvoicePaidStatus(id, isPaid);
            return(Json(new { result = "ok" }));
        }
        // TODO: test?
        public ActionResult InvoiceDetail(InvoiceFilterModel filter)
        {
            var detail = AdministrationServices.GetInvoiceAdministrationDetail(filter);

            ViewBag.Filter    = "InvoiceDetail";
            ViewBag.Locations = LocationServices.GetLocationLookup(true, filter.LocationId);
            ViewBag.Paid      = LookupServices.GetPaidOptions(filter.HasBeenPaid, true);

            if (detail.InvoiceList.Count == 0)
            {
                return(View("InvoiceDetailNoData", detail));
            }
            else
            {
                return(View("InvoiceDetail", detail));
            }
        }
        // TODO: test?
        public ActionResult InvoiceListing(InvoiceFilterModel filter)
        {
            var listing = AdministrationServices.GetInvoiceListing(filter);

            ViewBag.Filter    = "InvoiceListing";
            ViewBag.Locations = LocationServices.GetLocationLookup(true, filter.LocationId);
            ViewBag.Paid      = LookupServices.GetPaidOptions(filter.HasBeenPaid, true);
            ViewBag.Size      = LookupServices.GetSizeOptions(filter.Size);

            if (listing.InvoiceList.Count == 0)
            {
                return(View("InvoiceListingNoData", listing));
            }
            else
            {
                return(View("InvoiceListing", listing));
            }
        }
 public ActionResult UpdateInvoicePurchaseOrder(int id, string purchaseOrder)
 {
     AdministrationServices.UpdateInvoicePurchaseOrder(id, purchaseOrder);
     return(Json(new { result = "ok" }));
 }