mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-11 18:51:31 +00:00
updated streamline-setup v2
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'Patient Discounts'
|
||||
];
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PatientDiscounts\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
}
|
||||
Executable
+225
@@ -0,0 +1,225 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PatientDiscounts\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Streamline\Models\Donors;
|
||||
use Streamline\Models\Patient;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Streamline\Models\DiscountCategories;
|
||||
use Streamline\Models\PatientCategory;
|
||||
|
||||
class DiscountCategoryController extends Controller{
|
||||
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('permission:discount-category-list', ['only' => ['index']]);
|
||||
$this->middleware('permission:discount-category-create', ['only' => ['create', 'store']]);
|
||||
$this->middleware('permission:discount-category-edit', ['only' => ['edit', 'update']]);
|
||||
$this->middleware('permission:discount-category-delete', ['only' => ['destroy', 'inactive', 'activate']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
*/
|
||||
public function index(){
|
||||
$categories = PatientCategory::pluck("name", "id")->toArray();
|
||||
$donors = Donors::pluck("name", "id")->toArray();
|
||||
|
||||
$discount_categories = DiscountCategories::orderBy('name', 'asc')
|
||||
->paginate(50);
|
||||
|
||||
return view('patient_discounts::discount_categories.index',compact('discount_categories','categories','donors'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
*/
|
||||
public function create(){
|
||||
|
||||
$categories = PatientCategory::pluck("name", "id")->toArray();
|
||||
$categories = ['' => '- select -'] + $categories;
|
||||
$donors = Donors::pluck("name", "id")->toArray();
|
||||
$donors = ['' => '- select -'] + $donors;
|
||||
|
||||
return view('patient_discounts::discount_categories.create',compact('categories','donors'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request){
|
||||
request()->validate([
|
||||
'patient_category' => 'required',
|
||||
'donor' => 'required',
|
||||
'discount_name' => 'required',
|
||||
'discount_type' => 'required'
|
||||
]);
|
||||
|
||||
// get discount type
|
||||
$type = $request->discount_type;
|
||||
|
||||
$discount_category = new DiscountCategories;
|
||||
$discount_category->name = $request->discount_name;
|
||||
$discount_category->discount_type = $type;
|
||||
$discount_category->patient_category = $request->patient_category;
|
||||
$discount_category->donor_id = $request->donor;
|
||||
|
||||
// check which type of discount category has been selected and save appropriate amount
|
||||
if ($type == 1){
|
||||
// fixed figure
|
||||
$discount_category->donor_amount = $request->donor_fixed_amount;
|
||||
$discount_category->patient_amount = $request->patient_fixed_amount;
|
||||
} elseif ($type == 2) {
|
||||
// patient ceiling
|
||||
$discount_category->donor_amount = 0;
|
||||
$discount_category->patient_amount = $request->patient_ceiling;
|
||||
} elseif ($type == 3) {
|
||||
// patient top up
|
||||
$discount_category->donor_amount = $request->donor_top_up;
|
||||
$discount_category->patient_amount = 0;
|
||||
}
|
||||
|
||||
|
||||
$discount_category->created_by = auth()->user()->id;
|
||||
$discount_category->updated_by = auth()->user()->id;
|
||||
|
||||
if ($discount_category->save()) {
|
||||
return redirect('/discount_category');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id){
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
*/
|
||||
public function edit($id){
|
||||
|
||||
$discount_category = DiscountCategories::where(['id' => $id])->first();
|
||||
|
||||
$categories = PatientCategory::pluck("name", "id")->toArray();
|
||||
$categories = ['' => '- select -'] + $categories;
|
||||
|
||||
$donors = Donors::pluck("name", "id")->toArray();
|
||||
$donors = ['' => '- select -'] + $donors;
|
||||
|
||||
if (!$discount_category) {
|
||||
flash()->error("Discount category not found");
|
||||
return redirect('/discount_category/');
|
||||
} else {
|
||||
return view('patient_discounts::discount_categories.edit', compact('discount_category', 'categories', 'donors'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id){
|
||||
request()->validate([
|
||||
'patient_category' => 'required',
|
||||
'donor' => 'required',
|
||||
'discount_name' => 'required',
|
||||
'discount_type' => 'required'
|
||||
]);
|
||||
|
||||
// get discount type
|
||||
$type = $request->discount_type;
|
||||
|
||||
$discount_category = DiscountCategories::find($id);
|
||||
$discount_category->name = $request->discount_name;
|
||||
$discount_category->discount_type = $type;
|
||||
$discount_category->patient_category = $request->patient_category;
|
||||
$discount_category->donor_id = $request->donor;
|
||||
|
||||
// check which type of discount category has been selected and save appropriate amount
|
||||
if ($type == 1){
|
||||
// fixed figure
|
||||
$discount_category->donor_amount = $request->donor_fixed_amount;
|
||||
$discount_category->patient_amount = $request->patient_fixed_amount;
|
||||
} elseif ($type == 2) {
|
||||
// patient ceiling
|
||||
$discount_category->donor_amount = 0;
|
||||
$discount_category->patient_amount = $request->patient_ceiling;
|
||||
} elseif ($type == 3) {
|
||||
// patient top up
|
||||
$discount_category->donor_amount = $request->donor_top_up;
|
||||
$discount_category->patient_amount = 0;
|
||||
}
|
||||
|
||||
$discount_category->updated_by = auth()->user()->id;
|
||||
|
||||
if ($discount_category->save()) {
|
||||
return redirect('/discount_category');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id){
|
||||
$discount_category = DiscountCategories::find($id);
|
||||
|
||||
// $discount_category->active = 0;
|
||||
|
||||
if ($discount_category->delete()){
|
||||
flash("Discount category has been deleted.")->success();
|
||||
return redirect('/discount_category/');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the inactive resource(s).
|
||||
*
|
||||
*/
|
||||
public function inactive() {
|
||||
$discount_categories = DiscountCategories::onlyTrashed()
|
||||
->orderBy('name', 'asc')
|
||||
->paginate(50);
|
||||
|
||||
$categories = PatientCategory::pluck("name", "id")->toArray();
|
||||
$donors = Donors::pluck("name", "id")->toArray();
|
||||
|
||||
if (count($donors) < 1) {
|
||||
flash()->error("There is no inactive patient discount category");
|
||||
return redirect('/discount_category/');
|
||||
} else {
|
||||
return view('patient_discounts::discount_categories.inactive', compact('categories','donors', 'discount_categories'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate the specified resource in storage.
|
||||
*
|
||||
*/
|
||||
public function activate($id) {
|
||||
$discount_category = DiscountCategories::withTrashed()->find($id);
|
||||
|
||||
if ($discount_category->restore()):
|
||||
flash("Discount category has been activated.")->success();
|
||||
return redirect('/discount_category/inactive');
|
||||
endif;
|
||||
}
|
||||
}
|
||||
+588
@@ -0,0 +1,588 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PatientDiscounts\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Streamline\Models\DependantsConsumption;
|
||||
use Streamline\Models\HospitalInformation;
|
||||
use Streamline\Models\OrderedInvestigation;
|
||||
use Streamline\Models\OrderedProcedure;
|
||||
use Streamline\Models\OrderedService;
|
||||
use Streamline\Models\OrderedSundry;
|
||||
use Streamline\Models\Patient;
|
||||
use Streamline\Models\PatientCategory;
|
||||
use Streamline\Models\PatientCategoryInvoice;
|
||||
use Streamline\Models\PatientDiscount;
|
||||
use Streamline\Models\ChartOfAccount;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Streamline\Models\CategoryPatientDependant;
|
||||
use Carbon\Carbon;
|
||||
use Streamline\Models\TrackInvoice;
|
||||
use Streamline\Models\Treatment;
|
||||
|
||||
class DiscountController extends Controller {
|
||||
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('permission:discount-list', ['only' => ['index']]);
|
||||
$this->middleware('permission:discount-create', ['only' => ['create', 'store']]);
|
||||
$this->middleware('permission:discount-edit', ['only' => ['edit', 'update']]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
*/
|
||||
public function index(){
|
||||
$discounts = PatientDiscount::orderBy('patient_category', 'asc')
|
||||
->paginate(50);
|
||||
|
||||
$categories = DB::table('patient_categories')->where('available', 1)->pluck("name", "id")->toArray();
|
||||
return view('patient_discounts::discounts.index',compact('discounts','categories'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
*/
|
||||
public function create(){
|
||||
// make sure that patient discounts are not repeated
|
||||
$exiting_discount = PatientDiscount::all()->pluck('patient_category')->toArray();
|
||||
$categories = PatientCategory::whereNotIn('id',$exiting_discount)->pluck("name", "id")->toArray();
|
||||
$categories = ['' => '- select -'] + $categories;
|
||||
$expense_accounts = ChartOfAccount::where('type', 2)->pluck('name', 'id')->prepend('-select-', '')->toArray();
|
||||
|
||||
return view('patient_discounts::discounts.create',compact('categories', 'expense_accounts'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
*/
|
||||
public function store(Request $request){
|
||||
|
||||
request()->validate([
|
||||
'patient_category' => 'required',
|
||||
'pay_later' => 'required'
|
||||
]);
|
||||
|
||||
$patient_category_discount = new PatientDiscount;
|
||||
$patient_category_discount->patient_category = $request->patient_category;
|
||||
$patient_category_discount->discount = $request->discount;
|
||||
$patient_category_discount->pay_later = $request->pay_later;
|
||||
|
||||
if ($request->is_pay_later_threshold_discount == "1") {
|
||||
$patient_category_discount->threshold_type = $request->threshold_type;
|
||||
$patient_category_discount->threshold_amount = $request->threshold_amount;
|
||||
}
|
||||
|
||||
$patient_category_discount->co_payment = $request->co_payment;
|
||||
$patient_category_discount->co_payment_share = $request->co_payment_share;
|
||||
$patient_category_discount->tracking_expense_account = $request->tracking_expense_account;
|
||||
$patient_category_discount->created_by = Auth::id();
|
||||
|
||||
if ($patient_category_discount->save()) {
|
||||
flash('new patient discount saved')->success();
|
||||
return redirect('/discounts/');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function edit($id){
|
||||
|
||||
$discount = PatientDiscount::find($id);
|
||||
$categories = DB::table('patient_categories')->where('available', 1)->pluck("name", "id")->toArray();
|
||||
$expense_accounts = ChartOfAccount::where('type', 2)->pluck('name', 'id')->prepend('-select-', '')->toArray();
|
||||
|
||||
return view('patient_discounts::discounts.edit',compact('discount','categories', 'id', 'expense_accounts'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
*/
|
||||
public function update(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'discount' => 'required',
|
||||
'pay_later' => 'required'
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$string = "";
|
||||
foreach ($validator->errors()->getMessages() as $item) {
|
||||
$string .= "{$item[0]}<br>";
|
||||
}
|
||||
flash($string)->error();
|
||||
return back()->withErrors($validator)->withInput();
|
||||
} else {
|
||||
$patient_category_discount = PatientDiscount::find($request->id);
|
||||
|
||||
$patient_category_discount->discount = $request->discount;
|
||||
$patient_category_discount->pay_later = $request->pay_later;
|
||||
$patient_category_discount->updated_by = $request->discount;
|
||||
|
||||
if ($patient_category_discount->pay_later == 0) {
|
||||
$request->is_pay_later_threshold_discount = 0;
|
||||
$request->co_payment = 0;
|
||||
}
|
||||
|
||||
if ($request->is_pay_later_threshold_discount == 1) {
|
||||
$patient_category_discount->threshold_type = $request->threshold_type;
|
||||
$patient_category_discount->threshold_amount = $request->threshold_amount;
|
||||
} else {
|
||||
$patient_category_discount->threshold_type = NULL;
|
||||
$patient_category_discount->threshold_amount = NULL;
|
||||
}
|
||||
|
||||
if ($request->track_discounts == 1 || $request->is_pay_later_threshold_discount == 1) {
|
||||
$patient_category_discount->tracking_expense_account = $request->tracking_expense_account;
|
||||
} else {
|
||||
$patient_category_discount->tracking_expense_account = NULL;
|
||||
}
|
||||
|
||||
$patient_category_discount->co_payment = $request->co_payment;
|
||||
|
||||
if ($request->co_payment == 1) {
|
||||
$patient_category_discount->co_payment_share = $request->co_payment_share;
|
||||
} else {
|
||||
$patient_category_discount->co_payment_share = 0;
|
||||
}
|
||||
|
||||
if ($patient_category_discount->update()) {
|
||||
flash('Patient discount has been updated')->success();
|
||||
} else {
|
||||
flash("An error occurred!")->error();
|
||||
}
|
||||
return redirect('/discounts/');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
*/
|
||||
public function destroy($id) {
|
||||
if (PatientDiscount::destroy($id)) {
|
||||
flash("Patient discount has been deleted.")->success();
|
||||
return redirect('/discounts/');
|
||||
} else {
|
||||
flash("Patient discount failed to deleted.")->error();
|
||||
return redirect('/discounts/');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the inactive resource(s).
|
||||
*
|
||||
*/
|
||||
public function inactive() {
|
||||
$discounts = PatientDiscount::onlyTrashed()
|
||||
->orderBy('patient_category', 'asc')
|
||||
->paginate(50);
|
||||
|
||||
$categories = DB::table('patient_categories')->where('available', 1)->pluck("name", "id")->toArray();
|
||||
|
||||
if (count($discounts) < 1) {
|
||||
flash()->error("There is no inactive discount");
|
||||
return redirect('/discounts/');
|
||||
} else {
|
||||
return view('patient_discounts::discounts.inactive', compact('discounts', 'categories'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
*/
|
||||
public function activate($id) {
|
||||
$discount = PatientDiscount::withTrashed()->find($id);
|
||||
|
||||
if($discount->restore()){
|
||||
flash("Patient discount has been activated.")->success();
|
||||
return redirect('/discounts/inactive');
|
||||
} else {
|
||||
flash("Patient discount failed to activate.")->error();
|
||||
return redirect('/discounts/inactive');
|
||||
}
|
||||
}
|
||||
|
||||
public function edit_insured_drugs($patient_category_id) {
|
||||
$drugs = DB::table('drugs')->whereNull('deleted_at')->get(['id', 'name', 'patient_category_coverage']);
|
||||
|
||||
return view('patient_discounts::discounts.edit_insured_drugs', compact('drugs', 'patient_category_id'));
|
||||
}
|
||||
|
||||
public function store_edited_insured_drugs(Request $request) {
|
||||
$is_covered = $request->is_covered;
|
||||
$current_covered = is_null($request->current_covered) ? [] : $request->current_covered;
|
||||
$removed_coverage = array_diff($current_covered, $is_covered);
|
||||
|
||||
foreach ($is_covered as $value) {
|
||||
$current_coverages = get_name($value, 'id', 'patient_category_coverage', 'drugs');
|
||||
|
||||
if ($current_coverages != 'N/A') {
|
||||
if (is_null($current_coverages) || $current_coverages == "") {
|
||||
$current_coverages_array = [];
|
||||
} else {
|
||||
$current_coverages_array = explode(",", $current_coverages);
|
||||
|
||||
// check if the id is already in the array and just chill
|
||||
if (in_array($request->patient_category_id, $current_coverages_array)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$current_coverages_array[] = $request->patient_category_id;
|
||||
DB::table('drugs')->where('id', $value)->update(['patient_category_coverage' => implode(",", $current_coverages_array)]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($removed_coverage as $value) {
|
||||
$current_coverages = get_name($value, 'id', 'patient_category_coverage', 'drugs');
|
||||
|
||||
if ($current_coverages != 'N/A') {
|
||||
$current_coverages_array = explode(",", $current_coverages);
|
||||
|
||||
if (in_array($request->patient_category_id, $current_coverages_array)) {
|
||||
unset($current_coverages_array[array_search($request->patient_category_id, $current_coverages_array)]);
|
||||
}
|
||||
|
||||
DB::table('drugs')->where('id', $value)->update(['patient_category_coverage' => implode(",", $current_coverages_array)]);
|
||||
}
|
||||
}
|
||||
|
||||
flash("Drug coverages have been updated")->success();
|
||||
return redirect('/discounts/edit_insured_drugs/' . $request->patient_category_id);
|
||||
}
|
||||
|
||||
public function add_category_patient_dependants(Request $request)
|
||||
{
|
||||
$discount_id = $request->discount_id;
|
||||
$patient_discount = PatientDiscount::find($discount_id);
|
||||
$patient_category_patients = Patient::where('category_id', $patient_discount->patient_category)->orderBy('first_name', 'asc')->get();
|
||||
/*
|
||||
$patient_category_patients = DB::table("patients")->select('*')->where('category_id', $patient_discount->patient_category)->whereRaw('!FIND_IN_SET(id,'.function($query) {
|
||||
$query->select('dependant_patient_ids')->from('category_patient_dependants');
|
||||
}.')')->get();
|
||||
*/
|
||||
|
||||
return view('patient_discounts::discounts.patient_category_patients', compact('patient_discount','patient_category_patients'));
|
||||
}
|
||||
|
||||
/*
|
||||
* Display blade to enable adding dependants to a main category patient
|
||||
*/
|
||||
public function add_dependants_to_category_patient(Request $request)
|
||||
{
|
||||
$patient_id = $request->patient_id;
|
||||
$patient_category_id = $request->patient_category;
|
||||
$patient_discount_id = $request->patient_discount_id;
|
||||
$patient = Patient::find($patient_id);
|
||||
|
||||
$patients_array = [];//Patient::all(['id', 'first_name', 'last_name'])->where('category_id', 1)->pluck("full_name", "id")->toArray();
|
||||
|
||||
return view('patient_discounts::discounts.add_dependants_to_category_patient', compact('patient_id','patient_discount_id','patient_category_id','patient','patients_array'));
|
||||
}
|
||||
|
||||
/*
|
||||
* Store the added dependants
|
||||
*/
|
||||
public function store_dependants_to_category_patient(Request $request)
|
||||
{
|
||||
//check to make sure that the dependants are not attached to another dependant or even are the main patients
|
||||
$all_main_patients_array = CategoryPatientDependant::pluck('main_patient_id')->toArray();
|
||||
$patient_dependants_array = is_null($request->dependants) ? [] : $request->dependants;
|
||||
|
||||
for ($i=0; $i < count($patient_dependants_array) ; $i++) {
|
||||
if (in_array($patient_dependants_array[$i],$all_main_patients_array)) {
|
||||
flash('Patient <b>'.get_full_name($patient_dependants_array[$i], "id", "first_name", "last_name", "patients").'</b> is already a main patient and so can not be another person\'s dependant ')->error();
|
||||
return redirect('discounts');
|
||||
}
|
||||
|
||||
$all_dependants = CategoryPatientDependant::whereRaw('FIND_IN_SET(' . $patient_dependants_array[$i] . ',dependant_patient_ids)')->get();
|
||||
if (count($all_dependants)) {
|
||||
$patient_is_a_dependant_of = patient_is_a_dependant_of($patient_dependants_array[$i]);
|
||||
if (!is_null($patient_is_a_dependant_of) && ($patient_is_a_dependant_of != $request->patient_id)) {
|
||||
flash('Patient <b>'.get_full_name($patient_dependants_array[$i], "id", "first_name", "last_name", "patients").'</b> is already a dependant of someone else')->error();
|
||||
return redirect('discounts');
|
||||
}
|
||||
}
|
||||
|
||||
//make sure that they are not configured to the same category
|
||||
$main_patient_category = get_name($request->patient_id, "id", "category_id", "patients");
|
||||
$dependant_patient_category = get_name($patient_dependants_array[$i], "id", "category_id", "patients");
|
||||
if ($main_patient_category == $dependant_patient_category) {
|
||||
flash('Patient <b>'.get_full_name($patient_dependants_array[$i], "id", "first_name", "last_name", "patients").'</b> belongs to the same patient category. Both the dependant and dependee can not belong to the same category')->error();
|
||||
return redirect('discounts');
|
||||
}
|
||||
}
|
||||
|
||||
$patient = Patient::find($request->patient_id);
|
||||
$patient_category_id = $request->patient_category_id;
|
||||
$start_date = is_null($request->start_date) ? null : Carbon::createFromFormat('d/m/Y', $request->start_date)->toDateString();
|
||||
|
||||
$patient_category_depedants_record = CategoryPatientDependant::where('main_patient_id', $request->patient_id)->get();
|
||||
if (count($patient_category_depedants_record) > 0) {
|
||||
|
||||
$patient_category_depedants = $patient_category_depedants_record->first();
|
||||
$patient_category_depedants->main_patient_id = $request->patient_id;
|
||||
$patient_category_depedants->dependant_patient_ids = implode(",", $patient_dependants_array);
|
||||
$patient_category_depedants->patient_category_id = $patient_category_id;
|
||||
$patient_category_depedants->start_date = $start_date;
|
||||
$duration = 0;
|
||||
$duration = get_name($patient_category_id, "patient_category", "threshold_type", "patient_discounts");
|
||||
if ($duration == 2) {
|
||||
$duration = 12; //12 months
|
||||
}
|
||||
if ($duration == 1) {
|
||||
$duration = 1; //1 month
|
||||
}
|
||||
$patient_category_depedants->duration = $duration;
|
||||
$patient_category_depedants->update();
|
||||
} else {
|
||||
|
||||
$patient_category_depedants = new CategoryPatientDependant;
|
||||
$patient_category_depedants->main_patient_id = $request->patient_id;
|
||||
$patient_category_depedants->dependant_patient_ids = implode(",", $patient_dependants_array);
|
||||
$patient_category_depedants->patient_category_id = $patient_category_id;
|
||||
$patient_category_depedants->start_date = $start_date;
|
||||
$duration = 0;
|
||||
$duration = get_name($patient_category_id, "patient_category", "threshold_type", "patient_discounts");
|
||||
if ($duration == 2) {
|
||||
$duration = 12; //12 months
|
||||
}
|
||||
if ($duration == 1) {
|
||||
$duration = 1; //1 month
|
||||
}
|
||||
$patient_category_depedants->duration = $duration;
|
||||
$patient_category_depedants->save();
|
||||
}
|
||||
|
||||
flash('new dependants have been saved')->success();
|
||||
return redirect('discounts');
|
||||
}
|
||||
|
||||
public function view_patient_dependant_details(Request $request)
|
||||
{
|
||||
$patient_category_depedant = CategoryPatientDependant::first();
|
||||
return view('patient_discounts::discounts.view_patient_dependant_details', compact('patient_category_depedant'));
|
||||
}
|
||||
|
||||
/* View all dependants to a category patient */
|
||||
public function view_dependants_to_category_patient($id)
|
||||
{
|
||||
$patient_category_depedants_record = CategoryPatientDependant::where('main_patient_id', $id)->get();
|
||||
|
||||
$patient = Patient::find($id);
|
||||
$dependants_record = null;
|
||||
|
||||
if (count($patient_category_depedants_record) > 0) {
|
||||
$dependants_record = $patient_category_depedants_record->first();
|
||||
return view('patient_discounts::discounts.view_dependants_to_category_patient', compact('patient','dependants_record'));
|
||||
}
|
||||
return view('patient_discounts::discounts.view_dependants_to_category_patient', compact('patient','dependants_record'));
|
||||
}
|
||||
|
||||
public function search_dependant_name(Request $request)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
if ($request->has('q')) {
|
||||
$search = $request->q;
|
||||
$data = DB::table('patients')
|
||||
->where('category_id', 1)
|
||||
->where('first_name', 'LIKE', "%$search%")
|
||||
->orWhere('last_name', 'LIKE', "%$search%")
|
||||
->orWhere('number', 'LIKE', "%$search%")
|
||||
->get(["id", "first_name", "last_name", "number", "phone"]);
|
||||
}
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
public function generate_dependants_payment_invoice(Request $request)
|
||||
{
|
||||
$main_patient_id = $request->main_patient_id;
|
||||
$dependants_array = [];
|
||||
$dependants = CategoryPatientDependant::where('main_patient_id', $main_patient_id)->get();
|
||||
$consumptions = DependantsConsumption::where('main_patient_id', $main_patient_id)->get();
|
||||
$patient_category_id = 0;
|
||||
foreach ($dependants as $record) {
|
||||
$dependants_array = explode(",", $record->dependant_patient_ids);
|
||||
$patient_category_id = $record->patient_category_id;
|
||||
}
|
||||
$dependants_array[] = $main_patient_id; //add the main patient in array
|
||||
|
||||
$start_of_year = Carbon::now()->startOfYear();
|
||||
$start = $start_of_year->toDateTimeString();
|
||||
$end = Carbon::now()->toDateString();
|
||||
$patient_category_name = get_name($patient_category_id, "id", "name", "patient_categories");
|
||||
$invoice_number = generateInvoiceNumberFromDB($patient_category_name);
|
||||
$invoice_start = Carbon::parse($start)->format('d-m-Y');
|
||||
$invoice_date = $invoice_start."/".$end; //according to how Benjamin organized it
|
||||
$invoice_with_payment_amount_paid = $invoice_with_payment_balance = 0;
|
||||
|
||||
$update = PatientCategoryInvoice::where('invoice_generated', 0)
|
||||
->where('patient_category', $patient_category_id)
|
||||
->whereIn('patient_id', $dependants_array)
|
||||
->update(
|
||||
[
|
||||
'invoice_generated' => 1,
|
||||
'invoice_date' => $invoice_date,
|
||||
'invoice_number' => $invoice_number,
|
||||
'is_invoice_for_individual' => $main_patient_id
|
||||
]
|
||||
);
|
||||
|
||||
$track_invoice = new TrackInvoice;
|
||||
$track_invoice->reason = $patient_category_id;
|
||||
$track_invoice->created_by = Auth::id();
|
||||
|
||||
if (!is_null($update) && $track_invoice->save()) {
|
||||
$hospital_information = HospitalInformation::first();
|
||||
$users_name = get_full_name(Auth::id(), 'id', 'first_name', 'last_name', 'users');
|
||||
|
||||
$start_date = Carbon::parse($start)->startOfDay()->toDateTimeString();
|
||||
$end_date = Carbon::parse($end)->endOfDay()->toDateTimeString();
|
||||
|
||||
//update the dependant consumption table with the generated invoices number
|
||||
$consumption = DependantsConsumption::where('main_patient_id', $main_patient_id)->whereNull('invoice_number')
|
||||
->where('unpaid_balance', '>', 0)
|
||||
->whereBetween('created_at', [$start_date, $end_date])
|
||||
->update(['invoice_number' => $invoice_number]);
|
||||
|
||||
$last_invoice = DB::table('patient_category_invoices')->select('invoice_number')->distinct()->orderBy('invoice_number', 'desc')->first();
|
||||
$last_invoice_number = $invoice_number;
|
||||
|
||||
$invoices = DB::table('patient_category_invoices')
|
||||
->whereNotIn('patient_id', findTestOrDemoPatients())
|
||||
->whereBetween('created_at', [$start_date, $end_date])
|
||||
->where('patient_category', $patient_category_id)
|
||||
->where('invoice_generated', 1)
|
||||
->where('status', 0)
|
||||
->where('invoice_number', $last_invoice_number)
|
||||
->groupBy('episode_id')->selectRaw('*, sum(patient_amount) as sum')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
$request->merge(['invoice_number' => $invoice_number]);
|
||||
$request->merge(['patient_category' => $patient_category_id]);
|
||||
$request->merge(['start_date' => $start_date]);
|
||||
$request->merge(['end_date' => $end_date]);
|
||||
|
||||
return view('invoices::invoices.generate_invoice.patient_invoice', compact(
|
||||
'invoices',
|
||||
'request',
|
||||
'users_name',
|
||||
'hospital_information',
|
||||
'invoice_with_payment_amount_paid',
|
||||
'invoice_with_payment_balance'
|
||||
));
|
||||
} else {
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
/* receive payment for a patient and his dependants */
|
||||
public function receive_dependants_payment(Request $request)
|
||||
{
|
||||
//load the page that loads invoice payment with the requests as below
|
||||
/*
|
||||
"patient_category" => "15"
|
||||
"created_by" => "17"
|
||||
"created_at" => "2021-02-01 10:35:49"
|
||||
"status" => "new"
|
||||
"total" => "3150600"
|
||||
"invoice_date" => "01-02-2021/2021-02-27"
|
||||
"invoice_number" => "0865"
|
||||
*/
|
||||
}
|
||||
|
||||
public function clean_dependants_that_are_main_patients()
|
||||
{
|
||||
//1. loop through category_patient_dependants table
|
||||
//2. explode dependants and check if any is main patient
|
||||
//3. if main patient record exists, delete main patient record, soft delete consumption and make records unpaid
|
||||
//4. soft delete episode record from patient_category_invoices and make ordered record not paid
|
||||
$patient_category_dependants = CategoryPatientDependant::all();
|
||||
if (count($patient_category_dependants) > 0) {
|
||||
foreach ($patient_category_dependants as $category_record) {
|
||||
$dependants_array = explode(",", $category_record->dependant_patient_ids);
|
||||
for ($i=0; $i < count($dependants_array) ; $i++) {
|
||||
$checking_for_main_patients = CategoryPatientDependant::where('main_patient_id',$dependants_array[$i])->get();
|
||||
if (count($checking_for_main_patients) > 0) {
|
||||
foreach ($checking_for_main_patients as $main_record) {
|
||||
$main_record->delete();
|
||||
$consumptions_records = DependantsConsumption::where('main_patient_id', $main_record->main_patient_id)->get();
|
||||
if (count($consumptions_records) > 0) {
|
||||
foreach ($consumptions_records as $consumption) {
|
||||
$consumption->delete();
|
||||
//treatments
|
||||
$treatments = Treatment::where('episode_id', $consumption->episode_id)->get();
|
||||
if (count($treatments) > 0) {
|
||||
foreach ($treatments as $treatment) {
|
||||
$treatment->update(['payment_status' => 0]);
|
||||
}
|
||||
}
|
||||
//investigations
|
||||
$investigations = OrderedInvestigation::where('episode_id', $consumption->episode_id)->get();
|
||||
if (count($investigations) > 0) {
|
||||
foreach ($investigations as $ordered_investigation) {
|
||||
$ordered_investigation->update(['payment_status' => 0]);
|
||||
}
|
||||
}
|
||||
//procedures
|
||||
$procedures = OrderedProcedure::where('episode_id', $consumption->episode_id)->get();
|
||||
if (count($procedures) > 0) {
|
||||
foreach ($procedures as $ordered_procedure) {
|
||||
$ordered_procedure->update(['payment_status' => 0]);
|
||||
}
|
||||
}
|
||||
//services
|
||||
$services = OrderedService::where('episode_id', $consumption->episode_id)->get();
|
||||
if (count($services) > 0) {
|
||||
foreach ($services as $ordered_service) {
|
||||
$ordered_service->update(['payment_status' => 0]);
|
||||
}
|
||||
}
|
||||
//sundrys
|
||||
$sundrys = OrderedSundry::where('episode_id', $consumption->episode_id)->get();
|
||||
if (count($sundrys) > 0) {
|
||||
foreach ($sundrys as $ordered_sundry) {
|
||||
$ordered_sundry->update(['payment_status' => 0]);
|
||||
}
|
||||
}
|
||||
//patient category invoice
|
||||
$patient_category_invoice = PatientCategoryInvoice::where('episode_id',$consumption->episode_id)->delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+1018
File diff suppressed because it is too large
Load Diff
Executable
+592
@@ -0,0 +1,592 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PatientDiscounts\Http\Controllers;
|
||||
|
||||
use Barryvdh\Snappy\Facades\SnappyPdf;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\PatientFinance\Http\Controllers\PatientFinanceController;
|
||||
use Streamline\Models\ChartOfAccount;
|
||||
use Streamline\Models\HospitalInformation;
|
||||
use Streamline\Models\Patient;
|
||||
use Streamline\Models\PatientAccountConsumption;
|
||||
use Streamline\Models\PatientAccountsDeposit;
|
||||
use Streamline\Models\PatientAccountsRefund;
|
||||
use Streamline\Models\PatientPaymentMethod;
|
||||
use Streamline\Models\TrackReceipt;
|
||||
|
||||
class PatientAccountsController extends Controller {
|
||||
|
||||
public function statement(Request $request) {
|
||||
$patient_id = session()->get('patient_id');
|
||||
|
||||
$search_by = $request->search_by;
|
||||
$reg_date = $request->reg_date;
|
||||
$start_date = $request->start_date;
|
||||
$end_date = $request->end_date;
|
||||
|
||||
$patient = DB::table('patients')
|
||||
->where('id', $patient_id)
|
||||
->first();
|
||||
|
||||
if (!is_null($search_by)){
|
||||
if($search_by == "0"){
|
||||
// last 24 hours
|
||||
$start_date_search = Carbon::now()->subDay()->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::now()->endOfDay()->toDateTimeString();
|
||||
} elseif($search_by == "1"){
|
||||
// custom date
|
||||
$start_date_search = Carbon::parse($reg_date)->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::parse($reg_date)->endOfDay()->toDateTimeString();
|
||||
} elseif($search_by == "2"){
|
||||
// custom date range
|
||||
$start_date_search = Carbon::parse($start_date)->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::parse($end_date)->endOfDay()->toDateTimeString();
|
||||
} else {
|
||||
$start_date_search = Carbon::now()->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::now()->endOfDay()->toDateTimeString();
|
||||
}
|
||||
} else {
|
||||
$start_date_search = Carbon::now()->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::now()->endOfDay()->toDateTimeString();
|
||||
}
|
||||
|
||||
$patient_deposits = PatientAccountsDeposit::whereBetween('deposit_date', [$start_date_search, $end_date_search])
|
||||
->where('patient_id', $patient_id)
|
||||
->get();
|
||||
|
||||
$patient_refunds = PatientAccountsRefund::whereBetween('refund_date', [$start_date_search, $end_date_search])
|
||||
->where('patient_id', $patient_id)
|
||||
->get();
|
||||
|
||||
$patient_consumptions = PatientAccountConsumption::whereBetween('created_at', [$start_date_search, $end_date_search])
|
||||
->where('patient_id', $patient_id)
|
||||
->get();
|
||||
|
||||
return view('patient_discounts::patient_accounts.statement', compact('patient', 'search_by', 'reg_date', 'start_date', 'end_date',
|
||||
'patient_deposits', 'patient_refunds', 'patient_consumptions'));
|
||||
}
|
||||
|
||||
public function print_statement(Request $request) {
|
||||
$patient_id = session()->get('patient_id');
|
||||
|
||||
$search_by = $request->search_by;
|
||||
$reg_date = $request->reg_date;
|
||||
$start_date = $request->start_date;
|
||||
$end_date = $request->end_date;
|
||||
|
||||
if (!is_null($search_by)){
|
||||
if($search_by == "0"){
|
||||
// last 24 hours
|
||||
$start_date_search = Carbon::now()->subDay()->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::now()->endOfDay()->toDateTimeString();
|
||||
} elseif($search_by == "1"){
|
||||
// custom date
|
||||
$start_date_search = Carbon::parse($reg_date)->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::parse($reg_date)->endOfDay()->toDateTimeString();
|
||||
} elseif($search_by == "2"){
|
||||
// custom date range
|
||||
$start_date_search = Carbon::parse($start_date)->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::parse($end_date)->endOfDay()->toDateTimeString();
|
||||
} else {
|
||||
$start_date_search = Carbon::now()->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::now()->endOfDay()->toDateTimeString();
|
||||
}
|
||||
} else {
|
||||
$start_date_search = Carbon::now()->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::now()->endOfDay()->toDateTimeString();
|
||||
}
|
||||
|
||||
$patient_deposits = PatientAccountsDeposit::whereBetween('deposit_date', [$start_date_search, $end_date_search])
|
||||
->where('patient_id', $patient_id)
|
||||
->get();
|
||||
|
||||
$patient_refunds = PatientAccountsRefund::whereBetween('refund_date', [$start_date_search, $end_date_search])
|
||||
->where('patient_id', $patient_id)
|
||||
->get();
|
||||
|
||||
$patient_consumptions = PatientAccountConsumption::whereBetween('created_at', [$start_date_search, $end_date_search])
|
||||
->where('patient_id', $patient_id)
|
||||
->get();
|
||||
|
||||
$hospital_information = HospitalInformation::first();
|
||||
|
||||
$data = [
|
||||
'patient_consumptions' => $patient_consumptions,
|
||||
'patient_refunds' => $patient_refunds,
|
||||
'patient_deposits' => $patient_deposits,
|
||||
'hospitalInfo' => $hospital_information,
|
||||
'patient_id' => $patient_id,
|
||||
'search_info' => "Patient Account details and transactions between " . streamline_date($start_date_search)
|
||||
. " and " . streamline_date($end_date_search) . " for " .
|
||||
get_full_name($patient_id, 'id', 'first_name', 'last_name', 'patients') .
|
||||
" (" . get_name($patient_id, 'id', 'number', 'patients') . ")"
|
||||
];
|
||||
|
||||
$pdf = SnappyPDF::loadView("patient_discounts::patient_accounts/print_statement", $data)
|
||||
->setOrientation('portrait')
|
||||
->setOption('margin-bottom', 7)
|
||||
->setOption('margin-top', 5)
|
||||
->setOption('footer-html', '<i>© ' . date('Y') . ' Stre@mline</i>');
|
||||
|
||||
return $pdf->inline('Patient Account Statement' . date(" d-m-y h:ia") . '.pdf');
|
||||
}
|
||||
|
||||
public function make_deposit() {
|
||||
$patient_id = session()->get('patient_id');
|
||||
|
||||
$patient = DB::table('patients')->find($patient_id);
|
||||
|
||||
$patient_payment_methods = PatientPaymentMethod::pluck('name', 'id');
|
||||
$patient_payment_methods_options = "";
|
||||
foreach ($patient_payment_methods as $key => $value) {
|
||||
$patient_payment_methods_options .= '<option value="' . $key . '">' . $value . '</option>';
|
||||
}
|
||||
|
||||
return view('patient_discounts::patient_accounts.make_deposit', compact('patient', 'patient_payment_methods_options'));
|
||||
}
|
||||
|
||||
public function store_deposit(Request $request) {
|
||||
$patient_id = session()->get('patient_id');
|
||||
$patient = DB::table('patients')->find($patient_id);
|
||||
|
||||
$deposit_amount = $request->deposit_amount;
|
||||
$deposit_date = $request->deposit_date;
|
||||
|
||||
$track_receipts = new TrackReceipt;
|
||||
$track_receipts->created_by = Auth::id();
|
||||
$track_receipts->reason = 'Patient Account Deposit';
|
||||
$track_receipts->save();
|
||||
$receipt_number = sprintf("%04u", $track_receipts->id);
|
||||
|
||||
$deposit = new PatientAccountsDeposit();
|
||||
|
||||
$deposit->patient_id = $patient_id;
|
||||
$deposit->deposit_amount = $deposit_amount;
|
||||
$deposit->deposit_date = Carbon::createFromFormat('d-m-Y', $deposit_date)->toDateString();
|
||||
$deposit->receipt_number = $receipt_number;
|
||||
$deposit->created_by = Auth::id();
|
||||
|
||||
if ($deposit->save()) {
|
||||
record_cash_credits_to_daily_collection_account($deposit_amount, $receipt_number, "Patient Account Deposits");
|
||||
|
||||
$patient_to_update = Patient::find($patient_id);
|
||||
$patient_to_update->patient_account_balance = $patient_to_update->patient_account_balance + (int)$request->deposit_amount;
|
||||
$patient_to_update->update();
|
||||
|
||||
$patient_account_balance_id = get_name("patient_account_balance", "slug", "id", "chart_of_accounts");
|
||||
if (is_numeric($patient_account_balance_id)) {
|
||||
// increase the balance on chart of accounts called "patient account deposit"
|
||||
$chart_of_account = ChartOfAccount::find($patient_account_balance_id);
|
||||
$chart_of_account->balance = $chart_of_account->balance + (int)$request->deposit_amount;
|
||||
$chart_of_account->update();
|
||||
} else {
|
||||
flash('A chart of accounts is missing. Please contact Stre@mline support immediately!')->error();
|
||||
}
|
||||
|
||||
$receipt_date = date('Y-m-d h:i:s');
|
||||
|
||||
$return_payment_methods = PatientFinanceController::register_payment_method($patient_id, 0, $request->original_cash_to_pay, $request->payment_method,
|
||||
$request->payment_methods_amount, array_fill(0, ($request->payment_methods_amount ? count($request->payment_methods_amount) : 0), null), array_fill(0, ($request->payment_methods_amount ? count($request->payment_methods_amount) : 0), 0), $receipt_number, 15, Auth::id(), 0);
|
||||
|
||||
flash('Patient account deposit has been updated')->success();
|
||||
|
||||
$description = "Amount Deposited";
|
||||
|
||||
if (is_cashier_receipt_type_print_html()) {
|
||||
return view('patient_discounts::patient_accounts.deposit_receipt',compact('deposit_amount', 'receipt_number', 'receipt_date', 'return_payment_methods',
|
||||
'patient', 'deposit_date', 'description'));
|
||||
} else {
|
||||
// so we first have to set a session and then go back to the payment page
|
||||
// on the payment page we can then set a JS variable that can help redirect us to our pdf print
|
||||
session()->put('print_patient_account_receipt_pdf', 1);
|
||||
|
||||
// since we want to reduce the amount of duplicate code, we shall send all items to one file for printing
|
||||
$data = [
|
||||
"deposit_amount" => $deposit_amount, "receipt_number" => $receipt_number, "deposit_date" => $deposit_date,
|
||||
"return_payment_methods" => $return_payment_methods, "receipt_date" => $receipt_date, "patient_id" => $patient_id, "description" => $description
|
||||
];
|
||||
|
||||
session()->put('print_patient_account_receipt_pdf_details', $data);
|
||||
|
||||
return redirect('/patient_finance/home/');
|
||||
}
|
||||
} else {
|
||||
return redirect('patient_accounts/make_deposit');
|
||||
}
|
||||
}
|
||||
|
||||
public function print_receipt_pdf_details() {
|
||||
$data = session()->get("print_patient_account_receipt_pdf_details");
|
||||
|
||||
// add check for when the people try to reload the page
|
||||
if (!$data) {
|
||||
return redirect('/home');
|
||||
}
|
||||
|
||||
$data['hospital_information'] = \Streamline\Models\HospitalInformation::first();
|
||||
|
||||
// lest i forget Thy love for me
|
||||
session()->forget('print_patient_account_receipt_pdf');
|
||||
session()->forget('print_patient_account_receipt_pdf_details');
|
||||
|
||||
$pdf = SnappyPDF::loadView("patient_discounts::patient_accounts.print_receipt_pdf_details", $data)
|
||||
->setOrientation('portrait')
|
||||
->setPaper('a4')
|
||||
->setOption('margin-bottom', 5)
|
||||
->setOption('margin-top', 5)
|
||||
->setOption('footer-html', '<i>© ' . date('Y') . ' Stre@mline</i>');
|
||||
|
||||
return $pdf->inline('Patient Accounts Receipt' . date(" d-m-y h:ia") . '.pdf');
|
||||
}
|
||||
|
||||
public function refund_deposit() {
|
||||
$patient_id = session()->get('patient_id');
|
||||
$patient = DB::table('patients')->find($patient_id);
|
||||
|
||||
$current_balance = get_name($patient_id, 'id', 'patient_account_balance', 'patients');
|
||||
|
||||
$banks = DB::table('chart_of_accounts')->whereNull('deleted_at')->where('type', 4)->pluck('name', 'id')->prepend('--select--', '');
|
||||
|
||||
if ($current_balance > 0) {
|
||||
return view('patient_discounts::patient_accounts.refund_deposit', compact('current_balance', 'patient', 'banks'));
|
||||
} else {
|
||||
flash("Patient account refund can not be completed because balance is less than refund limit")->error();
|
||||
return redirect('/patient_accounts/statement');
|
||||
}
|
||||
}
|
||||
|
||||
public function save_refund_deposit(Request $request) {
|
||||
$patient_id = session()->get('patient_id');
|
||||
$patient = DB::table('patients')->find($patient_id);
|
||||
|
||||
$track_receipts = new TrackReceipt;
|
||||
$track_receipts->created_by = Auth::id();
|
||||
$track_receipts->reason = 'Patient Accounts Refund';
|
||||
$track_receipts->save();
|
||||
$receipt_number = sprintf("%04u", $track_receipts->id);
|
||||
|
||||
$current_balance = $request->current_balance;
|
||||
$refund_amount = $request->refund_amount;
|
||||
$refund_date = $request->refund_date;
|
||||
$account_id = $request->account_id;
|
||||
$account_balance = $request->account_balance;
|
||||
$refund_reason = $request->refund_reason;
|
||||
|
||||
if (($current_balance < $refund_amount) || ($refund_amount < 1) || ($account_balance < $refund_amount)) {
|
||||
flash("Please enter a valid refund amount")->error();
|
||||
return redirect('/patient_accounts/refund_deposit');
|
||||
}
|
||||
|
||||
// reduce the patient's current balance by deleted amount
|
||||
$patient_to_update = Patient::find($patient_id);
|
||||
$patient_to_update->patient_account_balance = (int)$current_balance - (int)$refund_amount;
|
||||
$patient_to_update->update();
|
||||
|
||||
// decrease the balance on select account
|
||||
$chart_of_account = ChartOfAccount::find($account_id);
|
||||
$chart_of_account->balance = $chart_of_account->balance - (int)$refund_amount;
|
||||
$chart_of_account->update();
|
||||
|
||||
$account_balance_record_on_expense_date = get_latest_banking_record_based_on_transaction_date($account_id, date('Y-m-d', strtotime($refund_date)));
|
||||
$account_balance_on_expense_date_after_payment = ($account_balance_record_on_expense_date ? (int)$account_balance_record_on_expense_date->account_balance : 0) - $refund_amount;
|
||||
$last_insert_id = capture_bank_record('Patient Account Refunds', date('Y-m-d', strtotime($refund_date)), $account_id, 0,
|
||||
$account_balance_on_expense_date_after_payment, 0, $refund_amount, $refund_reason, $receipt_number);
|
||||
|
||||
update_banking_record_balances(date('Y-m-d', strtotime($refund_date)), $account_id, $last_insert_id, $account_balance_on_expense_date_after_payment);
|
||||
|
||||
$patient_account_balance_id = get_name("patient_account_balance", "slug", "id", "chart_of_accounts");
|
||||
if (is_numeric($patient_account_balance_id)) {
|
||||
// decrease the balance on chart of accounts called "patient account deposit"
|
||||
$chart_of_account = ChartOfAccount::find($patient_account_balance_id);
|
||||
$chart_of_account->balance = $chart_of_account->balance - (int)$refund_amount;
|
||||
$chart_of_account->update();
|
||||
} else {
|
||||
flash('A chart of accounts is missing. Please contact Stre@mline support immediately!')->error();
|
||||
}
|
||||
|
||||
$refund = new PatientAccountsRefund();
|
||||
$refund->patient_id = $patient_id;
|
||||
$refund->refund_amount = $refund_amount;
|
||||
$refund->refund_date = Carbon::createFromFormat('d-m-Y', $refund_date)->toDateString();
|
||||
$refund->refund_reason = $refund_reason;
|
||||
$refund->account_id = $account_id;
|
||||
$refund->receipt_number = $receipt_number;
|
||||
$refund->created_by = Auth::id();
|
||||
$refund->save();
|
||||
|
||||
$description = "Amount Refunded";
|
||||
$deposit_amount = $refund_amount;
|
||||
$receipt_date = date('Y-m-d h:i:s');
|
||||
$deposit_date = $refund_date;
|
||||
$return_payment_methods = [];
|
||||
|
||||
if (is_cashier_receipt_type_print_html()) {
|
||||
return view('patient_discounts::patient_accounts.deposit_receipt',compact('deposit_amount', 'receipt_number', 'receipt_date', 'return_payment_methods',
|
||||
'patient', 'deposit_date', 'description'));
|
||||
} else {
|
||||
// so we first have to set a session and then go back to the payment page
|
||||
// on the payment page we can then set a JS variable that can help redirect us to our pdf print
|
||||
session()->put('print_patient_account_receipt_pdf', 1);
|
||||
|
||||
// since we want to reduce the amount of duplicate code, we shall send all items to one file for printing
|
||||
$data = [
|
||||
"deposit_amount" => $deposit_amount, "receipt_number" => $receipt_number, "deposit_date" => $deposit_date,
|
||||
"return_payment_methods" => $return_payment_methods, "receipt_date" => $receipt_date, "patient_id" => $patient_id, "description" => $description
|
||||
];
|
||||
|
||||
session()->put('print_patient_account_receipt_pdf_details', $data);
|
||||
|
||||
return redirect('/patient_finance/home/');
|
||||
}
|
||||
}
|
||||
|
||||
public function deposits_report(Request $request) {
|
||||
$search_by = $request->search_by;
|
||||
$reg_date = $request->reg_date;
|
||||
$start_date = $request->start_date;
|
||||
$end_date = $request->end_date;
|
||||
$filters = [];
|
||||
|
||||
if (!is_null($search_by)){
|
||||
if($search_by == "0"){
|
||||
// last 24 hours
|
||||
$last_day = Carbon::now()->subDay();
|
||||
$filters[] = ['deposit_date', '>', $last_day];
|
||||
} elseif($search_by == "1"){
|
||||
// custom date
|
||||
$start_date_search = Carbon::parse($reg_date)->toDateString();
|
||||
$filters[] = ['deposit_date', '=', $start_date_search];
|
||||
} elseif($search_by == "2"){
|
||||
// custom date range
|
||||
if ($start_date == $end_date) {
|
||||
$start_date_search = Carbon::parse($start_date)->startOfDay()->toDateString();
|
||||
|
||||
$filters[] = ['deposit_date', '=', $start_date_search];
|
||||
} else {
|
||||
$start_date_search = Carbon::parse($start_date)->startOfDay()->toDateString();
|
||||
$end_date_search = Carbon::parse($end_date)->endOfDay()->toDateString();
|
||||
|
||||
$filters[] = ['deposit_date', '>', $start_date_search];
|
||||
$filters[] = ['deposit_date', '<', $end_date_search];
|
||||
}
|
||||
} else {
|
||||
$start_date_search = Carbon::now()->startOfDay()->toDateString();
|
||||
$end_date_search = Carbon::now()->endOfDay()->toDateString();
|
||||
|
||||
$filters[] = ['deposit_date', '>', $start_date_search];
|
||||
$filters[] = ['deposit_date', '<', $end_date_search];
|
||||
}
|
||||
} else {
|
||||
$filters[] = ['deposit_date', '=', Carbon::now()->toDateString()];
|
||||
}
|
||||
|
||||
if (isset($request->patient_number)) {
|
||||
$filters[] = ['patient_id', '=', get_name($request->patient_number, 'number', 'id', 'patients')];
|
||||
}
|
||||
|
||||
if (isset($request->user_id)) {
|
||||
$filters[] = ['created_by', '=', $request->user_id];
|
||||
}
|
||||
|
||||
$patient_numbers = DB::table('patients')->orderBy('number')->distinct()->pluck('number');
|
||||
|
||||
$patient_deposits = PatientAccountsDeposit::where($filters)->get();
|
||||
|
||||
return view('patient_discounts::patient_accounts.deposits_report', compact('patient_deposits', 'reg_date', 'start_date', 'end_date', 'patient_numbers'));
|
||||
}
|
||||
|
||||
public function view_details($id) {
|
||||
session()->put(['patient_id' => $id]);
|
||||
|
||||
return redirect('/patient_accounts/statement');
|
||||
}
|
||||
|
||||
public function cancel_deposit($id) {
|
||||
$deposit = PatientAccountsDeposit::find($id);
|
||||
$receipt_number = $deposit->receipt_number;
|
||||
$patient_id = $deposit->patient_id;
|
||||
$deposit_amount = $deposit->deposit_amount;
|
||||
|
||||
if ($deposit->delete()) {
|
||||
$patient_account_balance_id = get_name("patient_account_balance", "slug", "id", "chart_of_accounts");
|
||||
if (is_numeric($patient_account_balance_id)) {
|
||||
// decrease the balance on chart of accounts called "patient account deposit"
|
||||
$chart_of_account = ChartOfAccount::find($patient_account_balance_id);
|
||||
$chart_of_account->balance = (int)$chart_of_account->balance - (int)$deposit_amount;
|
||||
$chart_of_account->update();
|
||||
} else {
|
||||
flash('A chart of accounts is missing. Please contact Stre@mline support immediately!')->error();
|
||||
}
|
||||
|
||||
record_cash_debits_to_daily_collection_account($deposit_amount, $receipt_number, 'Cancel Patient Account Deposit');
|
||||
|
||||
// reduce the patient's current balance by deleted amount
|
||||
$patient_to_update = Patient::find($patient_id);
|
||||
$patient_to_update->patient_account_balance = $patient_to_update->patient_account_balance - $deposit_amount;
|
||||
$patient_to_update->update();
|
||||
|
||||
// delete the patient payment methods
|
||||
DB::table('payment_methods_transactions')
|
||||
->where('receipt_number', $receipt_number)
|
||||
->delete();
|
||||
|
||||
flash("Patient account deposit of " . $deposit_amount . " has been cancelled")->success();
|
||||
|
||||
} else {
|
||||
flash("Patient account deposit of " . $deposit_amount . " has not been cancelled")->error();
|
||||
}
|
||||
|
||||
return redirect('/patient_accounts/deposits_report');
|
||||
}
|
||||
|
||||
public function refunds_report(Request $request) {
|
||||
$search_by = $request->search_by;
|
||||
$reg_date = $request->reg_date;
|
||||
$start_date = $request->start_date;
|
||||
$end_date = $request->end_date;
|
||||
$filters = [];
|
||||
|
||||
if (!is_null($search_by)){
|
||||
if($search_by == "0"){
|
||||
// last 24 hours
|
||||
$last_day = Carbon::now()->subDay();
|
||||
array_push($filters, ['refund_date', '>', $last_day]);
|
||||
} elseif($search_by == "1"){
|
||||
// custom date
|
||||
$start_date_search = Carbon::parse($reg_date)->toDateString();
|
||||
array_push($filters, ['refund_date', '=', $start_date_search]);
|
||||
} elseif($search_by == "2"){
|
||||
// custom date range
|
||||
if ($start_date == $end_date) {
|
||||
$start_date_search = Carbon::parse($start_date)->startOfDay()->toDateString();
|
||||
|
||||
array_push($filters, ['refund_date', '=', $start_date_search]);
|
||||
} else {
|
||||
$start_date_search = Carbon::parse($start_date)->startOfDay()->toDateString();
|
||||
$end_date_search = Carbon::parse($end_date)->endOfDay()->toDateString();
|
||||
|
||||
array_push($filters, ['refund_date', '>', $start_date_search]);
|
||||
array_push($filters, ['refund_date', '<', $end_date_search]);
|
||||
}
|
||||
} else {
|
||||
$start_date_search = Carbon::now()->startOfDay()->toDateString();
|
||||
$end_date_search = Carbon::now()->endOfDay()->toDateString();
|
||||
|
||||
array_push($filters, ['refund_date', '>', $start_date_search]);
|
||||
array_push($filters, ['refund_date', '<', $end_date_search]);
|
||||
}
|
||||
} else {
|
||||
$start_date_search = Carbon::now()->startOfDay()->toDateString();
|
||||
$end_date_search = Carbon::now()->endOfDay()->toDateString();
|
||||
|
||||
array_push($filters, ['refund_date', '>', $start_date_search]);
|
||||
array_push($filters, ['refund_date', '<', $end_date_search]);
|
||||
}
|
||||
|
||||
if (isset($request->patient_number)) {
|
||||
array_push($filters, ['patient_id', '=', get_name($request->patient_number, 'number', 'id', 'patients')]);
|
||||
}
|
||||
|
||||
$patient_numbers = DB::table('patients')->orderBy('number')->distinct()->pluck('number');
|
||||
|
||||
$patient_refunds = PatientAccountsRefund::where($filters)->get();
|
||||
|
||||
return view('patient_discounts::patient_accounts.refunds_report', compact('patient_refunds', 'reg_date', 'start_date', 'end_date', 'patient_numbers'));
|
||||
}
|
||||
|
||||
public function cancel_refund($id) {
|
||||
$refund = PatientAccountsRefund::find($id);
|
||||
$refund_amount = $refund->refund_amount;
|
||||
$account_id = $refund->account_id;
|
||||
|
||||
$track_receipts = new TrackReceipt;
|
||||
$track_receipts->created_by = Auth::id();
|
||||
$track_receipts->reason = 'Patient Accounts Refund';
|
||||
$track_receipts->save();
|
||||
$receipt_number = sprintf("%04u", $track_receipts->id);
|
||||
|
||||
if ($refund->delete()) {
|
||||
// decrease the balance on select account
|
||||
$chart_of_account = ChartOfAccount::find($account_id);
|
||||
$chart_of_account->balance = $chart_of_account->balance + (int)$refund_amount;
|
||||
$chart_of_account->update();
|
||||
|
||||
$account_balance_record_on_expense_date = get_latest_banking_record_based_on_transaction_date($account_id, date('Y-m-d'));
|
||||
$account_balance_on_expense_date_after_payment = ($account_balance_record_on_expense_date ? (int)$account_balance_record_on_expense_date->account_balance : 0) + $refund_amount;
|
||||
$last_insert_id = capture_bank_record('Patient Account Refunds Cancellation', date('Y-m-d'), $account_id, 0,
|
||||
$account_balance_on_expense_date_after_payment, $refund_amount, 0, 'Patient Account Refunds Cancellation', $receipt_number);
|
||||
|
||||
update_banking_record_balances(date('Y-m-d'), $account_id, $last_insert_id, $account_balance_on_expense_date_after_payment);
|
||||
|
||||
$patient_account_balance_id = get_name("patient_account_balance", "slug", "id", "chart_of_accounts");
|
||||
if (is_numeric($patient_account_balance_id)) {
|
||||
// increase the balance on chart of accounts called "patient account deposit"
|
||||
$chart_of_account = ChartOfAccount::find($patient_account_balance_id);
|
||||
$chart_of_account->balance = (int)$chart_of_account->balance + (int)$refund_amount;
|
||||
$chart_of_account->update();
|
||||
} else {
|
||||
flash('A chart of accounts is missing. Please contact Stre@mline support immediately!')->error();
|
||||
}
|
||||
|
||||
flash("Patient account refund of " . $refund_amount . " has been cancelled")->success();
|
||||
|
||||
} else {
|
||||
flash("Patient account refund of " . $refund_amount . " has not been cancelled")->error();
|
||||
}
|
||||
|
||||
return redirect('/patient_accounts/refunds_report');
|
||||
}
|
||||
|
||||
public function consumptions_report(Request $request) {
|
||||
$search_by = $request->search_by;
|
||||
$reg_date = $request->reg_date;
|
||||
$start_date = $request->start_date;
|
||||
$end_date = $request->end_date;
|
||||
$filters = [];
|
||||
|
||||
if (!is_null($search_by)){
|
||||
if($search_by == "0"){
|
||||
// last 24 hours
|
||||
$last_day = Carbon::now()->subDay();
|
||||
array_push($filters, ['created_at', '>', $last_day]);
|
||||
} elseif($search_by == "1"){
|
||||
// custom date
|
||||
$start_date_search = Carbon::parse($reg_date)->toDateTimeString();
|
||||
array_push($filters, ['created_at', '=', $start_date_search]);
|
||||
} elseif($search_by == "2"){
|
||||
// custom date range
|
||||
$start_date_search = Carbon::parse($start_date)->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::parse($end_date)->endOfDay()->toDateTimeString();
|
||||
|
||||
array_push($filters, ['created_at', '>', $start_date_search]);
|
||||
array_push($filters, ['created_at', '<', $end_date_search]);
|
||||
} else {
|
||||
$start_date_search = Carbon::now()->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::now()->endOfDay()->toDateTimeString();
|
||||
|
||||
array_push($filters, ['created_at', '>', $start_date_search]);
|
||||
array_push($filters, ['created_at', '<', $end_date_search]);
|
||||
}
|
||||
} else {
|
||||
$start_date_search = Carbon::now()->startOfDay()->toDateTimeString();
|
||||
$end_date_search = Carbon::now()->endOfDay()->toDateTimeString();
|
||||
|
||||
array_push($filters, ['created_at', '>', $start_date_search]);
|
||||
array_push($filters, ['created_at', '<', $end_date_search]);
|
||||
}
|
||||
|
||||
if (isset($request->patient_number)) {
|
||||
array_push($filters, ['patient_id', '=', get_name($request->patient_number, 'number', 'id', 'patients')]);
|
||||
}
|
||||
|
||||
$patient_numbers = DB::table('patients')->orderBy('number')->distinct()->pluck('number');
|
||||
|
||||
$patient_consumptions = PatientAccountConsumption::where($filters)->get();
|
||||
|
||||
return view('patient_discounts::patient_accounts.consumptions_report', compact('patient_consumptions', 'reg_date', 'start_date', 'end_date', 'patient_numbers'));
|
||||
}
|
||||
}
|
||||
+364
@@ -0,0 +1,364 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PatientDiscounts\Http\Controllers;
|
||||
|
||||
use Barryvdh\Snappy\Facades\SnappyPdf;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\PatientFinance\Http\Controllers\PatientFinanceController;
|
||||
use Streamline\Models\ChartOfAccount;
|
||||
use Streamline\Models\Debtor;
|
||||
use Streamline\Models\DebtorPayment;
|
||||
use Streamline\Models\DebtPlan;
|
||||
use Streamline\Models\DebtPlanPaymentStaff;
|
||||
use Streamline\Models\HospitalInformation;
|
||||
use Streamline\Models\Patient;
|
||||
use Streamline\Models\PatientPaymentMethod;
|
||||
use Streamline\Models\Payment;
|
||||
use Streamline\Models\User;
|
||||
use Streamline\Services\PatientDiscounts\DebtorsService;
|
||||
use Streamline\Services\PatientDiscounts\DebtPlanService;
|
||||
use Streamline\Services\ReceiptService;
|
||||
use Streamline\Services\UserService;
|
||||
|
||||
class PatientDebtorsController extends Controller {
|
||||
public function __construct(
|
||||
protected ReceiptService $receiptService,
|
||||
protected DebtorsService $debtorsService,
|
||||
protected DebtPlanService $debtPlanService,
|
||||
protected UserService $userService
|
||||
) {}
|
||||
|
||||
public function receive_debtor_payment($string): View {
|
||||
$string_array = explode(",", $string);
|
||||
$debts = DB::table('debtors')->where('id', $string_array[0])->first();
|
||||
|
||||
$debt_payments = DB::table('debtor_payments')->whereNull('deleted_at')
|
||||
->where('debt_id', $string_array[0])->get();
|
||||
|
||||
$patient_payment_methods = PatientPaymentMethod::pluck('name', 'id');
|
||||
$patient_payment_methods_options = "";
|
||||
foreach ($patient_payment_methods as $key => $value) {
|
||||
$patient_payment_methods_options .= '<option value="' . $key . '">' . $value . '</option>';
|
||||
}
|
||||
|
||||
$expense_accounts = ChartOfAccount::where('type', 2)->pluck('name', 'id')->prepend('-select-', '')->toArray();
|
||||
|
||||
return view('patient_discounts::patient_debtors.receive_debtor_payment', compact('debts', 'debt_payments', 'patient_payment_methods_options', 'expense_accounts'));
|
||||
}
|
||||
|
||||
public function write_off_debts(Request $request): string {
|
||||
$new_receipt_number = $this->receiptService->createReceipt("Debt Plan Payment Update");
|
||||
|
||||
$balance = $request->amount_owed - $request->amount;
|
||||
$debtorPayment = $this->debtorsService->createDebtorPayment($request->debt_id, $new_receipt_number, $request->amount, Carbon::today()->toDateString(),
|
||||
$balance, '', $request->amount);
|
||||
|
||||
if ($debtorPayment) {
|
||||
$this->debtorsService->clearDebt($request->debt_id);
|
||||
$message = "Payment Received Successfully";
|
||||
} else {
|
||||
$message = "Payment Not Received";
|
||||
}
|
||||
|
||||
$payment = new Payment;
|
||||
$payment->item_id = "";
|
||||
$payment->vendor = "N/A";
|
||||
$payment->unit_cost = $request->amount;
|
||||
$payment->amount = $request->amount;
|
||||
$payment->quantity = 1;
|
||||
$payment->memo = $request->write_off_memo ?? "N/A";
|
||||
$payment->account_balance = 0;
|
||||
$payment->transaction_id = $new_receipt_number;
|
||||
$payment->account_id = 0;
|
||||
$payment->created_by = Auth::id();
|
||||
$payment->expense_date = now();
|
||||
$payment->expense_account = $request->expense_account;
|
||||
|
||||
$payment->save();
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
public function process_debtor_payment(Request $request): View|RedirectResponse
|
||||
{
|
||||
$new_receipt_number = $this->receiptService->createReceipt('Debtor Payment');
|
||||
$patient_id = $request->patient_id;
|
||||
|
||||
$debtorPayment = $this->debtorsService->createDebtorPayment($request->debt_id, $new_receipt_number, $request->amount_paid, $request->date,
|
||||
$request->balance, $request->comment, 0);
|
||||
|
||||
if ($debtorPayment) {
|
||||
$this->debtorsService->clearDebt($request->debt_id);
|
||||
record_cash_credits_to_daily_collection_account($request->amount_paid, $new_receipt_number, 'Patient Debt Payment');
|
||||
flash("Payment Received Successfully")->success();
|
||||
} else {
|
||||
flash("Payment Not Received")->error();
|
||||
return back();
|
||||
}
|
||||
|
||||
$return_payment_methods = PatientFinanceController::register_payment_method($patient_id, 0, $request->original_cash_to_pay,
|
||||
$request->payment_method, $request->payment_methods_amount, array_fill(0, count($request->payment_methods_amount ?? []), null), array_fill(0, count($request->payment_methods_amount ?? []), 0), $new_receipt_number, 13, Auth::id(), 0);
|
||||
|
||||
return $this->debtorPaymentReceipt($request, $new_receipt_number, $return_payment_methods);
|
||||
}
|
||||
|
||||
public function debtorPaymentReceipt(Request $request, $new_receipt_number, $payment_methods): View
|
||||
{
|
||||
$patient = Patient::where(['id' => $request->patient_id])->first();
|
||||
$hospital_information = HospitalInformation::first();
|
||||
$compact_values = compact('hospital_information', 'request', 'new_receipt_number', 'patient', 'payment_methods');
|
||||
|
||||
return view('patient_discounts::patient_debtors.debtor_payment', $compact_values);
|
||||
}
|
||||
|
||||
public function history_debtor_payments($debtor_id): View
|
||||
{
|
||||
$hospital_information = HospitalInformation::first();
|
||||
$payments = DebtorPayment::where('debt_id', $debtor_id)->get();
|
||||
$debtor = Debtor::where('id', $debtor_id)->first();
|
||||
$patient_id = $debtor->patient_id;
|
||||
return view('patient_discounts::patient_debtors.history_debtor_payments', compact('payments', 'hospital_information', 'patient_id', 'debtor_id'));
|
||||
}
|
||||
|
||||
public function reverse_debtor_payment($payment_id): RedirectResponse
|
||||
{
|
||||
$payment = DebtorPayment::find($payment_id);
|
||||
|
||||
$amount_being_removed = $payment->amount_paid;
|
||||
$receipt_number = $payment->receipt_number;
|
||||
|
||||
$this->debtorsService->reverseDebtPayment($payment_id);
|
||||
|
||||
// reverse any patient payment methods
|
||||
DB::table('payment_methods_transactions')
|
||||
->where('receipt_number', $receipt_number)
|
||||
->delete();
|
||||
|
||||
record_cash_debits_to_daily_collection_account($amount_being_removed, $this->receiptService->createReceipt('N/A'), "Patient Debt Payment Cancellation");
|
||||
|
||||
return redirect('patient_debtors/debtors');
|
||||
}
|
||||
|
||||
public function print_debtor_receipt_pdf_details(Request $request)
|
||||
{
|
||||
$hospital_information = HospitalInformation::find(1);
|
||||
|
||||
$data = [
|
||||
'hospital_information' => $hospital_information,
|
||||
'comment' => $request->comment,
|
||||
'amount_owed' => $request->amount_owed,
|
||||
'amount_paid' => $request->amount_paid,
|
||||
'balance' => $request->balance,
|
||||
'payment_methods' => unserialize($request->payment_methods),
|
||||
'receipt_number' => $request->receipt_number,
|
||||
'patient_id' => $request->patient_id
|
||||
];
|
||||
|
||||
$pdf = SnappyPDF::loadView("patient_discounts::patient_debtors.print_debtor_receipt_pdf_details", $data)
|
||||
->setOrientation('portrait')
|
||||
->setPaper('a4')
|
||||
->setOption('margin-bottom', 5)
|
||||
->setOption('margin-top', 5)
|
||||
->setOption('footer-html', '<i>© ' . date('Y') . ' Stre@mline</i>');
|
||||
|
||||
return $pdf->inline('Patient Receipt' . date(" d-m-y h:ia") . '.pdf');
|
||||
}
|
||||
|
||||
public function reprint_debtor_receipt_pdf_details(Request $request)
|
||||
{
|
||||
$hospital_information = HospitalInformation::find(1);
|
||||
|
||||
if (isset($request->is_single_print) && is_numeric($request->is_single_print) && $request->is_single_print > 0) {
|
||||
$debt_payments = DebtorPayment::where('id', $request->is_single_print)->get();
|
||||
} else {
|
||||
$debt_payments = DebtorPayment::where('debt_id', $request->debt_id)->get();
|
||||
}
|
||||
|
||||
$data = [
|
||||
'hospital_information' => $hospital_information,
|
||||
'debt_payments' => $debt_payments,
|
||||
'patient_id' => $request->patient_id,
|
||||
];
|
||||
|
||||
$pdf = SnappyPDF::loadView("patient_discounts::patient_debtors.reprint_debtor_receipt_pdf_details", $data)
|
||||
->setOrientation('portrait')
|
||||
->setPaper('a4')
|
||||
->setOption('margin-bottom', 5)
|
||||
->setOption('margin-top', 5)
|
||||
->setOption('footer-html', '<i>© ' . date('Y') . ' Stre@mline</i>');
|
||||
|
||||
return $pdf->inline('Patient Receipt' . date(" d-m-y h:ia") . '.pdf');
|
||||
}
|
||||
|
||||
public function debtors(Request $request) {
|
||||
$users = User::get();
|
||||
$debtors = queryDateFilter('debtors', $request);
|
||||
$display = dateLabelSetter($request);
|
||||
|
||||
return view('patient_discounts::patient_debtors.debtorsReport', compact('debtors', 'display', 'users'));
|
||||
}
|
||||
|
||||
public function debtors_patient_search($patient_id) {
|
||||
$users = User::get();
|
||||
|
||||
$debtors = DB::table('debtors')
|
||||
->where('patient_id', $patient_id)
|
||||
->whereNull('deleted_at')
|
||||
->get();
|
||||
|
||||
$display = "Showing debt records for " . get_full_name($patient_id, 'id', 'first_name', 'last_name', 'patients')
|
||||
. " (" . get_name($patient_id, 'id', 'number', 'patients') . ")";
|
||||
|
||||
return view('patient_discounts::patient_debtors.debtorsReport', compact('debtors', 'display', 'users'));
|
||||
}
|
||||
|
||||
public function receive_debt_plan_payment_staff(Request $request) {
|
||||
$debts = DB::table('debt_plan')->where('id', $request->debt_plan_id)->groupBy('staff_guarantor')->first();
|
||||
$debt_with_balances = DB::table('debt_plan_payment_staffs')->where('debt_plan_id', $request->debt_plan_id)->get();
|
||||
$expense_accounts = ChartOfAccount::where('type', 2)->pluck('name', 'id')->prepend('-select-', '')->toArray();
|
||||
$users_array = $this->userService->pluckUserFullName();
|
||||
|
||||
return view('patient_discounts::patient_debtors.debt_plan_payments_staff', compact('debts', 'debt_with_balances',
|
||||
'request', 'expense_accounts', 'users_array'));
|
||||
}
|
||||
|
||||
public function process_debt_plan_payment_staff(Request $request) {
|
||||
$new_receipt_number = $this->receiptService->createReceipt('Debt Plan');
|
||||
|
||||
$payment = $this->debtPlanService->createDebtPlanPayment(
|
||||
$request->amount_paid, $request->balance, $request->payment_id,
|
||||
$request->comment, $new_receipt_number, $request->date
|
||||
);
|
||||
|
||||
if ($payment) {
|
||||
record_cash_credits_to_daily_collection_account($request->amount_paid, $new_receipt_number, 'Debt Plan Payment');
|
||||
$this->debtPlanService->clearDebtPlan($request->payment_id, $request->amount_paid);
|
||||
flash("Payment Received Successfully")->success();
|
||||
return $this->debtPlanPaymentReceipt($request, $new_receipt_number);
|
||||
} else {
|
||||
flash("Payment Not Received")->error();
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
||||
|
||||
public function debtPlanPaymentReceipt(Request $request, $new_receipt_number)
|
||||
{
|
||||
$patient = Patient::where(['id' => $request->patient_id])->first();
|
||||
$hospital_information = HospitalInformation::first();
|
||||
$compact_values = compact('hospital_information', 'request', 'new_receipt_number', 'patient');
|
||||
|
||||
return view('patient_discounts::patient_debtors.debt_plan_payment', $compact_values);
|
||||
}
|
||||
|
||||
public function write_off_debt_plan(Request $request): string
|
||||
{
|
||||
$receipt_number = $this->receiptService->createReceipt("Patient Debt Plan Write Off");
|
||||
$today = Carbon::today()->toDateTimeString();
|
||||
|
||||
$payment = $this->debtPlanService->createDebtPlanPayment(
|
||||
$request->amount, ($request->amount_owed - $request->amount), $request->payment_id,
|
||||
$request->comment, $receipt_number, $today, $request->amount,
|
||||
);
|
||||
|
||||
if ($payment) {
|
||||
$message = "Payment Received Successfully";
|
||||
$this->debtPlanService->clearDebtPlan($request->payment_id, $request->amount);
|
||||
|
||||
$payment = new Payment;
|
||||
$payment->item_id = "";
|
||||
$payment->vendor = "N/A";
|
||||
$payment->unit_cost = $request->amount;
|
||||
$payment->amount = $request->amount;
|
||||
$payment->quantity = 1;
|
||||
$payment->memo = $request->write_off_memo ?? "N/A";
|
||||
$payment->account_balance = 0;
|
||||
$payment->transaction_id = $receipt_number;
|
||||
$payment->account_id = 0;
|
||||
$payment->created_by = Auth::id();
|
||||
$payment->expense_date = now();
|
||||
$payment->expense_account = $request->expense_account;
|
||||
$payment->save();
|
||||
} else {
|
||||
$message = "Payment Not Received";
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
public function debt_plan_payment($id)
|
||||
{
|
||||
$payment = DebtPlanPaymentStaff::where(['id' => $id])->first();
|
||||
$hospital_information = HospitalInformation::first();
|
||||
$compact_values = compact('hospital_information', 'payment');
|
||||
|
||||
return view('patient_discounts::patient_debtors.debt_plan_payment_detail', $compact_values);
|
||||
}
|
||||
|
||||
public function debt_plan_receipt(Request $request)
|
||||
{
|
||||
$hospital_information = HospitalInformation::first();
|
||||
$patient = Patient::where(['id' => $request->patient_id])->first();
|
||||
$debt_plan = DB::table('debt_plan')->where('id', $request->debt_plan_id)->first();
|
||||
return view('patient_discounts::patient_debtors.patient_debt_plan', compact('debt_plan', 'hospital_information', 'patient'));
|
||||
}
|
||||
|
||||
public function staff_guarantors(Request $request)
|
||||
{
|
||||
$users = DB::table('users')->get()->toArray();
|
||||
$start = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
|
||||
$end = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
|
||||
|
||||
if ($request->staff_member == "ALL STAFF") {
|
||||
$debts = DB::table('debt_plan')->whereBetween('created_at', [$start, $end])->get()->toArray();
|
||||
} else {
|
||||
$debts = DB::table('debt_plan')
|
||||
->where('staff_guarantor', $request->staff_member)->whereBetween('created_at', [$start, $end])->get()->toArray();
|
||||
}
|
||||
|
||||
$display = dateLabelSetter($request);
|
||||
return view('patient_discounts::patient_debtors.staffGuarantors', compact('users', 'debts', 'display', 'request'));
|
||||
}
|
||||
|
||||
public function debt_plan_patient_search($patient_id) {
|
||||
$users = DB::table('users')->get()->toArray();
|
||||
|
||||
$debts = DebtPlan::where('patient_id', $patient_id)->get();
|
||||
|
||||
$display = "Showing debt plan records of " . get_full_name($patient_id, 'id', 'first_name', 'last_name', 'patients')
|
||||
. " (" . get_name($patient_id, 'id', 'number', 'patients') . ")";
|
||||
|
||||
return view('patient_discounts::patient_debtors.staffGuarantors', compact('users', 'debts', 'display'));
|
||||
}
|
||||
|
||||
public function debt_plan_guarantor_agreement($id) {
|
||||
$debt_plan = DebtPlan::find($id);
|
||||
|
||||
if ($debt_plan) {
|
||||
// just get the first person for now but would be better to list all as well as the dates
|
||||
$user_id = explode(",", $debt_plan->staff_guarantor)[0];
|
||||
|
||||
if ($debt_plan->guarantor_type == 0) {
|
||||
$guarantor_name = get_full_name($user_id, 'id', 'first_name', 'last_name', 'non_staff_guarantors');
|
||||
} else {
|
||||
$guarantor_name = get_full_name($user_id, 'id', 'first_name', 'last_name', 'users');
|
||||
}
|
||||
|
||||
$amount_to_pay = $debt_plan->staff_guarantor_to_pay;
|
||||
$amount_owed = $debt_plan->amount_owed;
|
||||
$patient_names = get_full_name($debt_plan->patient_id, 'id', 'first_name', 'last_name', 'patients');
|
||||
$payment_date = $debt_plan->first_installment_date;
|
||||
$arrangement = $debt_plan->debt_plan_arrangement;
|
||||
|
||||
return view('patient_discounts::patient_debtors.debt_plan_guarantor_agreement', compact('amount_to_pay', 'patient_names', 'payment_date', 'arrangement', 'guarantor_name', 'amount_owed'));
|
||||
} else {
|
||||
return redirect('home');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+1048
File diff suppressed because it is too large
Load Diff
+113
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PatientDiscounts\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\PatientDiscounts\Providers\RouteServiceProvider;
|
||||
|
||||
class PatientDiscountsServiceProvider extends ServiceProvider{
|
||||
/**
|
||||
* @var string $moduleName
|
||||
*/
|
||||
protected $moduleName = 'PatientDiscounts';
|
||||
|
||||
/**
|
||||
* @var string $moduleNameLower
|
||||
*/
|
||||
protected $moduleNameLower = 'patient_discounts';
|
||||
|
||||
/**
|
||||
* Boot the application events.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerConfig()
|
||||
{
|
||||
$this->publishes([
|
||||
module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'),
|
||||
], 'config');
|
||||
$this->mergeConfigFrom(
|
||||
module_path($this->moduleName, 'Config/config.php'), $this->moduleNameLower
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register views.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerViews()
|
||||
{
|
||||
$viewPath = resource_path('views/modules/' . $this->moduleNameLower);
|
||||
|
||||
$sourcePath = module_path($this->moduleName, 'Resources/views');
|
||||
|
||||
$this->publishes([
|
||||
$sourcePath => $viewPath
|
||||
], ['views', $this->moduleNameLower . '-module-views']);
|
||||
|
||||
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register translations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerTranslations()
|
||||
{
|
||||
$langPath = resource_path('lang/modules/' . $this->moduleNameLower);
|
||||
|
||||
if (is_dir($langPath)) {
|
||||
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom($langPath);
|
||||
} else {
|
||||
$this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'Resources/lang'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function getPublishableViewPaths(): array
|
||||
{
|
||||
$paths = [];
|
||||
foreach (\Config::get('view.paths') as $path) {
|
||||
if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
|
||||
$paths[] = $path . '/modules/' . $this->moduleNameLower;
|
||||
}
|
||||
}
|
||||
return $paths;
|
||||
}
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PatientDiscounts\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* This namespace is applied to your controller routes.
|
||||
*
|
||||
* In addition, it is set as the URL generator's root namespace.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $namespace = 'Modules\PatientDiscounts\Http\Controllers';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map()
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
$this->mapWebRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapWebRoutes()
|
||||
{
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(module_path('PatientDiscounts', '/Routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapApiRoutes()
|
||||
{
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(module_path('PatientDiscounts', '/Routes/api.php'));
|
||||
}
|
||||
}
|
||||
Executable
+120
@@ -0,0 +1,120 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('discount_categories.discount_category') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('discount_categories.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('discount_categories.finance_home') }}</a></li>
|
||||
<li><a href="{{ route('discount_category.index') }}"><i class="fa fa-eye"></i> {{ __('discount_categories.view_discount_categories') }}</a></li>
|
||||
<li class="active"><i class="fa fa-plus"></i> {{ __('discount_categories.new_discount_category') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
{{ Form::open(['method'=>'post','route'=>'discount_category.store']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('patient_category', __('discount_categories.patient_category')) }}
|
||||
{{ Form::select('patient_category', $categories, '', ['class' => 'form-control col-sm-12 compulsory']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('donor',__('discount_categories.donor_amount')) }}
|
||||
{{ Form::select('donor', $donors, '', ['class' => 'form-control col-sm-12 compulsory']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('discount_name',__('discount_categories.discount_name')) }}
|
||||
{{ Form::text('discount_name','',['class' => 'form-control compulsory']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::radio('discount_type', 1, false, ["required",'class'=>'discount_type']) }} {{ __('discount_categories.fixed_figure') }}
|
||||
{{ Form::radio('discount_type', 2, false, ["required",'class'=>'discount_type']) }} {{ __('discount_categories.patient_ceiling') }}
|
||||
{{ Form::radio('discount_type', 3, false, ["required",'class'=>'discount_type']) }} {{ __('discount_categories.patient_top_up') }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div id="fixed_figure" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('donor_fixed_amount',__('discount_categories.donor_amount')) }}
|
||||
{{ Form::number('donor_fixed_amount','',['class' => 'form-control compulsory']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('patient_fixed_amount',__('discount_categories.patient_amount')) }}
|
||||
{{ Form::number('patient_fixed_amount','',['class' => 'form-control compulsory']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ceiling_figure" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('patient_ceiling',__('discount_categories.patient_amount')) }}
|
||||
{{ Form::number('patient_ceiling','',['class' => 'form-control compulsory']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="top_up" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('donor_top_up',__('discount_categories.donor_amount')) }}
|
||||
{{ Form::number('donor_top_up','',['class' => 'form-control compulsory']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ Form::submit(__('discount_categories.save'),['class'=>'btn btn-success'])}}
|
||||
{{ Form::reset(__('discount_categories.cancel'),['type'=>'reset','class'=>'btn btn-default'])}}
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$('.discount_type').change(function(){
|
||||
var discountType = $(this).val();
|
||||
if(discountType == 1){
|
||||
$('#ceiling_figure').hide();
|
||||
$('#fixed_figure').show();
|
||||
$('#top_up').hide();
|
||||
} else if(discountType == 2){
|
||||
$('#fixed_figure').hide();
|
||||
$('#ceiling_figure').show();
|
||||
$('#top_up').hide();
|
||||
} else if(discountType == 3){
|
||||
$('#fixed_figure').hide();
|
||||
$('#ceiling_figure').hide();
|
||||
$('#top_up').show();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Executable
+121
@@ -0,0 +1,121 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('discount_categories.edit_discount_category') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('discount_categories.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('discount_categories.finance_home') }}</a></li>
|
||||
<li><a href="{{ route('discount_category.index') }}"><i class="fa fa-eye"></i> {{ __('discount_categories.view_discount_categories') }}</a></li>
|
||||
<li class="active">{{ __('discount_categories.edit_discount_category') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
{{ Form::model($discount_category, ['method' => 'PUT', 'route' => ['discount_category.update',$discount_category], 'data-toggle' => 'validator']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('patient_category',__('discount_categories.patient_category')) }}
|
||||
{{ Form::select('patient_category', $categories, $discount_category->patient_category, ['class' => 'form-control col-sm-12 compulsory']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('donor',__('discount_categories.donor_amount')) }}
|
||||
{{ Form::select('donor', $donors, $discount_category->donor_id, ['class' => 'form-control col-sm-12 compulsory']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('discount_name',__('discount_categories.discount_name')) }}
|
||||
{{ Form::text('discount_name',$discount_category->name,['class' => 'form-control compulsory']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::radio('discount_type', 1, false, ["required",'class'=>'discount_type']) }} {{ __('discount_categories.fixed_figure') }}
|
||||
{{ Form::radio('discount_type', 2, false, ["required",'class'=>'discount_type']) }} {{ __('discount_categories.patient_ceiling') }}
|
||||
{{ Form::radio('discount_type', 3, false, ["required",'class'=>'discount_type']) }} {{ __('discount_categories.patient_top_up') }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div id="fixed_figure" style="<?php if($discount_category->discount_type != 1){echo 'display: none;';} ?>">
|
||||
<div class="form-group">
|
||||
{{ Form::label('donor_fixed_amount',__('discount_categories.donor_amount')) }}
|
||||
{{ Form::number('donor_fixed_amount',$discount_category->donor_amount,['class' => 'form-control compulsory']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('patient_fixed_amount',__('discount_categories.patient_amount')) }}
|
||||
{{ Form::number('patient_fixed_amount',$discount_category->patient_amount,['class' => 'form-control compulsory']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ceiling_figure" style="<?php if($discount_category->discount_type != 2){echo 'display: none;';} ?>">
|
||||
<div class="form-group">
|
||||
{{ Form::label('patient_ceiling',__('discount_categories.patient_amount')) }}
|
||||
{{ Form::number('patient_ceiling',$discount_category->patient_amount,['class' => 'form-control compulsory']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="top_up" style="<?php if($discount_category->discount_type != 3){echo 'display: none;';} ?>">
|
||||
<div class="form-group">
|
||||
{{ Form::label('donor_top_up',__('discount_categories.donor_amount')) }}
|
||||
{{ Form::number('donor_top_up',$discount_category->donor_amount,['class' => 'form-control compulsory']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ Form::submit(__('discount_categories.save'),['class'=>'btn btn-success'])}}
|
||||
{{ Form::reset(__('discount_categories.cancel'),['type'=>'reset','class'=>'btn btn-default'])}}
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$('.discount_type').change(function(){
|
||||
let discountType = $(this).val();
|
||||
|
||||
if(discountType == 1){
|
||||
$('#ceiling_figure').hide();
|
||||
$('#fixed_figure').show();
|
||||
$('#top_up').hide();
|
||||
} else if(discountType == 2){
|
||||
$('#fixed_figure').hide();
|
||||
$('#ceiling_figure').show();
|
||||
$('#top_up').hide();
|
||||
} else if(discountType == 3){
|
||||
$('#fixed_figure').hide();
|
||||
$('#ceiling_figure').hide();
|
||||
$('#top_up').show();
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('discount_categories.activate_discounts') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('discount_categories.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('discount_categories.finance_home') }}</a></li>
|
||||
<li><a href="{{ route('discount_category.index') }}"><i class="fa fa-eye"></i> {{ __('discount_categories.view_discount_categories') }}</a></li>
|
||||
<li class="active"><i class="fa fa-trash"></i> {{ __('discount_categories.inactive_discount_categories') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('discount_categories.discount_category') }}</th>
|
||||
<th>{{ __('discount_categories.donor') }}</th>
|
||||
<th>{{ __('discount_categories.patient_category') }}</th>
|
||||
<th>{{ __('discount_categories.discount_type') }}</th>
|
||||
<th>{{ __('discount_categories.discount_amount') }}</th>
|
||||
<th>{{ __('discount_categories.patient_amount') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($discount_categories) > 0)
|
||||
@foreach($discount_categories as $discount)
|
||||
<tr>
|
||||
<td>{{ $discount->name }}</td>
|
||||
<td>{{ $donors[$discount->donor_id] }}</td>
|
||||
<td>{{ $categories[$discount->patient_category] }}</td>
|
||||
@php
|
||||
$discount_type = "";
|
||||
if($discount->discount_type==1){
|
||||
$discount_type = "Fixed Figure";
|
||||
}
|
||||
else if($discount->discount_type==2){
|
||||
$discount_type = "Patient Ceiling";
|
||||
}
|
||||
else{
|
||||
$discount_type = "Patient Top-up";
|
||||
}
|
||||
@endphp
|
||||
<td>{{ $discount_type }}</td>
|
||||
<td>{{ ugandan_shillings($discount->donor_amount) }}</td>
|
||||
<td>{{ ugandan_shillings($discount->patient_amount) }}</td>
|
||||
<td>
|
||||
{{ Form::model($discount->id ,['method' => 'POST', 'route' => ['discount_category.activate', $discount->id]]) }}
|
||||
<button type="submit" class="btn btn-warning" onclick="return confirm('<?php echo __('discount_categories.are_you_sure')?>')"><i class="fa fa-check"></i> {{ __('discount_categories.activate') }}</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr class="warning"><td class="center" colspan="10">{{ __('discount_categories.no_records_found') }}</td></tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $discount_categories->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Executable
+85
@@ -0,0 +1,85 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('discount_categories.patient_category_discounts') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('discount_categories.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('discount_categories.finance_home') }}</a></li>
|
||||
<li><a href="{{ route('discount_category.index') }}"><i class="fa fa-eye"></i> {{ __('discount_categories.view_discount_categories') }}</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('discount_categories.discount_category') }}</th>
|
||||
<th>{{ __('discount_categories.donor') }}</th>
|
||||
<th>{{ __('discount_categories.patient_category') }}</th>
|
||||
<th>{{ __('discount_categories.discount_type') }}</th>
|
||||
<th>{{ __('discount_categories.discount_amount') }}</th>
|
||||
<th>{{ __('discount_categories.patient_amount') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($discount_categories) > 0)
|
||||
@foreach($discount_categories as $discount)
|
||||
<tr>
|
||||
<td>{{ $discount->name }}</td>
|
||||
<td>{{ $donors[$discount->donor_id] ?? "N/A" }}</td>
|
||||
<td>{{ $categories[$discount->patient_category] ?? "N/A" }}</td>
|
||||
@php
|
||||
$discount_type = "";
|
||||
if($discount->discount_type==1){
|
||||
$discount_type = "Fixed Figure";
|
||||
}
|
||||
else if($discount->discount_type==2){
|
||||
$discount_type = "Patient Ceiling";
|
||||
}
|
||||
else{
|
||||
$discount_type = "Patient Top-up";
|
||||
}
|
||||
@endphp
|
||||
<td>{{ $discount_type }}</td>
|
||||
<td>{{ ugandan_shillings($discount->donor_amount) }}</td>
|
||||
<td>{{ ugandan_shillings($discount->patient_amount) }}</td>
|
||||
<td>
|
||||
<a href="/discount_category/{{ $discount->id }}/edit/" class="btn btn-info btn-sm"><i class="fa fa-pencil"></i> {{ __('discount_categories.edit') }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::model($discount->id ,['method' => 'DELETE', 'route' => ['discount_category.destroy', $discount->id]]) }}
|
||||
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('<?php echo __('discount_categories.are_you_sure')?>')"><i class="fa fa-trash"></i> {{ __('discount_categories.delete') }}</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr class="warning"><td class="center" colspan="10">{{ __('discount_categories.no_records_found') }}</td></tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $discount_categories->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css"/>
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Add Dependants to Category Patient</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li><a href="{{ route('discounts.index') }}">Discounts</a></li>
|
||||
<li class="active">Add Dependants to Category Patient</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<h4> Add Dependants</h4>
|
||||
{{ Form::open(['method'=>'post','url' => 'store_dependants_to_category_patient']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<div class="form-group">
|
||||
{{ Form::label('patient_name', 'Patient Name:') }}
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
{{ Form::text('patient_name',$patient->first_name.' '.$patient->last_name,['class' => 'form-control', 'readonly']) }}
|
||||
{{ Form::hidden('patient_id',$patient->id,['class' => 'form-control']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('patient_category', 'Patient Category:') }}
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
{{ Form::text('patient_category', get_name($patient_category_id, "id", "name", "patient_categories"), ['class' => 'form-control', 'readonly']) }}
|
||||
{{ Form::hidden('patient_category_id', $patient_category_id, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$existing_dependants_record_collection = \Streamline\Models\CategoryPatientDependant::where('main_patient_id', $patient->id)->get();
|
||||
$existing_record = null;
|
||||
$dependants_array = [];
|
||||
if (count($existing_dependants_record_collection) > 0) {
|
||||
$existing_record = $existing_dependants_record_collection->first();
|
||||
$dependants_array = explode(",", $existing_record->dependant_patient_ids);
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('current_dependants', 'Current Dependants:') }}
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<ul>
|
||||
@for($i=0; $i < count($dependants_array); $i++)
|
||||
<li><a href="{{ url('patients/') }}/{{$dependants_array[$i]}}">{{ get_full_name($dependants_array[$i], "id", "first_name", "last_name", "patients") }}</a></li>
|
||||
@endfor
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('dependenants', 'Dependants') }}
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<select class="patient_name form-control" name="dependants[]" id="patient_name" multiple="true">
|
||||
@if (count($dependants_array) > 0)
|
||||
@for($i=0; $i < count($dependants_array); $i++)
|
||||
@if ($patient->id != $dependants_array[$i])
|
||||
<option value="{{$dependants_array[$i]}}" selected>{{ get_full_name($dependants_array[$i], "id", "first_name", "last_name", "patients") }}</option>
|
||||
@endif
|
||||
@endfor
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', 'Start Date') }}
|
||||
<div class="row">
|
||||
<div class="col-sm-10 input-group">
|
||||
{{ Form::text('start_date',(is_null($existing_record) || is_null($existing_record->start_date)) ? '' : \Carbon\Carbon::createFromFormat('Y-m-d', $existing_record->start_date)->format('d/m/Y'),['class' => 'form-control compulsory','readonly','id'=>'start_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4"></div>
|
||||
</div>
|
||||
|
||||
{{ Form::submit('Submit dependants', ['class' => 'btn btn-success']) }}
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#dependants').select2({
|
||||
minimumInputLength: 3,
|
||||
allowClear: true,
|
||||
placeholder: "Select dependants"
|
||||
});
|
||||
|
||||
$('.patient_name').select2({
|
||||
placeholder: "Search name",
|
||||
ajax: {
|
||||
url: '/search_dependant_name',
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
text: item.first_name + " " + item.last_name+ " - " + item.number+ " (" + item.phone + ")",
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#start_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd/mm/yyyy',
|
||||
endDate: new Date()
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+189
@@ -0,0 +1,189 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('discounts.patient_category_discounts') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('discounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('discounts.finance_home') }}</a></li>
|
||||
<li><a href="{{ route('discounts.index') }}"><i class="fa fa-eye"></i> {{ __('discounts.view_discounts') }}</a></li>
|
||||
<li class="active"><i class="fa fa-plus"></i> {{ __('discounts.new_discount') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
{{ Form::open(['method'=>'post','route'=>'discounts.store']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="patient_category">{{ __('discounts.patient_category') }}</label>
|
||||
{{ Form::select('patient_category', $categories, '', ['class' => 'form-control col-sm-12 compulsory']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="pay_late">{{ __('discounts.pay_later') }}</label>
|
||||
<br>
|
||||
{{ Form::radio('pay_later', 1, false, ["required", 'id' => 'pay_later_yes','onclick' => 'setOptions()']) }} Yes
|
||||
{{ Form::radio('pay_later', 0, false, ["required", 'id' => 'pay_later_no', 'onclick' => 'setOptions()']) }} No
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group discount_div" style="display: none;">
|
||||
<label for="co_payment">{{ __('discounts.co_payment') }}</label>
|
||||
<br>
|
||||
{{ Form::radio('co_payment', 1, false, ['id' => 'co_payment_yes','onclick' => 'setCoPaymentOptions()']) }} Yes
|
||||
{{ Form::radio('co_payment', 0, false, ['id' => 'co_payment_no','onclick' => 'setCoPaymentOptions()']) }} No
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="display: none;" id="co_payment_share">
|
||||
<label for="co_payment_share">{{ __('discounts.co_payment_share') }}</label>
|
||||
{{ Form::number('co_payment_share',0,['class' => 'form-control', 'max' => '100']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group threshold_radios_div" style="display: none;">
|
||||
{{ Form::label('is_pay_later_threshold_discount','Does a patient have threshold amount') }}
|
||||
<br>
|
||||
{{ Form::radio('is_pay_later_threshold_discount', 1, false, ['id' => 'is_pay_later_threshold_discount_yes', 'onclick' => 'displayOfDiscountThresholdDivs()']) }} Yes
|
||||
{{ Form::radio('is_pay_later_threshold_discount', 0, false, ['id' => 'is_pay_later_threshold_discount_no', 'onclick' => 'displayOfDiscountThresholdDivs()']) }} No
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="set_threshold_div" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('threshold_type','Threshold type') }}
|
||||
{{ Form::select('threshold_type', [''=>'--Select discount type','1'=>'Monthly threshold amount','2'=>'Yearly threshold amount'], '', ['class' => 'form-control compulsory', 'id' => 'threshold_type']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('threshold_amount','Threshold amount') }}
|
||||
{{ Form::number('threshold_amount', null, ['class' => 'form-control compulsory', 'id' => 'threshold_amount']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="discount">{{ __('discounts.discounts_percentage') }}</label>
|
||||
{{ Form::number('discount',0,['class' => 'form-control compulsory', 'max' => '100', 'min' => '0','onchange' => 'setDiscountPercentageOptions(this.value)']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="track_discount_div" style="display: none;">
|
||||
<label for="co_payment">Track Discounts</label>
|
||||
<br>
|
||||
{{ Form::radio('track_discounts', 1, false, ['id' => 'tracking_yes','onclick' => 'setTrackingOption()']) }} Yes
|
||||
{{ Form::radio('track_discounts', 0, false, ['id' => 'tracking_no','onclick' => 'setTrackingOption()']) }} No
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="display: none;" id="tracking_expense_account_div">
|
||||
<label for="tracking_expense_account">Expense Account</label>
|
||||
{{ Form::select('tracking_expense_account', $expense_accounts, null,['class' => 'form-control', 'id' => 'tracking_expense_account']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::submit('Save',['class'=>'btn btn-success'])}}
|
||||
{{ Form::reset('Cancel',['type'=>'reset','class'=>'btn btn-default'])}}
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function setOptions() {
|
||||
if (document.getElementById("pay_later_yes").checked) {
|
||||
$('.discount_div').show();
|
||||
$('.threshold_radios_div').show();
|
||||
$('#is_pay_later_threshold_discount_yes').attr('required', true);
|
||||
$('#is_pay_later_threshold_discount_no').attr('required', true);
|
||||
$('#co_payment_yes').attr('required', true);
|
||||
$('#co_payment_no').attr('required', true);
|
||||
}
|
||||
if (document.getElementById("pay_later_no").checked) {
|
||||
$('.discount_div').hide();
|
||||
$('.threshold_radios_div').hide();
|
||||
$('#is_pay_later_threshold_discount_yes').attr('required', false);
|
||||
$('#is_pay_later_threshold_discount_no').attr('required', false);
|
||||
$('#co_payment_yes').attr('required', false);
|
||||
$('#co_payment_no').attr('required', false);
|
||||
}
|
||||
}
|
||||
|
||||
function setCoPaymentOptions() {
|
||||
if (document.getElementById("co_payment_yes").checked) {
|
||||
$('#co_payment_share').show();
|
||||
}
|
||||
if (document.getElementById("co_payment_no").checked) {
|
||||
$('#co_payment_share').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function setTrackingOption() {
|
||||
if (document.getElementById("tracking_yes").checked) {
|
||||
$('#tracking_expense_account_div').show();
|
||||
$('#tracking_expense_account').attr('required', true);
|
||||
}
|
||||
if (document.getElementById("tracking_no").checked) {
|
||||
$('#tracking_expense_account_div').hide();
|
||||
$('#tracking_expense_account').attr('required', false);
|
||||
}
|
||||
}
|
||||
|
||||
function displayOfDiscountThresholdDivs() {
|
||||
if (document.getElementById("is_pay_later_threshold_discount_yes").checked) {
|
||||
$('.set_threshold_div').show();
|
||||
$('#threshold_type').attr('required', true);
|
||||
$('#threshold_amount').attr('required', true);
|
||||
}
|
||||
if (document.getElementById("is_pay_later_threshold_discount_no").checked) {
|
||||
$('.set_threshold_div').hide();
|
||||
$('#threshold_type').attr('required', false);
|
||||
$('#threshold_amount').attr('required', false);
|
||||
}
|
||||
}
|
||||
|
||||
function setDiscountOption() {
|
||||
var selector = document.getElementById('threshold_type');
|
||||
var discountTypeValue = selector[selector.selectedIndex].value;
|
||||
|
||||
if (discountTypeValue == 1) {
|
||||
$('.discount_amount').hide();
|
||||
}
|
||||
|
||||
if (discountTypeValue == 2) {
|
||||
$('.discount_amount').show();
|
||||
}
|
||||
}
|
||||
|
||||
function setDiscountPercentageOptions(percentage) {
|
||||
if (percentage > 0) {
|
||||
$('#track_discount_div').show();
|
||||
$('#tracking_yes').attr('required', true);
|
||||
$('#tracking_no').attr('required', true);
|
||||
} else {
|
||||
$('#track_discount_div').hide();
|
||||
$('#tracking_yes').attr('required', false);
|
||||
$('#tracking_no').attr('required', false);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('discounts.patient_category_discounts') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('discounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('discounts.finance_home') }}</a></li>
|
||||
<li><a href="{{ route('discounts.index') }}"><i class="fa fa-eye"></i> {{ __('discounts.view_discounts') }}</a></li>
|
||||
<li class="active"><i class="fa fa-pencil"></i> {{ __('discounts.edit_discount') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
{{ Form::model($discount, ['method' => 'PUT', 'route' => ['discounts.update',$discount], 'data-toggle' => 'validator']) }}
|
||||
|
||||
{{ Form::hidden('id', $id) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="patient_category">{{ __('discounts.patient_category') }}</label>
|
||||
{{ Form::text('patient_category_text', $categories[$discount->patient_category] ?? 'Category Deleted', ['class' => 'form-control col-sm-12', 'readonly']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="pay_late">{{ __('discounts.pay_later') }}</label>
|
||||
<br>
|
||||
{{ Form::radio('pay_later', 1, $discount->pay_later == 1, ["required", 'id' => 'pay_later_yes','onclick' => 'setOptions()']) }} Yes
|
||||
{{ Form::radio('pay_later', 0, $discount->pay_later == 0, ["required", 'id' => 'pay_later_no', 'onclick' => 'setOptions()']) }} No
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group discount_div" @if($discount->pay_later == 0) style="display: none;" @endif>
|
||||
<label for="co_payment">{{ __('discounts.co_payment') }}</label>
|
||||
<br>
|
||||
{{ Form::radio('co_payment', 1, $discount->co_payment == 1, ['id' => 'co_payment_yes','onclick' => 'setCoPaymentOptions()']) }} Yes
|
||||
{{ Form::radio('co_payment', 0, $discount->co_payment == 0, ['id' => 'co_payment_no','onclick' => 'setCoPaymentOptions()']) }} No
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" @if($discount->co_payment == 0) style="display: none;" @endif id="co_payment_share">
|
||||
<label for="co_payment_share">{{ __('discounts.co_payment_share') }}</label>
|
||||
{{ Form::number('co_payment_share',$discount->co_payment_share ?? 0,['class' => 'form-control', 'max' => '100']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group threshold_radios_div" @if($discount->pay_later == 0) style="display: none;" @endif>
|
||||
{{ Form::label('is_pay_later_threshold_discount','Does a patient have threshold amount') }}
|
||||
<br>
|
||||
{{ Form::radio('is_pay_later_threshold_discount', 1, !is_null($discount->threshold_type), ['id' => 'is_pay_later_threshold_discount_yes', 'onclick' => 'displayOfDiscountThresholdDivs()']) }} Yes
|
||||
{{ Form::radio('is_pay_later_threshold_discount', 0, is_null($discount->threshold_type), ['id' => 'is_pay_later_threshold_discount_no', 'onclick' => 'displayOfDiscountThresholdDivs()']) }} No
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="set_threshold_div" @if($discount->threshold_type == 0) style="display: none;" @endif>
|
||||
<div class="form-group">
|
||||
{{ Form::label('threshold_type','Threshold type') }}
|
||||
{{ Form::select('threshold_type', [''=>'--Select discount type','1'=>'Monthly threshold amount','2'=>'Yearly threshold amount'], $discount->threshold_type, ['class' => 'form-control compulsory', 'id' => 'threshold_type']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('threshold_amount','Threshold amount') }}
|
||||
{{ Form::number('threshold_amount', $discount->threshold_amount, ['class' => 'form-control compulsory', 'id' => 'threshold_amount']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="discount">{{ __('discounts.discounts_percentage') }}</label>
|
||||
{{ Form::number('discount',$discount->discount,['class' => 'form-control compulsory', 'max' => '100', 'min' => '0','onchange' => 'setDiscountPercentageOptions(this.value)']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="track_discount_div" @if($discount->discount == 0) style="display: none;" @endif>
|
||||
<label for="track_discounts">Track Discounts</label>
|
||||
<br>
|
||||
{{ Form::radio('track_discounts', 1, !is_null($discount->tracking_expense_account), ['id' => 'tracking_yes','onclick' => 'setTrackingOption()']) }} Yes
|
||||
{{ Form::radio('track_discounts', 0, is_null($discount->tracking_expense_account), ['id' => 'tracking_no','onclick' => 'setTrackingOption()']) }} No
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" @if(is_null($discount->tracking_expense_account))style="display: none;" @endif id="tracking_expense_account_div">
|
||||
<label for="tracking_expense_account">Expense Account</label>
|
||||
{{ Form::select('tracking_expense_account', $expense_accounts, $discount->tracking_expense_account,['class' => 'form-control', 'id' => 'tracking_expense_account']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::submit('Save',['class'=>'btn btn-success'])}}
|
||||
{{ Form::reset('Cancel',['type'=>'reset','class'=>'btn btn-default'])}}
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function setOptions() {
|
||||
if (document.getElementById("pay_later_yes").checked) {
|
||||
$('.discount_div').show();
|
||||
$('.threshold_radios_div').show();
|
||||
$('#is_pay_later_threshold_discount_yes').attr('required', true);
|
||||
$('#is_pay_later_threshold_discount_no').attr('required', true);
|
||||
$('#co_payment_yes').attr('required', true);
|
||||
$('#co_payment_no').attr('required', true);
|
||||
}
|
||||
if (document.getElementById("pay_later_no").checked) {
|
||||
$('.discount_div').hide();
|
||||
$('.threshold_radios_div').hide();
|
||||
$('#is_pay_later_threshold_discount_yes').attr('required', false);
|
||||
$('#is_pay_later_threshold_discount_no').attr('required', false);
|
||||
$('#co_payment_yes').attr('required', false);
|
||||
$('#co_payment_no').attr('required', false);
|
||||
}
|
||||
}
|
||||
|
||||
function setCoPaymentOptions() {
|
||||
if (document.getElementById("co_payment_yes").checked) {
|
||||
$('#co_payment_share').show();
|
||||
}
|
||||
if (document.getElementById("co_payment_no").checked) {
|
||||
$('#co_payment_share').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function setTrackingOption() {
|
||||
if (document.getElementById("tracking_yes").checked) {
|
||||
$('#tracking_expense_account_div').show();
|
||||
$('#tracking_expense_account').attr('required', true);
|
||||
}
|
||||
if (document.getElementById("tracking_no").checked) {
|
||||
$('#tracking_expense_account_div').hide();
|
||||
$('#tracking_expense_account').attr('required', false);
|
||||
}
|
||||
}
|
||||
|
||||
function displayOfDiscountThresholdDivs() {
|
||||
if (document.getElementById("is_pay_later_threshold_discount_yes").checked) {
|
||||
$('.set_threshold_div').show();
|
||||
$('#threshold_type').attr('required', true);
|
||||
$('#threshold_amount').attr('required', true);
|
||||
}
|
||||
if (document.getElementById("is_pay_later_threshold_discount_no").checked) {
|
||||
$('.set_threshold_div').hide();
|
||||
$('#threshold_type').attr('required', false);
|
||||
$('#threshold_amount').attr('required', false);
|
||||
}
|
||||
}
|
||||
|
||||
function setDiscountOption() {
|
||||
var selector = document.getElementById('threshold_type');
|
||||
var discountTypeValue = selector[selector.selectedIndex].value;
|
||||
|
||||
if (discountTypeValue == 1) {
|
||||
$('.discount_amount').hide();
|
||||
}
|
||||
|
||||
if (discountTypeValue == 2) {
|
||||
$('.discount_amount').show();
|
||||
}
|
||||
}
|
||||
|
||||
function setDiscountPercentageOptions(percentage) {
|
||||
if (percentage > 0) {
|
||||
$('#track_discount_div').show();
|
||||
$('#tracking_yes').attr('required', true);
|
||||
$('#tracking_no').attr('required', true);
|
||||
} else {
|
||||
$('#track_discount_div').hide();
|
||||
$('#tracking_yes').attr('required', false);
|
||||
$('#tracking_no').attr('required', false);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('discounts.patient_category_discounts') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('discounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('discounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i>{{ __('discounts.view_discounts') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
{{ Form::open(['route' => 'discounts.store_edited_insured_drugs','data-toggle'=>'validator']) }}
|
||||
{{ Form::hidden('patient_category_id', $patient_category_id) }}
|
||||
|
||||
<h3>Drugs covered by {{ get_name($patient_category_id, 'id', 'name', 'patient_categories') }}</h3>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered color-bordered-table success-bordered-table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Drug Name</th>
|
||||
<th>Is Not Covered</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($drugs as $drug)
|
||||
@php
|
||||
$patient_category_coverage = explode(",", $drug->patient_category_coverage);
|
||||
$is_drug_covered = in_array($patient_category_id, $patient_category_coverage);
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $drug->name }}</td>
|
||||
<td>
|
||||
@if($is_drug_covered)
|
||||
{{ Form::hidden('current_covered[]', $drug->id) }}
|
||||
@endif
|
||||
|
||||
{{ Form::checkbox('is_covered[]', $drug->id, $is_drug_covered, ['class' => 'item_checkbox']) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{ Form::button(__('patients.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button(__('patients.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+65
@@ -0,0 +1,65 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('discounts.patient_category_discounts') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('discounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('discounts.finance_home') }}</a></li>
|
||||
<li><a href="{{ route('discounts.index') }}"><i class="fa fa-eye"></i> {{ __('discounts.view_discounts') }}</a></li>
|
||||
<li class="active"><i class="fa fa-trash"></i> {{ __('discounts.inactive_discounts') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('discounts.patient_category') }}</th>
|
||||
<th>{{ __('discounts.discount') }}</th>
|
||||
<th>{{ __('discounts.pay_late') }}</th>
|
||||
<th class="text-center">{{ __('discounts.action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($discounts) > 0)
|
||||
@foreach($discounts as $discount)
|
||||
<tr>
|
||||
<td>{{ $categories[$discount->patient_category] }}</td>
|
||||
<td>{{ $discount->discount }}</td>
|
||||
<td>{{ $discount->pay_later == 1 ? "Yes" : "No" }}</td>
|
||||
<td>
|
||||
{{ Form::model($discount->id ,['method' => 'POST', 'route' => ['discounts.activate', $discount->id]]) }}
|
||||
<button type="submit" class="btn btn-warning" onclick="return confirm('Are you sure?')"><i class="fa fa-check"></i> Restore</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr class="warning"><td class="center" colspan="5">{{ __('discounts.no_discounts_found') }}</td></tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $discounts->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('discounts.patient_category_discounts') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('discounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('discounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i>{{ __('discounts.view_discounts') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('discounts.patient_category') }}</th>
|
||||
<th>{{ __('discounts.discount') }}</th>
|
||||
<th>{{ __('discounts.co_payment') }}</th>
|
||||
<th>{{ __('discounts.pay_later') }}</th>
|
||||
<th>Threshold</th>
|
||||
<th>Add dependants</th>
|
||||
<th>{{ __('discounts.action') }}</th>
|
||||
<th>{{ __('discounts.action') }}</th>
|
||||
<th>{{ __('discounts.action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($discounts) > 0)
|
||||
@foreach($discounts as $discount)
|
||||
<tr>
|
||||
<td>{{ $categories[$discount->patient_category] ?? "" }}</td>
|
||||
<td>{{ $discount->discount }}</td>
|
||||
<td>@if($discount->co_payment_share) {{ $discount->co_payment_share }} @else <label class='label label-danger'>{{ __('discounts.not_set') }}</label>@endif</td>
|
||||
<td>{{ $discount->pay_later == 1 ? "Yes" : "No" }}</td>
|
||||
<td>{{ is_null($discount->threshold_amount) ? "" : ugandan_shillings($discount->threshold_amount) }}</td>
|
||||
<td>
|
||||
@if(!is_null($discount->threshold_type))
|
||||
@if( Auth::user()->can('view-dependants-to-patient'))
|
||||
{{ Form::open(['method'=>'post','url' => 'discounts/add_dependants']) }}
|
||||
{{ Form::hidden('discount_id', $discount->id) }}
|
||||
{{ Form::submit('View dependants', ['class' => 'btn btn-primary btn-rounded btn-sm']) }}
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($discount->pay_later == 1 && Auth::user()->can('change-drugs-covered-by-category'))
|
||||
<a href="/discounts/edit_insured_drugs/{{ $discount->patient_category }}/" class="btn btn-info btn-sm"><i class="fa fa-pencil"></i> Edit Insured Drugs</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if(Auth::user()->can('discount-list'))
|
||||
<a href="/discounts/{{ $discount->id }}/edit/" class="btn btn-info btn-sm"><i class="fa fa-pencil"></i> {{ __('discounts.edit') }}</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if(Auth::user()->can('discount-list'))
|
||||
{{ Form::model($discount->id ,['method' => 'DELETE', 'route' => ['discounts.destroy', $discount->id]]) }}
|
||||
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want to remove this patient discount?')"><i class="fa fa-trash"></i> {{ __('discounts.delete') }}</button>
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr class="warning"><td class="center" colspan="8">{{ __('discounts.no_discounts_found') }}</td></tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $discounts->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
order: [[3, 'desc']],
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-6 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Patient Category Dependants</h4>
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li class="active">Patient Category Dependants</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<h4> Showing patients for {{ $patient_discount->threshold_type == 1 ? "Monthly" : "Yearly" }} Discount <font color="blue">{{ get_name($patient_discount->patient_category, "id", "name", "patient_categories") }}, registered on {{ streamline_date($patient_discount->created_on) }}</font></h4>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-table success-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Patient Name</th>
|
||||
<th>Threshold Amount</th>
|
||||
<th>Current Balance</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($patient_category_patients) > 0)
|
||||
@foreach($patient_category_patients as $patient)
|
||||
<tr>
|
||||
<td>
|
||||
<b>Main patient:</b><br>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ url('patients/') }}/{{ $patient->id }}">{{ $patient->first_name }} {{ $patient->last_name }} ({{$patient->number}})</a>
|
||||
</li>
|
||||
</ul>
|
||||
@php
|
||||
$existing_dependants_record_collection = \Streamline\Models\CategoryPatientDependant::where('main_patient_id', $patient->id)->get();
|
||||
$existing_record = null;
|
||||
$dependants_array = [];
|
||||
if (count($existing_dependants_record_collection) > 0) {
|
||||
$existing_record = $existing_dependants_record_collection->first();
|
||||
$dependants_array = explode(",", $existing_record->dependant_patient_ids);
|
||||
echo "<b>Dependants</b>";
|
||||
}
|
||||
@endphp
|
||||
<ul>
|
||||
@for($i=0; $i < count($dependants_array); $i++)
|
||||
<li><a href="{{ url('patients/') }}/{{$dependants_array[$i]}}">{{ get_full_name($dependants_array[$i], "id", "first_name", "last_name", "patients") }} ({{ get_name($dependants_array[$i], "id", "number", "patients")}})</a></li>
|
||||
@endfor
|
||||
</ul>
|
||||
</td>
|
||||
<td>{{ ugandan_shillings($patient_discount->threshold_amount) }}</td>
|
||||
<td>
|
||||
{{ ugandan_shillings(get_balance_from_category_threshold($patient->id)) }}
|
||||
</td>
|
||||
<td>
|
||||
@if( Auth::user()->can('view-dependants-to-patient') && count($dependants_array) > 0)
|
||||
<a href="{{ url('view_dependants_to_category_patient') }}/{{ $patient->id }}" class="btn btn-info"><i class="fa fa-eye"></i> View dependants</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if( Auth::user()->can('add-dependants-to-patient'))
|
||||
{{ Form::open(['method'=>'post','url' => 'discounts/add_dependants_to_category_patient']) }}
|
||||
{{ Form::hidden('patient_id', $patient->id) }}
|
||||
{{ Form::hidden('patient_category', $patient_discount->patient_category) }}
|
||||
{{ Form::hidden('patient_discount_id', $patient_discount->id) }}
|
||||
{{ Form::submit('Add dependants', ['class' => 'btn btn-primary']) }}
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr class="warning"><td class="center" colspan="9">No records found</td></tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<!-- <script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script> -->
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
order: [[3, 'desc']],
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">List of dependants</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li><a href="{{ route('discounts.index') }}">Discounts</a></li>
|
||||
<li class="active">List of dependants</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
@if(!is_null($dependants_record))
|
||||
<h4> List of dependants for <font color="blue">{{ $patient->first_name }} {{ $patient->last_name }} {{ $patient->number }} <strong>({{ get_name($dependants_record->patient_category_id, "id", "name", "patient_categories") }})</strong></font></h4>
|
||||
|
||||
@php
|
||||
$dependants_array = explode(",", $dependants_record->dependant_patient_ids);
|
||||
@endphp
|
||||
<ul>
|
||||
@for($i=0; $i < count($dependants_array); $i++)
|
||||
<li><a href="{{ url('patients/') }}/{{$dependants_array[$i]}}">{{ get_full_name($dependants_array[$i], "id", "first_name", "last_name", "patients") }} ({{ get_name($dependants_array[$i], "id", "number", "patients")}})</a></li>
|
||||
@endfor
|
||||
</ul>
|
||||
@else
|
||||
<font style="color: red; font-size: 18px;"><strong>There are no recorded dependants for this patient </strong></font>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#dependants').select2({
|
||||
placeholder: "Select dependants"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
+181
@@ -0,0 +1,181 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('family_accounts.add_family_deposit') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('family_accounts.add_family_deposit') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::family_accounts.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{{ Form::open(['method'=>'post','route'=>'family_accounts.store_family_deposit']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('family_head',__('family_accounts.family_head')) }}
|
||||
{{ Form::text('family_head', get_full_name($family_account_details->family_head_id, "id", "first_name", "last_name", "patients"), ['class' => 'form-control col-sm-12 compulsory', 'readonly' => 'true']) }}
|
||||
</div>
|
||||
|
||||
{{ Form::hidden('family_account_id', $family_account_details->id) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposit_amount',__('family_accounts.amount_deposited')) }}
|
||||
{{ Form::number('deposit_amount', '',['class' => 'form-control compulsory', 'id' => 'deposit_amount', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<label class="label label-primary" id="add_payment_method_button" onclick="add_payment_method();">Add Payment Method</label>
|
||||
</div>
|
||||
<div class="col-md-6"></div>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<div id="payment_methods_div" style="display: none">
|
||||
<div class="form-group">
|
||||
{{ Form::label('cash_to_pay','Cash to Pay') }}
|
||||
{{ Form::hidden('original_cash_to_pay', 0, ['id' => 'original_cash_to_pay']) }}
|
||||
{{ Form::number('cash_to_pay',0,['class' => 'form-control','id'=>'cash_to_pay','readonly']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposit_date', __('family_accounts.deposited_on')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('deposit_date', date('d-m-Y'), ['class'=>'form-control compulsory', 'required' , 'readonly', 'id'=>'deposit_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposited_by', __('family_accounts.deposited_by')) }}
|
||||
{{ Form::text('deposited_by', '', ['class'=>'form-control required compulsory', 'required', 'id'=>'deposit_by']) }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ Form::submit(__('family_accounts.save'),['class'=>'btn btn-success'])}}
|
||||
{{ Form::reset(__('family_accounts.cancel'),['type'=>'reset','class'=>'btn btn-default'])}}
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<h3>{{ __('family_accounts.family_members') }}</h3>
|
||||
@php
|
||||
$family_members_array = explode(",", $family_account_details->family_members_ids);
|
||||
@endphp
|
||||
<ol>
|
||||
@for($i = 0; $i < count($family_members_array); $i++)
|
||||
<li>
|
||||
<a href="patients/{{ $family_members_array[$i] }}">{{ get_full_name($family_members_array[$i], "id", "first_name", "last_name", "patients") }}</a>
|
||||
<br>
|
||||
<strong>{{ __('family_accounts.number') }} </strong>{{ get_name($family_members_array[$i], "id", "number","patients") }}
|
||||
<br>
|
||||
<strong>{{ __('family_accounts.contact') }}</strong>{{ get_name($family_members_array[$i], "id", "phone","patients") }}<br>
|
||||
<strong>{{ __('family_accounts.residence') }}</strong>{{ patient_residence($family_members_array[$i]) }}
|
||||
</li>
|
||||
@endfor
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.family_dropdown').select2({
|
||||
placeholder: "Select member"
|
||||
});
|
||||
$('.select2-selection.select2-selection--single').css('height','calc(3.85rem)');
|
||||
$('.select2-selection.select2-selection--single').css('padding-top','5px');
|
||||
$('.select2-selection.select2-selection--single').css('border-left', '3px solid #F08080');/*add compulsory class*/
|
||||
$('.select2-selection.select2-selection--single.sec_d').css('border-left', '3px solid #aaa');
|
||||
$('.select2-selection__arrow').css('top','3px');
|
||||
|
||||
$('#deposit_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
});
|
||||
|
||||
$('#deposit_amount').change(function (e) {
|
||||
reset_payment_methods_amounts();
|
||||
});
|
||||
|
||||
function add_payment_method() {
|
||||
$('#payment_methods_div').show();
|
||||
|
||||
if ($('#cash_to_pay').val() == 0) {
|
||||
$('#cash_to_pay').val( $('#deposit_amount').val());
|
||||
$('#original_cash_to_pay').val( $('#deposit_amount').val());
|
||||
}
|
||||
|
||||
$('#payment_methods_div').append('<div class="row"><div class="col-md-6"><label>Payment Method</label><select class="form-control payment_method" name="payment_method[]"><option value="0">--select method--</option><?php echo $patient_payment_methods_options ?></select></div><div class="col-md-6"><label>Payment Amount</label><input name="payment_methods_amount[]" type="number" class="form-control payment_methods_amount" onkeyup="payment_methods_amount_calculate()"></div></div><br>');
|
||||
}
|
||||
|
||||
function payment_methods_amount_calculate() {
|
||||
// tally up all the entered values
|
||||
let total_amount_payment_methods = 0;
|
||||
|
||||
$('.payment_methods_amount').each(function () {
|
||||
total_amount_payment_methods += +$(this).val();
|
||||
});
|
||||
|
||||
let cash_to_pay = $('#original_cash_to_pay').val();
|
||||
cash_to_pay -= total_amount_payment_methods;
|
||||
|
||||
if (cash_to_pay < 0) {
|
||||
alert("You have entered more money in the payment methods than is supposed to be paid");
|
||||
$('#cash_to_pay').val($('#original_cash_to_pay').val());
|
||||
$('.payment_methods_amount').each(function () {
|
||||
$(this).val(0);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
$('#cash_to_pay').val(cash_to_pay);
|
||||
}
|
||||
|
||||
function reset_payment_methods_amounts() {
|
||||
$('#cash_to_pay').val( $('#deposit_amount').val());
|
||||
$('#original_cash_to_pay').val( $('#deposit_amount').val());
|
||||
|
||||
$('.payment_methods_amount').each(function () {
|
||||
$(this).val(0);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Cancel Family Account Deposit</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/finance">Finance</a></li>
|
||||
<li><a href="/family_accounts_deposits_report">Family Deposits</a></li>
|
||||
<li class="active">Cancel Family Deposit</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table id="table" class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Family Members</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$members_array = explode(",", $family_account->family_members_ids);
|
||||
@endphp
|
||||
|
||||
@for($i=0; $i < count($members_array); $i++)
|
||||
<tr>
|
||||
<th><a href="patients/{{ $members_array[$i] }}">{{ get_full_name($members_array[$i], "id", "first_name", "last_name", "patients") }} ({{ get_name($members_array[$i], "id", "number", "patients") }})</a></th>
|
||||
</tr>
|
||||
@endfor
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{--<div class="col-md-1"></div>--}}
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
{{ Form::open(['method'=>'post','url'=>'family_account_deposit_cancellation']) }}
|
||||
|
||||
{{ Form::hidden('deposit_id', $family_deposit->id) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposited_by', 'Deposited By') }}
|
||||
{{ Form::text('deposited_by', $family_deposit->deposited_by, ['class'=>'form-control compulsory', 'readonly', ]) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposited_amount', 'Deposited Amount') }}
|
||||
{{ Form::text('deposited_amount', ugandan_shillings($family_deposit->deposit_amount), ['class'=>'form-control compulsory', 'readonly', ]) }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('received_by', "Received By") }}
|
||||
{{ Form::text('received_by', get_full_name($family_deposit->created_by, "id", "first_name", "last_name", "users"), ['class'=>'form-control compulsory', 'readonly']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('reason_name', 'Reason For Cancellation') }}
|
||||
{{ Form::textarea('reason', '', ['class'=>'form-control compulsory required', 'rows'=>'5', 'cols' => '10', 'required']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::submit('Cancel Deposit', ['class' => 'btn btn-success']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
Executable
+180
@@ -0,0 +1,180 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('family_accounts.create_family_account') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('family_accounts.create_family_account') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::family_accounts.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
{{ Form::open(['method'=>'post','route'=>'family_accounts.store', 'id' => 'family_account_form']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('family_head', __('family_accounts.family_head')) }}
|
||||
<select class="patient_name form-control" name="family_head" id="family_head_name"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('family_members',__('family_accounts.family_members')) }}
|
||||
<select class="patient_name form-control" name="family_members[]" id="patient_name" multiple="true"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposit_amount', __('family_accounts.amount_deposited')) }}
|
||||
{{ Form::number('deposit_amount',0,['class' => 'form-control', 'id' => 'deposit_amount']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="initial_div" style="display: none;">
|
||||
<div class="alert alert-info">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<span>Is this amount part of the opening family account amounts on Stre@mline. This will affect Equity in case it is</span>
|
||||
</div>
|
||||
{{ Form::label('is_it_opening_family_amount', 'Is it the opening balance on Stre@mline for this family') }}
|
||||
{{ Form::select('is_it_opening_family_amount', [0 => 'No', 1 => 'Yes'], null, ['class' => 'form-control compulsory','required', 'id' => 'is_it_opening_amt']) }}
|
||||
<br>
|
||||
|
||||
<div class="form-group" id="opening_account_div" style="display: none;">
|
||||
{{ Form::label('opening_account_id', 'Opening Account') }}
|
||||
{{ Form::select('opening_account_id', $chart_of_accounts, null, ['class' => 'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="input-group" id="opening_date_div" style="display: none;">
|
||||
<input type="text" name="opening_amount_date" placeholder="Opening amount deposit date" class="form-control col-sm-12" autocomplete="off" id="opening_amount_date">
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposited_by', __('family_accounts.deposited_by')) }}
|
||||
{{ Form::text('deposited_by', '', ['class'=>'form-control', 'id'=>'deposit_by']) }}
|
||||
</div>
|
||||
|
||||
@if (Auth::user()->can('add-family-account-credit-limit'))
|
||||
<div class="form-group">
|
||||
{{ Form::label('credit_limit', __('family_accounts.credit_limit')) }}
|
||||
{{ Form::number('credit_limit',0,['class' => 'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div>
|
||||
{{ Form::submit(__('family_accounts.save'),['class'=>'btn btn-success', 'id' => 'submitBtn'])}}
|
||||
{{ Form::reset(__('family_accounts.cancel'),['type'=>'reset','class'=>'btn btn-default'])}}
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.family_dropdown').select2({
|
||||
placeholder: "Select member"
|
||||
});
|
||||
|
||||
$('.select2-selection.select2-selection--single').css('height','calc(3.85rem)');
|
||||
$('.select2-selection.select2-selection--single').css('padding-top','5px');
|
||||
$('.select2-selection.select2-selection--single').css('border-left', '3px solid #F08080');/*add compulsory class*/
|
||||
$('.select2-selection.select2-selection--single.sec_d').css('border-left', '3px solid #aaa');
|
||||
$('.select2-selection__arrow').css('top','3px');
|
||||
|
||||
$('#deposit_amount').change(function(e) {
|
||||
//if ($('#deposit_amount').val() > 0) {
|
||||
$('#initial_div').show();
|
||||
//}
|
||||
});
|
||||
|
||||
$('#is_it_opening_amt').click(function(e){
|
||||
var outcome = $("#is_it_opening_amt :selected").val();
|
||||
if (outcome == 1) { //1=yes
|
||||
$('#opening_account_div').show();
|
||||
$('#opening_date_div').show();
|
||||
$('#opening_account_id').attr("required", "true");
|
||||
}
|
||||
else{
|
||||
$('#opening_account_div').hide();
|
||||
$('#opening_date_div').hide();
|
||||
$('#opening_account_id').removeAttr("required");
|
||||
}
|
||||
});
|
||||
|
||||
$('.patient_name').select2({
|
||||
placeholder: "Search name",
|
||||
ajax: {
|
||||
url: '/search_family_account_name',
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
text: item.first_name + " " + item.last_name+ " - " + item.number+ " (" + item.phone + ")",
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#opening_amount_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
$('#submitBtn').click(function(e){
|
||||
let deposit_amount = $('#deposit_amount').val();
|
||||
let is_it_opening_balance = $('#is_it_opening_amt :selected').val();
|
||||
if((deposit_amount < 0) && is_it_opening_balance == 0){
|
||||
alert('Deposited amount can not be negative if it is not the opening balance of the family');
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
|
||||
<style type="text/css">
|
||||
#divToPrint{
|
||||
font-size: 13px;
|
||||
color: #7c7c7c;
|
||||
}
|
||||
|
||||
#receipt_table{
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
font-family: monospace
|
||||
}
|
||||
|
||||
#receipt_table th{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
#receipt_table td{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.receipt-label{
|
||||
margin-top: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.receipt-title{
|
||||
font-weight: bolder;
|
||||
text-decoration: underline;
|
||||
display: block; font-family:
|
||||
monospace
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-7">
|
||||
<h4>{{ __('family_accounts.family_account_deposit_receipt') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('family_accounts.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patient_finance.home') }}">{{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active">{{ __('family_accounts.family_account_deposit_receipt') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::family_accounts.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
<div class="row" style="float:right;"><button class="btn btn-success glyphicon glyphicon-print" onclick="print_receipt()"> Print</button></div>
|
||||
<div class="row" id="divToPrint">
|
||||
<div class="col-sm-3"></div>
|
||||
<div class="col-sm-6" style="text-align: center;">
|
||||
<p style="text-align: center; font-size: 1em">
|
||||
@php
|
||||
$hospital_information = \Streamline\Models\HospitalInformation::first();
|
||||
@endphp
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.tel') }}</b> {{ $hospital_information->phone_number }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.email') }}</b> {{ $hospital_information->email }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.cashier') }}</b> {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.date') }}</b> {{ streamline_date_time_short($receipt_date) }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.receipt_number') }}</b> {{ $receipt_number }} @if(str_contains(url()->current(), 'family_deposit_reprint'))<span style="color:maroon; font-weight:900">(Reprinted Receipt)</span>@endif</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.deposit_date') }}</b> {{ streamline_date($new_family_deposit->deposit_date) }}</span><br>
|
||||
</p>
|
||||
|
||||
@php
|
||||
$family_account_details = \Streamline\Models\FamilyAccount::find($new_family_deposit->family_account_id);
|
||||
$family_head_name = get_full_name($family_account_details->family_head_id, "id", "first_name", "last_name", "patients");
|
||||
@endphp
|
||||
|
||||
@if(should_members_display_on_deposit_receipt())
|
||||
<div>
|
||||
<table class="table" id="receipt_table">
|
||||
<thead>
|
||||
<th style="width: 60%"><b>{{ __('family_accounts.family_members') }}</b></th>
|
||||
<th style="width: 20%"><b>{{ __('family_accounts.amount_deposited') }}</b></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><ol>
|
||||
@for($i = 0; $i < count($family_members_array); $i++)
|
||||
<li>
|
||||
{{ get_full_name($family_members_array[$i], "id", "first_name", "last_name", "patients") }}({{ get_name($family_members_array[$i], "id", "number","patients") }})
|
||||
</li>
|
||||
@endfor
|
||||
</ol></td>
|
||||
<td><b>{{ ugandan_shillings($new_family_deposit->deposit_amount) }}</b></td>
|
||||
</tr>
|
||||
|
||||
@if(count($return_payment_methods) > 0)
|
||||
<tr><td colspan="2"></td></tr>
|
||||
@foreach($return_payment_methods as $key => $value)
|
||||
<tr>
|
||||
<td><b>Patient Paid With {{ ($key == 0) ? 'Cash' : get_name($key, 'id', 'name', 'patient_payment_methods') }}</b></td>
|
||||
<td><b>{{ ugandan_shillings($value) }}</b></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div>
|
||||
<table class="table" id="receipt_table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Family Head: </th>
|
||||
<td>{{$family_head_name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Amount</th>
|
||||
<td>
|
||||
<b>{{ ugandan_shillings($new_family_deposit->deposit_amount) }}</b>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
</div>
|
||||
<i style="font-size: 0.8em; margin-left: 50%;">{{ __('family_accounts.streamline') }}</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<script type="text/javascript">
|
||||
function print_receipt() {
|
||||
let myDiv = document.getElementById('divToPrint');
|
||||
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
|
||||
|
||||
newWindow.document.write("<html><body " +
|
||||
"class='' " +
|
||||
" onload='window.print()'>" +
|
||||
myDiv.innerHTML +
|
||||
"</body></html>");
|
||||
newWindow.document.close();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+239
@@ -0,0 +1,239 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('family_accounts.family_account_deposit_report') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('family_accounts.family_account_deposit_report') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::family_accounts.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
{{ Form::open(['url' => 'family_accounts_deposits_report', 'method' => 'ANY']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
{{ Form::label('family_account_id', __('family_accounts.family_of')) }}
|
||||
{{ Form::select('family_account_id', $family_accounts_array, '', ['class' => 'form-control compulsory']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
{{ Form::label('staff_member', 'Staff Member') }}
|
||||
{{ Form::select('staff_member', $staff_members, null, ['class' => 'form-control', 'id' => 'staff_member', 'required']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('search_by', __('family_accounts.date')) }}
|
||||
{{ Form::select('search_by', ['0'=>'Today','1'=>'Yesterday','2'=>'Custom Date','3'=>'Custom Range'], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2" id="start_date_div" style="display: none">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('family_accounts.from')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'start_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2" id="end_date_div" style="display: none">
|
||||
<div class="form-group">
|
||||
{{ Form::label('end_date', __('family_accounts.to')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'end_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group" style="padding-top: 5px;"><br>
|
||||
{{ Form::button(__('family_accounts.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
@if($search_text != "")
|
||||
<h4><label class="label label-info">{{ $search_text }}</label></h4>
|
||||
<br>
|
||||
@endif
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('family_accounts.family_head') }}</th>
|
||||
<th>{{ __('family_accounts.total_deposits') }}</th>
|
||||
<th>Received By</th>
|
||||
<th>Deposited By</th>
|
||||
<th>Deposit Date</th>
|
||||
<th>Transaction Date</th>
|
||||
<th colspan="2">{{ __('family_accounts.action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_family_deposits = 0; @endphp
|
||||
@foreach($family_deposits as $deposit)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
@php $family_head_id = get_name($deposit->family_account_id, "id", "family_head_id", "family_accounts") @endphp
|
||||
<td>
|
||||
{{ get_full_name($family_head_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($family_head_id, "id", "number","patients") }})
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($deposit->deposit_amount) }}
|
||||
@php $total_family_deposits += $deposit->deposit_amount; @endphp
|
||||
</td>
|
||||
<td>{{ $deposit->user_first_name . " " . $deposit->user_last_name }}</td>
|
||||
<td>{{ $deposit->deposited_by }}</td>
|
||||
<td>{{ $deposit->deposit_date }}</td>
|
||||
<td>{{ streamline_date_time($deposit->created_at) }}</td>
|
||||
<td>
|
||||
@if(Auth::user()->can('cancel-family-account-deposit') && $deposit->is_opening_amount != 1 && is_null($deposit->received))
|
||||
{{ Form::open(['url'=>'family_deposit_cancellation_reason']) }}
|
||||
{{ Form::hidden('deposit_id', $deposit->id) }}
|
||||
{{ Form::submit('Cancel Deposit', ['class' => 'btn btn-danger btn-sm', 'onclick' => 'return confirm("Are you sure you want to cancel this family deposit?")']) }}
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<a href="/family_accounts/{{ $deposit->family_account_id }}/statement/" class="btn btn-primary btn-xs"><i class="fa fa-book"></i> Statement</a>
|
||||
<br>
|
||||
<a href="/family_deposit_reprint/{{ $deposit->id }}" class="btn btn-info btn-xs btn-rounded">Reprint</a>
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }} Amount Deposited</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($total_family_deposits) }}</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
|
||||
<!-- Date Picker Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script>
|
||||
|
||||
$('#start_date,#end_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#search_by').change(function () {
|
||||
if($(this).val() == 2){
|
||||
$("#end_date_div").hide();
|
||||
$("#start_date_div").show();
|
||||
} else if($(this).val() == 3){
|
||||
$("#end_date_div").show();
|
||||
$("#start_date_div").show();
|
||||
} else {
|
||||
$("#end_date_div").hide();
|
||||
$("#start_date_div").hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
message: 'FAMILY CONSUMPTION'
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: 'FAMILY CONSUMPTION',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
sheetName: 'FAMILY CONSUMPTION'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: 'LIST OF DRUGS',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
customize: function(doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
}
|
||||
},
|
||||
{ extend: 'print',
|
||||
message: 'LIST OF DRUGS',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
customize: function (win) {
|
||||
$(win.document.body)
|
||||
.css('font-size', '10pt')
|
||||
.css('background', '#fff')
|
||||
.prepend(
|
||||
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
|
||||
);
|
||||
$(win.document.body).find('table')
|
||||
.addClass('compact')
|
||||
.css('font-size', 'inherit');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Executable
+181
@@ -0,0 +1,181 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('family_accounts.edit_family_account') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('family_accounts.edit_family_account') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::family_accounts.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{{ Form::model($family_account, ['method' => 'PUT', 'route' => ['family_accounts.update',$family_account], 'data-toggle' => 'validator']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('family_head',__('family_accounts.family_head')) }}
|
||||
<select class="patient_name form-control" name="family_head" id="family_head_name">
|
||||
<option value="{{ $family_head_id }}">{{ $family_head_name }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('family_members',__('family_accounts.family_members')) }}
|
||||
<select class="patient_name form-control" name="family_members[]" multiple="true">
|
||||
@foreach($family_members_array as $family_member)
|
||||
<option value="{{ $family_member }}" selected>{{ get_full_name($family_member, 'id', 'first_name', 'last_name', 'patients') }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('current_balance',__('family_accounts.current_balance')) }}
|
||||
{{ Form::number('current_balance', $current_balance,['class' => 'form-control', 'readonly' => 'true']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('opening_amount',__('family_accounts.opening_amount')) }}
|
||||
{{ Form::number('opening_amount', $family_account->opening_amount,['class' => 'form-control','id' => 'opening_amount']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="initial_div" @if(is_null($family_account->opening_account_id)) style="display: none;" @endif>
|
||||
<div class="alert alert-info">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<span>
|
||||
Select affected <b>equity account</b> if the opening amount is the opening balance of this family on Stre@mline
|
||||
</span>
|
||||
</div>
|
||||
{{ Form::label('is_it_opening_family_amount', 'Is opening amount the opening balance on Stre@mline for this family') }}
|
||||
{{ Form::select('is_it_opening_family_amount', [1 => 'Yes', 0 => 'No'], is_null($family_account->opening_account_id) ? null : 1, ['class' => 'form-control compulsory','required', 'id' => 'is_it_opening_amt']) }}
|
||||
<br>
|
||||
|
||||
<div class="form-group" id="opening_account_div" @if(is_null($family_account->opening_account_id)) style="display: none;" @endif>
|
||||
{{ Form::label('opening_account_id', 'Opening Account') }}
|
||||
{{ Form::select('opening_account_id', $chart_of_accounts, $family_account->opening_account_id, ['class' => 'form-control opening_account_id']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" @if(is_null($family_account->opening_account_id)) style="display: none;" @endif>
|
||||
{{ Form::label('opening_account_date', 'Opening Amount Date') }}
|
||||
<div class="input-group" id="opening_date_div" @if(is_null($family_account->opening_account_id)) style="display: none;" @endif>
|
||||
<input type="text" name="opening_amount_date" value="{{ $family_account->opening_amount_date}}" placeholder="Opening amount deposit date" class="form-control col-sm-12" id="opening_amount_date">
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposited_by', __('family_accounts.deposited_by')) }}
|
||||
{{ Form::text('deposited_by', $opening_deposit_record ? $opening_deposit_record->deposited_by : '', ['class'=>'form-control', 'id'=>'deposit_by']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (Auth::user()->can('add-family-account-credit-limit'))
|
||||
<div class="form-group">
|
||||
{{ Form::label('credit_limit', __('family_accounts.credit_limit')) }}
|
||||
{{ Form::number('credit_limit',$family_account->credit_limit,['class' => 'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div>
|
||||
{{ Form::submit(__('family_accounts.save'),['class'=>'btn btn-success'])}}
|
||||
{{ Form::reset(__('family_accounts.cancel'),['type'=>'reset','class'=>'btn btn-default'])}}
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.family_dropdown').select2({
|
||||
placeholder: "Select member"
|
||||
});
|
||||
|
||||
$('.select2-selection.select2-selection--single').css('height','calc(3.85rem)');
|
||||
$('.select2-selection.select2-selection--single').css('padding-top','5px');
|
||||
$('.select2-selection.select2-selection--single').css('border-left', '3px solid #F08080');/*add compulsory class*/
|
||||
$('.select2-selection.select2-selection--single.sec_d').css('border-left', '3px solid #aaa');
|
||||
$('.select2-selection__arrow').css('top','3px');
|
||||
|
||||
$('#opening_amount').change(function(e) {
|
||||
if ($('#opening_amount').val() > 0) {
|
||||
$('#initial_div').show();
|
||||
$('#opening_account_div').show();
|
||||
$('#opening_date_div').show();
|
||||
$('#opening_account_id').attr("required", "true");
|
||||
}
|
||||
});
|
||||
|
||||
$('#is_it_opening_amt').click(function(e){
|
||||
var outcome = $("#is_it_opening_amt :selected").val();
|
||||
if (outcome == 1) { //1=yes
|
||||
$('#opening_account_div').show();
|
||||
$('#opening_date_div').show();
|
||||
$('#opening_account_id').attr("required", "true");
|
||||
}
|
||||
else{
|
||||
$('#opening_account_div').hide();
|
||||
$('#opening_date_div').hide();
|
||||
$('#opening_account_id').removeAttr("required");
|
||||
}
|
||||
});
|
||||
|
||||
$('.patient_name').select2({
|
||||
placeholder: "Search name",
|
||||
ajax: {
|
||||
url: '/search_family_account_name',
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
text: item.first_name + " " + item.last_name+ " - " + item.number+ " (" + item.phone + ")",
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#opening_amount_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
+299
@@ -0,0 +1,299 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('family_accounts.family_account_consumption_report') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('family_accounts.family_account_consumption_report') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::family_accounts.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
{{ Form::open(['url' => 'family_accounts_consumption_report', 'method' => 'ANY']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
{{ Form::label('family_account_id', __('family_accounts.family_of')) }}
|
||||
{{ Form::select('family_account_id', $family_accounts_array, '', ['class' => 'form-control compulsory']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
{{ Form::label('staff_member', 'Staff Member') }}
|
||||
{{ Form::select('staff_member', $staff_members, null, ['class' => 'form-control', 'id' => 'staff_member', 'required']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('search_by', __('family_accounts.date')) }}
|
||||
{{ Form::select('search_by', ['0'=>'Today','1'=>'Yesterday','2'=>'Custom Date','3'=>'Custom Range'], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2" id="start_date_div" style="display: none">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('family_accounts.from')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'start_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2" id="end_date_div" style="display: none">
|
||||
<div class="form-group">
|
||||
{{ Form::label('end_date', __('family_accounts.to')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'end_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group" style="padding-top: 5px;"><br>
|
||||
{{ Form::button(__('family_accounts.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
@if($search_text != "")
|
||||
<h4><label class="label label-info">{{ $search_text }}</label></h4>
|
||||
<br>
|
||||
@endif
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Patient Information</th>
|
||||
<th>{{ __('family_accounts.family_head') }}</th>
|
||||
<th>{{ __('family_accounts.reason') }}</th>
|
||||
<th>{{ __('family_accounts.amount_consumed') }}</th>
|
||||
<th>Received By</th>
|
||||
<th>Receipt Number</th>
|
||||
<th>{{ __('family_accounts.date') }}</th>
|
||||
<th>{{ __('family_accounts.action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_consumptions = 0; @endphp
|
||||
@foreach($family_consumptions as $family_consumption)
|
||||
@php
|
||||
$expenditure_type = $family_consumption->expenditure_tag;
|
||||
$items_received_array = [];
|
||||
|
||||
if (!is_null($family_consumption->receipt_number)) {
|
||||
$filters = ['receipt_number' => $family_consumption->receipt_number];
|
||||
} else {
|
||||
$filters = ['patient_id' => $family_consumption->patient_id, 'episode_id' => $family_consumption->episode_id];
|
||||
}
|
||||
|
||||
if($expenditure_type == "Services"){
|
||||
$service_deposit_record = \Illuminate\Support\Facades\DB::table('service_deposits')->where($filters)->first();
|
||||
|
||||
if ($service_deposit_record){
|
||||
$items_received = explode(",", $service_deposit_record->items_ids);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "services");
|
||||
}
|
||||
}
|
||||
} elseif($expenditure_type == "Treatment"){
|
||||
$treatment_deposit_record = \Illuminate\Support\Facades\DB::table('treatment_deposits')->where($filters)->first();
|
||||
|
||||
if ($treatment_deposit_record){
|
||||
$items_received = explode(",", $treatment_deposit_record->treatment_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "drugs");
|
||||
}
|
||||
}
|
||||
} elseif($expenditure_type == "Sundries"){
|
||||
$sundries_deposit_record = \Illuminate\Support\Facades\DB::table('sundries_deposits')->where($filters)->first();
|
||||
|
||||
if ($sundries_deposit_record){
|
||||
$items_received = explode(",", $sundries_deposit_record->sundry_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "sundries");
|
||||
}
|
||||
}
|
||||
} elseif($expenditure_type == "Investigations"){
|
||||
$investigation_deposit_record = \Illuminate\Support\Facades\DB::table('investigation_deposits')->where($filters)->first();
|
||||
|
||||
if ($investigation_deposit_record){
|
||||
$items_received = explode(",", $investigation_deposit_record->investigation_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "investigations");
|
||||
}
|
||||
}
|
||||
} elseif($expenditure_type == "Procedures"){
|
||||
$procedure_deposit_record = \Illuminate\Support\Facades\DB::table('procedure_deposits')->where($filters)->first();
|
||||
|
||||
if ($procedure_deposit_record){
|
||||
$items_received = explode(",", $procedure_deposit_record->procedure_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "procedures");
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $family_consumption->first_name . " " . $family_consumption->last_name }} ({{ $family_consumption->number }})</td>
|
||||
@php $family_head_id = get_name($family_consumption->family_account_id, "id", "family_head_id", "family_accounts") @endphp
|
||||
<td>
|
||||
{{ get_full_name($family_head_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($family_head_id, "id", "number","patients") }})
|
||||
</td>
|
||||
<td>
|
||||
<strong>{{ $family_consumption->expenditure_tag == "Services" ? "Consultation / Services" : $family_consumption->expenditure_tag }}</strong>
|
||||
<ol>
|
||||
@for($j = 0; $j < count($items_received_array); $j++)
|
||||
<li>{{ $items_received_array[$j] }}</li>
|
||||
@endfor
|
||||
</ol>
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($family_consumption->amount_consumed) }}
|
||||
@php $total_consumptions += $family_consumption->amount_consumed; @endphp
|
||||
</td>
|
||||
<td>{{ $family_consumption->user_first_name . " " . $family_consumption->user_last_name }}</td>
|
||||
<td>{{ $family_consumption->receipt_number }}</td>
|
||||
<td>{{ streamline_date_time($family_consumption->created_at) }}</td>
|
||||
<td>
|
||||
<a href="/family_accounts/{{ $family_consumption->family_account_id }}/statement/" class="btn btn-primary btn-sm"><i class="fa fa-book"></i> Statement</a>
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }} Amount Consumed</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($total_consumptions) }}</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
|
||||
<!-- Date Picker Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script>
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
message: 'FAMILY CONSUMPTION'
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: 'FAMILY CONSUMPTION',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
sheetName: 'FAMILY CONSUMPTION'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: 'FAMILY CONSUMPTION',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
customize: function(doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
}
|
||||
},
|
||||
{ extend: 'print',
|
||||
message: 'FAMILY CONSUMPTION',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
customize: function (win) {
|
||||
$(win.document.body)
|
||||
.css('font-size', '10pt')
|
||||
.css('background', '#fff')
|
||||
.prepend(
|
||||
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
|
||||
);
|
||||
$(win.document.body).find('table')
|
||||
.addClass('compact')
|
||||
.css('font-size', 'inherit');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('#start_date,#end_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#search_by').change(function () {
|
||||
if($(this).val() == 2){
|
||||
$("#end_date_div").hide();
|
||||
$("#start_date_div").show();
|
||||
} else if($(this).val() == 3){
|
||||
$("#end_date_div").show();
|
||||
$("#start_date_div").show();
|
||||
} else {
|
||||
$("#end_date_div").hide();
|
||||
$("#start_date_div").hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('family_accounts.activate_family_accounts') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('family_accounts.activate_family_accounts') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::family_accounts.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
<div class="row">
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('family_accounts.family_head') }}</th>
|
||||
<th>{{ __('family_accounts.family_members') }}</th>
|
||||
<th>{{ __('family_accounts.action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($family_accounts as $family_account)
|
||||
<tr>
|
||||
{{-- <td>{{ get_full_name($family_account->family_head_id, "id", "first_name", "last_name", "patients") }} </td> --}}
|
||||
<td>
|
||||
{{ get_full_name($family_account->family_head_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($family_account->family_head_id, "id", "number", "patients") }})
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$members_array = explode(",", $family_account->family_members_ids);
|
||||
@endphp
|
||||
<ol>
|
||||
@for($i=0; $i < count($members_array); $i++)
|
||||
<li>{{ get_full_name($members_array[$i], "id", "first_name", "last_name", "patients") }} ({{ get_name($members_array[$i], "id", "number", "patients") }})</li>
|
||||
@endfor
|
||||
</ol>
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::model($family_account->id ,['method' => 'POST', 'route' => ['family_accounts.activate', $family_account->id]]) }}
|
||||
<button type="submit" class="btn btn-warning" onclick="return confirm('<?php echo __('Are you sure ?');?>')"><i class="fa fa-check"></i> {{ __('family_accounts.activate') }}</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+284
@@ -0,0 +1,284 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('family_accounts.family_accounts') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('family_accounts.view_family_accounts') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::family_accounts.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
{{ Form::open(['url' => 'family_accounts_search', 'method' => 'ANY']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
{{ Form::label('family_account_id', __('family_accounts.family_of')) }}
|
||||
{{ Form::select('family_account_id', $family_accounts_array, '', ['class' => 'form-control compulsory', 'id' => 'family_account_id_dropdown']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('search_by', __('family_accounts.date')) }}
|
||||
{{ Form::select('search_by', ['0'=>'Last 24 hours','1'=>'Custom Date','2'=>'Custom Range'], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="display: none;" id="date_search">
|
||||
<div class="form-group" id="reg_date" style="padding-top: 23px;">
|
||||
<div class="input-group">
|
||||
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="display: none;" id="date_range_search">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('family_accounts.from')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group" id="reg_date">
|
||||
{{ Form::label('end_date', __('family_accounts.to')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" style="padding-top: 5px;"><br>
|
||||
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
@if(!is_null($reg_date))
|
||||
<h4>{{ __('family_accounts.showing_consumption_of') }}<font color="blue">{{ streamline_date($reg_date) }}</font></h4>
|
||||
@elseif(!is_null($start_date) && !is_null($end_date))
|
||||
<h4>{{ __('family_accounts.showing_consumption_from') }}<font color="blue">{{ streamline_date($start_date) }}</font> {{ __('family_accounts.to') }} <font color="blue">{{ streamline_date($end_date) }}</font></h4>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('family_accounts.family_head') }}</th>
|
||||
<th>{{ __('family_accounts.family_members') }}</th>
|
||||
<th>{{ __('family_accounts.last_deposit') }}</th>
|
||||
<th>{{ __('family_accounts.current_balance') }}</th>
|
||||
<th>{{ __('family_accounts.opening_amount') }}</th>
|
||||
<th>{{ __('family_accounts.credit_limit') }}</th>
|
||||
<th colspan="4">{{ __('family_accounts.action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $current_balance_total = 0; @endphp
|
||||
@if(count($family_accounts) > 0)
|
||||
@foreach($family_accounts as $family_account)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>
|
||||
<a href="patients/{{ $family_account->family_head_id }}">{{ get_full_name($family_account->family_head_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($family_account->family_head_id, "id", "number", "patients") }})</a>
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$members_array = explode(",", $family_account->family_members_ids);
|
||||
@endphp
|
||||
<ol>
|
||||
@for($i=0; $i < count($members_array); $i++)
|
||||
<li><a href="patients/{{ $members_array[$i] }}">{{ get_full_name($members_array[$i], "id", "first_name", "last_name", "patients") }} ({{ get_name($members_array[$i], "id", "number", "patients") }})</a></li>
|
||||
@endfor
|
||||
</ol>
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$family_deposit_record = \Streamline\Models\FamilyAccountDeposit::where('family_account_id', $family_account->id)->orderBy('id', 'desc')->get();
|
||||
$last_deposit_amount = 0;
|
||||
|
||||
if(count($family_deposit_record) > 0){
|
||||
$last_deposit_record_amount = $family_deposit_record->first();
|
||||
$last_deposit_amount = $last_deposit_record_amount->deposit_amount;
|
||||
}
|
||||
@endphp
|
||||
|
||||
{{ ugandan_shillings($last_deposit_amount) }}<br>
|
||||
<small>(Date: {{ get_name($family_account->id, "family_account_id", "created_at", "family_account_deposits") != "N/A" ? streamline_date(get_name($family_account->id, "family_account_id", "deposit_date", "family_account_deposits")) : "N/A" }})</small>
|
||||
</td>
|
||||
<td>
|
||||
{{ is_numeric($family_account->current_balance) ? ugandan_shillings($family_account->current_balance) : "N/A" }}
|
||||
|
||||
@php $current_balance_total += $family_account->current_balance; @endphp
|
||||
</td>
|
||||
<td>
|
||||
{{ is_numeric($family_account->opening_amount) ? ugandan_shillings($family_account->opening_amount) : "" }}
|
||||
</td>
|
||||
<td>
|
||||
{{ is_numeric($family_account->credit_limit) ? ugandan_shillings($family_account->credit_limit) : "" }}
|
||||
</td>
|
||||
<td>
|
||||
<a href="/family_accounts/{{ $family_account->id }}/edit/" class="btn btn-info btn-sm"><i class="fa fa-pencil"></i> {{ __('family_accounts.edit') }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::open(['url' => 'family_accounts/add_deposit']) }}
|
||||
{{ Form::hidden('family_account_id', $family_account->id) }}
|
||||
{{ Form::submit('Add deposit', ['class' => 'btn btn-success btn-sm']) }}
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
<td>
|
||||
<a href="/family_accounts/{{ $family_account->id }}/statement/" class="btn btn-primary btn-sm"><i class="fa fa-book"></i> Statement</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::model($family_account->id, ['method' => 'DELETE', 'route' => ['family_accounts.destroy', $family_account->id], 'id' => 'delete_form_'.$family_account->id]) }}
|
||||
<button type="submit" class="btn btn-danger btn-sm" id="{{$family_account->id}}"><i class="fa fa-trash"></i> {{ __('family_accounts.deactivate') }}</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($current_balance_total) }}</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
$('.btn-danger').click(function(e){
|
||||
let id = $(this).attr('id');
|
||||
e.preventDefault();
|
||||
let sure = confirm('Are you sure you want to remove this family account?');
|
||||
if(sure){
|
||||
$.ajax({
|
||||
url: '/get_family_acc_balance/'+id,
|
||||
data: {},
|
||||
success: function(response){
|
||||
console.log("family balance === "+response);
|
||||
if(response != 0){
|
||||
if(response > 0){
|
||||
alert("The family account has a balance of "+response+". First make a refund to the family before deleting the account");
|
||||
}
|
||||
|
||||
if(response < 0){
|
||||
alert("The family account has a balance of "+response+". Let the family pay the excess balance before deleting the account");
|
||||
}
|
||||
return false;
|
||||
} else{
|
||||
$('#delete_form_'+id).submit();
|
||||
}
|
||||
},
|
||||
error: function(response){
|
||||
console.log(response);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script>
|
||||
$('#family_account_id_dropdown').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
|
||||
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#search_by').change(function () {
|
||||
if ($(this).val() == 1) {
|
||||
$('#date_search').show();
|
||||
$('#date_range_search').hide();
|
||||
}
|
||||
else if ($(this).val() == 2) {
|
||||
$('#date_range_search').show();
|
||||
$('#date_search').hide();
|
||||
}
|
||||
else {
|
||||
$('#date_search,#date_range_search').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Executable
+10
@@ -0,0 +1,10 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<a href="{{ url('family_accounts/create') }}" class="nav-item btn btn-success" style="border-radius: 5px;"><i class="fa fa-plus"></i> <span style="margin-left: 10px">{{ __('family_accounts.create_family_account') }}</span></a>
|
||||
<a href="{{ url('family_accounts') }}" class="nav-item btn btn-info" style="border-radius: 5px;"><i class="fa fa-pencil"></i> <span style="margin-left: 10px">{{ __('family_accounts.view_family_accounts') }}</span></a>
|
||||
<a href="{{ url('family_accounts') }}" class="nav-item btn btn-info" style="border-radius: 5px;"><i class="fa fa-pencil"></i> <span style="margin-left: 10px">{{ __('family_accounts.add_family_account') }}</span></a>
|
||||
<a href="{{ route('family_accounts.consumption_report') }}" class="nav-item btn btn-primary" style="border-radius: 5px;"><i class="fa fa-book"></i> <span style="margin-left: 10px">{{ __('family_accounts.family_account_consumption_report') }}</span></a>
|
||||
<a href="{{ url('family_accounts_deposits_report') }}" class="nav-item btn btn-primary" style="border-radius: 5px;"><i class="fa fa-book"></i> <span style="margin-left: 10px">{{ __('family_accounts.family_account_deposit_report') }}</span></a>
|
||||
<a href="{{ route('family_accounts.inactive_family_accounts') }}" class="nav-item btn btn-danger" style="border-radius: 5px;"><i class="fa fa-book"></i> <span style="margin-left: 8px">{{ __('family_accounts.inactive_family_accounts') }}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'Patient Receipt - Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body{
|
||||
font-size: 0.8em;
|
||||
}
|
||||
/*thead, tfoot { display: table-row-group }*/
|
||||
thead {
|
||||
display: table-header-group;
|
||||
}
|
||||
tfoot {
|
||||
display: table-row-group;
|
||||
}
|
||||
tr {
|
||||
page-break-before: always;
|
||||
page-break-after: always;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container-fluid">
|
||||
@include('layouts.header_pdf_print')
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td><b>{{ __('patient_finance.date') }}</b></td>
|
||||
<td colspan="2">{{ streamline_date_time_short($receipt_date) }}</td>
|
||||
<td><b>{{ __('patient_finance.receipt_number') }}</b></td>
|
||||
<td colspan="2">{{ $receipt_number }}</td>
|
||||
<td><b>{{ __('family_accounts.deposit_date') }}</b></td>
|
||||
<td colspan="2">{{ $new_family_deposit->deposit_date }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="table table-bordered" id="receipt_table">
|
||||
<thead>
|
||||
<th style="width: 60%"><b>{{ __('family_accounts.family_members') }}</b></th>
|
||||
<th style="width: 20%"><b>{{ __('family_accounts.amount_deposited') }}</b></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<ol>
|
||||
@for($i = 0; $i < count($family_members_array); $i++)
|
||||
<li>
|
||||
{{ get_full_name($family_members_array[$i], "id", "first_name", "last_name", "patients") }}({{ get_name($family_members_array[$i], "id", "number","patients") }})
|
||||
</li>
|
||||
@endfor
|
||||
</ol>
|
||||
</td>
|
||||
<td><b>{{ ugandan_shillings($new_family_deposit->deposit_amount) }}</b></td>
|
||||
</tr>
|
||||
|
||||
@if(count($return_payment_methods) > 0)
|
||||
<tr><td colspan="2"></td></tr>
|
||||
@foreach($return_payment_methods as $key => $value)
|
||||
<tr>
|
||||
<td><b>Patient Paid With {{ ($key == 0) ? 'Cash' : get_name($key, 'id', 'name', 'patient_payment_methods') }}</b></td>
|
||||
<td><b>{{ ugandan_shillings($value) }}</b></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<i style="font-size: 0.8em; float: left">© {{ date('Y') }} Stre@mline</i>
|
||||
</div>
|
||||
<div class="col">
|
||||
<i style="float: right">Printed On {{ date(" d M Y h:ia") }} By {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'Patient Receipt - Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body{
|
||||
font-size: 0.8em;
|
||||
}
|
||||
/*thead, tfoot { display: table-row-group }*/
|
||||
thead {
|
||||
display: table-header-group;
|
||||
}
|
||||
tfoot {
|
||||
display: table-row-group;
|
||||
}
|
||||
tr {
|
||||
page-break-before: always;
|
||||
page-break-after: always;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container-fluid">
|
||||
@include('layouts.header_pdf_print')
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td><b>{{ __('patient_finance.receipt_number') }}</b></td>
|
||||
<td>{{ $receipt_number }}</td>
|
||||
<td><b>Refund Date</b></td>
|
||||
<td>{{ $refund_date }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="table table-bordered" id="receipt_table">
|
||||
<thead>
|
||||
<th style="width: 60%"><b>{{ __('family_accounts.family_members') }}</b></th>
|
||||
<th style="width: 20%"><b>Amount Refunded</b></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<ol>
|
||||
@for($i = 0; $i < count($family_members_array); $i++)
|
||||
<li>
|
||||
{{ get_full_name($family_members_array[$i], "id", "first_name", "last_name", "patients") }}({{ get_name($family_members_array[$i], "id", "number","patients") }})
|
||||
</li>
|
||||
@endfor
|
||||
</ol>
|
||||
</td>
|
||||
<td><b>{{ ugandan_shillings($refund_amount) }}</b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<i style="font-size: 0.8em; float: left">© {{ date('Y') }} Stre@mline</i>
|
||||
</div>
|
||||
<div class="col">
|
||||
<i style="float: right">Printed On {{ date(" d M Y h:ia") }} By {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Executable
+169
@@ -0,0 +1,169 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Refund Family Accounts</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> Refund Family Accounts</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::family_accounts.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{{ Form::open(['method'=>'post','route'=>'family_accounts.store_family_refund']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('family_head',__('family_accounts.family_head')) }}
|
||||
{{ Form::text('family_head', get_full_name($family_account_details->family_head_id, "id", "first_name", "last_name", "patients"), ['class' => 'form-control col-sm-12 compulsory', 'readonly' => 'true']) }}
|
||||
</div>
|
||||
|
||||
{{ Form::hidden('family_account_id', $family_account_details->id) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('current_balance', 'Current Balance') }}
|
||||
{{ Form::number('current_balance', $family_account_details->current_balance,['class' => 'form-control compulsory', 'id' => 'current_balance', 'readonly']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('refund_amount', 'Amount to refund') }}
|
||||
{{ Form::number('refund_amount', '',['class' => 'form-control compulsory', 'id' => 'refund_amount', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('account_id','Account To Pay From') }}
|
||||
{{ Form::select('account_id', $banks, '', ['class' => 'form-control compulsory','required', 'id' => 'account_id', 'onchange' => 'get_bank_balance()']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('account_balance','Account Balance') }}
|
||||
{{ Form::text('account_balance', 0, ['class'=>'form-control compulsory', 'id'=>'account_balance', 'readonly']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('refund_date', 'Refund Date') }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('refund_date', date('d-m-Y'), ['class'=>'form-control compulsory', 'required' , 'readonly', 'id'=>'refund_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('refunded_to', 'Refunded To') }}
|
||||
{{ Form::text('refunded_to', '', ['class'=>'form-control compulsory', 'required']) }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ Form::submit(__('family_accounts.save'),['class'=>'btn btn-success submit_btn'])}}
|
||||
{{ Form::reset(__('family_accounts.cancel'),['type'=>'reset','class'=>'btn btn-default'])}}
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<h3>{{ __('family_accounts.family_members') }}</h3>
|
||||
@php
|
||||
$family_members_array = explode(",", $family_account_details->family_members_ids);
|
||||
@endphp
|
||||
<ol>
|
||||
@for($i = 0; $i < count($family_members_array); $i++)
|
||||
<li>
|
||||
<a href="patients/{{ $family_members_array[$i] }}">{{ get_full_name($family_members_array[$i], "id", "first_name", "last_name", "patients") }}</a>
|
||||
<br>
|
||||
<strong>{{ __('family_accounts.number') }} </strong>{{ get_name($family_members_array[$i], "id", "number","patients") }}
|
||||
<br>
|
||||
<strong>{{ __('family_accounts.contact') }}</strong>{{ get_name($family_members_array[$i], "id", "phone","patients") }}<br>
|
||||
<strong>{{ __('family_accounts.residence') }}</strong>{{ patient_residence($family_members_array[$i]) }}
|
||||
</li>
|
||||
@endfor
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#refund_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
function get_bank_balance() {
|
||||
let refund_amount = parseInt($('#refund_amount').val());
|
||||
|
||||
if (!isNaN(refund_amount)) {
|
||||
let account_id = $('#account_id').val();
|
||||
|
||||
let today = new Date();
|
||||
let today_formatted = String(today.getDate()).padStart(2, '0') + '-' + String(today.getMonth() + 1).padStart(2, '0') + '-' + today.getFullYear();
|
||||
|
||||
if (account_id !== '') {
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/banking/get_current_account_balance_per_date',
|
||||
data: {
|
||||
'bank': account_id,
|
||||
'date': today_formatted
|
||||
},
|
||||
async: true,
|
||||
success: function(response) {
|
||||
var bank_record = JSON.parse(response);
|
||||
var account_balance = bank_record['account_balance'];
|
||||
$('#account_balance').val(account_balance);
|
||||
|
||||
if (account_balance <= 0) {
|
||||
alert('Account Balance is Zero(0) UGX');
|
||||
$('.submit_btn').hide();
|
||||
} else if (refund_amount > account_balance) {
|
||||
alert('Your Account Balance is low');
|
||||
$('.submit_btn').hide();
|
||||
} else {
|
||||
$('.submit_btn').show();
|
||||
}
|
||||
|
||||
},
|
||||
error: function(error) {
|
||||
//console.log(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
alert("Please enter the refund before selecting an account");
|
||||
$('#account_id').val('');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
|
||||
<style type="text/css">
|
||||
#divToPrint{
|
||||
font-size: 13px;
|
||||
color: #7c7c7c;
|
||||
}
|
||||
|
||||
#receipt_table{
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
font-family: monospace
|
||||
}
|
||||
|
||||
#receipt_table th{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
#receipt_table td{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.receipt-label{
|
||||
margin-top: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.receipt-title{
|
||||
font-weight: bolder;
|
||||
text-decoration: underline;
|
||||
display: block; font-family:
|
||||
monospace
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-7">
|
||||
<h4>{{ __('family_accounts.family_account_deposit_receipt') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('family_accounts.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patient_finance.home') }}">{{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active">{{ __('family_accounts.family_account_deposit_receipt') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::family_accounts.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
<div class="row" style="float:right;"><button class="btn btn-success glyphicon glyphicon-print" onclick="print_receipt()"> Print</button></div>
|
||||
<div class="row" id="divToPrint">
|
||||
<div class="col-sm-3"></div>
|
||||
<div class="col-sm-6" style="text-align: center;">
|
||||
<p style="text-align: center; font-size: 1em">
|
||||
@php
|
||||
$hospital_information = \Streamline\Models\HospitalInformation::first();
|
||||
@endphp
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.tel') }}</b> {{ $hospital_information->phone_number }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.email') }}</b> {{ $hospital_information->email }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.cashier') }}</b> {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.date') }}</b> {{ streamline_date(date('Y-m-d')) }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.receipt_number') }}</b> {{ $receipt_number }}</span><br>
|
||||
<span class="receipt-label"><b>Refund Date</b> {{ streamline_date($refund_date) }}</span><br>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<table class="table" id="receipt_table">
|
||||
<thead>
|
||||
<th style="width: 60%"><b>{{ __('family_accounts.family_members') }}</b></th>
|
||||
<th style="width: 20%"><b>Amount Refunded</b></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><ol>
|
||||
@for($i = 0; $i < count($family_members_array); $i++)
|
||||
<li>
|
||||
{{ get_full_name($family_members_array[$i], "id", "first_name", "last_name", "patients") }}({{ get_name($family_members_array[$i], "id", "number","patients") }})
|
||||
</li>
|
||||
@endfor
|
||||
</ol></td>
|
||||
<td><b>{{ ugandan_shillings($refund_amount) }}</b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
</div>
|
||||
<i style="font-size: 0.8em; margin-left: 50%;">{{ __('family_accounts.streamline') }}</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<script type="text/javascript">
|
||||
function print_receipt() {
|
||||
let myDiv = document.getElementById('divToPrint');
|
||||
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
|
||||
|
||||
newWindow.document.write("<html><body " +
|
||||
"class='' " +
|
||||
" onload='window.print()'>" +
|
||||
myDiv.innerHTML +
|
||||
"</body></html>");
|
||||
newWindow.document.close();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+507
@@ -0,0 +1,507 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
@if(session()->get("print_family_account_receipt_pdf") == 1)
|
||||
{{ Form::hidden('print_family_account_receipt_pdf', 1, ['id' => 'print_family_account_receipt_pdf']) }}
|
||||
@endif
|
||||
|
||||
@if(session()->get("print_family_account_refund_receipt_pdf") == 1)
|
||||
{{ Form::hidden('print_family_account_refund_receipt_pdf', 1, ['id' => 'print_family_account_refund_receipt_pdf']) }}
|
||||
@endif
|
||||
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-6 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Family Account Statement <font color="blue">{{ get_full_name($family_account_details->family_head_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($family_account_details->family_head_id, "id", "number","patients") }})</font></h4>
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> Family Account Statement</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::family_accounts.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
@php $family_head_id = get_name($family_account_id, "id", "family_head_id", "family_accounts") @endphp
|
||||
|
||||
{{ Form::open(['url' => 'family_accounts/' . $family_account_id . '/statement/', 'method' => 'ANY']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
{{ Form::hidden('family_account_id', $family_account_id) }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('search_by', __('family_accounts.date')) }}
|
||||
{{ Form::select('search_by', ['0'=>'Last 24 hours','1'=>'Custom Date','2'=>'Custom Range'], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="display: none;" id="date_search">
|
||||
<div class="form-group" id="reg_date" style="padding-top: 23px;">
|
||||
<div class="input-group">
|
||||
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="display: none;" id="date_range_search">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('family_accounts.from')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group" id="reg_date">
|
||||
{{ Form::label('end_date', __('family_accounts.to')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" style="padding-top: 5px;"><br>
|
||||
{{ Form::button(__('family_accounts.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
<div class="col-md-1">
|
||||
<div style="float: right;">
|
||||
{{ Form::open(['url' => 'family_statement_print'])}}
|
||||
{{ Form::hidden('family_account_id', $family_account_id) }}
|
||||
{{ Form::hidden('reg_date', $reg_date) }}
|
||||
{{ Form::hidden('start_date', $start_date) }}
|
||||
{{ Form::hidden('end_date', $end_date) }}
|
||||
<button type="submit" class="btn btn-rounded" style="background-color: #03C03C; color: white;">
|
||||
<i class="fa fa-print"></i>
|
||||
<span>Print Statement</span>
|
||||
</button>
|
||||
{{ Form::close() }}
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(!is_null($reg_date))
|
||||
<h2>Family Statement as at <font color="blue">{{ streamline_date($reg_date) }}</font></h2>
|
||||
@elseif(!is_null($start_date) && !is_null($end_date))
|
||||
<h2>Family statement as at <font color="blue">{{ streamline_date($start_date) }}</font> {{ __('family_accounts.to') }} <font color="blue">{{ streamline_date($end_date) }}</font></h2>
|
||||
@endif
|
||||
|
||||
<h3>Family Deposits</h3>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('family_accounts.deposited_on') }}</th>
|
||||
<th>Received By</th>
|
||||
<th>{{ __('family_accounts.family_head') }}</th>
|
||||
<th>{{ __('family_accounts.deposited_by') }}</th>
|
||||
<th>{{ __('family_accounts.amount_deposited') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_family_deposits = 0; $current_balance_total = 0; @endphp
|
||||
@if(count($family_deposits) > 0)
|
||||
@foreach($family_deposits as $deposit)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ streamline_date($deposit->deposit_date) }}</td>
|
||||
<td>{{ get_full_name($deposit->created_by, "id", "first_name", "last_name", "users") }}</td>
|
||||
@php $family_head_id = get_name($deposit->family_account_id, "id", "family_head_id", "family_accounts") @endphp
|
||||
<td>
|
||||
{{ get_full_name($family_head_id, "id", "first_name", "last_name", "patients") }}
|
||||
({{ get_name($family_head_id, "id", "number","patients") }})
|
||||
</td>
|
||||
@php
|
||||
$family_members_array = [];
|
||||
$family_account_details = \Streamline\Models\FamilyAccount::withTrashed()->find($deposit->family_account_id);
|
||||
$family_members_array = explode(",", $family_account_details->family_members_ids);
|
||||
@endphp
|
||||
{{--<td>
|
||||
@for($i = 0; $i < count($family_members_array); $i++)
|
||||
<li>
|
||||
<a href="patients/{{ $family_members_array[$i] }}">{{ get_full_name($family_members_array[$i], "id", "first_name", "last_name", "patients") }} ({{ get_name($family_members_array[$i], "id", "number","patients") }})</a>
|
||||
</li>
|
||||
@endfor
|
||||
</td>--}}
|
||||
<td>
|
||||
{{ $deposit->deposited_by }}
|
||||
</td>
|
||||
<td>
|
||||
@php $total_family_deposits += $deposit->deposit_amount; @endphp
|
||||
|
||||
{{ ugandan_shillings($deposit->deposit_amount) }}
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="6" class="text-center"><code>No family deposits have been made</code></td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td></td>
|
||||
<td><strong>{{ ugandan_shillings($total_family_deposits) }}</strong></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h3>Family consumption</h3>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('family_accounts.date') }}</th>
|
||||
<th>Member</th>
|
||||
<th>{{ __('family_accounts.reason') }}</th>
|
||||
<th>{{ __('family_accounts.amount_consumed') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_consumptions = 0; @endphp
|
||||
@if(count($family_consumptions) > 0)
|
||||
@foreach($family_consumptions as $member_consumption)
|
||||
|
||||
@php
|
||||
$expenditure_type = $member_consumption->expenditure_tag;
|
||||
$items_received_array = [];
|
||||
|
||||
if($expenditure_type == "Services"){
|
||||
|
||||
$service_deposit_record = \Streamline\Models\ServiceDeposit::where(['patient_id' => $member_consumption->patient_id, 'episode_id' => $member_consumption->episode_id])->first();
|
||||
|
||||
if ($service_deposit_record){
|
||||
$items_received = explode(",", $service_deposit_record->items_ids);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "services");
|
||||
}
|
||||
}
|
||||
} elseif($expenditure_type == "Treatment"){
|
||||
|
||||
$treatment_deposit_record = \Streamline\Models\TreatmentDeposits::where(['patient_id' => $member_consumption->patient_id, 'episode_id' => $member_consumption->episode_id])->first();
|
||||
|
||||
if ($treatment_deposit_record){
|
||||
$items_received = explode(",", $treatment_deposit_record->treatment_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "drugs");
|
||||
}
|
||||
}
|
||||
} elseif($expenditure_type == "Sundries"){
|
||||
|
||||
$sundries_deposit_record = \Streamline\Models\SundryDeposit::where(['patient_id' => $member_consumption->patient_id, 'episode_id' => $member_consumption->episode_id])->first();
|
||||
|
||||
if ($sundries_deposit_record){
|
||||
$items_received = explode(",", $sundries_deposit_record->sundry_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "sundries");
|
||||
}
|
||||
}
|
||||
} elseif($expenditure_type == "Investigations"){
|
||||
|
||||
$investigation_deposit_record = \Streamline\Models\InvestigationDeposit::where(['patient_id' => $member_consumption->patient_id, 'episode_id' => $member_consumption->episode_id])->first();
|
||||
|
||||
if ($investigation_deposit_record){
|
||||
$items_received = explode(",", $investigation_deposit_record->investigation_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "investigations");
|
||||
}
|
||||
}
|
||||
} elseif($expenditure_type == "Procedures"){
|
||||
|
||||
$procedure_deposit_record = \Streamline\Models\ProcedureDeposit::where(['patient_id' => $member_consumption->patient_id, 'episode_id' => $member_consumption->episode_id])->first();
|
||||
|
||||
if ($procedure_deposit_record){
|
||||
$items_received = explode(",", $procedure_deposit_record->procedure_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "procedures");
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
@php $family_head_id = get_name($member_consumption->family_account_id, "id", "family_head_id", "family_accounts") @endphp
|
||||
<td>
|
||||
{{ streamline_date($member_consumption->created_at) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ get_full_name($member_consumption->patient_id, "id", "first_name", "last_name", "patients") }}
|
||||
</td>
|
||||
<td>
|
||||
<strong>{{ $member_consumption->expenditure_tag == "Services" ? "Consultation / Services" : $member_consumption->expenditure_tag }}</strong>
|
||||
<ol>
|
||||
@for($j = 0; $j < count($items_received_array); $j++)
|
||||
<li>{{ $items_received_array[$j] }}</li>
|
||||
@endfor
|
||||
</ol>
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($member_consumption->amount_consumed) }}
|
||||
@php
|
||||
$total_consumptions += $member_consumption->amount_consumed;
|
||||
@endphp
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="6" class="text-center"><code>No family consumption has been recorded</code></td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td></td>
|
||||
<td><strong>{{ ugandan_shillings($total_consumptions) }}</strong></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h3>Family Refunds</h3>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Refunded On</th>
|
||||
<th>Cashier</th>
|
||||
<th>{{ __('family_accounts.family_head') }}</th>
|
||||
<th>Refunded To</th>
|
||||
<th>Amount Refunded</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_family_refunds = 0; @endphp
|
||||
@if(count($family_refunds) > 0)
|
||||
@foreach($family_refunds as $refund)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ streamline_date($refund->created_at) }}</td>
|
||||
<td>{{ get_full_name($refund->created_by, "id", "first_name", "last_name", "users") }}</td>
|
||||
@php $family_head_id = get_name($refund->family_account_id, "id", "family_head_id", "family_accounts") @endphp
|
||||
<td>
|
||||
{{ get_full_name($family_head_id, "id", "first_name", "last_name", "patients") }}
|
||||
({{ get_name($family_head_id, "id", "number","patients") }})
|
||||
</td>
|
||||
<td>
|
||||
{{ $refund->refund_to }}
|
||||
</td>
|
||||
<td>
|
||||
@php $total_family_refunds += $refund->refund_amount; @endphp
|
||||
|
||||
{{ ugandan_shillings($refund->refund_amount) }}
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="6" class="text-center"><code>No family refunds have been made</code></td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td></td>
|
||||
<td><strong>{{ ugandan_shillings($total_family_refunds) }}</strong></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="font-weight: bolder; font-size: 24px;">
|
||||
<br><br>
|
||||
<span><strong>Current Balance:</strong> {{ is_numeric($family_account_details->current_balance) ? ugandan_shillings($family_account_details->current_balance) : "N/A" }}</span>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-1"></div>
|
||||
<div class="col-md-2">
|
||||
<a href="/family_accounts/{{ $family_account_details->id }}/edit/" class="btn btn-info btn-block"><i class="fa fa-pencil"></i> {{ __('family_accounts.edit') }}</a>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
{{ Form::open(['url' => 'family_accounts/add_deposit']) }}
|
||||
{{ Form::hidden('family_account_id', $family_account_details->id) }}
|
||||
{{ Form::submit('Add deposit', ['class' => 'btn btn-success btn-block']) }}
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<a href="/family_accounts/{{ $family_account_details->id }}/statement/" class="btn btn-primary btn-block"><i class="fa fa-book"></i> Statement</a>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
{{ Form::model($family_account_details->id ,['method' => 'DELETE', 'route' => ['family_accounts.destroy', $family_account_details->id]]) }}
|
||||
<button type="submit" class="btn btn-danger btn-block" onclick="return confirm('Are you sure you want to remove this family account?')"><i class="fa fa-trash"></i> {{ __('family_accounts.deactivate') }}</button>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<a href="/family_accounts/refund/{{ $family_account_details->id }}" class="btn btn-default btn-block"> Refund Family Account</a>
|
||||
</div>
|
||||
<div class="col-md-1"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
|
||||
<!-- Date Picker Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script>
|
||||
if ($('#print_family_account_receipt_pdf').val() == 1) {
|
||||
var win = window.open('/print_family_account_receipt_pdf_details', '_blank');
|
||||
if (win) {
|
||||
win.focus();
|
||||
} else {
|
||||
alert('Please allow popups for Stre@mline');
|
||||
}
|
||||
}
|
||||
|
||||
if ($('#print_family_account_refund_receipt_pdf').val() == 1) {
|
||||
var win = window.open('/print_family_account_refund_receipt_pdf_details', '_blank');
|
||||
if (win) {
|
||||
win.focus();
|
||||
} else {
|
||||
alert('Please allow popups for Stre@mline');
|
||||
}
|
||||
}
|
||||
|
||||
var family_name = {!! json_encode(get_full_name($family_head_id, "id", "first_name", "last_name", "patients")) !!};
|
||||
$('.table111').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
message: 'CONSUMPTION DETAILS FOR THE FAMILY OF '+family_name
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: 'CONSUMPTION DETAILS FOR THE FAMILY OF '+family_name,
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4 ]
|
||||
},
|
||||
sheetName: 'CONSUMPTION DETAILS FOR THE FAMILY OF '+family_name
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: 'CONSUMPTION DETAILS FOR THE FAMILY OF '+family_name,
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4 ]
|
||||
},
|
||||
customize: function(doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
}
|
||||
},
|
||||
{ extend: 'print',
|
||||
message: 'CONSUMPTION DETAILS FOR THE FAMILY OF '+family_name,
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4 ]
|
||||
},
|
||||
customize: function (win) {
|
||||
$(win.document.body)
|
||||
.css('font-size', '10pt')
|
||||
.css('background', '#fff')
|
||||
.prepend(
|
||||
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
|
||||
);
|
||||
$(win.document.body).find('table')
|
||||
.addClass('compact')
|
||||
.css('font-size', 'inherit');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#search_by').change(function () {
|
||||
if ($(this).val() == 1) {
|
||||
$('#date_search').show();
|
||||
$('#date_range_search').hide();
|
||||
}
|
||||
else if ($(this).val() == 2) {
|
||||
$('#date_range_search').show();
|
||||
$('#date_search').hide();
|
||||
}
|
||||
else {
|
||||
$('#date_search,#date_range_search').hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+298
@@ -0,0 +1,298 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
|
||||
<style style="text-css">
|
||||
body{
|
||||
/*font-size: 1.2em;*/
|
||||
}
|
||||
|
||||
thead {
|
||||
/*display: table-header-group;*/
|
||||
}
|
||||
|
||||
tfoot {
|
||||
/*display: table-row-group;*/
|
||||
}
|
||||
|
||||
tr {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
@include('layouts.header_pdf_print')
|
||||
<h5 class="heading" style="text-align: center;">Family Account Statement for <font color="blue">{{ get_full_name($family_account_details->family_head_id, "id", "first_name", "last_name", "patients")}} ({{ get_name($family_account_details->family_head_id, "id", "number", "patients")}})</font></h5>
|
||||
|
||||
<hr><br>
|
||||
|
||||
<h5>Family Account Deposits</h5>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<table class="table table-sm color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('family_accounts.deposited_on') }}</th>
|
||||
<th>{{ __('family_accounts.received_by') }}</th>
|
||||
<th>{{ __('family_accounts.family_head') }}</th>
|
||||
<th>{{ __('family_accounts.deposited_by') }}</th>
|
||||
<th>{{ __('family_accounts.amount_deposited') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_family_deposits = 0; $current_balance_total = 0; @endphp
|
||||
@if(count($family_deposits) > 0)
|
||||
@foreach($family_deposits as $deposit)
|
||||
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ streamline_date($deposit->deposit_date) }}</td>
|
||||
<td>{{ get_full_name($deposit->created_by, "id", "first_name", "last_name", "users") }}</td>
|
||||
@php $family_head_id = get_name($deposit->family_account_id, "id", "family_head_id", "family_accounts") @endphp
|
||||
<td>
|
||||
{{ get_full_name($family_head_id, "id", "first_name", "last_name", "patients") }}
|
||||
({{ get_name($family_head_id, "id", "number","patients") }})
|
||||
</td>
|
||||
@php
|
||||
$family_members_array = [];
|
||||
$family_account_details = \Streamline\Models\FamilyAccount::withTrashed()->find($deposit->family_account_id);
|
||||
$family_members_array = explode(",", $family_account_details->family_members_ids);
|
||||
@endphp
|
||||
{{--<td>
|
||||
@for($i = 0; $i < count($family_members_array); $i++)
|
||||
<li>
|
||||
<a href="patients/{{ $family_members_array[$i] }}">{{ get_full_name($family_members_array[$i], "id", "first_name", "last_name", "patients") }} ({{ get_name($family_members_array[$i], "id", "number","patients") }})</a>
|
||||
</li>
|
||||
@endfor
|
||||
</td>--}}
|
||||
<td>
|
||||
{{ $deposit->deposited_by }}
|
||||
</td>
|
||||
<td>
|
||||
@php $total_family_deposits += $deposit->deposit_amount; @endphp
|
||||
|
||||
{{ ugandan_shillings($deposit->deposit_amount) }}
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td></td>
|
||||
<td><strong>{{ ugandan_shillings($total_family_deposits) }}</strong></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr><br>
|
||||
|
||||
<h5>Family Account Consumptions</h5>
|
||||
<div class="row">
|
||||
<table class="table table-sm color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('family_accounts.date') }}</th>
|
||||
<th>{{ __('family_accounts.family_member') }}</th>
|
||||
<th>{{ __('family_accounts.reason') }}</th>
|
||||
<th>{{ __('family_accounts.amount_consumed') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_consumptions = 0; @endphp
|
||||
@if(count($family_consumptions) > 0)
|
||||
@foreach($family_consumptions as $member_consumption)
|
||||
|
||||
@php
|
||||
$expenditure_type = $member_consumption->expenditure_tag;
|
||||
$items_received_array = [];
|
||||
|
||||
if($expenditure_type == "Services"){
|
||||
|
||||
$service_deposit_record = \Streamline\Models\ServiceDeposit::where(['patient_id' => $member_consumption->patient_id, 'episode_id' => $member_consumption->episode_id])->first();
|
||||
|
||||
if ($service_deposit_record){
|
||||
$items_received = explode(",", $service_deposit_record->items_ids);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "services");
|
||||
}
|
||||
}
|
||||
} elseif($expenditure_type == "Treatment"){
|
||||
|
||||
$treatment_deposit_record = \Streamline\Models\TreatmentDeposits::where(['patient_id' => $member_consumption->patient_id, 'episode_id' => $member_consumption->episode_id])->first();
|
||||
|
||||
if ($treatment_deposit_record){
|
||||
$items_received = explode(",", $treatment_deposit_record->treatment_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "drugs");
|
||||
}
|
||||
}
|
||||
} elseif($expenditure_type == "Sundries"){
|
||||
|
||||
$sundries_deposit_record = \Streamline\Models\SundryDeposit::where(['patient_id' => $member_consumption->patient_id, 'episode_id' => $member_consumption->episode_id])->first();
|
||||
|
||||
if ($sundries_deposit_record){
|
||||
$items_received = explode(",", $sundries_deposit_record->sundry_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "sundries");
|
||||
}
|
||||
}
|
||||
} elseif($expenditure_type == "Investigations"){
|
||||
|
||||
$investigation_deposit_record = \Streamline\Models\InvestigationDeposit::where(['patient_id' => $member_consumption->patient_id, 'episode_id' => $member_consumption->episode_id])->first();
|
||||
|
||||
if ($investigation_deposit_record){
|
||||
$items_received = explode(",", $investigation_deposit_record->investigation_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "investigations");
|
||||
}
|
||||
}
|
||||
} elseif($expenditure_type == "Procedures"){
|
||||
|
||||
$procedure_deposit_record = \Streamline\Models\ProcedureDeposit::where(['patient_id' => $member_consumption->patient_id, 'episode_id' => $member_consumption->episode_id])->first();
|
||||
|
||||
if ($procedure_deposit_record){
|
||||
$items_received = explode(",", $procedure_deposit_record->procedure_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "procedures");
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>
|
||||
{{ streamline_date($member_consumption->created_at) }}
|
||||
</td>
|
||||
@php $family_head_id = get_name($member_consumption->family_account_id, "id", "family_head_id", "family_accounts") @endphp
|
||||
<td>
|
||||
{{ get_full_name($member_consumption->patient_id, "id", "first_name", "last_name", "patients") }}
|
||||
</td>
|
||||
<td>
|
||||
<strong>{{ $member_consumption->expenditure_tag == "Services" ? "Consultation / Services" : $member_consumption->expenditure_tag }}</strong>
|
||||
<ol>
|
||||
@for($j = 0; $j < count($items_received_array); $j++)
|
||||
<li>{{ $items_received_array[$j] }}</li>
|
||||
@endfor
|
||||
</ol>
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($member_consumption->amount_consumed) }}
|
||||
@php
|
||||
$total_consumptions += $member_consumption->amount_consumed;
|
||||
@endphp
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td></td>
|
||||
<td><strong>{{ ugandan_shillings($total_consumptions) }}</strong></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr><br>
|
||||
<h5>Family Refunds</h5>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Refunded On</th>
|
||||
<th>Cashier</th>
|
||||
<th>{{ __('family_accounts.family_head') }}</th>
|
||||
<th>Refunded To</th>
|
||||
<th>Amount Refunded</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_family_refunds = 0; @endphp
|
||||
@if(count($family_refunds) > 0)
|
||||
@foreach($family_refunds as $refund)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ streamline_date($refund->created_at) }}</td>
|
||||
<td>{{ get_full_name($refund->created_by, "id", "first_name", "last_name", "users") }}</td>
|
||||
@php $family_head_id = get_name($refund->family_account_id, "id", "family_head_id", "family_accounts") @endphp
|
||||
<td>
|
||||
{{ get_full_name($family_head_id, "id", "first_name", "last_name", "patients") }}
|
||||
({{ get_name($family_head_id, "id", "number","patients") }})
|
||||
</td>
|
||||
<td>
|
||||
{{ $refund->refund_to }}
|
||||
</td>
|
||||
<td>
|
||||
@php $total_family_refunds += $refund->refund_amount; @endphp
|
||||
|
||||
{{ ugandan_shillings($refund->refund_amount) }}
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="6" class="text-center"><code>No family refunds have been made</code></td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td></td>
|
||||
<td><strong>{{ ugandan_shillings($total_family_refunds) }}</strong></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr><br>
|
||||
|
||||
<div class="row" style="float: right; font-weight: bolder; font-size: 24px; padding-right: 50px; padding-bottom: 20px;">
|
||||
<span><strong>Current Balance:</strong> {{ is_numeric($family_account_details->current_balance) ? ugandan_shillings($family_account_details->current_balance) : "N/A" }}</span>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<h3>.</h3>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+331
@@ -0,0 +1,331 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Patient Accounts Consumptions{{ __('patient_accounts.') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> Reports</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('patient_discounts::patient_accounts.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
{{ Form::open(['url' => 'patient_accounts/consumptions_report', 'method' => 'ANY']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="patient_numbers">
|
||||
{{ Form::label('patient_number',__('investigations.patient_number')) }}
|
||||
{{ Form::text('patient_number', '', ['class' => 'form-control typeahead', 'placeholder' => 'Patient number', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('search_by', __('family_accounts.date')) }}
|
||||
{{ Form::select('search_by', ['0'=>'Last 24 hours','1'=>'Custom Date','2'=>'Custom Range'], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="display: none;" id="date_search">
|
||||
<div class="form-group" id="reg_date" style="padding-top: 23px;">
|
||||
<div class="input-group">
|
||||
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="display: none;" id="date_range_search">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('family_accounts.from')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group" id="reg_date">
|
||||
{{ Form::label('end_date', __('family_accounts.to')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" style="padding-top: 5px;"><br>
|
||||
{{ Form::button(__('family_accounts.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
@if(!is_null($reg_date))
|
||||
<h4>Showing consumption of <font color="blue">{{ streamline_date($reg_date) }}</font></h4>
|
||||
@elseif(!is_null($start_date) && !is_null($end_date))
|
||||
<h4>Showing consumption from<font color="blue">{{ streamline_date($start_date) }}</font> to <font color="blue">{{ streamline_date($end_date) }}</font></h4>
|
||||
@endif
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Patient Names</th>
|
||||
<th>Amount Consumed</th>
|
||||
<th>Date Consumed</th>
|
||||
<th>Staff</th>
|
||||
<th>Reason</th>
|
||||
<th>{{ __('family_accounts.action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_consumption = 0; @endphp
|
||||
@foreach($patient_consumptions as $record)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ get_full_name($record->patient_id, 'id', 'first_name', 'last_name', 'patients') }} ({{ get_name($record->patient_id, 'id', 'number', 'patients') }})</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($record->amount_consumed) }}
|
||||
@php $total_consumption += $record->amount_consumed; @endphp
|
||||
</td>
|
||||
<td>{{ streamline_date_time($record->created_at) }}</td>
|
||||
<td>{{ get_full_name($record->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
@php
|
||||
$tag_id = $record->tag_id;
|
||||
$items_received_array = [];
|
||||
|
||||
if($tag_id == 6 || $tag_id == 8){
|
||||
|
||||
$service_deposit_record = \Streamline\Models\ServiceDeposit::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($service_deposit_record){
|
||||
$items_received = explode(",", $service_deposit_record->items_ids);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "services");
|
||||
}
|
||||
}
|
||||
} elseif($tag_id == 3){
|
||||
|
||||
$treatment_deposit_record = \Streamline\Models\TreatmentDeposits::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($treatment_deposit_record){
|
||||
$items_received = explode(",", $treatment_deposit_record->treatment_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "drugs");
|
||||
}
|
||||
}
|
||||
} elseif($tag_id == 5){
|
||||
|
||||
$sundries_deposit_record = \Streamline\Models\SundryDeposit::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($sundries_deposit_record){
|
||||
$items_received = explode(",", $sundries_deposit_record->sundry_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "sundries");
|
||||
}
|
||||
}
|
||||
} elseif($tag_id == 2){
|
||||
$investigation_deposit_record = \Streamline\Models\InvestigationDeposit::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($investigation_deposit_record){
|
||||
$items_received = explode(",", $investigation_deposit_record->investigation_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "investigations");
|
||||
}
|
||||
}
|
||||
} elseif($tag_id == 4){
|
||||
|
||||
$procedure_deposit_record = \Streamline\Models\ProcedureDeposit::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($procedure_deposit_record){
|
||||
$items_received = explode(",", $procedure_deposit_record->procedure_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "procedures");
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<td>
|
||||
<strong>{{ get_name($record->tag_id, 'id', 'name', 'finance_point_tags') }}</strong>
|
||||
<ol>
|
||||
@for($j = 0; $j < count($items_received_array); $j++)
|
||||
<li>{{ $items_received_array[$j] }}</li>
|
||||
@endfor
|
||||
</ol>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/patient_accounts/view_details/{{ $record->patient_id }}/" class="btn btn-outline-success btn-sm"><i class="fa fa-book"></i> Statement</a>
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($total_consumption) }}</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
|
||||
<!-- Date Picker Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
|
||||
<script>
|
||||
var substringMatcher = function (strs) {
|
||||
return function findMatches(q, cb) {
|
||||
var matches, substringRegex;
|
||||
|
||||
// an array that will be populated with substring matches
|
||||
matches = [];
|
||||
|
||||
// regex used to determine if a string contains the substring `q`
|
||||
substrRegex = new RegExp(q, 'i');
|
||||
|
||||
// iterate through the pool of strings and for any string that
|
||||
// contains the substring `q`, add it to the `matches` array
|
||||
$.each(strs, function (i, str) {
|
||||
if (substrRegex.test(str)) {
|
||||
matches.push(str);
|
||||
}
|
||||
});
|
||||
|
||||
cb(matches);
|
||||
};
|
||||
};
|
||||
|
||||
$('#patient_numbers .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'patient_numbers',
|
||||
source: substringMatcher(<?php echo json_encode($patient_numbers); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
message: 'Patient Accounts'
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: 'Patient Accounts',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
sheetName: 'Patient Accounts'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: 'Patient Accounts',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
customize: function(doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
}
|
||||
},
|
||||
{ extend: 'print',
|
||||
message: 'Patient Accounts',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
customize: function (win) {
|
||||
$(win.document.body)
|
||||
.css('font-size', '10pt')
|
||||
.css('background', '#fff')
|
||||
.prepend(
|
||||
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
|
||||
);
|
||||
$(win.document.body).find('table')
|
||||
.addClass('compact')
|
||||
.css('font-size', 'inherit');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#search_by').change(function () {
|
||||
if ($(this).val() == 1) {
|
||||
$('#date_search').show();
|
||||
$('#date_range_search').hide();
|
||||
}
|
||||
else if ($(this).val() == 2) {
|
||||
$('#date_range_search').show();
|
||||
$('#date_search').hide();
|
||||
}
|
||||
else {
|
||||
$('#date_search,#date_range_search').hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
|
||||
<style type="text/css">
|
||||
#divToPrint{
|
||||
font-size: 13px;
|
||||
color: #7c7c7c;
|
||||
}
|
||||
|
||||
#receipt_table{
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
font-family: monospace
|
||||
}
|
||||
|
||||
#receipt_table th{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
#receipt_table td{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.receipt-label{
|
||||
margin-top: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.receipt-title{
|
||||
font-weight: bolder;
|
||||
text-decoration: underline;
|
||||
display: block; font-family:
|
||||
monospace
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-7">
|
||||
<h4>Patient Account Deposits{{ __('patient_accounts.') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('family_accounts.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('patient_finance.home') }}">{{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active">Patient Account Deposits Receipt{{ __('patient_accounts.') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
<div class="row" style="float:right;"><button class="btn btn-success glyphicon glyphicon-print" onclick="print_receipt()"> Print{{ __('patient_accounts.') }}</button></div>
|
||||
<div class="row" id="divToPrint">
|
||||
<div class="col-sm-3"></div>
|
||||
<div class="col-sm-6" style="text-align: center;">
|
||||
<p style="text-align: center; font-size: 1em">
|
||||
@php
|
||||
$hospital_information = \Streamline\Models\HospitalInformation::first();
|
||||
@endphp
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.tel') }}</b> {{ $hospital_information->phone_number }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.email') }}</b> {{ $hospital_information->email }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.cashier') }}</b> {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.date') }}</b> {{ streamline_date_time_short($receipt_date) }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('family_accounts.receipt_number') }}</b> {{ $receipt_number }}</span><br>
|
||||
<span class="receipt-label"><b>Transaction Date{{ __('patient_accounts.') }}</b> {{ streamline_date($deposit_date) }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('patient_finance.patient_names') }}</b> : {{ $patient->first_name }} {{ $patient->last_name }}</span><br>
|
||||
<span class="receipt-label"><b>{{ __('patient_finance.patient_number') }}</b> : {{ $patient->number }} </span><br>
|
||||
<span class="receipt-label"><b>{{ __('patient_finance.patient_category') }} :</b> {{ get_name($patient->category_id, "id", "name", "patient_categories") }}</span>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<table class="table" id="receipt_table">
|
||||
<thead>
|
||||
<th style="width: 60%"><b>{{ __('patient_finance.description') }}</b></th>
|
||||
<th style="width: 20%"><b>Amounts{{ __('patient_accounts.') }}</b></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ $description }}</td>
|
||||
<td><b>{{ ugandan_shillings($deposit_amount) }}</b></td>
|
||||
</tr>
|
||||
|
||||
@if(count($return_payment_methods) > 0)
|
||||
<tr><td colspan="2"></td></tr>
|
||||
@foreach($return_payment_methods as $key => $value)
|
||||
<tr>
|
||||
<td><b>Patient Paid With{{ __('patient_accounts.') }} {{ ($key == 0) ? 'Cash' : get_name($key, 'id', 'name', 'patient_payment_methods') }}</b></td>
|
||||
<td><b>{{ ugandan_shillings($value) }}</b></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
</div>
|
||||
<i style="font-size: 0.8em; margin-left: 50%;">{{ __('family_accounts.streamline') }}</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<script type="text/javascript">
|
||||
function print_receipt() {
|
||||
let myDiv = document.getElementById('divToPrint');
|
||||
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
|
||||
|
||||
newWindow.document.write("<html><body " +
|
||||
"class='' " +
|
||||
" onload='window.print()'>" +
|
||||
myDiv.innerHTML +
|
||||
"</body></html>");
|
||||
newWindow.document.close();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+268
@@ -0,0 +1,268 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('patient_accounts.patient_accounts_deposits') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('patient_accounts.reports') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('patient_discounts::patient_accounts.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
{{ Form::open(['url' => 'patient_accounts/deposits_report', 'method' => 'ANY']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="patient_numbers">
|
||||
{{ Form::label('patient_number',__('investigations.patient_number')) }}
|
||||
{{ Form::text('patient_number', '', ['class' => 'form-control typeahead', 'placeholder' => 'Patient number', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('search_by', __('family_accounts.date')) }}
|
||||
{{ Form::select('search_by', ['0'=>'Last 24 hours','1'=>'Custom Date','2'=>'Custom Range'], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="display: none;" id="date_search">
|
||||
<div class="form-group" id="reg_date" style="padding-top: 23px;">
|
||||
<div class="input-group">
|
||||
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="display: none;" id="date_range_search">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('family_accounts.from')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group" id="reg_date">
|
||||
{{ Form::label('end_date', __('family_accounts.to')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" style="padding-top: 5px;"><br>
|
||||
{{ Form::button(__('family_accounts.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
@if(!is_null($reg_date))
|
||||
<h4>{{ __('family_accounts.showing_deposit_of') }} <font color="blue">{{ streamline_date($reg_date) }}</font></h4>
|
||||
@elseif(!is_null($start_date) && !is_null($end_date))
|
||||
<h4>{{ __('family_accounts.showing_deposit_from') }}<font color="blue">{{ streamline_date($start_date) }}</font> {{ __('patient_accounts.to') }} <font color="blue">{{ streamline_date($end_date) }}</font></h4>
|
||||
@endif
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('patient_accounts.patient_names') }}</th>
|
||||
<th>{{ __('patient_accounts.deposit_amount') }}</th>
|
||||
<th>{{ __('patient_accounts.deposit_date') }}</th>
|
||||
<th>{{ __('patient_accounts.received_by') }}</th>
|
||||
<th>{{ __('family_accounts.action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_deposits = 0; @endphp
|
||||
@if(count($patient_deposits) > 0)
|
||||
@foreach($patient_deposits as $deposit)
|
||||
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ get_full_name($deposit->patient_id, 'id', 'first_name', 'last_name', 'patients') }} ({{ get_name($deposit->patient_id, 'id', 'number', 'patients') }})</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($deposit->deposit_amount) }}
|
||||
@php $total_deposits += $deposit->deposit_amount; @endphp
|
||||
</td>
|
||||
<td>{{ streamline_date($deposit->deposit_date) }}</td>
|
||||
<td>{{ get_full_name($deposit->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
<td>
|
||||
<a href="/patient_accounts/view_details/{{ $deposit->patient_id }}/" class="btn btn-outline-success btn-sm"><i class="fa fa-book"></i> {{ __('patient_accounts.statement') }}</a>
|
||||
<br><br>
|
||||
@if(Auth::user()->can('cancel-patient-accounts-deposits') && is_null($deposit->received))
|
||||
<a href="/patient_accounts/cancel_deposit/{{ $deposit->id }}/" class="btn btn-outline-primary btn-sm" onclick="return confirm('Are you sure you want to cancel this deposit?')"> {{ __('patient_accounts.cancel_deposit') }}</a>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($total_deposits) }}</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
|
||||
<!-- Date Picker Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
|
||||
<script>
|
||||
var substringMatcher = function (strs) {
|
||||
return function findMatches(q, cb) {
|
||||
var matches, substringRegex;
|
||||
|
||||
// an array that will be populated with substring matches
|
||||
matches = [];
|
||||
|
||||
// regex used to determine if a string contains the substring `q`
|
||||
substrRegex = new RegExp(q, 'i');
|
||||
|
||||
// iterate through the pool of strings and for any string that
|
||||
// contains the substring `q`, add it to the `matches` array
|
||||
$.each(strs, function (i, str) {
|
||||
if (substrRegex.test(str)) {
|
||||
matches.push(str);
|
||||
}
|
||||
});
|
||||
|
||||
cb(matches);
|
||||
};
|
||||
};
|
||||
|
||||
$('#patient_numbers .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'patient_numbers',
|
||||
source: substringMatcher(<?php echo json_encode($patient_numbers); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
message: 'Patient Accounts'
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: 'Patient Accounts',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
sheetName: 'Patient Accounts'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: 'Patient Accounts',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
customize: function(doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
}
|
||||
},
|
||||
{ extend: 'print',
|
||||
message: 'Patient Accounts',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
customize: function (win) {
|
||||
$(win.document.body)
|
||||
.css('font-size', '10pt')
|
||||
.css('background', '#fff')
|
||||
.prepend(
|
||||
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
|
||||
);
|
||||
$(win.document.body).find('table')
|
||||
.addClass('compact')
|
||||
.css('font-size', 'inherit');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#search_by').change(function () {
|
||||
if ($(this).val() == 1) {
|
||||
$('#date_search').show();
|
||||
$('#date_range_search').hide();
|
||||
}
|
||||
else if ($(this).val() == 2) {
|
||||
$('#date_range_search').show();
|
||||
$('#date_search').hide();
|
||||
}
|
||||
else {
|
||||
$('#date_search,#date_range_search').hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('family_accounts.add_family_deposit') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('family_accounts.add_family_deposit') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('patient_discounts::patient_accounts.menu')
|
||||
|
||||
<div class="white-box">
|
||||
@include('patient_discounts::patient_accounts.patient_details')
|
||||
|
||||
@include('flash::message')
|
||||
{{ Form::open(['method'=>'post','route'=>'patient_accounts.store_deposit']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposit_amount',__('family_accounts.amount_deposited')) }}
|
||||
{{ Form::number('deposit_amount', '',['class' => 'form-control compulsory', 'id' => 'deposit_amount', 'required']) }}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<label class="label label-primary" id="add_payment_method_button" onclick="add_payment_method();">{{ __('patient_accounts.add_payment_method') }}</label>
|
||||
</div>
|
||||
<div class="col-md-6"></div>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<div id="payment_methods_div" style="display: none">
|
||||
<div class="form-group">
|
||||
{{ Form::label('cash_to_pay',__('patient_accounts.cash_to_pay')) }}
|
||||
{{ Form::hidden('original_cash_to_pay', 0, ['id' => 'original_cash_to_pay']) }}
|
||||
{{ Form::number('cash_to_pay',0,['class' => 'form-control','id'=>'cash_to_pay','readonly']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ Form::submit(__('family_accounts.save'),['class'=>'btn btn-success'])}}
|
||||
{{ Form::reset(__('family_accounts.cancel'),['type'=>'reset','class'=>'btn btn-default'])}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposit_date', __('family_accounts.deposited_on')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('deposit_date', date('d-m-Y'), ['class'=>'form-control compulsory', 'required' , 'readonly', 'id'=>'deposit_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('.family_dropdown').select2({
|
||||
placeholder: "Select member"
|
||||
});
|
||||
$('.select2-selection.select2-selection--single').css('height','calc(3.85rem)');
|
||||
$('.select2-selection.select2-selection--single').css('padding-top','5px');
|
||||
$('.select2-selection.select2-selection--single').css('border-left', '3px solid #F08080');/*add compulsory class*/
|
||||
$('.select2-selection.select2-selection--single.sec_d').css('border-left', '3px solid #aaa');
|
||||
$('.select2-selection__arrow').css('top','3px');
|
||||
|
||||
$('#deposit_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
});
|
||||
|
||||
$('#deposit_amount').change(function (e) {
|
||||
reset_payment_methods_amounts();
|
||||
});
|
||||
|
||||
function add_payment_method() {
|
||||
$('#payment_methods_div').show();
|
||||
|
||||
if ($('#cash_to_pay').val() == 0) {
|
||||
$('#cash_to_pay').val( $('#deposit_amount').val());
|
||||
$('#original_cash_to_pay').val( $('#deposit_amount').val());
|
||||
}
|
||||
|
||||
$('#payment_methods_div').append('<div class="row"><div class="col-md-6"><label>Payment Method</label><select class="form-control payment_method" name="payment_method[]"><option value="0">--select method--</option><?php echo $patient_payment_methods_options ?></select></div><div class="col-md-6"><label>Payment Amount</label><input name="payment_methods_amount[]" type="number" class="form-control payment_methods_amount" onkeyup="payment_methods_amount_calculate()"></div></div><br>');
|
||||
}
|
||||
|
||||
function payment_methods_amount_calculate() {
|
||||
// tally up all the entered values
|
||||
let total_amount_payment_methods = 0;
|
||||
|
||||
$('.payment_methods_amount').each(function () {
|
||||
total_amount_payment_methods += +$(this).val();
|
||||
});
|
||||
|
||||
let cash_to_pay = $('#original_cash_to_pay').val();
|
||||
cash_to_pay -= total_amount_payment_methods;
|
||||
|
||||
if (cash_to_pay < 0) {
|
||||
alert("You have entered more money in the payment methods than is supposed to be paid");
|
||||
$('#cash_to_pay').val($('#original_cash_to_pay').val());
|
||||
$('.payment_methods_amount').each(function () {
|
||||
$(this).val(0);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
$('#cash_to_pay').val(cash_to_pay);
|
||||
}
|
||||
|
||||
function reset_payment_methods_amounts() {
|
||||
$('#cash_to_pay').val( $('#deposit_amount').val());
|
||||
$('#original_cash_to_pay').val( $('#deposit_amount').val());
|
||||
|
||||
$('.payment_methods_amount').each(function () {
|
||||
$(this).val(0);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
<div class="panel panel-default" style="border-radius: 5px;">
|
||||
<div class="panel-body">
|
||||
@if(Auth::user()->can('view-patient-accounts-deposits'))
|
||||
<a href="{{ route('patient_accounts.deposits_report') }}" class="nav-item btn btn-success"><i class="fa fa-plus"></i> <span style="margin-left: 10px;">{{ __('patient_accounts.patient_accounts_deposits_reports') }}</span></a>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->can('view-patient-accounts-refunds'))
|
||||
<a href="{{ route('patient_accounts.refunds_report') }}" class="nav-item btn btn-success"><i class="fa fa-plus"></i> <span style="margin-left: 10px;">{{ __('patient_accounts.patient_accounts_refunds_reports') }}</span></a>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->can('view-patient-accounts-consumptions'))
|
||||
<a href="{{ route('patient_accounts.consumptions_report') }}" class="nav-item btn btn-success"><i class="fa fa-plus"></i> <span style="margin-left: 10px;">{{ __('patient_accounts.patient_accounts_consumption_reports') }}</span></a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-condensed table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="color: black">{{ __('layout.patient_number') }}</th>
|
||||
<th style="color: black">{{ __('layout.patient_names') }}</th>
|
||||
<th style="color: black">{{ __('layout.gender') }}</th>
|
||||
<th style="color: black">{{ __('layout.age') }}</th>
|
||||
<th style="color: black">{{ __('patient_accounts.phone_number') }}</th>
|
||||
<th style="color: black">{{ __('patient_accounts.email') }}</th>
|
||||
<th style="color: black">{{ __('layout.patient_category') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $dob = new Carbon\Carbon($patient->date_of_birth) @endphp
|
||||
<tr>
|
||||
<td>{{ $patient->number }}</td>
|
||||
<td>{!! insurance_flag($patient->id) !!}</td>
|
||||
<td>{{ $patient->gender == 1 ? __('layout.male') : __('layout.female') }}</td>
|
||||
<td>{{ $dob->diffInYears(Carbon\Carbon::now()) }} ({{ __('patient_accounts.years') }})</td>
|
||||
<td>{{ $patient->phone }}</td>
|
||||
<td>{{ $patient->email }}</td>
|
||||
<td>{{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<hr>
|
||||
</div>
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'Patient Receipt - Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body{
|
||||
font-size: 0.8em;
|
||||
}
|
||||
/*thead, tfoot { display: table-row-group }*/
|
||||
thead {
|
||||
display: table-header-group;
|
||||
}
|
||||
tfoot {
|
||||
display: table-row-group;
|
||||
}
|
||||
tr {
|
||||
page-break-before: always;
|
||||
page-break-after: always;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container-fluid">
|
||||
@include('layouts.header_pdf_print')
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td>{{ __('patient_finance.patient_names') }}</b></td>
|
||||
<td>{{ get_full_name($patient_id, 'id', 'first_name', 'last_name', 'patients') }} ({{ get_name($patient_id, 'id', 'number', 'patients') }})</td>
|
||||
<td><b>{{ __('patient_finance.date') }}</b></td>
|
||||
<td colspan="2">{{ streamline_date_time_short($receipt_date) }}</td>
|
||||
<td><b>{{ __('patient_finance.receipt_number') }}</b></td>
|
||||
<td colspan="2">{{ $receipt_number }}</td>
|
||||
<td><b>{{ __('patient_accounts.transaction_date') }}</b></td>
|
||||
<td colspan="2">{{ $deposit_date }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="table table-bordered" id="receipt_table">
|
||||
<thead>
|
||||
<th style="width: 60%"><b>{{ __('patient_accounts.details') }}</b></th>
|
||||
<th style="width: 20%"><b>{{ __('patient_accounts.amounts') }}</b></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ $description }}</td>
|
||||
<td><b>{{ ugandan_shillings($deposit_amount) }}</b></td>
|
||||
</tr>
|
||||
|
||||
@if(count($return_payment_methods) > 0)
|
||||
<tr><td colspan="2"></td></tr>
|
||||
@foreach($return_payment_methods as $key => $value)
|
||||
<tr>
|
||||
<td><b>{{ __('patient_accounts.patient_paid_with') }} {{ ($key == 0) ? 'Cash' : get_name($key, 'id', 'name', 'patient_payment_methods') }}</b></td>
|
||||
<td><b>{{ ugandan_shillings($value) }}</b></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<i style="font-size: 0.8em; float: left">© {{ date('Y') }} Stre@mline</i>
|
||||
</div>
|
||||
<div class="col">
|
||||
<i style="float: right">{{ __('patient_accounts.printed_on') }} {{ date(" d M Y h:ia") }} {{ __('patient_accounts.by') }} {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+234
@@ -0,0 +1,234 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'Inpatient Bill - Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
@include('layouts.header_pdf_print')
|
||||
<h5 class="heading" style="text-align: center;">{{ $search_info }}</h5>
|
||||
|
||||
<hr><br>
|
||||
|
||||
@if(count($patient_deposits) > 0)
|
||||
<h4><b>{{ __('patient_accounts.deposits') }}</b></h4>
|
||||
|
||||
<div>
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('patient_accounts.patient_names') }}</th>
|
||||
<th>{{ __('patient_accounts.deposit_amount') }}</th>
|
||||
<th>{{ __('patient_accounts.deposit_date') }}</th>
|
||||
<th>{{ __('patient_accounts.received_by') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_deposits = 0; @endphp
|
||||
@foreach($patient_deposits as $deposit)
|
||||
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ get_full_name($deposit->patient_id, 'id', 'first_name', 'last_name', 'patients') }} ({{ get_name($deposit->patient_id, 'id', 'number', 'patients') }})</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($deposit->deposit_amount) }}
|
||||
@php $total_deposits += $deposit->deposit_amount; @endphp
|
||||
</td>
|
||||
<td>{{ streamline_date($deposit->deposit_date) }}</td>
|
||||
<td>{{ get_full_name($deposit->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($total_deposits) }}</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@endif
|
||||
|
||||
@if(count($patient_refunds) > 0)
|
||||
<h4><b>{{ __('patient_accounts.refunds') }}</b></h4>
|
||||
|
||||
<div>
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('patient_accounts.patient_names') }}</th>
|
||||
<th>{{ __('patient_accounts.refund_amount') }}</th>
|
||||
<th>{{ __('patient_accounts.refund_date') }}</th>
|
||||
<th>{{ __('patient_accounts.received_by') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_refunds = 0; @endphp
|
||||
@foreach($patient_refunds as $refund)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ get_full_name($refund->patient_id, 'id', 'first_name', 'last_name', 'patients') }} ({{ get_name($refund->patient_id, 'id', 'number', 'patients') }})</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($refund->refund_amount) }}
|
||||
@php $total_refunds += $refund->refund_amount; @endphp
|
||||
</td>
|
||||
<td>{{ streamline_date($refund->refund_date) }}</td>
|
||||
<td>{{ get_full_name($refund->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($total_refunds) }}</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@endif
|
||||
|
||||
@if(count($patient_consumptions) > 0)
|
||||
<h4><b>{{ __('patient_accounts.consumption') }}</b></h4>
|
||||
|
||||
<div>
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('patient_accounts.patient_names') }}</th>
|
||||
<th>{{ __('patient_accounts.amount_consumed') }}</th>
|
||||
<th>{{ __('patient_accounts.date_consumed') }}</th>
|
||||
<th>{{ __('patient_accounts.reason') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_consumption = 0; @endphp
|
||||
@foreach($patient_consumptions as $record)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ get_full_name($record->patient_id, 'id', 'first_name', 'last_name', 'patients') }} ({{ get_name($record->patient_id, 'id', 'number', 'patients') }})</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($record->amount_consumed) }}
|
||||
@php $total_consumption += $record->amount_consumed; @endphp
|
||||
</td>
|
||||
<td>{{ streamline_date_time($record->created_at) }}</td>
|
||||
@php
|
||||
$tag_id = $record->tag_id;
|
||||
$items_received_array = [];
|
||||
|
||||
if($tag_id == 6 || $tag_id == 8){
|
||||
|
||||
$service_deposit_record = \Streamline\Models\ServiceDeposit::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($service_deposit_record){
|
||||
$items_received = explode(",", $service_deposit_record->items_ids);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "services");
|
||||
}
|
||||
}
|
||||
} elseif($tag_id == 3){
|
||||
|
||||
$treatment_deposit_record = \Streamline\Models\TreatmentDeposits::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($treatment_deposit_record){
|
||||
$items_received = explode(",", $treatment_deposit_record->treatment_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "drugs");
|
||||
}
|
||||
}
|
||||
} elseif($tag_id == 5){
|
||||
|
||||
$sundries_deposit_record = \Streamline\Models\SundryDeposit::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($sundries_deposit_record){
|
||||
$items_received = explode(",", $sundries_deposit_record->sundry_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "sundries");
|
||||
}
|
||||
}
|
||||
} elseif($tag_id == 2){
|
||||
$investigation_deposit_record = \Streamline\Models\InvestigationDeposit::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($investigation_deposit_record){
|
||||
$items_received = explode(",", $investigation_deposit_record->investigation_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "investigations");
|
||||
}
|
||||
}
|
||||
} elseif($tag_id == 4){
|
||||
|
||||
$procedure_deposit_record = \Streamline\Models\ProcedureDeposit::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($procedure_deposit_record){
|
||||
$items_received = explode(",", $procedure_deposit_record->procedure_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "procedures");
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<td>
|
||||
<strong>{{ get_name($record->tag_id, 'id', 'name', 'finance_point_tags') }}</strong>
|
||||
<ol>
|
||||
@for($j = 0; $j < count($items_received_array); $j++)
|
||||
<li>{{ $items_received_array[$j] }}</li>
|
||||
@endfor
|
||||
</ol>
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($total_consumption) }}</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@endif
|
||||
|
||||
<div style="font-weight: bolder; font-size: 24px;">
|
||||
<br><br>
|
||||
<span><strong>{{ __('patient_accounts.current_balance') }}:</strong> {{ ugandan_shillings(get_name($patient_id, 'id', 'patient_account_balance', 'patients')) }}</span>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('patient_accounts.refund_patient_accounts') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('patient_accounts.refund_patient_accounts') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('patient_discounts::patient_accounts.menu')
|
||||
|
||||
<div class="white-box">
|
||||
@include('patient_discounts::patient_accounts.patient_details')
|
||||
|
||||
{{ Form::open(['method'=>'post','route'=>'patient_accounts.save_refund_deposit']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('current_balance', __('patient_accounts.current_balance')) }}
|
||||
{{ Form::number('current_balance', $current_balance,['class' => 'form-control compulsory', 'id' => 'current_balance', 'readonly']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('refund_amount', __('patient_accounts.refund_amount')) }}
|
||||
{{ Form::number('refund_amount', '',['class' => 'form-control compulsory', 'id' => 'refund_amount', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('refund_date', __('patient_accounts.refund_date')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('refund_date', date('d-m-Y'), ['class'=>'form-control compulsory', 'required' , 'readonly', 'id'=>'refund_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('account_id',__('patient_accounts.account_to_pay_from')) }}
|
||||
{{ Form::select('account_id', $banks, '', ['class' => 'form-control compulsory','required', 'id' => 'account_id', 'onchange' => 'get_bank_balance()']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('account_balance',__('patient_accounts.account_balance')) }}
|
||||
{{ Form::text('account_balance', 0, ['class'=>'form-control compulsory', 'id'=>'account_balance', 'readonly']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('refund_reason', __('patient_accounts.refunded_reason')) }}
|
||||
{{ Form::textarea('refund_reason', '',['class' => 'form-control compulsory', 'required', 'rows' => '5']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ Form::submit(__('family_accounts.save'),['class'=>'btn btn-success submit_btn'])}}
|
||||
{{ Form::reset(__('family_accounts.cancel'),['type'=>'reset','class'=>'btn btn-default'])}}
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#refund_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
function get_bank_balance() {
|
||||
let refund_amount = parseInt($('#refund_amount').val());
|
||||
|
||||
if (!isNaN(refund_amount)) {
|
||||
let account_id = $('#account_id').val();
|
||||
|
||||
let today = new Date();
|
||||
let today_formatted = String(today.getDate()).padStart(2, '0') + '-' + String(today.getMonth() + 1).padStart(2, '0') + '-' + today.getFullYear();
|
||||
|
||||
if (account_id !== '') {
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/banking/get_current_account_balance_per_date',
|
||||
data: {
|
||||
'bank': account_id,
|
||||
'date': today_formatted
|
||||
},
|
||||
async: true,
|
||||
success: function(response) {
|
||||
var bank_record = JSON.parse(response);
|
||||
var account_balance = bank_record['account_balance'];
|
||||
$('#account_balance').val(account_balance);
|
||||
|
||||
if (account_balance <= 0) {
|
||||
alert('Account Balance is Zero(0) UGX');
|
||||
$('.submit_btn').hide();
|
||||
} else if (refund_amount > account_balance) {
|
||||
alert('Your Account Balance is low');
|
||||
$('.submit_btn').hide();
|
||||
} else {
|
||||
$('.submit_btn').show();
|
||||
}
|
||||
|
||||
},
|
||||
error: function(error) {
|
||||
//console.log(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
alert("Please enter the refund before selecting an account");
|
||||
$('#account_id').val('');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
+271
@@ -0,0 +1,271 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('patient_accounts.patient_accounts_refunds') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('patient_accounts.reports') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('patient_discounts::patient_accounts.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
{{ Form::open(['url' => 'patient_accounts/refunds_report', 'method' => 'ANY']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="patient_numbers">
|
||||
{{ Form::label('patient_number',__('investigations.patient_number')) }}
|
||||
{{ Form::text('patient_number', '', ['class' => 'form-control typeahead', 'placeholder' => 'Patient number', 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('search_by', __('family_accounts.date')) }}
|
||||
{{ Form::select('search_by', ['0'=>'Last 24 hours','1'=>'Custom Date','2'=>'Custom Range'], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="display: none;" id="date_search">
|
||||
<div class="form-group" id="reg_date" style="padding-top: 23px;">
|
||||
<div class="input-group">
|
||||
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="display: none;" id="date_range_search">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('family_accounts.from')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group" id="reg_date">
|
||||
{{ Form::label('end_date', __('family_accounts.to')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" style="padding-top: 5px;"><br>
|
||||
{{ Form::button(__('family_accounts.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
@if(!is_null($reg_date))
|
||||
<h4>{{ __('family_accounts.showing_deposit_of') }} <font color="blue">{{ streamline_date($reg_date) }}</font></h4>
|
||||
@elseif(!is_null($start_date) && !is_null($end_date))
|
||||
<h4>{{ __('family_accounts.showing_deposit_from') }}<font color="blue">{{ streamline_date($start_date) }}</font> {{ __('patient_accounts.to') }} <font color="blue">{{ streamline_date($end_date) }}</font></h4>
|
||||
@endif
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('patient_accounts.patient_names') }}</th>
|
||||
<th>{{ __('patient_accounts.refund_amount') }}</th>
|
||||
<th>{{ __('patient_accounts.refund_record_date') }}</th>
|
||||
<th>{{ __('patient_accounts.refund_transaction_date') }}</th>
|
||||
<th>{{ __('patient_accounts.refunded_by') }}</th>
|
||||
<th>{{ __('patient_accounts.refunded_reason') }}</th>
|
||||
<th>{{ __('family_accounts.action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_refunds = 0; @endphp
|
||||
@foreach($patient_refunds as $refund)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ get_full_name($refund->patient_id, 'id', 'first_name', 'last_name', 'patients') }} ({{ get_name($refund->patient_id, 'id', 'number', 'patients') }})</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($refund->refund_amount) }}
|
||||
@php $total_refunds += $refund->refund_amount; @endphp
|
||||
</td>
|
||||
<td>{{ streamline_date_time($refund->created_at) }}</td>
|
||||
<td>{{ streamline_date($refund->refund_date) }}</td>
|
||||
<td>{{ get_full_name($refund->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
<td>{{ $refund->refund_reason }}</td>
|
||||
<td>
|
||||
<a href="/patient_accounts/view_details/{{ $refund->patient_id }}/" class="btn btn-outline-success btn-sm"><i class="fa fa-book"></i> {{ __('patient_accounts.statement') }}</a>
|
||||
<br><br>
|
||||
@if(Auth::user()->can('cancel-patient-accounts-deposits'))
|
||||
<a href="/patient_accounts/cancel_refund/{{ $refund->id }}/" class="btn btn-outline-primary btn-sm" onclick="return confirm('Are you sure you want to cancel this refund?')"> {{ __('patient_accounts.cancel_refund') }}</a>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($total_refunds) }}</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
|
||||
<!-- Date Picker Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
|
||||
<script>
|
||||
var substringMatcher = function (strs) {
|
||||
return function findMatches(q, cb) {
|
||||
var matches, substringRegex;
|
||||
|
||||
// an array that will be populated with substring matches
|
||||
matches = [];
|
||||
|
||||
// regex used to determine if a string contains the substring `q`
|
||||
substrRegex = new RegExp(q, 'i');
|
||||
|
||||
// iterate through the pool of strings and for any string that
|
||||
// contains the substring `q`, add it to the `matches` array
|
||||
$.each(strs, function (i, str) {
|
||||
if (substrRegex.test(str)) {
|
||||
matches.push(str);
|
||||
}
|
||||
});
|
||||
|
||||
cb(matches);
|
||||
};
|
||||
};
|
||||
|
||||
$('#patient_numbers .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'patient_numbers',
|
||||
source: substringMatcher(<?php echo json_encode($patient_numbers); ?>)
|
||||
}
|
||||
);
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
message: 'Patient Accounts'
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: 'Patient Accounts',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
sheetName: 'Patient Accounts'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: 'Patient Accounts',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
customize: function(doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
}
|
||||
},
|
||||
{ extend: 'print',
|
||||
message: 'Patient Accounts',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4 ]
|
||||
},
|
||||
customize: function (win) {
|
||||
$(win.document.body)
|
||||
.css('font-size', '10pt')
|
||||
.css('background', '#fff')
|
||||
.prepend(
|
||||
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
|
||||
);
|
||||
$(win.document.body).find('table')
|
||||
.addClass('compact')
|
||||
.css('font-size', 'inherit');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#search_by').change(function () {
|
||||
if ($(this).val() == 1) {
|
||||
$('#date_search').show();
|
||||
$('#date_range_search').hide();
|
||||
}
|
||||
else if ($(this).val() == 2) {
|
||||
$('#date_range_search').show();
|
||||
$('#date_search').hide();
|
||||
}
|
||||
else {
|
||||
$('#date_search,#date_range_search').hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Executable
+363
@@ -0,0 +1,363 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-6 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('patient_accounts.patient_account_statement') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('family_accounts.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('family_accounts.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('patient_accounts.patient_account_statement') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('patient_discounts::patient_accounts.menu')
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
{{ Form::open(['url' => '/patient_accounts/statement', 'method' => 'ANY']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('search_by', __('family_accounts.date')) }}
|
||||
{{ Form::select('search_by', ['0'=>__('family_accounts.last_24_hours'),'1'=>__('family_accounts.custom_date'),'2'=>__('family_accounts.custom_range')], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="display: none;" id="date_search">
|
||||
<div class="form-group" id="reg_date" style="padding-top: 23px;">
|
||||
<div class="input-group">
|
||||
{{ Form::text('reg_date','',['class' => 'form-control compulsory', 'required','readonly','id'=>'datepicker-autoclose']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="display: none;" id="date_range_search">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('family_accounts.from')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('start_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group" id="reg_date">
|
||||
{{ Form::label('end_date', __('family_accounts.to')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('end_date','',['class' => 'form-control compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" style="padding-top: 5px;"><br>
|
||||
{{ Form::button(__('family_accounts.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
<div class="col-md-1">
|
||||
<div style="float: right;">
|
||||
{{ Form::open(['url' => '/patient_accounts/print_statement', 'target' => '_blank'])}}
|
||||
{{ Form::hidden('reg_date', $reg_date) }}
|
||||
{{ Form::hidden('start_date', $start_date) }}
|
||||
{{ Form::hidden('end_date', $end_date) }}
|
||||
{{ Form::hidden('search_by', $search_by) }}
|
||||
<button type="submit" class="btn btn-rounded" style="background-color: #03C03C; color: white;">
|
||||
<i class="fa fa-print"></i>
|
||||
<span>{{ __('patient_accounts.print_statement') }}</span>
|
||||
</button>
|
||||
{{ Form::close() }}
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('patient_discounts::patient_accounts.patient_details')
|
||||
|
||||
@if(count($patient_deposits) > 0)
|
||||
<h4><b>{{ __('patient_accounts.deposits') }}</b></h4>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('patient_accounts.patient_names') }}</th>
|
||||
<th>{{ __('patient_accounts.deposit_amount') }}</th>
|
||||
<th>{{ __('patient_accounts.deposit_date') }}</th>
|
||||
<th>{{ __('patient_accounts.received_by') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_deposits = 0; @endphp
|
||||
@foreach($patient_deposits as $deposit)
|
||||
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ get_full_name($deposit->patient_id, 'id', 'first_name', 'last_name', 'patients') }} ({{ get_name($deposit->patient_id, 'id', 'number', 'patients') }})</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($deposit->deposit_amount) }}
|
||||
@php $total_deposits += $deposit->deposit_amount; @endphp
|
||||
</td>
|
||||
<td>{{ streamline_date($deposit->deposit_date) }}</td>
|
||||
<td>{{ get_full_name($deposit->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($total_deposits) }}</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@endif
|
||||
|
||||
@if(count($patient_refunds) > 0)
|
||||
<h4><b>{{ __('patient_accounts.refunds') }}</b></h4>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('patient_accounts.patient_names') }}</th>
|
||||
<th>{{ __('patient_accounts.refund_amount') }}</th>
|
||||
<th>{{ __('patient_accounts.refund_date') }}</th>
|
||||
<th>{{ __('patient_accounts.received_by') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_refunds = 0; @endphp
|
||||
@foreach($patient_refunds as $refund)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ get_full_name($refund->patient_id, 'id', 'first_name', 'last_name', 'patients') }} ({{ get_name($refund->patient_id, 'id', 'number', 'patients') }})</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($refund->refund_amount) }}
|
||||
@php $total_refunds += $refund->refund_amount; @endphp
|
||||
</td>
|
||||
<td>{{ streamline_date($refund->refund_date) }}</td>
|
||||
<td>{{ get_full_name($refund->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($total_refunds) }}</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@endif
|
||||
|
||||
@if(count($patient_consumptions) > 0)
|
||||
<h4><b>{{ __('patient_accounts.consumption') }}</b></h4>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('patient_accounts.patient_names') }}</th>
|
||||
<th>{{ __('patient_accounts.amount_consumed') }}</th>
|
||||
<th>{{ __('patient_accounts.date_consumed') }}</th>
|
||||
<th>{{ __('patient_accounts.reason') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; $total_consumption = 0; @endphp
|
||||
@foreach($patient_consumptions as $record)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ get_full_name($record->patient_id, 'id', 'first_name', 'last_name', 'patients') }} ({{ get_name($record->patient_id, 'id', 'number', 'patients') }})</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($record->amount_consumed) }}
|
||||
@php $total_consumption += $record->amount_consumed; @endphp
|
||||
</td>
|
||||
<td>{{ streamline_date_time($record->created_at) }}</td>
|
||||
@php
|
||||
$tag_id = $record->tag_id;
|
||||
$items_received_array = [];
|
||||
|
||||
if($tag_id == 6 || $tag_id == 8){
|
||||
|
||||
$service_deposit_record = \Streamline\Models\ServiceDeposit::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($service_deposit_record){
|
||||
$items_received = explode(",", $service_deposit_record->items_ids);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "services");
|
||||
}
|
||||
}
|
||||
} elseif($tag_id == 3){
|
||||
|
||||
$treatment_deposit_record = \Streamline\Models\TreatmentDeposits::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($treatment_deposit_record){
|
||||
$items_received = explode(",", $treatment_deposit_record->treatment_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "drugs");
|
||||
}
|
||||
}
|
||||
} elseif($tag_id == 5){
|
||||
|
||||
$sundries_deposit_record = \Streamline\Models\SundryDeposit::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($sundries_deposit_record){
|
||||
$items_received = explode(",", $sundries_deposit_record->sundry_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "sundries");
|
||||
}
|
||||
}
|
||||
} elseif($tag_id == 2){
|
||||
$investigation_deposit_record = \Streamline\Models\InvestigationDeposit::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($investigation_deposit_record){
|
||||
$items_received = explode(",", $investigation_deposit_record->investigation_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "investigations");
|
||||
}
|
||||
}
|
||||
} elseif($tag_id == 4){
|
||||
|
||||
$procedure_deposit_record = \Streamline\Models\ProcedureDeposit::where('receipt_number', $record->receipt_number)->first();
|
||||
|
||||
if ($procedure_deposit_record){
|
||||
$items_received = explode(",", $procedure_deposit_record->procedure_items);
|
||||
|
||||
for($i = 0; $i < count($items_received); $i++){
|
||||
$items_received_array[] = get_name($items_received[$i], "id", "name", "procedures");
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<td>
|
||||
<strong>{{ get_name($record->tag_id, 'id', 'name', 'finance_point_tags') }}</strong>
|
||||
<ol>
|
||||
@for($j = 0; $j < count($items_received_array); $j++)
|
||||
<li>{{ $items_received_array[$j] }}</li>
|
||||
@endfor
|
||||
</ol>
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($total_consumption) }}</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
@endif
|
||||
|
||||
<div style="font-weight: bolder; font-size: 24px;">
|
||||
<br><br>
|
||||
<span><strong>{{ __('patient_accounts.current_balance') }}:</strong> {{ ugandan_shillings($patient->patient_account_balance) }}</span>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2"></div>
|
||||
@if(Auth::user()->can('view-patient-accounts-deposits'))
|
||||
<div class="col-md-4">
|
||||
<a href="/patient_accounts/make_deposit/" class="btn btn-success btn-block"> {{ __('patient_accounts.make_deposit') }}</a>
|
||||
</div>
|
||||
@endif
|
||||
@if(Auth::user()->can('view-patient-accounts-refunds'))
|
||||
<div class="col-md-4">
|
||||
<a href="/patient_accounts/refund_deposit/" class="btn btn-primary btn-block"> {{ __('patient_accounts.refund_deposit') }}</a>
|
||||
</div>
|
||||
@endif
|
||||
<div class="col-md-2"></div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script>
|
||||
|
||||
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#search_by').change(function () {
|
||||
if ($(this).val() == 1) {
|
||||
$('#date_search').show();
|
||||
$('#date_range_search').hide();
|
||||
}
|
||||
else if ($(this).val() == 2) {
|
||||
$('#date_range_search').show();
|
||||
$('#date_search').hide();
|
||||
}
|
||||
else {
|
||||
$('#date_search,#date_range_search').hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('finance_reports.guarantor_agreement') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/finance_reports">{{ __('finance_reports.reports_home') }}</a></li>
|
||||
<li class="active">{{ __('finance_reports.guarantor_agreement') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
<div class="row" style="float:right;"><button class="btn btn-success glyphicon glyphicon-print" onclick="print_receipt()"> {{ __('patient_finance.print') }}</button></div>
|
||||
|
||||
<div id="divToPrint">
|
||||
<div class="row" style="padding: 10px;">
|
||||
<div class="col-sm-6">
|
||||
<img style="margin: auto; height: 83px;" src="/uploads/logo/logo.png">
|
||||
</div>
|
||||
<div class="col-sm-6"></div>
|
||||
</div>
|
||||
<div class="row" style="padding: 10px;">
|
||||
<div class="col-sm-12">
|
||||
{{ __('patient_finance.agreement1') }}
|
||||
<b>{{ ugandan_shillings($amount_to_pay) }}</b>
|
||||
{{ __('patient_finance.agreement2') }}
|
||||
<b>{{ ugandan_shillings($amount_owed) }}</b>
|
||||
{{ __('patient_finance.agreement3') }}
|
||||
(<b>{{ $patient_names }}</b>)
|
||||
{{ __('patient_finance.agreement4') }}
|
||||
<b>{{ $payment_date }}</b>
|
||||
{{ __('patient_finance.agreement5') }}
|
||||
<b>{{ $arrangement }}</b>
|
||||
{{ __('patient_finance.agreement6') }}.
|
||||
<br><br><br>
|
||||
<div class="row">
|
||||
<div class="col-sm-2"><b>{{ __('patient_finance.signed_by') }}:</b></div>
|
||||
<div class="col-sm-4"><b>{{ __('patient_finance.name') }}: {{ $guarantor_name }}</b></div>
|
||||
<div class="col-sm-2"><b>{{ __('patient_finance.grade') }}:</b></div>
|
||||
<div class="col-sm-2"><b>{{ __('patient_finance.department') }}:</b></div>
|
||||
<div class="col-sm-2"><b>{{ __('patient_finance.date') }}:</b></div>
|
||||
</div>
|
||||
<br><br>
|
||||
<div class="row">
|
||||
<div class="col-sm-2"><b>{{ __('patient_finance.witnessed_by') }}:</b></div>
|
||||
<div class="col-sm-4"><b>{{ __('patient_finance.name') }}:</b></div>
|
||||
<div class="col-sm-2"><b>{{ __('patient_finance.grade') }}:</b></div>
|
||||
<div class="col-sm-2"><b>{{ __('patient_finance.department') }}:</b></div>
|
||||
<div class="col-sm-2"><b>{{ __('patient_finance.date') }}:</b></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
<strong>{{ __('patient_finance.date') }} Printed:</strong> {{ \Carbon\Carbon::now()->format('D m Y') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function print_receipt() {
|
||||
let myDiv = document.getElementById('divToPrint');
|
||||
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
|
||||
|
||||
newWindow.document.write("<html><body " +
|
||||
"class='' " +
|
||||
" onload='window.print()'>" +
|
||||
myDiv.innerHTML +
|
||||
"</body></html>");
|
||||
newWindow.document.close();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
|
||||
<style type="text/css">
|
||||
#divToPrint{
|
||||
font-size: 13px;
|
||||
color: #7c7c7c;
|
||||
}
|
||||
|
||||
#receipt_table{
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
font-family: monospace
|
||||
}
|
||||
|
||||
#receipt_table th{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
#receipt_table td{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.receipt-label{
|
||||
margin-top: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.receipt-title{
|
||||
font-weight: bolder;
|
||||
text-decoration: underline;
|
||||
display: block; font-family:
|
||||
monospace
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-7">
|
||||
<h4>Debt Plan Receipt</h4>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('patient_debtors.staff_guarantors') }}">Debt Plan Report</a></li>
|
||||
<li class="active">Debt Plan Receipt</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
<div class="row" style="float:right;"><button class="btn btn-success glyphicon glyphicon-print" onclick="print_receipt()"> Print</button></div>
|
||||
<div class="row" id="divToPrint">
|
||||
<div class="col-sm-3"></div>
|
||||
<div class="col-sm-6" style="text-align: center;">
|
||||
<p style="text-align: center; font-size: 1em">
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
|
||||
<span class="receipt-label"><b>Tel:</b> {{ $hospital_information->phone_number }}</span><br>
|
||||
<span class="receipt-label"><b>Email:</b> {{ $hospital_information->email }}</span><br>
|
||||
<span class="receipt-label"><b>Cashier:</b> {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</span><br>
|
||||
<span class="receipt-label"><b>Receipt Number: </b> {{ $new_receipt_number }}</span><br>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<table class="table" id="receipt_table">
|
||||
<thead>
|
||||
<th style="width: 60%"><b>Description</b></th>
|
||||
<th style="width: 20%"><b>Amount</b></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Comment</td>
|
||||
<td>{{ $request->comment }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Expected Amount</td>
|
||||
<td>{{ ugandan_shillings($request->amount_owed) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Amount Paid</td>
|
||||
<td>{{ ugandan_shillings($request->amount_paid) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Balance</td>
|
||||
<td>{{ ugandan_shillings($request->balance) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
</div>
|
||||
<i style="font-size: 0.8em; margin-left: 50%;">© Stre@mline</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<script type="text/javascript">
|
||||
function print_receipt() {
|
||||
let myDiv = document.getElementById('divToPrint');
|
||||
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
|
||||
|
||||
newWindow.document.write("<html><body " +
|
||||
"class='' " +
|
||||
" onload='window.print()'>" +
|
||||
myDiv.innerHTML +
|
||||
"</body></html>");
|
||||
newWindow.document.close();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
|
||||
<style type="text/css">
|
||||
#divToPrint{
|
||||
font-size: 13px;
|
||||
color: #7c7c7c;
|
||||
}
|
||||
|
||||
#receipt_table{
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
font-family: monospace
|
||||
}
|
||||
|
||||
#receipt_table th{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
#receipt_table td{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.receipt-label{
|
||||
margin-top: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.receipt-title{
|
||||
font-weight: bolder;
|
||||
text-decoration: underline;
|
||||
display: block; font-family:
|
||||
monospace
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Debt Plan Receipt</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('finance_reports.index') }}">Reports</a></li>
|
||||
<li class="active">Receipt</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
@include('flash::message')
|
||||
<div class="row">
|
||||
<div class="col-md-6 offset-3">
|
||||
<div class="white-box">
|
||||
<div class="row" style="float:right;"><button class="btn btn-success glyphicon glyphicon-print" onclick="print_receipt()"> Print</button></div>
|
||||
<div class="row" id="divToPrint">
|
||||
<div class="col-sm-12" style="text-align: center;">
|
||||
<p style="text-align: center; font-size: 1em">
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
|
||||
<span class="receipt-label"><b>Tel:</b> {{ $hospital_information->phone_number }}</span><br>
|
||||
<span class="receipt-label"><b>Email:</b> {{ $hospital_information->email }}</span><br>
|
||||
<span class="receipt-label"><b>Cashier:</b> {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</span><br>
|
||||
<span class="receipt-label"><b>Receipt Number:</b>
|
||||
@php
|
||||
$amount_paid = unserialize($payment->amount_paid_history);
|
||||
$date_paid = unserialize($payment->date_paid_history);
|
||||
$staff_in_charge = unserialize($payment->staff_in_charge_history);
|
||||
$comments = unserialize($payment->comment_history);
|
||||
$receipts = unserialize($payment->receipt_history);
|
||||
$balances = unserialize($payment->balance_history);
|
||||
@endphp
|
||||
@foreach ($receipts as $item)
|
||||
{{ $item }}
|
||||
@endforeach
|
||||
</span><br>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<table class="table" id="receipt_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 60%; justify-content: center"><b>Description</b></th>
|
||||
<th style="width: 20%"><b>Amount</b></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td>Expected Amount:</td>
|
||||
<td>
|
||||
{{ ugandan_shillings(get_name($payment->debt_plan_id, 'id', 'staff_guarantor_to_pay', 'debt_plan')) }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Amount Paid:</td>
|
||||
<td>
|
||||
@foreach ($amount_paid as $item)
|
||||
{{ ugandan_shillings($item) }}<br>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Balance:</td>
|
||||
<td>
|
||||
@foreach ($balances as $item)
|
||||
{{ ugandan_shillings($item) }}<br>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Reason:</td>
|
||||
<td>Debt Plan Payment</td>
|
||||
</tr>
|
||||
|
||||
{{--<tr>--}}
|
||||
{{--<td><strong>Total Paid:</strong></td>--}}
|
||||
{{--<td><strong>{{ ugandan_shillings($payment->amount_received) }}</strong></td>--}}
|
||||
{{--</tr>--}}
|
||||
<tr>
|
||||
<td><strong>Received By</strong></td>
|
||||
<td><strong>{{ get_full_name($payment->created_by, 'id', 'first_name', 'last_name', 'users') }}</strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<i style="font-size: 0.8em; margin-left: 50%;">© Stre@mline</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<script type="text/javascript">
|
||||
function print_receipt() {
|
||||
let myDiv = document.getElementById('divToPrint');
|
||||
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
|
||||
|
||||
newWindow.document.write("<html><body " +
|
||||
"class='' " +
|
||||
" onload='window.print()'>" +
|
||||
myDiv.innerHTML +
|
||||
"</body></html>");
|
||||
newWindow.document.close();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+290
@@ -0,0 +1,290 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Receive Guarantor Payments</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/finance_reports">Reports Dashboard</a></li>
|
||||
<li class="active">Guarantor Payments</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="panel panel-default col-md-12">
|
||||
<div class="panel-body panel-primary">
|
||||
<h2><strong>Payment Debt Plan</strong></h2>
|
||||
<br/>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Guarantor Name</th>
|
||||
<th>Payment Arrangement</th>
|
||||
<th>Amount To Pay</th>
|
||||
<th>Amount Paid</th>
|
||||
<th>Completion Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $amount_paid_on_debt = 0; @endphp
|
||||
@if(!is_null($debts))
|
||||
<td>
|
||||
@php
|
||||
$guarantor_ids_array = explode(",", $debts->staff_guarantor);
|
||||
@endphp
|
||||
<ul>
|
||||
@if ($debts->guarantor_type == 1)
|
||||
@for ($i = 0; $i < count($guarantor_ids_array); $i++)
|
||||
<li>{{ get_full_name($guarantor_ids_array[$i], 'id', 'first_name', 'last_name', 'users') }}</li>
|
||||
@endfor
|
||||
@else
|
||||
@for ($i = 0; $i < count($guarantor_ids_array); $i++)
|
||||
<li>{{ get_full_name($guarantor_ids_array[$i], 'id', 'first_name', 'last_name', 'non_staff_guarantors') }}</li>
|
||||
@endfor
|
||||
@endif
|
||||
</ul>
|
||||
</td>
|
||||
<td>{{ get_name($debts->debt_plan_arrangement, 'id', 'name', 'debt_plan_arrangements') }}</td>
|
||||
<td>{{ ugandan_shillings($debts->staff_guarantor_to_pay) }}
|
||||
<td>
|
||||
<?php $amount_paid_on_debt = $debts->amount_paid_off ?? 0; ?>
|
||||
{{ ugandan_shillings($amount_paid_on_debt) }}
|
||||
</td>
|
||||
<td>
|
||||
@if (!is_null($debts->fourth_installment_date))
|
||||
{{ streamline_date($debts->fourth_installment_date) }}
|
||||
@elseif(!is_null($debts->third_installment_date))
|
||||
{{ streamline_date($debts->third_installment_date) }}
|
||||
@elseif(!is_null($debts->second_installment_date))
|
||||
{{ streamline_date($debts->second_installment_date) }}
|
||||
@elseif(!is_null($debts->first_installment_date))
|
||||
{{ streamline_date($debts->first_installment_date) }}
|
||||
@endif
|
||||
</td>
|
||||
@else
|
||||
<td colspan="6"><span style="color: red;">RECORDS NOT FOUND</span></td>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="panel panel-default col-md-12">
|
||||
<div class="panel-body panel-primary">
|
||||
<h2><strong>Payment History</strong></h2>
|
||||
<br/>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Balance</th>
|
||||
<th>Amount Paid</th>
|
||||
<th>Receipt No.</th>
|
||||
<th>Date</th>
|
||||
<th>Staff In Charge</th>
|
||||
<th>Comment</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($debt_with_balances)
|
||||
@foreach($debt_with_balances as $debt_with_balance)
|
||||
<tr>
|
||||
<td>{{ ugandan_shillings($debt_with_balance->balance) }}</td>
|
||||
<td>{{ ugandan_shillings($debt_with_balance->amount_paid) }}</td>
|
||||
<td>{{ $debt_with_balance->receipt_number }}</td>
|
||||
<td>{{ streamline_date($debt_with_balance->date_paid) }}</td>
|
||||
<td>{{ $users_array[$debt_with_balance->created_by] }}</td>
|
||||
<td>{{ $debt_with_balance->comment }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<td colspan="6"><span style="color: red;">RECORDS NOT FOUND</span></td>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body panel-primary">
|
||||
@php $amount_owed = $debts->staff_guarantor_to_pay - $amount_paid_on_debt @endphp
|
||||
@if($amount_owed < 1)
|
||||
<h3 style="color: green">Payment has been made in full</h3>
|
||||
@else
|
||||
{{ Form::open(['route' => 'patient_debtors.process_debt_plan_payment_staff', 'data-toggle' => 'validator']) }}
|
||||
<br/>
|
||||
<h3>Make Payment</h3>
|
||||
<br/>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('amount_label', 'Expected Amount') }}
|
||||
<div class="input-group">
|
||||
{{ Form::number('amount_owed', $amount_owed,
|
||||
['class'=>'form-control compulsory required', 'readonly', 'id'=>'amount_owed']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('amount_paid_label', 'Amount Paid') }}
|
||||
<div class="input-group">
|
||||
{{ Form::number('amount_paid', 0, ['class'=>'form-control compulsory required', 'id'=>'amount_paid']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('balance_label', 'Balance') }}
|
||||
<div class="input-group">
|
||||
{{ Form::number('balance', '', ['class'=>'form-control compulsory required', 'readonly', 'id'=>'balance']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('date_label', 'Date of Payment') }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('date', '', ['class'=>'form-control compulsory required','readonly', 'id'=>'date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('comment_label', 'Comment') }}
|
||||
<div class="input-group">
|
||||
{{ Form::textarea('comment','', ['class'=>'form-control compulsory required', 'id'=>'comment']) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::hidden('staff_guarantor', $debts->staff_guarantor, ['id' => 'staff_guarantor']) }}
|
||||
{{ Form::hidden('payment_id', $debts->id, ['id' => 'payment_id']) }}
|
||||
<div class="form-group">
|
||||
<a class="btn btn-danger" id="write_off_btn">Write Off Debt</a>
|
||||
{{ Form::submit('Make Payment', ['class'=>'btn btn-success pull-right']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal" id="write_off_modal" tabindex="-1" role="dialog" aria-labelledby="write_off_modal_label" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header text-center">
|
||||
<h5 class="modal-title" id="write_off_modal_label"><b>Write Off Balance</b></h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Amount To Be Written Off</label>
|
||||
<input id="amount_to_write_off" type="number" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Write Off Memo</label>
|
||||
<textarea id="write_off_memo" type="number" rows="5" class="form-control"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Expense Account</label>
|
||||
{{ Form::select('expense_account', $expense_accounts, '', ['class'=>'form-control', 'id'=>'expense_account']) }}
|
||||
</div>
|
||||
|
||||
<button class="btn btn-rounded btn-block btn-success" id="complete_write_off">Complete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<!-- Date Picker Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/js/validator.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#write_off_btn').click(function() {
|
||||
let amount_owed = $('#amount_owed').val();
|
||||
$('#amount_to_write_off').val(amount_owed);
|
||||
$('#write_off_modal').modal('show');
|
||||
});
|
||||
|
||||
$('#complete_write_off').click(function() {
|
||||
let amount = $('#amount_to_write_off').val();
|
||||
let expense_account = $('#expense_account').val();
|
||||
let write_off_memo = $('#write_off_memo').val();
|
||||
let amount_paid = $('#amount_paid').val();
|
||||
let amount_owed = $('#amount_owed').val();
|
||||
let staff_guarantor = $('#staff_guarantor').val();
|
||||
let payment_id = $('#payment_id').val();
|
||||
|
||||
if (amount === '') {
|
||||
alert('Please Enter An Amount To Write Off.')
|
||||
} else if (expense_account === '') {
|
||||
alert('Please Select An Expense Account To Write Off To.')
|
||||
} else if (write_off_memo === '') {
|
||||
alert('Please Enter A Memo For This Write Off.')
|
||||
} else {
|
||||
$.ajax({
|
||||
method: 'post',
|
||||
url: '/patient_debtors/write_off_debt_plan',
|
||||
data: {
|
||||
'amount': amount, 'amount_paid': amount_paid, 'amount_owed': amount_owed, 'staff_guarantor': staff_guarantor,
|
||||
'expense_account': expense_account, 'write_off_memo': write_off_memo, 'payment_id': payment_id
|
||||
},
|
||||
success: function(response) {
|
||||
if(!response.includes("no")) {
|
||||
alert("Write off has been completed successfully");
|
||||
window.location.href = '/patient_debtors/staff_guarantors';
|
||||
} else {
|
||||
alert("An error occurred. Please try again");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#amount_paid').change(function (e) {
|
||||
e.preventDefault();
|
||||
let amount = $('#amount_owed').val();
|
||||
let bal = amount - this.value;
|
||||
$('#balance').val(bal);
|
||||
});
|
||||
|
||||
$('#table').DataTable();
|
||||
</script>
|
||||
@endpush
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
|
||||
<style type="text/css">
|
||||
#divToPrint{
|
||||
font-size: 13px;
|
||||
color: #7c7c7c;
|
||||
}
|
||||
|
||||
#receipt_table{
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
font-family: monospace
|
||||
}
|
||||
|
||||
#receipt_table th{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
#receipt_table td{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.receipt-label{
|
||||
margin-top: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.receipt-title{
|
||||
font-weight: bolder;
|
||||
text-decoration: underline;
|
||||
display: block; font-family:
|
||||
monospace
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-7">
|
||||
<h4>Debtor Payment Receipt</h4>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('patient_debtors.debtors') }}">Debtors Report</a></li>
|
||||
<li class="active">Debtor Payment Receipt</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
<div class="row" style="float:right;">
|
||||
@if(is_cashier_receipt_type_print_html())
|
||||
<button class="btn btn-success glyphicon glyphicon-print" onclick="print_receipt()"> Print</button>
|
||||
@else
|
||||
<form action="{{ route('patient_debtors.print_debtor_receipt_pdf_details') }}" method="post" target="_blank">
|
||||
{{ csrf_field() }}
|
||||
<input value="{{ $request->comment }}" type="hidden" name="comment"/>
|
||||
<input value="{{ $request->amount_owed }}" type="hidden" name="amount_owed"/>
|
||||
<input value="{{ $request->amount_paid }}" type="hidden" name="amount_paid"/>
|
||||
<input value="{{ $request->balance }}" type="hidden" name="balance"/>
|
||||
<input value="{{ serialize($payment_methods) }}" type="hidden" name="payment_methods"/>
|
||||
<input value="{{ $new_receipt_number }}" type="hidden" name="receipt_number"/>
|
||||
<input value="{{ $patient->id }}" type="hidden" name="patient_id"/>
|
||||
<button type="submit" class="btn btn-success glyphicon glyphicon-print"> Print</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
<div class="row" id="divToPrint">
|
||||
<div class="col-sm-3"></div>
|
||||
<div class="col-sm-6" style="text-align: center;">
|
||||
<p style="text-align: center; font-size: 1em">
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
|
||||
<span class="receipt-label"><b>Tel:</b> {{ $hospital_information->phone_number }}</span><br>
|
||||
<span class="receipt-label"><b>Email:</b> {{ $hospital_information->email }}</span><br>
|
||||
<span class="receipt-label"><b>Cashier:</b> {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</span><br>
|
||||
<span class="receipt-label"><b>Receipt Number: </b> {{ $new_receipt_number }}</span><br>
|
||||
<span class="receipt-label"><b>Patient Names: </b> {{ $patient->first_name }} {{ $patient->last_name }}</span><br>
|
||||
<span class="receipt-label"><b>Patient Number: </b> {{ $patient->number }}</span><br>
|
||||
<span class="receipt-label"><b>Patient Category: </b> {{ get_name($patient->category_id, 'id', 'name', 'patient_categories') }}</span><br>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<table class="table" id="receipt_table">
|
||||
<thead>
|
||||
<th style="width: 60%"><b>Description</b></th>
|
||||
<th style="width: 20%"><b>Amount</b></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Comment</td>
|
||||
<td>{{ $request->comment }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Expected Amount</td>
|
||||
<td>{{ ugandan_shillings($request->amount_owed) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Amount Paid</td>
|
||||
<td>{{ ugandan_shillings($request->amount_paid) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Balance</td>
|
||||
<td>{{ ugandan_shillings($request->balance) }}</td>
|
||||
</tr>
|
||||
@if(count($payment_methods) > 0)
|
||||
<tr><td colspan="2"></td></tr>
|
||||
@foreach($payment_methods as $key => $value)
|
||||
<tr>
|
||||
<td><b>Patient Paid With {{ ($key == 0) ? 'Cash' : get_name($key, 'id', 'name', 'patient_payment_methods') }}</b></td>
|
||||
<td><b>{{ ugandan_shillings($value) }}</b></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
</div>
|
||||
<i style="font-size: 0.8em; margin-left: 50%;">© Stre@mline</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<script type="text/javascript">
|
||||
function print_receipt() {
|
||||
let myDiv = document.getElementById('divToPrint');
|
||||
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
|
||||
|
||||
newWindow.document.write("<html><body " +
|
||||
"class='' " +
|
||||
" onload='window.print()'>" +
|
||||
myDiv.innerHTML +
|
||||
"</body></html>");
|
||||
newWindow.document.close();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+307
@@ -0,0 +1,307 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Debtors</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/finance_reports">Reports Dashboard</a></li>
|
||||
<li class="active">Debtors Reports</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
{{ Form::open(['method'=>'post','route' => 'patient_debtors.debtors']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3 b-r">
|
||||
<div class="form-group">
|
||||
<label>Staff Member:</label>
|
||||
<select class="form-control compulsory required" name="staff_member" id="staff_member" required>
|
||||
<option value="">-select-</option>
|
||||
<option value="ALL STAFF">ALL STAFF</option>
|
||||
@foreach($users as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->username }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label>Select Date:</label>
|
||||
<select class="form-control compulsory required" name="dates" id="dates" required>
|
||||
<option value="">-select-</option>
|
||||
<option value="today">TODAY</option>
|
||||
<option value="yesterday">YESTERDAY</option>
|
||||
<option value="custom_date">CUSTOM DATE</option>
|
||||
<option value="custom_date_range">DATE RANGE</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div id="sDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', 'Date On') }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('start_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'start_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div id="eDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('end_date', 'End Date') }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('end_date', '', ['class'=>'form-control required compulsory', 'readonly', 'id'=>'end_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" style="margin-top: 25px;">
|
||||
{{ Form::submit('Submit', ['class'=>'btn btn-success btn-rounded btn-block pull-right']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body panel-primary">
|
||||
@if(count($debtors) > 0)
|
||||
|
||||
<h2><strong>Report For Debtors</strong></h2>
|
||||
<br/>
|
||||
@if(isset($display))
|
||||
<h3 class="label label-info"> {!! $display !!}</h3>
|
||||
@endif
|
||||
<br/>
|
||||
<br/>
|
||||
<div class="table-responsive">
|
||||
<table id="table" class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Date</th>
|
||||
<th>Patient No.</th>
|
||||
<th>Patient Name</th>
|
||||
<th>Staff In-charge</th>
|
||||
<th>Receipt No.</th>
|
||||
<th>Initial Debt Amount</th>
|
||||
<th>Amount Paid</th>
|
||||
<th>Balance</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@php
|
||||
$sum_total_amount = 0;
|
||||
$sum_amount_paid = 0;
|
||||
$sum_balance = 0;
|
||||
$counter = 1;
|
||||
@endphp
|
||||
|
||||
@if(count($debtors) > 0)
|
||||
<tbody>
|
||||
@foreach($debtors as $debtor)
|
||||
|
||||
@php
|
||||
$payment = Streamline\Models\DebtorPayment::where('debt_id', $debtor->id)->first();
|
||||
$balance_remaining = $debtor->balance_remaining ?? $debtor->balance;
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>
|
||||
{{ streamline_date($debtor->created_at) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ get_name($debtor->patient_id, 'id', 'number', 'patients') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ get_full_name($debtor->patient_id, 'id', 'first_name', 'last_name', 'patients') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ get_full_name($debtor->created_by, 'id', 'first_name', 'last_name', 'users') }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $debtor->receipt_number }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($debtor->balance) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($debtor->amount_paid_off ?? 0) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($balance_remaining) }}
|
||||
</td>
|
||||
|
||||
@if(is_null($payment))
|
||||
<td>
|
||||
<a class="btn btn-success btn-block btn-sm btn-rounded" style="color: white" href="{{ route('patient_debtors.receive_debtor_payment', implode(",",array($debtor->id, "new"))) }}">Receive Payment</a>
|
||||
</td>
|
||||
<td></td>
|
||||
@elseif($payment)
|
||||
@if($balance_remaining > 0)
|
||||
<td>
|
||||
<a class="btn btn-warning btn-sm btn-block btn-rounded" style="color: white" href="{{ route('patient_debtors.receive_debtor_payment', implode(",",array($debtor->id, "update"))) }}">Update Payment</a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-info btn-sm btn-block btn-rounded" style="color: white" href="{{ route('patient_debtors.history_debtor_payments', $debtor->id) }}"><i class="fa fa-eye"></i> View Receipts</a>
|
||||
</td>
|
||||
@elseif($balance_remaining == 0)
|
||||
<td>
|
||||
<a class="btn btn-info btn-block btn-sm btn-rounded" style="color: white" href="{{ route('patient_debtors.history_debtor_payments', $debtor->id) }}"><i class="fa fa-eye"></i> View Receipts</a>
|
||||
</td>
|
||||
<td></td>
|
||||
@else
|
||||
<td></td>
|
||||
<td></td>
|
||||
@endif
|
||||
@else
|
||||
<td></td>
|
||||
<td></td>
|
||||
@endif
|
||||
</tr>
|
||||
@php
|
||||
$sum_total_amount += $debtor->balance;
|
||||
$sum_amount_paid += ($debtor->amount_paid_off ?? 0);
|
||||
$sum_balance += $balance_remaining;
|
||||
$counter++;
|
||||
@endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>Total</td>
|
||||
<td>{{ ugandan_shillings($sum_total_amount) }}</td>
|
||||
<td>{{ ugandan_shillings($sum_amount_paid) }}</td>
|
||||
<td>{{ ugandan_shillings($sum_balance) }}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@else
|
||||
<td colspan="9"><span style="color: red;">RECORDS NOT FOUND</span></td>
|
||||
@endif
|
||||
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="offset-5"></div>
|
||||
<div class="col-md-6" style="margin-top: 70px;">
|
||||
<h3 class="btn btn-warning"><strong>Select a Valid date range</strong>e</h3>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<!-- Date Picker Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$('#dates').change(function (e) {
|
||||
|
||||
if($(this).val() === "custom_date"){
|
||||
|
||||
$("#eDate").hide();
|
||||
$("#sDate").show();
|
||||
|
||||
}else if($(this).val() === "custom_date_range"){
|
||||
|
||||
$("#sDate").show();
|
||||
$("#eDate").show();
|
||||
}else{
|
||||
|
||||
$("#eDate").hide();
|
||||
$("#sDate").hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
jQuery('#end_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery('#start_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
],
|
||||
"aoColumnDefs": [{
|
||||
"aTargets": [2,3],
|
||||
"defaultContent": "",
|
||||
}]
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('#staff_member').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Debtor Payment Receipt</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('patient_debtors.debtors') }}">Debtors Report</a></li>
|
||||
<li class="active">Debtor Payment Receipt</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box" id="divToPrint">
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<style type="text/css" media="print" >
|
||||
/*class for the element we don’t want to print*/
|
||||
.no-print{
|
||||
display:none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3"></div>
|
||||
<div class="col-md-5">
|
||||
<p style="text-align: center; font-size: 0.8em">
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
|
||||
<span class="receipt-label"><b>Tel:</b> {{ $hospital_information->phone_number }}</span><br>
|
||||
<span class="receipt-label"><b>Email:</b> {{ $hospital_information->email }}</span><br>
|
||||
<span class="receipt-label"><b>Department:</b> Finance</span><br>
|
||||
<span class="receipt-label"><b>Date:</b> {{ streamline_date(\Carbon\Carbon::now()->toDateTimeString()) }}</span><br>
|
||||
<span class="receipt-label"><b>Patient Name:</b> {{ get_name($patient_id, 'id', 'first_name', 'patients') }} {{ get_name($patient_id, 'id', 'last_name', 'patients') }}</span><br>
|
||||
<span class="receipt-label"><b>Patient Number</b> : {{ get_name($patient_id, 'id', 'number', 'patients') }}</span><br>
|
||||
</p>
|
||||
|
||||
@php $x = 0; @endphp
|
||||
@foreach($payments as $payment)
|
||||
<table style="font-size: 0.8em; font-weight: normal; font-family: monospace">
|
||||
<tr class="no-print">
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th width="10%"></th>
|
||||
</tr>
|
||||
<tr class="{{ $x }} no-print print-all">
|
||||
<td>Amount Paid: </td>
|
||||
<td>{{ ugandan_shillings($payment->amount_paid) }}</td>
|
||||
|
||||
<td class="no-print" style="font-size: 1em;">
|
||||
@if(is_cashier_receipt_type_print_html())
|
||||
<button id="{{ $x }}" class="btn float-right btn-sm btn-primary waves-effect waves-light no-print print-btn">
|
||||
<i class="fa fa-print m-r-5"></i> <span>Print</span>
|
||||
</button>
|
||||
@else
|
||||
<form action="{{ route('patient_debtors.reprint_debtor_receipt_pdf_details') }}" method="post" target="_blank">
|
||||
{{ csrf_field() }}
|
||||
<input value="{{ $debtor_id }}" type="hidden" name="debt_id"/>
|
||||
<input value="{{ $payment->id }}" type="hidden" name="is_single_print"/>
|
||||
<input value="{{ $patient_id }}" type="hidden" name="patient_id"/>
|
||||
<button type="submit" class="btn float-right btn-sm btn-primary waves-effect waves-light">
|
||||
<i class="fa fa-print m-r-5"></i> <span>Print</span>
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
|
||||
<br><br><br>
|
||||
|
||||
@if(is_null($payment->received_id))
|
||||
<a class="btn float-right btn-sm btn-danger waves-effect waves-light" href="/patient_debtors/reverse_debtor_payment/{{ $payment->id }}" onclick="return confirm('Are you sure you want to reverse this debtor payment?')">
|
||||
<i class="fa fa-trash m-r-5"></i>Reverse
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="{{ $x }} no-print print-all">
|
||||
<td>Balance: </td>
|
||||
<td>{{ ugandan_shillings($payment->balance) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr class="{{ $x }} no-print print-all">
|
||||
<td>Receipt Number: </td>
|
||||
<td>
|
||||
{{ $payment->receipt_number }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="{{ $x }} no-print print-all">
|
||||
<td>Received By: </td>
|
||||
<td>
|
||||
{{ get_full_name($payment->created_by, 'id', 'first_name', 'last_name', 'users') }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="{{ $x }} no-print print-all">
|
||||
<td>Comment : </td>
|
||||
<td>
|
||||
{{ $payment->comment }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="{{ $x }} no-print print-all">
|
||||
<td>Received On : </td>
|
||||
<td>
|
||||
{{ streamline_date($payment->date_paid) }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class=" no-print"><td colspan="2"><hr ></td></tr>
|
||||
|
||||
</table>
|
||||
@php $x++; @endphp
|
||||
@endforeach
|
||||
|
||||
<i style="font-size: 0.7em; float: left">Viewed By : {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</i>
|
||||
<i style="font-size: 0.6em; float: right">© Stre@mline</i>
|
||||
</div>
|
||||
@if(count($payments) > 1)
|
||||
<div class="col-md-4 no-print">
|
||||
<div style="float: right;">
|
||||
@if(is_cashier_receipt_type_print_html())
|
||||
<button class="btn btn-primary btn-sm print-all-debtor-receipts">Print all receipts</button><br>
|
||||
@else
|
||||
<form action="{{ route('patient_debtors.reprint_debtor_receipt_pdf_details') }}" method="post" target="_blank">
|
||||
{{ csrf_field() }}
|
||||
<input value="{{ $debtor_id }}" type="hidden" name="debt_id"/>
|
||||
<input value="0" type="hidden" name="is_single_print"/>
|
||||
<input value="{{ $patient_id }}" type="hidden" name="patient_id"/>
|
||||
<button type="submit" class="btn btn-primary btn-sm">Print all receipts</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(".print-all-debtor-receipts").click(function () {
|
||||
$(".print-all").each(function () {
|
||||
$(this).removeClass("no-print");
|
||||
});
|
||||
|
||||
// print the whole document
|
||||
print_debtor_receipt();
|
||||
|
||||
// add no-print attribute to all for the selected debts
|
||||
$(".print-all").each(function () {
|
||||
$(this).addClass("no-print");
|
||||
});
|
||||
});
|
||||
|
||||
// prepare for printing single debt receipt
|
||||
$(".print-btn").click(function () {
|
||||
var id = $(this).attr("id");
|
||||
|
||||
// remove no-print attribute from all for the selected debts
|
||||
$("." + id).each(function () {
|
||||
$(this).removeClass("no-print");
|
||||
});
|
||||
|
||||
// print the whole document
|
||||
print_debtor_receipt();
|
||||
|
||||
// add no-print attribute to all for the selected print_debtor_receipt
|
||||
$("." + id).each(function () {
|
||||
$(this).addClass("no-print");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// print for a single debt receipt
|
||||
function print_debtor_receipt() {
|
||||
let myDiv = document.getElementById('divToPrint');
|
||||
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
|
||||
|
||||
newWindow.document.write("<html><body " +
|
||||
"class='' " +
|
||||
" onload='window.print()'>" +
|
||||
myDiv.innerHTML +
|
||||
"</body></html>");
|
||||
newWindow.document.close();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
|
||||
|
||||
<style type="text/css">
|
||||
#divToPrint{
|
||||
font-size: 13px;
|
||||
color: #7c7c7c;
|
||||
}
|
||||
|
||||
#receipt_table{
|
||||
font-size: 1em;
|
||||
font-weight: normal;
|
||||
font-family: monospace
|
||||
}
|
||||
|
||||
#receipt_table th{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
#receipt_table td{
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.receipt-label{
|
||||
margin-top: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.receipt-title{
|
||||
font-weight: bolder;
|
||||
text-decoration: underline;
|
||||
display: block; font-family:
|
||||
monospace
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-7">
|
||||
<h4>Debt Plan Receipt</h4>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/">Debt Plan Report</a></li>
|
||||
<li class="active">Debt Plan Receipt</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
<div class="row" style="float:right;"><button class="btn btn-success glyphicon glyphicon-print" onclick="print_receipt()"> Print</button></div>
|
||||
<div class="row" id="divToPrint">
|
||||
<div class="col-sm-3"></div>
|
||||
<div class="col-sm-6" style="text-align: center;">
|
||||
<p style="text-align: center; font-size: 1em">
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace"><b>{{ $hospital_information->name }}</b></span>
|
||||
<span style="font-weight: bolder; text-decoration: underline; display: block; font-family: monospace">{{ $hospital_information->address }}</span>
|
||||
<span class="receipt-label"><b>Tel:</b> {{ $hospital_information->phone_number }}</span><br>
|
||||
<span class="receipt-label"><b>Email:</b> {{ $hospital_information->email }}</span><br>
|
||||
<span class="receipt-label"><b>Cashier:</b> {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</span><br>
|
||||
{{--<span class="receipt-label"><b>Date:</b> {{ streamline_date_time_short($request->date) }}</span><br>--}}
|
||||
@php
|
||||
$new_receipt_number = generateReceiptNumberFromDB();
|
||||
@endphp
|
||||
<span class="receipt-label"><b>Receipt Number: </b> {{ $new_receipt_number }}</span><br>
|
||||
{{--<span class="receipt-label"><b>REF</b> : {{ get_patient_name($request->patient_id) }}</span><br>--}}
|
||||
{{--<span class="receipt-label"><b>Category :</b> {{ get_name($patient->category_id, "id", "name", "patient_categories") }}</span>--}}
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<table class="table" id="receipt_table">
|
||||
<thead>
|
||||
<th style="width: 60%"><b>Description</b></th>
|
||||
<th style="width: 20%"><b>Amount</b></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Reason</td>
|
||||
<td>Patient Debt Plan Receipt</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Staff Guarantor To Pay</td>
|
||||
<td>{{ ugandan_shillings($debt_plan->staff_guarantor_to_pay) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Patient Amount Paid</td>
|
||||
<td>{{ ugandan_shillings($debt_plan->amount_owed - $debt_plan->staff_guarantor_to_pay) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Amount</td>
|
||||
<td>{{ ugandan_shillings($debt_plan->amount_owed) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
</div>
|
||||
<i style="font-size: 0.8em; margin-left: 50%;">© Stre@mline</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('styles')
|
||||
<script type="text/javascript">
|
||||
function print_receipt() {
|
||||
let myDiv = document.getElementById('divToPrint');
|
||||
let newWindow = window.open('', 'SecondWindow', 'toolbar=0,stat=0');
|
||||
|
||||
newWindow.document.write("<html><body " +
|
||||
"class='' " +
|
||||
" onload='window.print()'>" +
|
||||
myDiv.innerHTML +
|
||||
"</body></html>");
|
||||
newWindow.document.close();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'Patient Receipt - Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body{
|
||||
font-size: 0.8em;
|
||||
}
|
||||
/*thead, tfoot { display: table-row-group }*/
|
||||
thead {
|
||||
display: table-header-group;
|
||||
}
|
||||
tfoot {
|
||||
display: table-row-group;
|
||||
}
|
||||
tr {
|
||||
page-break-before: always;
|
||||
page-break-after: always;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container-fluid">
|
||||
@include('layouts.header_pdf_print')
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td><b>Patient Names</b></td>
|
||||
<td>{{ get_full_name($patient_id, 'id', 'first_name', 'last_name', 'patients') }}</td>
|
||||
<td><b>Patient Number</b></td>
|
||||
<td>{{ get_name($patient_id, 'id', 'number', 'patients') }}</td>
|
||||
<td><b>Patient Category</b></td>
|
||||
<td>{{ get_name(get_name($patient_id, 'id', 'category_id', 'patients'), 'id', 'name', 'patient_categories') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Cashier</b></td>
|
||||
<td colspan="2">{{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</td>
|
||||
<td><b>Receipt Number</b></td>
|
||||
<td colspan="2">{{ $receipt_number }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="table table-bordered" id="receipt_table">
|
||||
<thead>
|
||||
<th style="width: 60%"><b>Description</b></th>
|
||||
<th style="width: 20%"><b>Amount</b></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Comment</td>
|
||||
<td>{{ $comment }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Expected Amount</td>
|
||||
<td>{{ ugandan_shillings($amount_owed) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Amount Paid</td>
|
||||
<td>{{ ugandan_shillings($amount_paid) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Balance</td>
|
||||
<td>{{ ugandan_shillings($balance) }}</td>
|
||||
</tr>
|
||||
@if(count($payment_methods) > 0)
|
||||
<tr><td colspan="2"></td></tr>
|
||||
@foreach($payment_methods as $key => $value)
|
||||
<tr>
|
||||
<td><b>Patient Paid With {{ ($key == 0) ? 'Cash' : get_name($key, 'id', 'name', 'patient_payment_methods') }}</b></td>
|
||||
<td><b>{{ ugandan_shillings($value) }}</b></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<i style="font-size: 0.8em; float: left">© {{ date('Y') }} Stre@mline</i>
|
||||
</div>
|
||||
<div class="col">
|
||||
<i style="float: right">Printed On {{ date(" d M Y h:ia") }} By {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+323
@@ -0,0 +1,323 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Receive Debtor Payments</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/finance_reports">Reports Dashboard</a></li>
|
||||
<li class="active">Debtors</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
@php
|
||||
$back_date = \Streamline\Models\HospitalInformation::first()->pluck('back_date');
|
||||
@endphp
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="panel panel-default col-md-12">
|
||||
<div class="panel-body panel-primary">
|
||||
<h2><strong>Debtor Payment</strong></h2>
|
||||
<br/>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Patient Number</th>
|
||||
<th>Patient Name</th>
|
||||
<th>Amount To Pay</th>
|
||||
<th>Amount Paid</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(!is_null($debts))
|
||||
<td>{{ get_name($debts->patient_id, 'id', 'number', 'patients') }}</td>
|
||||
<td>{{ get_full_name($debts->patient_id, 'id', 'first_name', 'last_name', 'patients') }}</td>
|
||||
<td>{{ ugandan_shillings($debts->balance) }}
|
||||
<td>{{ ugandan_shillings($debts->amount_paid_off) }}</td>
|
||||
@else
|
||||
<td colspan="3"><span style="color: red;">RECORDS NOT FOUND</span></td>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="panel panel-default col-md-12">
|
||||
<div class="panel-body panel-primary">
|
||||
<h2><strong>Payment History</strong></h2>
|
||||
<br/>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Balance</th>
|
||||
<th>Amount Paid</th>
|
||||
<th>Receipt No.</th>
|
||||
<th>Date</th>
|
||||
<th>Staff In Charge</th>
|
||||
<th>Comment</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($debt_payments as $debt_payment)
|
||||
<tr>
|
||||
<td>{{ ugandan_shillings($debt_payment->balance) }}</td>
|
||||
<td>{{ ugandan_shillings($debt_payment->amount_paid) }}</td>
|
||||
<td>{{ $debt_payment->receipt_number }}</td>
|
||||
<td>{{ streamline_date($debt_payment->date_paid) }}</td>
|
||||
<td>{{ get_full_name($debt_payment->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
<td>{{ $debt_payment->comment }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body panel-primary">
|
||||
<?php $amount_owed = !is_null($debts->balance_remaining) ? $debts->balance_remaining : $debts->balance ?>
|
||||
@if($amount_owed < 1)
|
||||
<h3 style="color: green">Payment has been made in full</h3>
|
||||
@else
|
||||
{{ Form::open(['route' => 'patient_debtors.process_debtor_payment', 'data-toggle' => 'validator']) }}
|
||||
<h3>Make Payment</h3>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('amount_label', 'Expected Amount') }}
|
||||
<div class="input-group">
|
||||
{{ Form::number('amount_owed', $amount_owed,
|
||||
['class'=>'form-control compulsory required', 'readonly', 'id'=>'amount_owed']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('amount_paid_label', 'Amount Paid') }}
|
||||
<div class="input-group">
|
||||
{{ Form::number('amount_paid', 0, ['class'=>'form-control compulsory', 'id'=>'amount_paid', 'required']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<label class="label label-primary" id="add_payment_method_button" onclick="add_payment_method();">Add Payment Method</label>
|
||||
</div>
|
||||
<div class="col-md-6"></div>
|
||||
</div>
|
||||
<br><br>
|
||||
|
||||
<div id="payment_methods_div" style="display: none">
|
||||
<div class="form-group">
|
||||
{{ Form::label('cash_to_pay','Cash to Pay') }}
|
||||
{{ Form::hidden('original_cash_to_pay', 0, ['id' => 'original_cash_to_pay']) }}
|
||||
{{ Form::number('cash_to_pay',0,['class' => 'form-control','id'=>'cash_to_pay','readonly']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('balance_label', 'Balance Remaining on Debt') }}
|
||||
<div class="input-group">
|
||||
{{ Form::number('balance', '', ['class'=>'form-control compulsory required', 'readonly', 'id'=>'balance', 'required']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('date_label', 'Date of Payment') }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('date', date('d-m-Y'), ['class'=>'form-control compulsory','readonly', 'id'=>'date', 'required']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('comment_label', 'Comment') }}
|
||||
<div class="input-group">
|
||||
{{ Form::textarea('comment','', ['class'=>'form-control compulsory', 'id'=>'comment', 'required']) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::hidden('patient_id', $debts->patient_id, ['id' => 'patient_id']) }}
|
||||
{{ Form::hidden('debt_id', $debts->id, ['id' => 'debt_id']) }}
|
||||
|
||||
<a class="btn btn-danger" id="write_off_btn">Write Off Debt</a>
|
||||
{{ Form::submit('Receive Payment', ['class'=>'btn btn-success pull-right', 'onclick'=>"return confirm('Are you sure you want to complete this payment')"]) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal" id="write_off_modal" tabindex="-1" role="dialog" aria-labelledby="write_off_modal_label" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header text-center">
|
||||
<h5 class="modal-title" id="write_off_modal_label"><b>Write Off Balance</b></h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Amount To Be Written Off</label>
|
||||
<input id="amount_to_write_off" type="number" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Write Off Memo</label>
|
||||
<textarea id="write_off_memo" type="number" rows="5" class="form-control"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Expense Account</label>
|
||||
{{ Form::select('expense_account', $expense_accounts, '', ['class'=>'form-control', 'id'=>'expense_account']) }}
|
||||
</div>
|
||||
|
||||
<button class="btn btn-rounded btn-block btn-success" id="complete_write_off">Complete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<!-- Date Picker Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/js/validator.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#table').DataTable();
|
||||
|
||||
$('#write_off_btn').click(function() {
|
||||
let amount_owed = $('#amount_owed').val();
|
||||
$('#amount_to_write_off').val(amount_owed);
|
||||
$('#write_off_modal').modal('show');
|
||||
});
|
||||
|
||||
$('#complete_write_off').click(function() {
|
||||
let amount = $('#amount_to_write_off').val();
|
||||
let expense_account = $('#expense_account').val();
|
||||
let write_off_memo = $('#write_off_memo').val();
|
||||
let debt_id = $('#debt_id').val();
|
||||
let patient_id = $('#patient_id').val();
|
||||
let amount_owed = $('#amount_owed').val();
|
||||
let balance = $('#balance').val();
|
||||
|
||||
if (amount === '') {
|
||||
alert('Please Enter An Amount To Write Off.')
|
||||
} else if (expense_account === '') {
|
||||
alert('Please Select An Expense Account To Write Off To.')
|
||||
} else if (write_off_memo === '') {
|
||||
alert('Please Enter A Memo For This Write Off.')
|
||||
} else {
|
||||
$.ajax({
|
||||
method: 'post',
|
||||
url: '/patient_debtors/write_off_debts',
|
||||
data: {
|
||||
'amount': amount, 'debt_id': debt_id, 'amount_owed': amount_owed, 'patient_id': patient_id,
|
||||
'expense_account': expense_account, 'write_off_memo': write_off_memo, 'balance': balance
|
||||
},
|
||||
success: function(response) {
|
||||
if(!response.includes("not")) {
|
||||
alert("Write off has been completed successfully");
|
||||
window.location.href = '/patient_debtors/debtors';
|
||||
} else {
|
||||
alert("An error occurred. Please try again");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
let min_days = <?php echo $back_date[0]; ?>;
|
||||
var min_date = new Date();
|
||||
min_date.setDate(min_date.getDate()-min_days);
|
||||
$('#date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
endDate: new Date(),
|
||||
startDate: min_date,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#amount_paid').change(function (e) {
|
||||
e.preventDefault();
|
||||
let amount = $('#amount_owed').val();
|
||||
let bal = amount - this.value;
|
||||
if(bal < 0 ){
|
||||
alert("Please Don't Exceed the Required Amount, Thank You.");
|
||||
this.value = 0;
|
||||
}else if(bal > 0 || bal === 0){
|
||||
$('#balance').val(bal);
|
||||
}
|
||||
reset_payment_methods_amounts();
|
||||
});
|
||||
|
||||
function add_payment_method() {
|
||||
$('#payment_methods_div').show();
|
||||
|
||||
if ($('#cash_to_pay').val() == 0) {
|
||||
$('#cash_to_pay').val( $('#amount_paid').val());
|
||||
$('#original_cash_to_pay').val( $('#amount_paid').val());
|
||||
}
|
||||
|
||||
$('#payment_methods_div').append('<div class="row"><div class="col-md-6"><label>Payment Method</label><select class="form-control payment_method" name="payment_method[]"><option value="0">--select method--</option><?php echo $patient_payment_methods_options ?></select></div><div class="col-md-6"><label>Payment Amount</label><input name="payment_methods_amount[]" type="number" class="form-control payment_methods_amount" onkeyup="payment_methods_amount_calculate()"></div></div><br>');
|
||||
}
|
||||
|
||||
function payment_methods_amount_calculate() {
|
||||
// tally up all the entered values
|
||||
let total_amount_payment_methods = 0;
|
||||
|
||||
$('.payment_methods_amount').each(function () {
|
||||
total_amount_payment_methods += +$(this).val();
|
||||
});
|
||||
|
||||
let cash_to_pay = $('#original_cash_to_pay').val();
|
||||
cash_to_pay -= total_amount_payment_methods;
|
||||
|
||||
if (cash_to_pay < 0) {
|
||||
alert("You have entered more money in the payment methods than is supposed to be paid");
|
||||
$('#cash_to_pay').val($('#original_cash_to_pay').val());
|
||||
$('.payment_methods_amount').each(function () {
|
||||
$(this).val(0);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
$('#cash_to_pay').val(cash_to_pay);
|
||||
}
|
||||
|
||||
function reset_payment_methods_amounts() {
|
||||
$('#cash_to_pay').val( $('#amount_paid').val());
|
||||
$('#original_cash_to_pay').val( $('#amount_paid').val());
|
||||
|
||||
$('.payment_methods_amount').each(function () {
|
||||
$(this).val(0);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'Patient Receipt - Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body{
|
||||
font-size: 0.8em;
|
||||
}
|
||||
/*thead, tfoot { display: table-row-group }*/
|
||||
thead {
|
||||
display: table-header-group;
|
||||
}
|
||||
tfoot {
|
||||
display: table-row-group;
|
||||
}
|
||||
tr {
|
||||
page-break-before: always;
|
||||
page-break-after: always;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container-fluid">
|
||||
@include('layouts.header_pdf_print')
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td><b>Patient Names</b></td>
|
||||
<td>{{ get_full_name($patient_id, 'id', 'first_name', 'last_name', 'patients') }}</td>
|
||||
<td><b>Patient Number</b></td>
|
||||
<td>{{ get_name($patient_id, 'id', 'number', 'patients') }}</td>
|
||||
<td><b>Patient Category</b></td>
|
||||
<td>{{ get_name(get_name($patient_id, 'id', 'category_id', 'patients'), 'id', 'name', 'patient_categories') }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@foreach($debt_payments as $debt_payment)
|
||||
<table class="table table-bordered" id="receipt_table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><b>Amount Paid</b></td>
|
||||
<td>{{ ugandan_shillings($debt_payment->amount_paid) }}</td>
|
||||
<td><b>Balance</b></td>
|
||||
<td>{{ ugandan_shillings($debt_payment->balance) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Comment</b></td>
|
||||
<td>{{ $debt_payment->comment }}</td>
|
||||
<td><b>Received By</b></td>
|
||||
<td>{{ get_full_name($debt_payment->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Receipt Number</b></td>
|
||||
<td>{{ $debt_payment->receipt_number }}</td>
|
||||
<td><b>Received On</b></td>
|
||||
<td>{{ streamline_date($debt_payment->date_paid) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<hr>
|
||||
@endforeach
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<i style="font-size: 0.8em; float: left">© {{ date('Y') }} Stre@mline</i>
|
||||
</div>
|
||||
<div class="col">
|
||||
<i style="float: right">Printed On {{ date(" d M Y h:ia") }} By {{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Guarantors</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> Home</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> Finance Home</a></li>
|
||||
<li><a href="{{ route('finance_reports.index') }}"><i class="fa fa-list"></i> Reports Home</a></li>
|
||||
<li class="active">Guarantors</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
@include('flash::message')
|
||||
<div class="row white-box">
|
||||
{{ Form::open(['method'=>'post','route' => 'patient_debtors.staff_guarantors']) }}
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
{{ Form::label('staff_member', 'Select Guarantor') }}
|
||||
<select class="form-control compulsory required" name="staff_member" id="staff_member" required>
|
||||
<option value="">-- Select --</option>
|
||||
<option value="ALL STAFF">ALL GUARANTORS</option>
|
||||
@foreach($users as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->first_name. " ".$item->last_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', 'Start Date') }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('start_date', '', ['class'=>'form-control compulsory required', 'readonly', 'id'=>'start_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
{{ Form::label('end_date', 'End Date') }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('end_date', '', ['class'=>'form-control compulsory required', 'readonly', 'id'=>'end_date']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group" style="margin-top: 20px;">
|
||||
{{ Form::submit('Submit', ['class'=>'btn btn-success pull-right']) }}
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
<h4> {!! $display ?? '' !!}</h4>
|
||||
<br>
|
||||
<br/>
|
||||
<div class="table-responsive">
|
||||
<table id="table" class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Guarantor Name</th>
|
||||
<th>Patient Name</th>
|
||||
<th>Date Of Bill</th>
|
||||
<th>Arrangement For Balance</th>
|
||||
<th>Completion Date</th>
|
||||
<th>Authorised By</th>
|
||||
<th>Comment</th>
|
||||
<th>Guarantor To Pay</th>
|
||||
<th>Amount Paid</th>
|
||||
<th>Balance</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@php
|
||||
$sum_total_amount = 0;
|
||||
$sum_amount_paid = 0;
|
||||
$sum_balance = 0;
|
||||
@endphp
|
||||
@if(count($debts) > 0)
|
||||
<tbody>
|
||||
@foreach($debts as $debt)
|
||||
<tr>
|
||||
<td>
|
||||
@php
|
||||
$guarantor_ids_array = explode(",", $debt->staff_guarantor);
|
||||
@endphp
|
||||
<ul>
|
||||
@if ($debt->guarantor_type == 1)
|
||||
@for ($i = 0; $i < count($guarantor_ids_array); $i++)
|
||||
<li>{{ get_full_name($guarantor_ids_array[$i], 'id', 'first_name', 'last_name', 'users') }}</li>
|
||||
@endfor
|
||||
@else
|
||||
@for ($i = 0; $i < count($guarantor_ids_array); $i++)
|
||||
<li>{{ get_full_name($guarantor_ids_array[$i], 'id', 'first_name', 'last_name', 'non_staff_guarantors') }}</li>
|
||||
@endfor
|
||||
@endif
|
||||
</ul>
|
||||
</td>
|
||||
<td>{{ get_name($debt->patient_id, 'id', 'first_name', 'patients') }} {{ get_name($debt->patient_id, 'id', 'last_name', 'patients') }}</td>
|
||||
<td>{{ streamline_date($debt->created_at) }}</td>
|
||||
<td>{{ get_name($debt->debt_plan_arrangement, 'id', 'name', 'debt_plan_arrangements') }}</td>
|
||||
<td>
|
||||
@if (!is_null($debt->fourth_installment_date))
|
||||
{{ streamline_date($debt->fourth_installment_date) }}
|
||||
@elseif(!is_null($debt->third_installment_date))
|
||||
{{ streamline_date($debt->third_installment_date) }}
|
||||
@elseif(!is_null($debt->second_installment_date))
|
||||
{{ streamline_date($debt->second_installment_date) }}
|
||||
@elseif(!is_null($debt->first_installment_date))
|
||||
{{ streamline_date($debt->first_installment_date) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ get_full_name($debt->authorised_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
<td>{{ $debt->comment ?? "N/A" }}</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($debt->staff_guarantor_to_pay) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($debt->amount_paid_off) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($debt->balance_remaining) }}
|
||||
</td>
|
||||
<td><a class="btn btn-primary btn-sm btn-rounded" target="_blank" href="/patient_debtors/debt_plan_guarantor_agreement/{{ $debt->id }}">{{ __('patient_finance.print_guarantor_agreement') }}</a></td>
|
||||
|
||||
@php
|
||||
$current_amount_paid = ($debt->amount_paid_off ?? 0);
|
||||
$sum_total_amount += $debt->staff_guarantor_to_pay;
|
||||
$sum_amount_paid += $current_amount_paid;
|
||||
$sum_balance += $debt->balance_remaining ?? $debt->staff_guarantor_to_pay;
|
||||
@endphp
|
||||
<td>
|
||||
@if($current_amount_paid == 0)
|
||||
{{ Form::open(['method'=>'post', 'route'=>'patient_debtors.receive_debt_plan_payments_staff']) }}
|
||||
{{ Form::hidden('debt_plan_id', $debt->id) }}
|
||||
{{ Form::hidden('status', 'new') }}
|
||||
{{ Form::submit('Receive Payment', ['class'=>'btn btn-success btn-sm btn-rounded']) }}
|
||||
{{ Form::close() }}
|
||||
@elseif ($current_amount_paid < $debt->staff_guarantor_to_pay)
|
||||
{{ Form::open(['method'=>'post', 'route'=>'patient_debtors.receive_debt_plan_payments_staff']) }}
|
||||
{{ Form::hidden('debt_plan_id', $debt->id) }}
|
||||
{{ Form::hidden('status', 'update') }}
|
||||
{{ Form::submit('Update Payment', ['class'=>'btn btn-warning btn-sm btn-rounded']) }}
|
||||
{{ Form::close() }}
|
||||
@elseif ($current_amount_paid == $debt->staff_guarantor_to_pay)
|
||||
{{ Form::open(['method'=>'post', 'route'=>'patient_debtors.receive_debt_plan_payments_staff']) }}
|
||||
{{ Form::hidden('debt_plan_id', $debt->id) }}
|
||||
{{ Form::hidden('status', 'update') }}
|
||||
{{ Form::submit('View Payments', ['class'=>'btn btn-primary btn-sm btn-rounded']) }}
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
</tbody>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>Total</td>
|
||||
<td>{{ ugandan_shillings($sum_total_amount) }}</td>
|
||||
<td>{{ ugandan_shillings($sum_amount_paid) }}</td>
|
||||
<td>{{ ugandan_shillings($sum_balance) }}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@else
|
||||
<td colspan="7"><span style="color: red;">RECORDS NOT FOUND</span></td>
|
||||
@endif
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<!-- Date Picker Plugin JavaScript -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery('#end_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery('#start_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('#staff_member').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
],
|
||||
"aoColumnDefs": [{
|
||||
"aTargets": [2,3],
|
||||
"defaultContent": "",
|
||||
}]
|
||||
});
|
||||
</script>
|
||||
|
||||
@endpush
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-8">
|
||||
<h4 class="page-title">Editing drugs pricing for {{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li><a href="/price_list_category/">Price List Categories</a></li>
|
||||
<li class="active">Edit</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('finance::markup_tags.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<!--Flash messages at the top -->
|
||||
@include('flash::message')
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<strong>Existing markups</strong>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th>Percentage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($markup_tags as $tag)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $tag->name }}</td>
|
||||
<td>{{ $tag->percentage }}%</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
{{ Form::open(['route' => 'price_list_category.save_apply_markup_to_drugs', 'data-toggle' => 'validator']) }}
|
||||
|
||||
{{ Form::hidden('price_list_category_id', $id) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('markup_tag', 'Select Markup to apply') }}
|
||||
{{ Form::select('markup_tag', $tags_select, '', ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<input id="select_all" type="checkbox"> Select all drugs
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table" id="items_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th>Current Cash Price</th>
|
||||
<th>{{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }} Price</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$counter = 1;
|
||||
@endphp
|
||||
|
||||
@foreach($drugs as $drug)
|
||||
@php
|
||||
$key = array_search($id, explode(",", $drug->price_list_category));
|
||||
$price_list_price_array = explode(",", $drug->price_list_price);
|
||||
$price_list_price = isset($price_list_price_array[$key]) ? $price_list_price_array[$key] : 0;
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $drug->name }}</td>
|
||||
<td>{{ ugandan_shillings($drug->non_insured_price) }}</td>
|
||||
<td>{{ ugandan_shillings($price_list_price) }}</td>
|
||||
<td><input class="item_checkbox" type="checkbox" name="checked_drug[]" value="{{ $drug->id }}"></td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{ Form::button('Apply',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button('Cancel',['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('#items_table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
bLengthChange: false,
|
||||
bPaginate: false,
|
||||
buttons: []
|
||||
});
|
||||
|
||||
$('#select_all').change(function() {
|
||||
if (this.checked === true) {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
} else {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-8">
|
||||
<h4 class="page-title">Editing drugs pricing for {{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li><a href="/price_list_category/">Price List Categories</a></li>
|
||||
<li class="active">Edit</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('finance::markup_tags.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<!--Flash messages at the top -->
|
||||
@include('flash::message')
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<strong>Existing markups</strong>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th>Percentage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($markup_tags as $tag)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $tag->name }}</td>
|
||||
<td>{{ $tag->percentage }}%</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
{{ Form::open(['route' => 'price_list_category.save_apply_markup_to_eye_glasses', 'data-toggle' => 'validator']) }}
|
||||
|
||||
{{ Form::hidden('price_list_category_id', $id) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('markup_tag', 'Select Markup to apply') }}
|
||||
{{ Form::select('markup_tag', $tags_select, '', ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="checkbox checkbox-success">
|
||||
<input id="select_all" type="checkbox">
|
||||
<label for="select_all"> Select all Eye Glases </label>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table" id="items_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th>Current Cash Price</th>
|
||||
<th>{{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }} Price</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$counter = 1;
|
||||
@endphp
|
||||
|
||||
@foreach($eye_glasses as $eye_glass)
|
||||
@php
|
||||
$key = array_search($id, explode(",", $eye_glass->price_list_category));
|
||||
$price_list_price_array = explode(",", $eye_glass->price_list_price);
|
||||
$price_list_price = isset($price_list_price_array[$key]) ? $price_list_price_array[$key] : 0;
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $eye_glass->name }}</td>
|
||||
<td>{{ ugandan_shillings($eye_glass->non_insured_price) }}</td>
|
||||
<td>{{ ugandan_shillings($price_list_price) }}</td>
|
||||
<td>
|
||||
<input class="item_checkbox" type="checkbox" name="checked_eye_glass[]" value="{{ $eye_glass->id }}">
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{ Form::button('Apply',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button('Cancel',['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('#items_table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
bLengthChange: false,
|
||||
bPaginate: false,
|
||||
buttons: []
|
||||
});
|
||||
|
||||
$('#select_all').change(function() {
|
||||
if (this.checked === true) {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
} else {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-8">
|
||||
<h4 class="page-title">Editing investigations pricing for {{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li><a href="/price_list_category/">Price List Categories</a></li>
|
||||
<li class="active">Edit</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('finance::markup_tags.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<!--Flash messages at the top -->
|
||||
@include('flash::message')
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<strong>Existing markups</strong>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th>Percentage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($markup_tags as $tag)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $tag->name }}</td>
|
||||
<td>{{ $tag->percentage }}%</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
{{ Form::open(['route' => 'price_list_category.save_apply_markup_to_investigations', 'data-toggle' => 'validator']) }}
|
||||
|
||||
{{ Form::hidden('price_list_category_id', $id) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('markup_tag', 'Select Markup to apply') }}
|
||||
{{ Form::select('markup_tag', $tags_select, '', ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<input id="select_all" type="checkbox"> Select all investigations
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table" id="items_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th>Current Cash Price</th>
|
||||
<th>{{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }} Price</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($investigations as $investigation)
|
||||
@php
|
||||
$key = array_search($id, explode(",", $investigation->price_list_category));
|
||||
$price_list_price_array = explode(",", $investigation->price_list_price);
|
||||
$price_list_price = isset($price_list_price_array[$key]) ? $price_list_price_array[$key] : 0;
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $investigation->name }}</td>
|
||||
<td>{{ ugandan_shillings($investigation->non_insured_price) }}</td>
|
||||
<td>{{ ugandan_shillings($price_list_price) }}</td>
|
||||
<td><input class="item_checkbox" type="checkbox" name="checked_investigation[]" value="{{ $investigation->id }}"></td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{ Form::button('Apply',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button('Cancel',['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('#items_table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
bLengthChange: false,
|
||||
bPaginate: false,
|
||||
buttons: []
|
||||
});
|
||||
|
||||
$('#select_all').change(function() {
|
||||
if (this.checked === true) {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
} else {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-8">
|
||||
<h4 class="page-title">Editing procedures pricing for {{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li><a href="/price_list_category/">Price List Categories</a></li>
|
||||
<li class="active">Edit</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('finance::markup_tags.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<!--Flash messages at the top -->
|
||||
@include('flash::message')
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<strong>Existing markups</strong>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th>Percentage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($markup_tags as $tag)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $tag->name }}</td>
|
||||
<td>{{ $tag->percentage }}%</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
{{ Form::open(['route' => 'price_list_category.save_apply_markup_to_procedures', 'data-toggle' => 'validator']) }}
|
||||
|
||||
{{ Form::hidden('price_list_category_id', $id) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('markup_tag', 'Select Markup to apply') }}
|
||||
{{ Form::select('markup_tag', $tags_select, '', ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<input id="select_all" type="checkbox"> Select all procedures
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table" id="items_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th>Current Cash Price</th>
|
||||
<th>{{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }} Price</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($procedures as $procedure)
|
||||
@php
|
||||
$key = array_search($id, explode(",", $procedure->price_list_category));
|
||||
$price_list_price_array = explode(",", $procedure->price_list_price);
|
||||
$price_list_price = isset($price_list_price_array[$key]) ? $price_list_price_array[$key] : 0;
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $procedure->name }}</td>
|
||||
<td>{{ ugandan_shillings($procedure->non_insured_price) }}</td>
|
||||
<td>{{ ugandan_shillings($price_list_price) }}</td>
|
||||
<td><input class="item_checkbox" type="checkbox" name="checked_procedure[]" value="{{ $procedure->id }}"></td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{ Form::button('Apply',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button('Cancel',['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
/*$('#items_table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
bLengthChange: false,
|
||||
bPaginate: false,
|
||||
buttons: []
|
||||
});*/
|
||||
|
||||
$('#select_all').change(function() {
|
||||
if (this.checked === true) {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
} else {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-8">
|
||||
<h4 class="page-title">Editing services pricing for {{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li><a href="/price_list_category">Price List Categories</a></li>
|
||||
<li class="active">Edit</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('finance::markup_tags.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<!--Flash messages at the top -->
|
||||
@include('flash::message')
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<strong>Existing markups</strong>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th>Percentage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($markup_tags as $tag)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $tag->name }}</td>
|
||||
<td>{{ $tag->percentage }}%</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
{{ Form::open(['route' => 'price_list_category.save_apply_markup_to_services', 'data-toggle' => 'validator']) }}
|
||||
|
||||
{{ Form::hidden('price_list_category_id', $id) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('markup_tag', 'Select Markup to apply') }}
|
||||
{{ Form::select('markup_tag', $tags_select, '', ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<input id="select_all" type="checkbox"> Select all services
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table" id="items_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th>Current Cash Price</th>
|
||||
<th>{{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }} Price</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($services as $service)
|
||||
@php
|
||||
$key = array_search($id, explode(",", $service->price_list_category));
|
||||
$price_list_price_array = explode(",", $service->price_list_price);
|
||||
$price_list_price = isset($price_list_price_array[$key]) ? $price_list_price_array[$key] : 0;
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $service->name }}</td>
|
||||
<td>{{ ugandan_shillings($service->non_insured_price) }}</td>
|
||||
<td>{{ ugandan_shillings($price_list_price) }}</td>
|
||||
<td><input class="item_checkbox" type="checkbox" name="checked_service[]" value="{{ $service->id }}"></td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{ Form::button('Apply',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button('Cancel',['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('#items_table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
bLengthChange: false,
|
||||
bPaginate: false,
|
||||
buttons: []
|
||||
});
|
||||
|
||||
$('#select_all').change(function() {
|
||||
if (this.checked === true) {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
} else {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-8">
|
||||
<h4 class="page-title">Editing sundries pricing for {{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li><a href="/price_list_category/">Price List Categories</a></li>
|
||||
<li class="active">Edit</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('finance::markup_tags.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<!--Flash messages at the top -->
|
||||
@include('flash::message')
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<strong>Existing markups</strong>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th>Percentage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($markup_tags as $tag)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $tag->name }}</td>
|
||||
<td>{{ $tag->percentage }}%</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
{{ Form::open(['route' => 'price_list_category.save_apply_markup_to_sundries', 'data-toggle' => 'validator']) }}
|
||||
|
||||
{{ Form::hidden('price_list_category_id', $id) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('markup_tag', 'Select Markup to apply') }}
|
||||
{{ Form::select('markup_tag', $tags_select, '', ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<input id="select_all" type="checkbox"> Select all sundries
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table" id="items_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th>Current Cash Price</th>
|
||||
<th>{{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }} Price</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($sundries as $sundry)
|
||||
@php
|
||||
$key = array_search($id, explode(",", $sundry->price_list_category));
|
||||
$price_list_price_array = explode(",", $sundry->price_list_price);
|
||||
$price_list_price = isset($price_list_price_array[$key]) ? $price_list_price_array[$key] : 0;
|
||||
@endphp
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $sundry->name }}</td>
|
||||
<td>{{ ugandan_shillings($sundry->non_insured_price) }}</td>
|
||||
<td>{{ ugandan_shillings($price_list_price) }}</td>
|
||||
<td><input class="item_checkbox" type="checkbox" name="checked_sundry[]" value="{{ $sundry->id }}"></td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{ Form::button('Apply',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button('Cancel',['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('#items_table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
bLengthChange: false,
|
||||
bPaginate: false,
|
||||
buttons: []
|
||||
});
|
||||
|
||||
$('#select_all').change(function() {
|
||||
if (this.checked === true) {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
} else {
|
||||
$(".item_checkbox").each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+64
@@ -0,0 +1,64 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<style type="text/css">
|
||||
.modal-dialog {
|
||||
position: absolute;
|
||||
top: 40%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%) !important;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Add Category</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li><a href="/price_list_category/index">Price List Categories</a></li>
|
||||
<li class="active">Create</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::price_list_category.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('flash::message')
|
||||
<div class="white-box">
|
||||
{{ Form::open(['route' => 'price_list_category.store', 'data-toggle' => 'validator']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('patient_category_id','Patient Category') }}
|
||||
{{ Form::select('patient_category_id', $patient_categories, '', ['class' => 'form-control col-sm-12 compulsory']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('pay_for_invoice','Invoice Patient Category For Pay Later Patients (If this price list will apply to other patient categories, tick no. If it is only for this patient category, tick yes.)') }}
|
||||
<br>
|
||||
{{ Form::radio('pay_for_invoice', 1, false, ["required"]) }} Yes
|
||||
{{ Form::radio('pay_for_invoice', 0, false, ["required"]) }} No
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button('Cancel',['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/js/validator.js') }}"></script>
|
||||
@endpush
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-8">
|
||||
<h4 class="page-title">Editing pricing for {{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li><a href="/price_list_category/index">Price List Categories</a></li>
|
||||
<li class="active">Edit</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::price_list_category.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-info btn-rounded col-md-12" href="/price_list_category/edit_pricing_sundries/{{ $id }}"> Edit Sundries Pricing</a>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-info btn-rounded col-md-12" href="/price_list_category/edit_pricing_procedures/{{ $id }}"> Edit Procedures Pricing</a>
|
||||
</div>
|
||||
</div>
|
||||
<br><br>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-info btn-rounded col-md-12" href="/price_list_category/edit_pricing_investigations/{{ $id }}"> Edit Investigations Pricing</a>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-info btn-rounded col-md-12" href="/price_list_category/edit_pricing_drugs/{{ $id }}"> Edit Drugs Pricing</a>
|
||||
</div>
|
||||
</div>
|
||||
<br><br>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-info btn-rounded col-md-12" href="/price_list_category/edit_pricing_services/{{ $id }}"> Edit Services Pricing</a>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-info btn-rounded col-md-12" href="/price_list_category/edit_pricing_eye_glasses/{{ $id }}"> Edit Eye Glasses Pricing</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
|
||||
<style>
|
||||
th, td { white-space: nowrap; }
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-8">
|
||||
<h4 class="page-title">Editing {{ $item_name }} pricing for {{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li><a href="/price_list_category">Price List Categories</a></li>
|
||||
<li class="active">Edit</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
@include('patient_discounts::price_list_category.menu')
|
||||
<div class="white-box">
|
||||
{{ Form::open(['route' => [$route,$id], 'method' => 'ANY', 'role' => 'search']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group" id="drug_names">
|
||||
{{ Form::select('search_items_ids[]',$items,'',['id'=>'items_ids', 'multiple'=>true, 'class' => 'form-control col-sm-8 items_ids']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<button type="submit" class="btn btn-info"><span class="glyphicon glyphicon-search"></span> {{ __('pharmacy.search') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
@if(count($filtered_items) > 0)
|
||||
{{ Form::open(['route' => [$route_markups,$id], 'method' => 'ANY', 'role' => 'search']) }}
|
||||
{{ Form::hidden('filtered_items', json_encode($filtered_items), ['class' => 'form-control']) }}
|
||||
<button class="btn btn-primary" type="submit" >Apply Markup Tags</button>
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- <div class="col-md-6">
|
||||
<div style="float: right; margin-bottom: 5px;">
|
||||
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
</div>
|
||||
</div> --}}
|
||||
</div>
|
||||
{{ Form::open(['route' => $route_submit, 'data-toggle' => 'validator']) }}
|
||||
|
||||
{{ Form::hidden('price_list_category_id', $id) }}
|
||||
<br>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th hidden>Id</th>
|
||||
<th>{{ $title }}</th>
|
||||
<th>Default (Cash) Price</th>
|
||||
<th>{{ get_name(get_name($id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') }} Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($filtered_items as $record)
|
||||
@php
|
||||
$key = array_search($id, explode(",", $record->price_list_category));
|
||||
$price_list_price_array = explode(",", $record->price_list_price);
|
||||
$price_list_price = ($key !== false )? $price_list_price_array[$key] : 0;
|
||||
@endphp
|
||||
<tr>
|
||||
<td hidden>
|
||||
{{ Form::text('id[]', $record->id, ['class' => 'form-control']) }}
|
||||
</td>
|
||||
<td>{{ $record->name }}</td>
|
||||
<td>
|
||||
{{ Form::number('non_insured_price[]', $record->non_insured_price , ['class' => 'form-control compulsory', 'readonly']) }}
|
||||
<span style="display: none">{{ $record->non_insured_price }}</span>
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::number('price_list_price[]', $price_list_price , ['class' => 'form-control compulsory']) }}
|
||||
<span style="display: none">{{ $price_list_price }}</span>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td rowspan="4" class="text-danger">Select Items</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<br>
|
||||
{{ Form::button(__('price_list_category.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button(__('price_list_category.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('.items_ids').select2({
|
||||
placeholder: "Select"
|
||||
});
|
||||
$('.table').DataTable({
|
||||
// pageLength: 600,
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
footer: true,
|
||||
title: 'PRICE LIST - STRE@MLINE',
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3 ]
|
||||
},
|
||||
},
|
||||
{ extend: 'excel',
|
||||
footer: true,
|
||||
title: 'PRICE LIST - STRE@MLINE',
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3 ]
|
||||
},
|
||||
sheetName: 'PRICE LIST ON STREAMLINE'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
footer: true,
|
||||
title: 'PRICE LIST - STRE@MLINE',
|
||||
repeatingHead: {
|
||||
logo: '<?php echo asset("uploads/logo/logo-sm.png"); ?>',
|
||||
logoPosition: 'right',
|
||||
logoStyle: '',
|
||||
},
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3 ]
|
||||
}
|
||||
},
|
||||
{ extend: 'print',
|
||||
footer: true,
|
||||
title: 'PRICE LIST - STRE@MLINE',
|
||||
exportOptions: {
|
||||
columns: [ 1, 2, 3 ]
|
||||
}
|
||||
}
|
||||
],
|
||||
sorting: false,
|
||||
paging:false,
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Activate Price List Categories</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li><a href="/price_list_category/index">Price List Categories</a></li>
|
||||
<li class="active">Activate</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::price_list_category.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box">
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<p class="text-muted m-b-30">Export data to Copy, CSV, Excel, PDF & Print</p>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Category Name</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($categories as $category)
|
||||
<tr>
|
||||
<td>{{ $patient_categories[$category->patient_category_id] }}</td>
|
||||
<td>
|
||||
{{ Form::model($category->id ,['method' => 'POST', 'route' => ['price_list_category.activate', $category->id]]) }}
|
||||
<button type="submit" class="btn btn-warning" onclick="return confirm('Are you sure?')"><i class="fa fa-check"></i> Activate</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">Price List Categories</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">Dashboard</a></li>
|
||||
<li class="active">View</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('patient_discounts::price_list_category.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box">
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Category Name</th>
|
||||
@if(Auth::user()->can('price-list-category-edit-pricing'))
|
||||
<th></th>
|
||||
@endif
|
||||
@if(Auth::user()->can('price-list-category-delete'))
|
||||
<th></th>
|
||||
@endif
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($categories as $category)
|
||||
<tr>
|
||||
<td>{{ isset($patient_categories[$category->patient_category_id]) ? $patient_categories[$category->patient_category_id] : "N/A" }}</td>
|
||||
@if(Auth::user()->can('price-list-category-edit-pricing'))
|
||||
<td>
|
||||
<a href="/price_list_category/edit_pricing/{{ $category->id }}" class="btn btn-info"><i class="fa fa-pencil"></i> Edit Pricing</a>
|
||||
</td>
|
||||
@endif
|
||||
@if(Auth::user()->can('price-list-category-delete'))
|
||||
<td>
|
||||
{{ Form::model($category->id ,['method' => 'DELETE', 'route' => ['price_list_category.destroy', $category->id]]) }}
|
||||
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i> Delete</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'pdf', 'print', 'excel'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
@if(Auth::user()->can('price-list-category-create'))
|
||||
<a href="{{ route('price_list_category.create') }}" class="nav-item btn btn-success ti-plus"> Add Price List Category</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('price-list-category-view'))
|
||||
<a href="{{ route('price_list_category.index') }}" class="nav-item btn btn-info ti-eye"> View Price List Categories</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('price-list-category-delete'))
|
||||
<a href="{{ route('price_list_category.inactive') }}" class="nav-item btn btn-danger ti-eye"> Inactive Price List Categories</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| API Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register API routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| is assigned the "api" middleware group. Enjoy building your API!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::middleware('auth:api')->get('/patient_discounts', function () {
|
||||
return "Patient Discounts";
|
||||
});
|
||||
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::group(['middleware' => ['auth', 'disablebackbutton', 'user-locale','subscription-tracking']], function () {
|
||||
/* DiscountCategory Controller */
|
||||
Route::get('/discount_category/inactive', 'DiscountCategoryController@inactive')->name('discount_category.inactive');
|
||||
Route::post('/discount_category/activate{id}', 'DiscountCategoryController@activate')->name('discount_category.activate');
|
||||
Route::resource('discount_category', 'DiscountCategoryController');
|
||||
|
||||
/* Patient Discounts Controller */
|
||||
Route::get('/discounts/inactive', 'DiscountController@inactive')->name('discounts.inactive');
|
||||
Route::post('/discounts/activate/{id}', 'DiscountController@activate')->name('discounts.activate');
|
||||
Route::any('/discounts/edit_insured_drugs/{patient_category_id}', 'DiscountController@edit_insured_drugs');
|
||||
Route::any('/discounts/store_edited_insured_drugs/', 'DiscountController@store_edited_insured_drugs')->name('discounts.store_edited_insured_drugs');
|
||||
|
||||
Route::any('discounts/add_dependants', 'DiscountController@add_category_patient_dependants');
|
||||
Route::any('discounts/add_dependants_to_category_patient', 'DiscountController@add_dependants_to_category_patient');
|
||||
Route::any('store_dependants_to_category_patient', 'DiscountController@store_dependants_to_category_patient');
|
||||
Route::any('view_patient_dependant_details', 'DiscountController@view_patient_dependant_details');
|
||||
Route::any('view_dependants_to_category_patient/{id}', 'DiscountController@view_dependants_to_category_patient');
|
||||
Route::any('generate_dependants_payment_invoice', 'DiscountController@generate_dependants_payment_invoice');
|
||||
Route::any('receive_dependants_payment', 'DiscountController@receive_dependants_payment');
|
||||
Route::get('search_dependant_name', 'DiscountController@search_dependant_name')->name('dependants.search_dependant_name');
|
||||
|
||||
Route::resource('discounts', 'DiscountController');
|
||||
|
||||
Route::any('clean_dependants_that_are_main_patients', 'DiscountController@clean_dependants_that_are_main_patients');
|
||||
|
||||
/* Price List */
|
||||
Route::get('/price_list_category/inactive', 'PriceListController@inactive')->name('price_list_category.inactive');
|
||||
Route::post('/price_list_category/activate{id}', 'PriceListController@activate')->name('price_list_category.activate');
|
||||
Route::any('/price_list_category/edit_pricing/{id}', 'PriceListController@edit_pricing');
|
||||
Route::any('/price_list_category/edit_pricing_sundries/{id}', 'PriceListController@edit_pricing_sundries')->name('price_list_category.edit_pricing_sundries');
|
||||
Route::any('/price_list_category/save_edit_pricing_sundries', 'PriceListController@save_edit_pricing_sundries')->name('price_list_category.save_edit_pricing_sundries');
|
||||
Route::any('/price_list_category/edit_pricing_procedures/{id}', 'PriceListController@edit_pricing_procedures')->name('price_list_category.edit_pricing_procedures');
|
||||
Route::any('/price_list_category/save_edit_pricing_procedures', 'PriceListController@save_edit_pricing_procedures')->name('price_list_category.save_edit_pricing_procedures');
|
||||
Route::any('/price_list_category/edit_pricing_investigations/{id}', 'PriceListController@edit_pricing_investigations')->name('price_list_category.edit_pricing_invesigations');
|
||||
Route::any('/price_list_category/save_edit_pricing_investigations', 'PriceListController@save_edit_pricing_investigations')->name('price_list_category.save_edit_pricing_investigations');
|
||||
Route::any('/price_list_category/edit_pricing_drugs/{id}', 'PriceListController@edit_pricing_drugs')->name('price_list_category.edit_pricing_drugs');
|
||||
Route::any('/price_list_category/save_edit_pricing_drugs', 'PriceListController@save_edit_pricing_drugs')->name('price_list_category.save_edit_pricing_drugs');
|
||||
Route::any('/price_list_category/edit_pricing_services/{id}', 'PriceListController@edit_pricing_services')->name('price_list_category.edit_pricing_services');
|
||||
Route::any('/price_list_category/save_edit_pricing_services', 'PriceListController@save_edit_pricing_services')->name('price_list_category.save_edit_pricing_services');
|
||||
Route::any('/price_list_category/edit_pricing_eye_glasses/{id}', 'PriceListController@edit_pricing_eye_glasses')->name('price_list_category.edit_pricing_eye_glasses');
|
||||
Route::any('/price_list_category/save_pricing_eye_glasses', 'PriceListController@save_pricing_eye_glasses')->name('price_list_category.save_pricing_eye_glasses');
|
||||
|
||||
Route::any('/price_list_category/apply_markup_to_drugs/{id}', 'PriceListController@apply_markup_to_drugs')->name('price_list_category.apply_markup_to_drugs');
|
||||
Route::any('/price_list_category/save_apply_markup_to_drugs', 'PriceListController@save_apply_markup_to_drugs')->name('price_list_category.save_apply_markup_to_drugs');
|
||||
Route::any('/price_list_category/apply_markup_to_eye_glasses/{id}', 'PriceListController@apply_markup_to_eye_glasses')->name('price_list_category.apply_markup_to_eye_glasses');
|
||||
Route::any('/price_list_category/save_apply_markup_to_eye_glasses', 'PriceListController@save_apply_markup_to_eye_glasses')->name('price_list_category.save_apply_markup_to_eye_glasses');
|
||||
Route::any('/price_list_category/apply_markup_to_investigations/{id}', 'PriceListController@apply_markup_to_investigations')->name('price_list_category.apply_markup_to_investigations');
|
||||
Route::any('/price_list_category/save_apply_markup_to_investigations', 'PriceListController@save_apply_markup_to_investigations')->name('price_list_category.save_apply_markup_to_investigations');
|
||||
Route::any('/price_list_category/apply_markup_to_procedures/{id}', 'PriceListController@apply_markup_to_procedures')->name('price_list_category.apply_markup_to_procedures');
|
||||
Route::any('/price_list_category/save_apply_markup_to_procedures', 'PriceListController@save_apply_markup_to_procedures')->name('price_list_category.save_apply_markup_to_procedures');
|
||||
Route::any('/price_list_category/apply_markup_to_services/{id}', 'PriceListController@apply_markup_to_services')->name('price_list_category.apply_markup_to_services');
|
||||
Route::any('/price_list_category/save_apply_markup_to_services', 'PriceListController@save_apply_markup_to_services')->name('price_list_category.save_apply_markup_to_services');
|
||||
Route::any('/price_list_category/apply_markup_to_sundries/{id}', 'PriceListController@apply_markup_to_sundries')->name('price_list_category.apply_markup_to_sundries');
|
||||
Route::any('/price_list_category/save_apply_markup_to_sundries', 'PriceListController@save_apply_markup_to_sundries')->name('price_list_category.save_apply_markup_to_sundries');
|
||||
|
||||
Route::resource('price_list_category', 'PriceListController');
|
||||
|
||||
// patient accounts
|
||||
Route::any('/patient_accounts/statement', 'PatientAccountsController@statement')->name('patient_accounts.statement');
|
||||
Route::any('/patient_accounts/print_statement', 'PatientAccountsController@print_statement')->name('patient_accounts.print_statement');
|
||||
Route::any('/patient_accounts/make_deposit', 'PatientAccountsController@make_deposit')->name('patient_accounts.make_deposit');
|
||||
Route::any('/patient_accounts/store_deposit', 'PatientAccountsController@store_deposit')->name('patient_accounts.store_deposit');
|
||||
Route::any('/patient_accounts/print_receipt_pdf_details', 'PatientAccountsController@print_receipt_pdf_details')->name('patient_accounts.print_receipt_pdf_details');
|
||||
Route::any('/patient_accounts/refund_deposit', 'PatientAccountsController@refund_deposit')->name('patient_accounts.refund_deposit');
|
||||
Route::any('/patient_accounts/save_refund_deposit', 'PatientAccountsController@save_refund_deposit')->name('patient_accounts.save_refund_deposit');
|
||||
Route::any('/patient_accounts/deposits_report', 'PatientAccountsController@deposits_report')->name('patient_accounts.deposits_report');
|
||||
Route::any('/patient_accounts/consumptions_report', 'PatientAccountsController@consumptions_report')->name('patient_accounts.consumptions_report');
|
||||
Route::any('/patient_accounts/view_details/{patient_id}', 'PatientAccountsController@view_details');
|
||||
Route::any('/patient_accounts/cancel_deposit/{id}', 'PatientAccountsController@cancel_deposit');
|
||||
Route::any('/patient_accounts/refunds_report', 'PatientAccountsController@refunds_report')->name('patient_accounts.refunds_report');
|
||||
Route::any('/patient_accounts/cancel_refund/{id}', 'PatientAccountsController@cancel_refund');
|
||||
|
||||
/* Family accounts routes */
|
||||
Route::resource('family_accounts', 'FamilyAccountsController');
|
||||
Route::any('family_accounts/refund/{family_account_id}', 'FamilyAccountsController@refund');
|
||||
Route::any('family_accounts/store_family_refund', 'FamilyAccountsController@store_family_refund')->name('family_accounts.store_family_refund');
|
||||
Route::any('family_accounts/add_deposit', 'FamilyAccountsController@add_family_deposit')->name('family_accounts.add_deposit');
|
||||
Route::any('family_accounts/store_family_deposit', 'FamilyAccountsController@store_family_deposit')->name('family_accounts.store_family_deposit');
|
||||
Route::any('family_accounts_consumption_report', 'FamilyAccountsController@family_accounts_consumption_report')->name('family_accounts.consumption_report');
|
||||
Route::any('family_accounts_deposits_report', 'FamilyAccountsController@deposits_report')->name('family_accounts.deposit_report');
|
||||
Route::any('inactive_family_accounts', 'FamilyAccountsController@inactive')->name('family_accounts.inactive_family_accounts');
|
||||
Route::post('/family_accounts/activate{id}', 'FamilyAccountsController@activate')->name('family_accounts.activate');
|
||||
Route::any('family_accounts_search', 'FamilyAccountsController@family_accounts_search');
|
||||
Route::any('/family_accounts/custom_family_accounts/{category}', 'FamilyAccountsController@custom_family_accounts')->name('family_accounts.custom_family_accounts');
|
||||
Route::any('/family_accounts/custom_family_account/{patient_id}/{category}', 'FamilyAccountsController@custom_family_account')->name('family_accounts.custom_family_account');
|
||||
Route::any('print_family_account_receipt_pdf_details', 'FamilyAccountsController@print_family_account_receipt_pdf_details');
|
||||
Route::any('print_family_account_refund_receipt_pdf_details', 'FamilyAccountsController@print_family_account_refund_receipt_pdf_details');
|
||||
|
||||
Route::any('family_accounts/{family_account}/statement/', 'FamilyAccountsController@family_accounts_statements')->name('family_accounts.family_accounts_statements');
|
||||
Route::any('family_statement_print', 'FamilyAccountsController@family_statement_print');
|
||||
|
||||
Route::any('family_deposit_cancellation_reason', 'FamilyAccountsController@cancel_deposit_reason');
|
||||
Route::any('family_account_deposit_cancellation', 'FamilyAccountsController@cancel_deposit');
|
||||
Route::get('search_family_account_name', 'FamilyAccountsController@search_family_account_name')->name('family_accounts.search_family_account_name');
|
||||
|
||||
Route::any('get_family_acc_balance/{id}', 'FamilyAccountsController@get_family_account_balance');
|
||||
|
||||
// Patient Debtors
|
||||
Route::any('patient_debtors/receive_debtor_payment/{id}', 'PatientDebtorsController@receive_debtor_payment')->name('patient_debtors.receive_debtor_payment');
|
||||
Route::post('patient_debtors/process_debtor_payment', 'PatientDebtorsController@process_debtor_payment')->name('patient_debtors.process_debtor_payment');
|
||||
Route::any('patient_debtors/history_debtor_payments/{debtor_id}', 'PatientDebtorsController@history_debtor_payments')->name('patient_debtors.history_debtor_payments');
|
||||
Route::any('patient_debtors/reverse_debtor_payment/{payment_id}', 'PatientDebtorsController@reverse_debtor_payment');
|
||||
Route::any('patient_debtors/print_debtor_receipt_pdf_details', 'PatientDebtorsController@print_debtor_receipt_pdf_details')->name('patient_debtors.print_debtor_receipt_pdf_details');
|
||||
Route::any('patient_debtors/reprint_debtor_receipt_pdf_details', 'PatientDebtorsController@reprint_debtor_receipt_pdf_details')->name('patient_debtors.reprint_debtor_receipt_pdf_details');
|
||||
Route::any('patient_debtors/debtor_payment_receipt', 'PatientDebtorsController@debtorPaymentReceipt')->name('patient_debtors.debtor_payment_receipt');
|
||||
Route::any('patient_debtors/write_off_debts', 'PatientDebtorsController@write_off_debts')->name('patient_debtors.write_off_debts');
|
||||
Route::any('patient_debtors/debtors', 'PatientDebtorsController@debtors')->name('patient_debtors.debtors');
|
||||
Route::any('patient_debtors/debtors_patient_search/{patient_id}', 'PatientDebtorsController@debtors_patient_search');
|
||||
|
||||
// Debt Plan
|
||||
Route::any('patient_debtors/debt_plan_payment_receipt', 'PatientDebtorsController@debtPlanPaymentReceipt')->name('patient_debtors.debt_plan_payment_receipt');
|
||||
Route::any('patient_debtors/write_off_debt_plan', 'PatientDebtorsController@write_off_debt_plan')->name('patient_debtors.write_off_debt_plan');
|
||||
Route::any('patient_debtors/debt_plan_payment/{id}', 'PatientDebtorsController@debt_plan_payment')->name('patient_debtors.debt_plan_payment');
|
||||
Route::any('patient_debtors/debt_plan_receipt', 'PatientDebtorsController@debt_plan_receipt')->name('patient_debtors.debt_plan_receipt');
|
||||
Route::any('patient_debtors/staff_guarantors', 'PatientDebtorsController@staff_guarantors')->name('patient_debtors.staff_guarantors');
|
||||
Route::any('patient_debtors/debt_plan_patient_search/{patient_id}', 'PatientDebtorsController@debt_plan_patient_search');
|
||||
Route::any('patient_debtors/debt_plan_guarantor_agreement/{id}', 'PatientDebtorsController@debt_plan_guarantor_agreement')->name('patient_debtors.debt_plan_guarantor_agreement');
|
||||
Route::any('patient_debtors/receive_debt_plan_payment_staff', 'PatientDebtorsController@receive_debt_plan_payment_staff')->name('patient_debtors.receive_debt_plan_payments_staff');
|
||||
Route::any('patient_debtors/process_debt_plan_payment_staff', 'PatientDebtorsController@process_debt_plan_payment_staff')->name('patient_debtors.process_debt_plan_payment_staff');
|
||||
Route::any('family_deposit_reprint/{id}', 'FamilyAccountsController@family_deposit_reprint')->name('family_accounts.family_deposit_reprint');
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
image: alpine/git:latest
|
||||
|
||||
pipelines:
|
||||
branches:
|
||||
main:
|
||||
- step:
|
||||
name: Merge To Beta
|
||||
script:
|
||||
- git remote set-url origin https://Kabricks:${APP_SECRET}@bitbucket.org/dcsammi/${BITBUCKET_REPO_SLUG}
|
||||
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
|
||||
- git fetch
|
||||
- git checkout beta
|
||||
- git merge main
|
||||
- git commit --amend -m "[skip ci] Merge changes from main"
|
||||
- git push
|
||||
- step:
|
||||
name: Deploy To Test
|
||||
script:
|
||||
- echo "Ready to deploy to demo or production!"
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "PatientDiscounts",
|
||||
"alias": "patient_discounts",
|
||||
"description": "Patient discounts, price lists, patient dependants, family accounts and patient accounts",
|
||||
"keywords": [],
|
||||
"priority": 0,
|
||||
"providers": [
|
||||
"Modules\\PatientDiscounts\\Providers\\PatientDiscountsServiceProvider"
|
||||
],
|
||||
"files": []
|
||||
}
|
||||
Reference in New Issue
Block a user