mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-13 03:31:31 +00:00
resolved conflicts
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'Finance'
|
||||
];
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Finance\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;
|
||||
}
|
||||
+1154
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,200 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Finance\Http\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Streamline\Models\Banking;
|
||||
use Streamline\Models\ChartOfAccount;
|
||||
use Streamline\Models\Equity;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class EquityController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index() {
|
||||
$equities = Equity::orderBy('name', 'asc')->paginate(1000);
|
||||
|
||||
return view('finance::equity.index', compact('equities'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create() {
|
||||
$banks = ChartOfAccount::where('type', 4)->orderBy('name', 'asc')->pluck('name', 'id')->prepend('- select -', '')->toArray();
|
||||
$chart_of_accounts = ChartOfAccount::where('type', 5)->orderBy('name', 'asc')->pluck('name', 'id')->prepend('- select -', '')->toArray();
|
||||
|
||||
return view('finance::equity.create', compact('chart_of_accounts', 'banks'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'name' => 'required',
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$string = "";
|
||||
foreach ($validator->errors()->getMessages() as $item) {
|
||||
$string .= "{$item[0]}<br>";
|
||||
}
|
||||
return back()->withErrors($validator)->withInput();
|
||||
} else {
|
||||
$logged_in_user_id = Auth::user()->id;
|
||||
|
||||
$trans_id = generateReceiptNumberFromDB('Equity Deposit to bank account');
|
||||
|
||||
$equity = new Equity;
|
||||
|
||||
$equity->name = $request->name;
|
||||
$equity->amount = $request->amount;
|
||||
$equity->account_id = $request->account_id;
|
||||
$equity->deposit_to = $request->deposit_to;
|
||||
$equity->deposit_date = $request->deposit_date;
|
||||
$equity->created_by = $logged_in_user_id;
|
||||
$equity->updated_by = $logged_in_user_id;
|
||||
|
||||
$equity->save();
|
||||
|
||||
$current_bank_balance = Banking::where('bank', $request->deposit_to)->latest()->first();
|
||||
$balance_after_addition = (int)$current_bank_balance->account_balance + (int)$request->amount;
|
||||
|
||||
capture_bank_record('DEPOSIT', Carbon::parse($request->deposit_date)->toDateString(), $request->deposit_to,
|
||||
$request->account_id, $balance_after_addition, $request->amount, 0, $request->amount, $trans_id);
|
||||
|
||||
flash($request->name . " Equity has been saved")->success();
|
||||
return redirect("/equities/");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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\Http\Response
|
||||
*/
|
||||
public function edit($id) {
|
||||
$equity = Equity::where(['id' => $id])->first();
|
||||
$banks = ChartOfAccount::where('type', 4)->orderBy('name', 'asc')->pluck('name', 'id')->prepend('- select -', '')->toArray();
|
||||
$chart_of_accounts = ChartOfAccount::where('type', 5)->orderBy('name', 'asc')->pluck('name', 'id')->prepend('- select -', '')->toArray();
|
||||
|
||||
if (!$equity) {
|
||||
flash()->error("There is no such equity");
|
||||
return redirect('/equities/');
|
||||
} else {
|
||||
return view('finance::equity.edit', compact('equity', 'chart_of_accounts', 'banks'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'name' => 'required',
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$string = "";
|
||||
foreach ($validator->errors()->getMessages() as $item) {
|
||||
$string .= "{$item[0]}<br>";
|
||||
}
|
||||
return back()->withErrors($validator)->withInput();
|
||||
} else {
|
||||
$logged_in_user_id = Auth::user()->id;
|
||||
|
||||
$equity = Equity::find($id);
|
||||
$equity->name = $request->name;
|
||||
$equity->amount = $request->amount;
|
||||
$equity->account_id = $request->account_id;
|
||||
$equity->updated_by = $logged_in_user_id;
|
||||
|
||||
try {
|
||||
$equity->save();
|
||||
flash($request->name . " Equity has been updated")->success();
|
||||
return redirect("/equities/");
|
||||
} catch (QueryException $e) {
|
||||
flash("An error occurred")->error();
|
||||
return back()->withInput();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id) {
|
||||
$equity = Equity::find($id);
|
||||
|
||||
if ($equity->delete()):
|
||||
flash("Equity has been deleted.")->success();
|
||||
return redirect('/equities/');
|
||||
endif;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the inactive resource(s).
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function inactive() {
|
||||
|
||||
$equities = Equity::onlyTrashed()
|
||||
->orderBy('name', 'asc')
|
||||
->paginate(50);
|
||||
|
||||
if (count($equities) < 1) {
|
||||
flash()->error("There is no inactive equity");
|
||||
return redirect('/equities/');
|
||||
} else {
|
||||
return view('finance::equity.inactive', compact('equities'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate the specified resource in storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function activate($id) {
|
||||
$equity = Equity::withTrashed()->find($id);
|
||||
|
||||
if ($equity->restore()):
|
||||
flash("Equity has been activated.")->success();
|
||||
return redirect('/equities/inactive');
|
||||
endif;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Finance\Http\Controllers;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class FinanceController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return view('finance::finance.index');
|
||||
}
|
||||
|
||||
public function incoming_opd_payments(Request $request): View
|
||||
{
|
||||
$clinic_id = $request->clinic_id;
|
||||
$search_by = $request->search_by;
|
||||
|
||||
$patient_categories = DB::table('patient_categories')->pluck("name", "id");
|
||||
|
||||
$filters = [];
|
||||
if($search_by == 0){
|
||||
$start_date = Carbon::now()->startOfDay()->toDateTimeString();
|
||||
$end_date = Carbon::now()->endOfDay()->toDateTimeString();
|
||||
} elseif ($search_by == 1) {
|
||||
$start_date = Carbon::now()->subDay()->startOfDay()->toDateTimeString();
|
||||
$end_date = Carbon::now()->subDay()->endOfDay()->toDateTimeString();
|
||||
} elseif ($search_by == 2) {
|
||||
$start_date = Carbon::parse($request->reg_date)->startOfDay()->toDateTimeString();
|
||||
$end_date = Carbon::parse($request->reg_date)->endOfDay()->toDateTimeString();
|
||||
} elseif ($search_by ==3) {
|
||||
// custom date range
|
||||
$start_date = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
|
||||
$end_date = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
|
||||
} else {
|
||||
$start_date = Carbon::now()->toDateTimeString();
|
||||
$end_date = Carbon::now()->toDateTimeString();
|
||||
}
|
||||
|
||||
if ($clinic_id != 0) {
|
||||
$filters[] = ['patient_episodes.clinic_id', '=', $clinic_id];
|
||||
}
|
||||
|
||||
if (is_numeric($request->patient_number)) {
|
||||
$filters[] = ['patient_episodes.patient_id', '=', $request->patient_number];
|
||||
$start_date = Carbon::now()->startOfCentury()->toDateTimeString();
|
||||
$end_date = Carbon::now()->endOfDay()->toDateTimeString();
|
||||
}
|
||||
|
||||
$patient_episodes = DB::table('patient_episodes')
|
||||
->leftJoin('patients', 'patients.id', '=', 'patient_episodes.patient_id')
|
||||
->leftJoin('treatments', 'treatments.episode_id', '=', 'patient_episodes.id')
|
||||
->leftJoin('ordered_procedures', 'ordered_procedures.episode_id', '=', 'patient_episodes.id')
|
||||
->leftJoin('ordered_investigations', 'ordered_investigations.episode_id', '=', 'patient_episodes.id')
|
||||
->leftJoin('ordered_sundries', 'ordered_sundries.episode_id', '=', 'patient_episodes.id')
|
||||
->leftJoin('ordered_services', 'ordered_services.episode_id', '=', 'patient_episodes.id')
|
||||
->where($filters)
|
||||
->groupBy('patient_episodes.id')
|
||||
->whereBetween('patient_episodes.created_at', [$start_date, $end_date])
|
||||
->select('patient_episodes.id as episode_id', 'patient_episodes.patient_id', 'patients.first_name', 'patients.last_name', 'patients.date_of_birth', 'patients.number',
|
||||
'patients.phone', 'patients.category_id',
|
||||
'treatments.id as treatment_id', 'treatments.payment_status as treatment_payment_status', 'treatments.inpatient_bill_generated as treatment_is_inpatient',
|
||||
'ordered_procedures.id as procedure_id', 'ordered_procedures.payment_status as procedures_payment_status', 'ordered_procedures.inpatient_bill_generated as procedures_is_inpatient',
|
||||
'ordered_investigations.id as investigation_id', 'ordered_investigations.payment_status as investigation_payment_status', 'ordered_investigations.inpatient_bill_generated as invs_is_inpatient',
|
||||
'ordered_sundries.id as sundries_id', 'ordered_sundries.payment_status as sundries_payment_status', 'ordered_sundries.inpatient_bill_generated as sundry_is_inpatient',
|
||||
'ordered_services.id as service_id', 'ordered_services.payment_status as service_payment_status', 'ordered_services.inpatient_bill_generated as service_is_inpatient')
|
||||
->get();
|
||||
|
||||
$clinics = DB::table("clinics")->whereNull("deleted_at")->orderBy("name")->pluck("name", "id")->toArray();
|
||||
$clinics = [0 => 'OPD'] + ['' => '- select -'] + $clinics;
|
||||
|
||||
return view('finance::finance.incoming_opd_payments', compact('patient_categories', 'clinics', 'patient_episodes'));
|
||||
}
|
||||
}
|
||||
+635
@@ -0,0 +1,635 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Finance\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Streamline\Models\Banking;
|
||||
use Streamline\Models\ChartOfAccount;
|
||||
use Streamline\Models\FixedAsset;
|
||||
use Streamline\Models\HospitalBill;
|
||||
use Streamline\Models\Payment;
|
||||
use Streamline\Models\Supplier;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Carbon\Carbon;
|
||||
use Streamline\Models\TrackInvoice;
|
||||
use Streamline\Models\TrackReceipt;
|
||||
use Streamline\Models\Equity;
|
||||
|
||||
class FixedAssetsController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('permission:fixed-assets-list', ['only' => ['index']]);
|
||||
$this->middleware('permission:create-fixed-assets', ['only' => ['create', 'store']]);
|
||||
$this->middleware('permission:edit-fixed-assets', ['only' => ['edit', 'update']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$fixed_assets = FixedAsset::orderBy('name', 'asc')->get();
|
||||
$suppliers = DB::table('suppliers')->where('available', 1)->pluck("name", "id");
|
||||
return view('finance::fixed_assets.index', compact('fixed_assets', 'suppliers'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$suppliers = Supplier::where('available', 1)->pluck('name', 'id')->toArray();
|
||||
$suppliers = ['' => '- select -'] + $suppliers;
|
||||
$fixed_asset_chart_of_accounts = ChartOfAccount::where(['type' => 3])->pluck('name', 'id')->toArray();/*4-fixed asset*/
|
||||
$fixed_asset_chart_of_accounts = ['' => '- select -'] + $fixed_asset_chart_of_accounts;
|
||||
$bank_chart_of_accounts = ChartOfAccount::where(['type' => 4])->pluck('name', 'id')->toArray();/*3-bank*/
|
||||
$bank_chart_of_accounts = ['' => '- select -'] + $bank_chart_of_accounts;
|
||||
$payable_accounts = ChartOfAccount::whereIn('type', [6, 9])->pluck('name', 'id')->toArray();
|
||||
|
||||
return view('finance::fixed_assets.create', compact('suppliers', 'fixed_asset_chart_of_accounts', 'bank_chart_of_accounts', 'payable_accounts'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validator = Validator::make($request->all(), [
|
||||
'acquisition_date' => 'required',
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$string = "";
|
||||
foreach ($validator->errors()->getMessages() as $item) {
|
||||
$string .= "{$item[0]}<br>";
|
||||
}
|
||||
return back()->withErrors($validator)->withInput();
|
||||
} else {
|
||||
|
||||
$fixed_asset = new FixedAsset;
|
||||
$fixed_asset->name = $request->name;
|
||||
$fixed_asset->serial_number = $request->serial_number;
|
||||
$fixed_asset->cost_price = $request->cost_price;
|
||||
$fixed_asset->acquisition_date = $acquisition_date = $request->acquisition_date != null ? Carbon::createFromFormat('d-m-Y', $request->acquisition_date)->toDateString() : null;
|
||||
$fixed_asset->item_condition = $request->item_condition;
|
||||
$fixed_asset->depreciation = $request->depreciation;
|
||||
$fixed_asset->supplier_id = $request->supplier;
|
||||
$fixed_asset->fixed_asset_account_id = $request->fixed_asset_account;
|
||||
$fixed_asset->warranty_expiration_date = $request->warranty_expiration_date != null ? Carbon::createFromFormat('d-m-Y', $request->warranty_expiration_date)->toDateString() : null;
|
||||
$fixed_asset->bank_account_id = $request->bank_account_id;
|
||||
$fixed_asset->description = $request->description;
|
||||
$fixed_asset->payment_type = $request->payment_type;
|
||||
$fixed_asset->created_by = Auth::id();
|
||||
|
||||
if ($fixed_asset->save()) {
|
||||
|
||||
if ($request->payment_type == 'cash') :
|
||||
|
||||
$current_bank_balance = get_latest_banking_record_based_on_transaction_date($request->bank_account_id, getTodayCarbon()->toDateString());
|
||||
|
||||
if (!is_null($current_bank_balance)) :
|
||||
|
||||
$balance_after_deduction = (int)$current_bank_balance->account_balance - (int)$request->amount_paid;
|
||||
$track_receipt = new TrackReceipt;
|
||||
$track_receipt->created_by = Auth::id();
|
||||
$track_receipt->reason = 'Fixed Asset Purchase';
|
||||
$track_receipt->save();
|
||||
$trans_id = sprintf("%04u", $track_receipt->id);
|
||||
|
||||
$last_insert_id_from_account = capture_bank_record(
|
||||
'PAYMENT',
|
||||
$acquisition_date,
|
||||
$request->bank_account_id,
|
||||
$request->fixed_asset_account,
|
||||
$balance_after_deduction,
|
||||
0,
|
||||
$request->cost_price,
|
||||
'Fixed Asset Purchase',
|
||||
$trans_id
|
||||
);
|
||||
|
||||
$fixed_asset->banking_id = $last_insert_id_from_account;
|
||||
$fixed_asset->save();
|
||||
|
||||
//update running bank balance
|
||||
update_banking_record_balances($acquisition_date, $request->bank_account_id, $last_insert_id_from_account, $balance_after_deduction);
|
||||
|
||||
if ($request->balance > 0) :
|
||||
// track the invoice
|
||||
$track_invoice = new TrackInvoice;
|
||||
$track_invoice->reason = (!is_null($request->description) ? $request->description : "Fixed Assets Creation");
|
||||
$track_invoice->created_by = Auth::id();
|
||||
$track_invoice->save();
|
||||
$invoice_number = sprintf("%04u", $track_invoice->id);
|
||||
|
||||
$bill = new HospitalBill;
|
||||
$bill->vendor = $request->supplier;
|
||||
$bill->bill_date = $acquisition_date;
|
||||
$bill->bill_memo = $request->description;
|
||||
$bill->bill_number = $invoice_number;
|
||||
$bill->total_amount = $request->balance;
|
||||
$bill->item_ids = $fixed_asset->id;
|
||||
$bill->item_accounts = $request->fixed_asset_account;
|
||||
$bill->item_quantities = 1;
|
||||
$bill->item_subtotals = $request->balance;
|
||||
$bill->payable_account = $request->payable_account;
|
||||
$bill->account_type = 3;
|
||||
$bill->created_by = Auth::id();
|
||||
$bill->bill_type = 'ASSETS';
|
||||
|
||||
$bill->balance_history = serialize(array());
|
||||
$bill->receipt_history = serialize(array());
|
||||
$bill->staff_incharge_history = serialize(array());
|
||||
$bill->amount_paid_history = serialize(array());
|
||||
$bill->date_paid_history = serialize(array());
|
||||
|
||||
$bill->save();
|
||||
endif;
|
||||
|
||||
else :
|
||||
|
||||
flash('error occured. contact system admin')->error();
|
||||
return redirect()->back()->withInput();
|
||||
endif;
|
||||
|
||||
elseif ($request->payment_type == 'bill') :
|
||||
// track the invoice
|
||||
$track_invoice = new TrackInvoice;
|
||||
$track_invoice->reason = (!is_null($request->description) ? $request->description : "Fixed Assets Creation");
|
||||
$track_invoice->created_by = Auth::id();
|
||||
$track_invoice->save();
|
||||
$invoice_number = sprintf("%04u", $track_invoice->id);
|
||||
|
||||
$bill = new HospitalBill;
|
||||
$bill->vendor = $request->supplier;
|
||||
$bill->bill_date = $acquisition_date;
|
||||
$bill->bill_memo = $request->description;
|
||||
$bill->bill_number = $invoice_number;
|
||||
$bill->total_amount = $request->cost_price;
|
||||
$bill->item_ids = $fixed_asset->id;
|
||||
$bill->item_accounts = $request->fixed_asset_account;
|
||||
$bill->item_quantities = 1;
|
||||
$bill->item_subtotals = $request->cost_price;
|
||||
$bill->payable_account = $request->payable_account;
|
||||
$bill->account_type = 3;
|
||||
$bill->created_by = Auth::id();
|
||||
$bill->bill_type = 'ASSETS';
|
||||
|
||||
$bill->balance_history = serialize(array());
|
||||
$bill->receipt_history = serialize(array());
|
||||
$bill->staff_incharge_history = serialize(array());
|
||||
$bill->amount_paid_history = serialize(array());
|
||||
$bill->date_paid_history = serialize(array());
|
||||
|
||||
$bill->save();
|
||||
|
||||
elseif ($request->payment_type == 'asset_exists') :
|
||||
// Update the opening_fixed_assets Equity Account
|
||||
$opening_fixed_assets = ChartOfAccount::where(['slug' => 'opening_fixed_assets'])->first();
|
||||
$opening_fixed_assets_balance = $opening_fixed_assets->balance;
|
||||
$opening_fixed_assets->balance = $opening_fixed_assets_balance + $request->cost_price;
|
||||
$opening_fixed_assets->updated_by = Auth::id();
|
||||
$opening_fixed_assets->update();
|
||||
|
||||
$equity = new Equity;
|
||||
$equity->name = $fixed_asset->name;
|
||||
$equity->amount = $request->cost_price;
|
||||
$equity->account_id = $opening_fixed_assets->id;
|
||||
$equity->created_by = Auth::id();
|
||||
$equity->updated_by = Auth::id();
|
||||
$equity->save();
|
||||
endif;
|
||||
|
||||
flash($fixed_asset->name . ' has been saved')->success();
|
||||
return redirect('fixed_assets');
|
||||
}
|
||||
flash('error occured. contact system admin')->error();
|
||||
return redirect()->back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$fixed_asset = FixedAsset::find($id);
|
||||
$suppliers = Supplier::where('available', 1)->pluck('name', 'id')->toArray();
|
||||
$suppliers = ['' => '- select -'] + $suppliers;
|
||||
$fixed_asset_chart_of_accounts = ChartOfAccount::where(['type' => 3])->pluck('name', 'id')->toArray();/*4-fixed asset*/
|
||||
$fixed_asset_chart_of_accounts = ['' => '- select -'] + $fixed_asset_chart_of_accounts;
|
||||
$bank_chart_of_accounts = ChartOfAccount::where(['type' => 4])->pluck('name', 'id')->toArray();/*3-bank*/
|
||||
$bank_chart_of_accounts = ['' => '- select -'] + $bank_chart_of_accounts;
|
||||
$payable_accounts = ChartOfAccount::whereIn('type', [6, 9])->pluck('name', 'id')->toArray();
|
||||
|
||||
return view('finance::fixed_assets.edit', compact('suppliers', 'fixed_asset_chart_of_accounts', 'bank_chart_of_accounts', 'fixed_asset', 'payable_accounts'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$validator = Validator::make($request->all(), [
|
||||
'acquisition_date' => 'required',
|
||||
'warranty_expiration_date' => 'required'
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$string = "";
|
||||
foreach ($validator->errors()->getMessages() as $item) {
|
||||
$string .= "{$item[0]}<br>";
|
||||
}
|
||||
flash($string)->error();
|
||||
return back()->withErrors($validator)->withInput();
|
||||
} else {
|
||||
//1. check if payment type's been edited
|
||||
//2. if it is a bill, ensure that the bill does not have a payment else reject
|
||||
//3. if already existing, do adjustments in equities
|
||||
//4. if cash, check if all was paid then check for the bill created for unpaid balance
|
||||
$hospital_bill = null;
|
||||
if ($request->edit_payment_type == 1) {
|
||||
$hospital_bill = HospitalBill::where(['item_ids' => $id, 'bill_type' => 'ASSETS'])->first();
|
||||
|
||||
$amount_paid_history_array = unserialize($hospital_bill->amount_paid_history);
|
||||
if (count($amount_paid_history_array) > 0) {
|
||||
//bill has a paid payment so can not be edited
|
||||
flash('Bill has some payments so first undo the payments')->error();
|
||||
return redirect()->back()->withInput();
|
||||
}
|
||||
}
|
||||
//dd($request->all());
|
||||
$acquisition_date = Carbon::parse($request->acquisition_date)->toDateString();
|
||||
|
||||
$fixed_asset = FixedAsset::find($id);
|
||||
|
||||
$previous_acquisition_date = $fixed_asset->acquisition_date;
|
||||
$previous_asset_name = $fixed_asset->name;
|
||||
$previous_bank_account_id = $fixed_asset->bank_account_id;
|
||||
$previous_cost_price = $fixed_asset->cost_price;
|
||||
$previous_asset_account = $fixed_asset->fixed_asset_account_id;
|
||||
|
||||
$fixed_asset->name = $request->name;
|
||||
$fixed_asset->serial_number = $request->serial_number;
|
||||
$fixed_asset->cost_price = $request->cost_price;
|
||||
$fixed_asset->acquisition_date = $acquisition_date;
|
||||
$fixed_asset->item_condition = $request->item_condition;
|
||||
$fixed_asset->supplier_id = $request->supplier;
|
||||
$fixed_asset->depreciation = $request->depreciation;
|
||||
$fixed_asset->fixed_asset_account_id = $request->fixed_asset_account;
|
||||
$fixed_asset->warranty_expiration_date = Carbon::parse($request->warranty_expiration_date)->toDateString();
|
||||
$fixed_asset->bank_account_id = $request->bank_account_id;
|
||||
$fixed_asset->description = $request->description;
|
||||
$fixed_asset->created_by = Auth::id();
|
||||
|
||||
//if the payment has been edited then we do
|
||||
if ($request->edit_payment_type == 1) {
|
||||
//payment type has not changed so handle accordingly
|
||||
if ($fixed_asset->payment_type == $request->payment_type) {
|
||||
# if it has a bill or bank and has no payment then adjust amount, if exisiting asset adjust the equity
|
||||
if ($fixed_asset->payment_type == "bill") {
|
||||
// track the invoice
|
||||
$track_invoice = new TrackInvoice;
|
||||
$track_invoice->reason = (!is_null($request->description) ? $request->description : "Fixed Assets Creation");
|
||||
$track_invoice->created_by = Auth::id();
|
||||
$track_invoice->save();
|
||||
$invoice_number = sprintf("%04u", $track_invoice->id);
|
||||
|
||||
$bill = HospitalBill::where(['item_ids' => $id, 'bill_type' => 'ASSETS'])->first();
|
||||
$bill->vendor = $request->supplier;
|
||||
$bill->bill_date = $fixed_asset->acquisition_date;
|
||||
$bill->bill_memo = $request->description;
|
||||
$bill->bill_number = $invoice_number;
|
||||
$bill->total_amount = $request->balance;
|
||||
$bill->item_ids = $fixed_asset->id;
|
||||
$bill->item_accounts = $request->fixed_asset_account;
|
||||
$bill->item_quantities = 1;
|
||||
$bill->item_subtotals = $request->balance;
|
||||
$bill->payable_account = $request->payable_account;
|
||||
$bill->account_type = 3;
|
||||
$bill->created_by = Auth::id();
|
||||
$bill->bill_type = 'ASSETS';
|
||||
|
||||
$bill->balance_history = serialize(array());
|
||||
$bill->receipt_history = serialize(array());
|
||||
$bill->staff_incharge_history = serialize(array());
|
||||
$bill->amount_paid_history = serialize(array());
|
||||
$bill->date_paid_history = serialize(array());
|
||||
$bill->save();
|
||||
} elseif ($fixed_asset->payment_type == "cash" && ($fixed_asset->cost_price != $previous_cost_price)) {
|
||||
//but first check it the money has changed
|
||||
$banking_record = Banking::where(["bank" => $previous_bank_account_id, "debit" => $previous_cost_price, "memo" => "Fixed Asset Purchase", "trans_date" => $previous_acquisition_date])->first();
|
||||
|
||||
if ($banking_record) {
|
||||
$banking_record->trans_date = $acquisition_date;
|
||||
$banking_record->bank = $request->bank_account_id;
|
||||
$banking_record->credit = $request->amount_paid;
|
||||
$current_bank_balance_record = get_latest_banking_record_based_on_transaction_date($request->bank_account_id, getTodayCarbon()->toDateString());
|
||||
$balance_after_deduction = is_null($current_bank_balance_record) ? 0 : (int)$current_bank_balance_record->account_balance - (int)$request->amount_paid;
|
||||
$banking_record->account_balance = $balance_after_deduction;
|
||||
$banking_record->update();
|
||||
}
|
||||
|
||||
//remember to re-calculate the running balance of this bank
|
||||
update_banking_record_balances($acquisition_date, $request->bank_account_id, $banking_record, $balance_after_deduction);
|
||||
|
||||
// track the invoice
|
||||
$track_invoice = new TrackInvoice;
|
||||
$track_invoice->reason = (!is_null($request->description) ? $request->description : "Fixed Assets Creation");
|
||||
$track_invoice->created_by = Auth::id();
|
||||
$track_invoice->save();
|
||||
$invoice_number = sprintf("%04u", $track_invoice->id);
|
||||
|
||||
//If the balance is more, find existing bill and adjust figures or create a new bill
|
||||
$hospital_bill = HospitalBill::where(['item_ids' => $id,'bill_type'=>'ASSETS'])->first();
|
||||
$bill = is_null($hospital_bill) ? new HospitalBill : $hospital_bill;
|
||||
|
||||
$bill->vendor = $request->supplier;
|
||||
$bill->bill_date = $acquisition_date;
|
||||
$bill->bill_memo = $request->description;
|
||||
$bill->bill_number = $invoice_number;
|
||||
$bill->total_amount = $request->balance;
|
||||
$bill->item_ids = $fixed_asset->id;
|
||||
$bill->item_accounts = $request->fixed_asset_account;
|
||||
$bill->item_quantities = 1;
|
||||
$bill->item_subtotals = $request->balance;
|
||||
$bill->payable_account = $request->payable_account;
|
||||
$bill->account_type = 3;
|
||||
$bill->created_by = Auth::id();
|
||||
$bill->bill_type = 'ASSETS';
|
||||
|
||||
$bill->balance_history = serialize(array());
|
||||
$bill->receipt_history = serialize(array());
|
||||
$bill->staff_incharge_history = serialize(array());
|
||||
$bill->amount_paid_history = serialize(array());
|
||||
$bill->date_paid_history = serialize(array());
|
||||
|
||||
$bill->save();
|
||||
} elseif ($fixed_asset->payment_type == "asset_exists") {
|
||||
$equity = Equity::where(['account_id' => $previous_asset_account, 'name' => $previous_asset_name, 'amount' => $previous_cost_price])->first();
|
||||
|
||||
// Update the opening_fixed_assets Equity Account
|
||||
$opening_fixed_assets = ChartOfAccount::where(['slug' => 'opening_fixed_assets'])->first();
|
||||
$opening_fixed_assets_balance = $opening_fixed_assets->balance;
|
||||
$opening_fixed_assets->balance = $opening_fixed_assets_balance + $request->cost_price;
|
||||
$opening_fixed_assets->updated_by = Auth::id();
|
||||
$opening_fixed_assets->update();
|
||||
|
||||
$equity->name = $fixed_asset->name;
|
||||
$equity->amount = $request->cost_price;
|
||||
$equity->account_id = $opening_fixed_assets->id;
|
||||
$equity->updated_by = Auth::id();
|
||||
$equity->save();
|
||||
}
|
||||
}
|
||||
|
||||
//payment type has changed deal with new payment type and old payment type too
|
||||
else {
|
||||
// if the previous payment type is bill and the payment type has changed then delete the bill
|
||||
if ($fixed_asset->payment_type == "bill") {
|
||||
$hospital_bill->delete();
|
||||
}
|
||||
|
||||
// if previous payment was already existing and payment has changed then delete equity and update chart of account with deduction
|
||||
if ($fixed_asset->payment_type == "asset_exists") {
|
||||
$equity = Equity::where(['account_id' => $previous_asset_account, 'name' => $previous_asset_name, 'amount' => $previous_cost_price])->first();
|
||||
$equity->delete();
|
||||
|
||||
$opening_fixed_assets = ChartOfAccount::where(['slug' => 'opening_fixed_assets'])->first();
|
||||
$opening_fixed_assets->balance = $opening_fixed_assets->balance - $fixed_asset->cost_price;
|
||||
$opening_fixed_assets->updated_by = Auth::id();
|
||||
$opening_fixed_assets->update();
|
||||
}
|
||||
|
||||
//if previous payment was cash and payment has changed then increase the balance of the bank the asset was paid from
|
||||
if ($fixed_asset->payment_type == "cash") {
|
||||
$track_receipt = new TrackReceipt;
|
||||
$track_receipt->created_by = Auth::id();
|
||||
$track_receipt->reason = 'Fixed Asset Purchase Edit';
|
||||
$track_receipt->save();
|
||||
$trans_id = sprintf("%04u", $track_receipt->id);
|
||||
|
||||
$current_bank_balance = get_latest_banking_record_based_on_transaction_date($previous_bank_account_id, getTodayCarbon()->toDateString());
|
||||
if (!is_null($current_bank_balance)) :
|
||||
|
||||
$balance_after_addition = (int)$current_bank_balance->account_balance + (int)$fixed_asset->amount_paid;
|
||||
endif;
|
||||
|
||||
$last_insert_id_from_account = capture_bank_record(
|
||||
'DEPOSIT',
|
||||
$fixed_asset->acquisition_date,
|
||||
$previous_bank_account_id,
|
||||
$fixed_asset->fixed_asset_account_id,
|
||||
$balance_after_addition,
|
||||
$previous_cost_price,
|
||||
0,
|
||||
'Fixed Asset Purchase Edit',
|
||||
$trans_id
|
||||
);
|
||||
|
||||
update_banking_record_balances($fixed_asset->acquisition_date, $previous_bank_account_id, $last_insert_id_from_account, $balance_after_addition);
|
||||
}
|
||||
|
||||
//deal with the new selected payment type
|
||||
if ($request->payment_type == 'cash') :
|
||||
|
||||
$current_bank_balance = get_latest_banking_record_based_on_transaction_date($request->bank_account_id, getTodayCarbon()->toDateString());
|
||||
|
||||
if (!is_null($current_bank_balance)) :
|
||||
|
||||
$balance_after_deduction = (int)$current_bank_balance->account_balance - (int)$request->amount_paid;
|
||||
$track_receipt = new TrackReceipt;
|
||||
$track_receipt->created_by = Auth::id();
|
||||
$track_receipt->reason = 'Fixed Asset Purchase';
|
||||
$track_receipt->save();
|
||||
$trans_id = sprintf("%04u", $track_receipt->id);
|
||||
|
||||
$last_insert_id_from_account = capture_bank_record(
|
||||
'PAYMENT',
|
||||
$fixed_asset->acquisition_date,
|
||||
$request->bank_account_id,
|
||||
$request->fixed_asset_account,
|
||||
$balance_after_deduction,
|
||||
0,
|
||||
$request->cost_price,
|
||||
'Fixed Asset Purchase',
|
||||
$trans_id
|
||||
);
|
||||
|
||||
update_banking_record_balances($fixed_asset->acquisition_date, $request->bank_account_id, $last_insert_id_from_account, $balance_after_deduction);
|
||||
|
||||
if ($request->balance > 0) :
|
||||
// track the invoice
|
||||
$track_invoice = new TrackInvoice;
|
||||
$track_invoice->reason = (!is_null($request->description) ? $request->description : "Fixed Assets Creation");
|
||||
$track_invoice->created_by = Auth::id();
|
||||
$track_invoice->save();
|
||||
$invoice_number = sprintf("%04u", $track_invoice->id);
|
||||
|
||||
$bill = new HospitalBill;
|
||||
$bill->vendor = $request->supplier;
|
||||
$bill->bill_date = $fixed_asset->acquisition_date;
|
||||
$bill->bill_memo = $request->description;
|
||||
$bill->bill_number = $invoice_number;
|
||||
$bill->total_amount = $request->balance;
|
||||
$bill->item_ids = $fixed_asset->id;
|
||||
$bill->item_accounts = $request->fixed_asset_account;
|
||||
$bill->item_quantities = 1;
|
||||
$bill->item_subtotals = $request->balance;
|
||||
$bill->payable_account = $request->payable_account;
|
||||
$bill->account_type = 3;
|
||||
$bill->created_by = Auth::id();
|
||||
$bill->bill_type = 'ASSETS';
|
||||
|
||||
$bill->balance_history = serialize(array());
|
||||
$bill->receipt_history = serialize(array());
|
||||
$bill->staff_incharge_history = serialize(array());
|
||||
$bill->amount_paid_history = serialize(array());
|
||||
$bill->date_paid_history = serialize(array());
|
||||
|
||||
$bill->save();
|
||||
endif;
|
||||
|
||||
else :
|
||||
|
||||
flash('error occured. contact system admin')->error();
|
||||
return redirect()->back()->withInput();
|
||||
endif;
|
||||
|
||||
elseif ($request->payment_type == 'asset_exists') :
|
||||
// Update the opening_fixed_assets Equity Account
|
||||
$opening_fixed_assets = ChartOfAccount::where(['slug' => 'opening_fixed_assets'])->first();
|
||||
$opening_fixed_assets_balance = $opening_fixed_assets->balance;
|
||||
$opening_fixed_assets->balance = $opening_fixed_assets_balance + $request->cost_price;
|
||||
$opening_fixed_assets->updated_by = Auth::id();
|
||||
$opening_fixed_assets->update();
|
||||
|
||||
$equity = new Equity;
|
||||
$equity->name = $fixed_asset->name;
|
||||
$equity->amount = $request->cost_price;
|
||||
$equity->account_id = $opening_fixed_assets->id;
|
||||
$equity->created_by = Auth::id();
|
||||
$equity->updated_by = Auth::id();
|
||||
$equity->save();
|
||||
endif;
|
||||
}
|
||||
}
|
||||
|
||||
if ($fixed_asset->update()) {
|
||||
flash($fixed_asset->name . ' has been updated')->success();
|
||||
return redirect('fixed_assets');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$fixed_asset = FixedAsset::find($id);
|
||||
|
||||
$bill = HospitalBill::where(['item_ids' => $id, 'bill_type' => 'ASSETS'])->first();
|
||||
|
||||
if ($bill) {
|
||||
if (is_null($bill->balance)) {
|
||||
# no money has been paid on this bill so delete it
|
||||
$bill->delete();
|
||||
} elseif ($bill->total_amount > 0) {
|
||||
# reverse the partial payment back to the respective bank then delete the bill
|
||||
$payments = Payment::where('bill_id', $bill->id)->get();
|
||||
|
||||
foreach ($payments as $payment) {
|
||||
$delete_result = delete_hospital_bill_payment($payment->id);
|
||||
}
|
||||
|
||||
# finally the bill with the fixed asset
|
||||
$bill->delete();
|
||||
}
|
||||
}
|
||||
|
||||
if ($fixed_asset->payment_type == 'cash') {
|
||||
if (is_null($fixed_asset->banking_id)) {
|
||||
$current_bank_balance = get_latest_banking_record_based_on_transaction_date($fixed_asset->bank_account_id, getTodayCarbon()->toDateString());
|
||||
|
||||
if (!is_null($current_bank_balance)) {
|
||||
$balance_after_deduction = (int)$current_bank_balance->account_balance + (int)$fixed_asset->cost_price;
|
||||
|
||||
$track_receipt = new TrackReceipt;
|
||||
$track_receipt->created_by = Auth::id();
|
||||
$track_receipt->reason = 'Fixed Asset Purchase Deletion';
|
||||
$track_receipt->save();
|
||||
$trans_id = sprintf("%04u", $track_receipt->id);
|
||||
|
||||
$last_insert_id = capture_bank_record('DEPOSIT', getTodayCarbon()->toDateString(), $fixed_asset->bank_account_id, $fixed_asset->fixed_asset_account_id,
|
||||
$balance_after_deduction, $fixed_asset->cost_price, 0, 'Fixed Asset Purchase Deletion', $trans_id);
|
||||
|
||||
update_banking_record_balances(date('Y-m-d'), $fixed_asset->bank_account_id, $last_insert_id, $balance_after_deduction);
|
||||
}
|
||||
} else {
|
||||
$bank_record = Banking::find($fixed_asset->banking_id);
|
||||
|
||||
if ($bank_record) {
|
||||
$bank_record->account_balance = $bank_record->account_balance + $fixed_asset->cost_price;
|
||||
$bank_record->debit = 0;
|
||||
$bank_record->update();
|
||||
|
||||
update_banking_record_balances($bank_record->trans_date, $fixed_asset->bank_account_id, $fixed_asset->banking_id, $bank_record->account_balance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($fixed_asset->delete()) {
|
||||
flash($fixed_asset->name . ' has been deleted')->success();
|
||||
return redirect('fixed_assets');
|
||||
}
|
||||
|
||||
return redirect()->back()->withInput();
|
||||
}
|
||||
|
||||
public function is_fixed_asset_attached_to_bill(Request $request)
|
||||
{
|
||||
$fixed_asset = FixedAsset::find($request->fixed_asset_id);
|
||||
|
||||
$bill = HospitalBill::where(['item_ids' => $fixed_asset->id, 'bill_type' => 'ASSETS'])->first();
|
||||
|
||||
if ($bill) {
|
||||
if ($bill->total_amount > 0) {
|
||||
return "has_attached_bill";
|
||||
}
|
||||
}
|
||||
|
||||
return "no_attached_bill";
|
||||
}
|
||||
}
|
||||
+281
@@ -0,0 +1,281 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Finance\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Streamline\Models\MarkupTag;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Streamline\Models\Drug;
|
||||
use Streamline\Models\Sundry;
|
||||
|
||||
|
||||
class MarkupTagController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$markup_tags = MarkupTag::orderBy('name','asc')->get();
|
||||
return view('finance::markup_tags.index',compact('markup_tags'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('finance::markup_tags.create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validator = Validator::make($request->all(), [
|
||||
'name' => 'required'
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$string = "";
|
||||
foreach ($validator->errors()->getMessages() as $item) {
|
||||
$string .= "{$item[0]}<br>";
|
||||
}
|
||||
return back()->withErrors($validator)->withInput();
|
||||
} else {
|
||||
$markup = new MarkupTag;
|
||||
$markup->name = $request->name;
|
||||
$markup->percentage = $request->percentage;
|
||||
$markup->created_by = auth()->user()->id;
|
||||
if ($markup->save()) {
|
||||
flash('successfully saved markup')->success();
|
||||
return redirect('markup_tag');
|
||||
}
|
||||
flash('Error in saving new markup. Contact system admin')->error();
|
||||
return redirect()->back()->withInput();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$tag = MarkupTag::find($id);
|
||||
|
||||
if (!$tag) {
|
||||
flash()->error("There is no such bed category");
|
||||
return redirect('markup_tag');
|
||||
} else {
|
||||
return view('finance::markup_tags.edit', compact('tag'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$tag = MarkupTag::find($id);
|
||||
$tag->update($request->all());
|
||||
flash('successfully updated details for '.$tag->name)->success();
|
||||
return redirect('markup_tag');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$tag = MarkupTag::find($id);
|
||||
if ($tag->delete()) {
|
||||
flash($tag->name. ' has been successfully deleted')->success();
|
||||
return redirect('markup_tag');
|
||||
}
|
||||
flash('error occurred. Contact system admin')->error();
|
||||
return redirect()->back()->withInput();
|
||||
}
|
||||
|
||||
/*
|
||||
*Display inactive markup
|
||||
*/
|
||||
public function inactive()
|
||||
{
|
||||
$tags = MarkupTag::onlyTrashed()->orderBy('name','asc')->paginate(50);
|
||||
|
||||
if (count($tags) < 1) {
|
||||
flash()->error("There is no inactive occupation");
|
||||
return redirect('markup_tag');
|
||||
} else {
|
||||
return view('finance::markup_tags.inactive', compact('tags'));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Activate an inactive
|
||||
*/
|
||||
public function activate($id)
|
||||
{
|
||||
$tag = MarkupTag::withTrashed()->find($id);
|
||||
|
||||
if ($tag->restore()):
|
||||
flash("Tag has been activated.")->success();
|
||||
return redirect('/inactive/markup_tag/');
|
||||
endif;
|
||||
}
|
||||
|
||||
/* Add markups to drugs */
|
||||
public function add_markups_to_drugs(Request $request)
|
||||
{
|
||||
$tags = MarkupTag::orderBy('name', 'asc')->get();
|
||||
$tags_select = MarkupTag::pluck('name','id')->toArray();
|
||||
$tags_select = ['' => '- Select Markup -'] + $tags_select;
|
||||
$drugs = DB::table('drugs')->where('available', 1)->whereNull('deleted_at')->orderBy('name', 'asc')->get();
|
||||
$tags_array = MarkupTag::pluck('name','id')->toArray();
|
||||
$names_array = Drug::where('available', 1)->orderby('name')->distinct()->pluck('name');
|
||||
return view('finance::markup_tags.add_markups_to_drugs', compact('tags','tags_select','drugs','tags_array','names_array'));
|
||||
}
|
||||
|
||||
/* Apply mark ups to drugs */
|
||||
public function update_mark_up_to_drug(Request $request)
|
||||
{
|
||||
$markup_tag_id = $request->markup_tag;
|
||||
$markup_tag = MarkupTag::find($markup_tag_id);
|
||||
if (!is_null($markup_tag)) {
|
||||
$markup_percentage = $markup_tag->percentage;
|
||||
|
||||
//use the markup percentage to calculate and set the selling price of the checked drugs
|
||||
$checked_drug_array = $request->checked_drug;
|
||||
for ($i=0; $i < count($checked_drug_array) ; $i++) {
|
||||
$drug = Drug::find($checked_drug_array[$i]);
|
||||
if (!is_null($drug)) {
|
||||
if ($drug->cost_price != 0) { /* add this to avoid */
|
||||
$markup = ($markup_percentage/100) * $drug->cost_price;
|
||||
$selling_price = $drug->cost_price + $markup;
|
||||
$drug->non_insured_price = $selling_price;
|
||||
$drug->markup_tag_id = $markup_tag_id;
|
||||
$price_has_been_updated = $drug->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($price_has_been_updated)) {
|
||||
flash("Drug selling prices have been updated with the new markup")->success();
|
||||
return redirect('stores');
|
||||
}
|
||||
|
||||
flash("Something went wrong. Contact your IT personel for help")->error();
|
||||
return redirect()->back()->withInput();
|
||||
}
|
||||
|
||||
/* drug search */
|
||||
public function drug_markup_search(Request $request)
|
||||
{
|
||||
$drugs = DB::select("select * from drugs where deleted_at IS NULL AND name like '%".$request->drug_name."%' ORDER BY name ASC");
|
||||
$names_array = Drug::where('available', 1)->orderby('name')->distinct()->pluck('name');
|
||||
$tags = MarkupTag::orderBy('name', 'asc')->get();
|
||||
$tags_select = MarkupTag::pluck('name','id')->toArray();
|
||||
$tags_select = ['' => '- Select Markup -'] + $tags_select;
|
||||
//$drugs = DB::table('drugs')->whereNull('deleted_at')->orderBy('name', 'asc')->get();
|
||||
$tags_array = MarkupTag::pluck('name','id')->toArray();
|
||||
|
||||
return view('finance::markup_tags.add_markups_to_drugs', compact('names_array','tags','tags_select','drugs','tags_array'));
|
||||
}
|
||||
|
||||
/* view drugs of selected markup tag */
|
||||
public function view_markup_drugs($id)
|
||||
{
|
||||
$drugs = Drug::where('markup_tag_id',$id)->orderBy('name')->get();
|
||||
$tag = MarkupTag::find($id);
|
||||
return view('finance::markup_tags.view_drugs_of_a_markup', compact('drugs','tag'));
|
||||
}
|
||||
|
||||
/* Add markups to sundries */
|
||||
public function add_markups_to_sundries(Request $request)
|
||||
{
|
||||
$tags = MarkupTag::orderBy('name', 'asc')->get();
|
||||
$tags_select = MarkupTag::pluck('name','id')->toArray();
|
||||
$tags_select = ['' => '- Select Markup -'] + $tags_select;
|
||||
$sundries = DB::table('sundries')->whereNull('deleted_at')->orderBy('name', 'asc')->get();
|
||||
$tags_array = MarkupTag::pluck('name','id')->toArray();
|
||||
$names_array = Sundry::where('available', 1)->orderby('name')->distinct()->pluck('name');
|
||||
return view('finance::markup_tags.add_markups_to_sundries', compact('tags','tags_select','sundries','tags_array','names_array'));
|
||||
}
|
||||
|
||||
/* Apply mark ups to sundries */
|
||||
public function update_mark_up_to_sundry(Request $request)
|
||||
{
|
||||
$markup_tag_id = $request->markup_tag;
|
||||
$markup_tag = MarkupTag::find($markup_tag_id);
|
||||
if (!is_null($markup_tag)) {
|
||||
$markup_percentage = $markup_tag->percentage;
|
||||
|
||||
//use the markup percentage to calculate and set the selling price of the checked sundries
|
||||
$checked_sundry_array = $request->checked_sundry;
|
||||
for ($i=0; $i < count($checked_sundry_array) ; $i++) {
|
||||
$sundry = Sundry::find($checked_sundry_array[$i]);
|
||||
if (!is_null($sundry)) {
|
||||
if ($sundry->cost_price != 0) { /* add this to avoid division by zero */
|
||||
$markup = ($markup_percentage/100) * $sundry->cost_price;
|
||||
$selling_price = $sundry->cost_price + $markup;
|
||||
$sundry->non_insured_price = $selling_price;
|
||||
$sundry->markup_tag_id = $markup_tag_id;
|
||||
$price_has_been_updated = $sundry->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($price_has_been_updated)) {
|
||||
flash("Sundry selling prices have been updated with the new markup")->success();
|
||||
return redirect('sundries_stock_sheet');
|
||||
}
|
||||
|
||||
flash("Make sure the cost price is not 0 else something went wrong. Contact your IT personel for help")->error();
|
||||
return redirect()->back()->withInput();
|
||||
}
|
||||
|
||||
/* sundry search */
|
||||
public function sundry_markup_search(Request $request)
|
||||
{
|
||||
$sundries = DB::select("select * from sundries where deleted_at IS NULL AND name like '%".$request->sundry_name."%' ORDER BY name ASC");
|
||||
$names_array = Sundry::where('available', 1)->orderby('name')->distinct()->pluck('name');
|
||||
$tags = MarkupTag::orderBy('name', 'asc')->get();
|
||||
$tags_select = MarkupTag::pluck('name','id')->toArray();
|
||||
$tags_select = ['' => '- Select Markup -'] + $tags_select;
|
||||
$tags_array = MarkupTag::pluck('name','id')->toArray();
|
||||
|
||||
return view('finance::markup_tags.add_markups_to_sundries', compact('names_array','tags','tags_select','sundries','tags_array'));
|
||||
}
|
||||
}
|
||||
Executable
+1076
File diff suppressed because it is too large
Load Diff
+150
@@ -0,0 +1,150 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Finance\Http\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Streamline\Models\ChartOfAccount;
|
||||
use Streamline\Models\HospitalInformation;
|
||||
use Streamline\Models\Patient;
|
||||
use Streamline\Models\PatientEpisode;
|
||||
use Streamline\Models\PaymentItem;
|
||||
use Streamline\Models\StreamlineBillReport;
|
||||
|
||||
class StreamlineBillsController extends Controller
|
||||
{
|
||||
public function __construct() {
|
||||
$this->middleware('auth');
|
||||
$this->middleware('permission:streamline-bills-create');
|
||||
$this->middleware('permission:streamline-bills-index');
|
||||
}
|
||||
|
||||
public function index(){
|
||||
$reports = StreamlineBillReport::all();
|
||||
$hospital_information = HospitalInformation::first();
|
||||
return view('finance::streamline_bills.index', compact('reports', 'hospital_information'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
$episodes = [];
|
||||
$patients = [];
|
||||
$user = Auth::id();
|
||||
$date_string = '';
|
||||
$patient_string = '';
|
||||
$report = new StreamlineBillReport;
|
||||
$hospital_information = HospitalInformation::first();
|
||||
|
||||
return view('finance::streamline_bills.create', compact( 'hospital_information','user', 'episodes', 'patients', 'date_string',
|
||||
'patient_string', 'patients'));
|
||||
}
|
||||
|
||||
public function detail($id)
|
||||
{
|
||||
$user = Auth::id();
|
||||
$report = StreamlineBillReport::where('id', $id)->first();
|
||||
$hospital_information = HospitalInformation::first();
|
||||
|
||||
return view('finance::streamline_bills.detail', compact( 'hospital_information', 'report', 'user'));
|
||||
}
|
||||
|
||||
public function generate(Request $request){
|
||||
$user = Auth::id();
|
||||
$patients = [];
|
||||
$report = new StreamlineBillReport;
|
||||
$hospital_information = HospitalInformation::first();
|
||||
|
||||
if($request->dates == "yesterday") {
|
||||
$start = Carbon::yesterday()->startOfDay()->toDateTimeString();
|
||||
$end = Carbon::yesterday()->endOfDay()->toDateTimeString();
|
||||
} else if($request->dates == "custom_date") {
|
||||
$start = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
|
||||
$end = Carbon::parse($request->start_date)->endOfDay()->toDateTimeString();
|
||||
} else if($request->dates == "custom_date_range") {
|
||||
$start = Carbon::parse($request->start_date)->startOfDay()->toDateTimeString();
|
||||
$end = Carbon::parse($request->end_date)->endOfDay()->toDateTimeString();
|
||||
} else {
|
||||
$start = Carbon::today()->startOfDay()->toDateTimeString();
|
||||
$end = Carbon::today()->endOfDay()->toDateTimeString();
|
||||
}
|
||||
|
||||
$dates = array($start, $end);
|
||||
$date_string = implode('&', $dates);
|
||||
$episodes = PatientEpisode::whereBetween('created_at', [$start, $end])->groupBy('patient_id')->get();
|
||||
foreach ($episodes as $item){
|
||||
$patient = Patient::where('id', $item->patient_id)->whereNotIn('id', findTestOrDemoPatients())->whereBetween('created_at', [$start, $end])->first();
|
||||
if(isset($patient->number)){
|
||||
array_push($patients, $patient->id);
|
||||
}
|
||||
}
|
||||
|
||||
$patient_string = implode('/', $patients);
|
||||
$report_check = StreamlineBillReport::where('patients', '=', $patient_string)->first();
|
||||
if($report_check === null){
|
||||
$report->patients = $patient_string;
|
||||
$report->time_frame = $date_string;
|
||||
$report->type = 3;
|
||||
$report->created_by = Auth::id();
|
||||
$report->save();
|
||||
}
|
||||
|
||||
return view('finance::streamline_bills.create', compact( 'hospital_information','user', 'dates',
|
||||
'episodes', 'request', 'patients', 'date_string', 'patient_string'));
|
||||
}
|
||||
|
||||
public function transfer(Request $request){
|
||||
|
||||
$result = StreamlineBillReport::where('patients', $request->patient_string)->update([
|
||||
'amount_to_be_paid'=>$request->total,
|
||||
'amount_paid'=>0
|
||||
]);
|
||||
|
||||
$current_balance = ChartOfAccount::where('id', 14)->pluck('balance')->first();
|
||||
$transfer = ChartOfAccount::where('id', 14)->update(['balance' => ((int)$request->total + $current_balance)]);
|
||||
$total_amount_transfer = ((int)$request->total);
|
||||
$deposit_on_item = PaymentItem::where('name', 'streamline bill')->update(['unit_cost'=> $total_amount_transfer]);
|
||||
|
||||
if($transfer == 1 && $deposit_on_item == 1){
|
||||
flash('Streamline Bill Transfer was Successful')->success();
|
||||
}else{
|
||||
flash('Streamline Bill Transfer Failed')->error();
|
||||
}
|
||||
|
||||
return redirect('/streamline_bill');
|
||||
}
|
||||
|
||||
public function view_patients(Request $request){
|
||||
$patients_string = StreamlineBillReport::where('id', $request->id)->pluck('patients')->first();
|
||||
$patients = explode("/", $patients_string);
|
||||
$display = "";
|
||||
foreach ($patients as $patient){
|
||||
$display .= "<li>".get_full_name($patient, 'id', 'first_name', 'last_name', 'patients')."</li>";
|
||||
}
|
||||
return $display;
|
||||
}
|
||||
|
||||
public function delete($id){
|
||||
$streamline_bill = StreamlineBillReport::find($id);
|
||||
|
||||
if ($streamline_bill->delete()):
|
||||
flash("Streamline Bill has been deleted.")->success();
|
||||
return redirect('/streamline_bill/');
|
||||
endif;
|
||||
}
|
||||
|
||||
public function verify_patients($patient_id){
|
||||
$reports = StreamlineBillReport::all();
|
||||
foreach($reports as $item){
|
||||
$patient_array = explode('/', $item['patients']);
|
||||
for($i = 0; $i < count($patient_array); $i++){
|
||||
if($patient_array[$i] == $patient_id){
|
||||
return null;
|
||||
}
|
||||
else{
|
||||
return $patient_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Finance\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\Finance\Providers\RouteServiceProvider;
|
||||
|
||||
class FinanceServiceProvider extends ServiceProvider {
|
||||
/**
|
||||
* @var string $moduleName
|
||||
*/
|
||||
protected $moduleName = 'Finance';
|
||||
|
||||
/**
|
||||
* @var string $moduleNameLower
|
||||
*/
|
||||
protected $moduleNameLower = 'finance';
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Finance\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\Finance\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('Finance', '/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('Finance', '/Routes/api.php'));
|
||||
}
|
||||
}
|
||||
+408
@@ -0,0 +1,408 @@
|
||||
@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" />
|
||||
<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">{{ __('cost_center_performance.center_performance') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/finance_reports">{{ __('cost_center_performance.reports_dashboard') }}</a></li>
|
||||
<li class="active">{{ __('cost_center_performance.center_performance') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
|
||||
{{ Form::open(['method'=>'post','route' => 'cost_centers.store']) }}
|
||||
|
||||
<br/>
|
||||
<h3>{{ __('cost_center_performance.select_cost_center') }}</h3>
|
||||
<br/>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::select('cost_center',$cost_centers,'',['class' => 'form-control compulsory required']) }}
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<h3>{{ __('cost_center_performance.select_date_range') }}</h3>
|
||||
<br/>
|
||||
|
||||
<div class="form-group">
|
||||
<select class="form-control compulsory required" name="dates" id="dates" required>
|
||||
<option value="">-{{ __('cost_center_performance.select') }}-</option>
|
||||
<option value="today">{{ __('cost_center_performance.today') }}</option>
|
||||
<option value="yesterday">{{ __('cost_center_performance.yesterday') }}</option>
|
||||
<option value="custom_date">{{ __('cost_center_performance.custom_date') }}</option>
|
||||
<option value="custom_date_range">{{ __('cost_center_performance.date_range') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="sDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('cost_center_performance.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 id="eDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('end_date', __('cost_center_performance.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 class="form-group">
|
||||
{{ Form::submit(__('cost_center_performance.submit'), ['class'=>'btn btn-success pull-right']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-xs-1"></div> -->
|
||||
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="panel panel-default col-md-12">
|
||||
<div class="panel-body panel-primary">
|
||||
<br/>
|
||||
<h3 class="label label-info col-lg-5 offset-4"> {!! __('cost_center_performance.showing_performance_of') . " " . $ward_name !!}</h3>
|
||||
<br>
|
||||
<br/>
|
||||
<div class="table-responsive">
|
||||
@if($ward_name == "OPD")
|
||||
<table id="table" class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><strong>{{ __('cost_center_performance.item') }}</strong></th>
|
||||
<th><strong>{{ __('cost_center_performance.total') }}</strong></th>
|
||||
<th><strong>{{ __('cost_center_performance.action') }}</strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@php $total = 0; @endphp
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ __('cost_center_performance.drug') }}</td>
|
||||
<td>{{ ugandan_shillings(array_sum($drugs) + array_sum($tta_cost)) }}</td>
|
||||
@php $total += array_sum($drugs) + array_sum($tta_cost); @endphp
|
||||
<td>
|
||||
@if(array_sum($drugs) > 0)
|
||||
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
|
||||
{{ Form::hidden('service_type', $request) }}
|
||||
{{ Form::hidden('dates', $request->dates) }}
|
||||
{{ Form::hidden('comparator', 'DR') }}
|
||||
{{ Form::hidden('date_type', $request->date_type) }}
|
||||
{{ Form::hidden('request', $request) }}
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
|
||||
{{ Form::close() }}
|
||||
@else
|
||||
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ __('cost_center_performance.consultation') }}</td>
|
||||
<td>{{ ugandan_shillings(array_sum($consultations)) }}</td>
|
||||
@php $total += array_sum($consultations); @endphp
|
||||
|
||||
<td>
|
||||
<!-- $request -->
|
||||
@if(array_sum($consultations) > 0)
|
||||
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
|
||||
{{ Form::hidden('service_type', $request) }}
|
||||
{{ Form::hidden('dates', $request->dates) }}
|
||||
{{ Form::hidden('comparator', 'CON') }}
|
||||
{{ Form::hidden('date_type', $request->date_type) }}
|
||||
{{ Form::hidden('request', $request) }}
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
|
||||
{{ Form::close() }}
|
||||
@else
|
||||
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ __('cost_center_performance.services') }}</td>
|
||||
<td>{{ ugandan_shillings(array_sum($services)) }}</td>
|
||||
@php $total += array_sum($services); @endphp
|
||||
<td>
|
||||
@if(array_sum($services) > 0)
|
||||
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
|
||||
{{ Form::hidden('service_type', $request) }}
|
||||
{{ Form::hidden('dates', $request->dates) }}
|
||||
{{ Form::hidden('comparator', 'OTH') }}
|
||||
{{ Form::hidden('date_type', $request->date_type) }}
|
||||
{{ Form::hidden('request', $request) }}
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
|
||||
{{ Form::close() }}
|
||||
@else
|
||||
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@if(is_eye_module_enabled())
|
||||
<tr>
|
||||
<td>{{ __('cost_center_performance.optical_items') }}</td>
|
||||
<td>{{ ugandan_shillings(array_sum($optics)) }}</td>
|
||||
@php $total += array_sum($optics); @endphp
|
||||
<td>
|
||||
@if(array_sum($optics) > 0)
|
||||
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
|
||||
{{ Form::hidden('service_type', $request) }}
|
||||
{{ Form::hidden('dates', $request->dates) }}
|
||||
{{ Form::hidden('comparator', 'OPTICS') }}
|
||||
{{ Form::hidden('date_type', $request->date_type) }}
|
||||
{{ Form::hidden('request', $request) }}
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
|
||||
{{ Form::close() }}
|
||||
@else
|
||||
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<tr>
|
||||
<td>{{ __('cost_center_performance.sundries') }}</td>
|
||||
<td>{{ ugandan_shillings(array_sum($sundries)) }}</td>
|
||||
@php $total += array_sum($sundries); @endphp
|
||||
<td>
|
||||
@if(array_sum($sundries) > 0)
|
||||
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
|
||||
{{ Form::hidden('service_type', $request) }}
|
||||
{{ Form::hidden('dates', $request->dates) }}
|
||||
{{ Form::hidden('comparator', 'SUN') }}
|
||||
{{ Form::hidden('date_type', $request->date_type) }}
|
||||
{{ Form::hidden('request', $request) }}
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
|
||||
{{ Form::close() }}
|
||||
@else
|
||||
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ __('cost_center_performance.investigations') }}</td>
|
||||
<td>{{ ugandan_shillings(array_sum($investigations)) }}</td>
|
||||
@php $total += array_sum($investigations); @endphp
|
||||
<td>
|
||||
@if(array_sum($investigations) > 0)
|
||||
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
|
||||
{{ Form::hidden('service_type', $request) }}
|
||||
{{ Form::hidden('dates', $request->dates) }}
|
||||
{{ Form::hidden('comparator', 'IA') }}
|
||||
{{ Form::hidden('date_type', $request->date_type) }}
|
||||
{{ Form::hidden('request', $request) }}
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
|
||||
{{ Form::close() }}
|
||||
@else
|
||||
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ __('cost_center_performance.procedures') }}</td>
|
||||
<td>{{ ugandan_shillings(array_sum($procedures)) }}</td>
|
||||
@php $total += array_sum($procedures); @endphp
|
||||
<td>
|
||||
@if(array_sum($procedures) > 0)
|
||||
{{ Form::open(['method'=>'post','route' => 'cost_center.income_detailed_report']) }}
|
||||
{{ Form::hidden('service_type', $request) }}
|
||||
{{ Form::hidden('dates', $request->dates) }}
|
||||
{{ Form::hidden('comparator', 'PR') }}
|
||||
{{ Form::hidden('date_type', $request->date_type) }}
|
||||
{{ Form::hidden('request', $request) }}
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success']) }}
|
||||
{{ Form::close() }}
|
||||
@else
|
||||
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@if($ward_name != "OPD")
|
||||
<tr>
|
||||
<td>{{ __('cost_center_performance.extras') }}</td>
|
||||
<td>{{ ugandan_shillings(array_sum($extras)) }}</td>
|
||||
@php $total += array_sum($extras); @endphp
|
||||
<td><button class="btn btn-success">{{ __('cost_center_performance.details') }}</button></td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td><strong>{{ __('cost_center_performance.total') }}</strong></td>
|
||||
<td>{{ ugandan_shillings($total) }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('cost_center_performance.patient') }}</th>
|
||||
<th>{{ __('cost_center_performance.staff_in_charge') }}</th>
|
||||
<th>{{ __('cost_center_performance.receipts') }}</th>
|
||||
<th>{{ __('cost_center_performance.amount') }}</th>
|
||||
<th>{{ __('cost_center_performance.action') }}</th>
|
||||
</tr>
|
||||
@php
|
||||
$sum_total = 0;
|
||||
@endphp
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($inpatient_record_results) > 0)
|
||||
@foreach($inpatient_record_results as $record)
|
||||
<tr>
|
||||
<td>{{ get_full_name($record->patient_id, 'id', 'first_name', 'last_name', 'patients') }}</td>
|
||||
<td>{{ get_full_name($record->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
<td>{{ $record->receipt_number }}</td>
|
||||
<td>{{ ugandan_shillings($record->patient_amount_paid) }}</td>
|
||||
<td>
|
||||
<a href="{{ route('finance_reports.inpatient_deposit_receipt_reprint', $record->id) }}" class="btn btn-default">{{ __('cost_center_performance.print_receipt') }}</a>
|
||||
</td>
|
||||
@php
|
||||
$sum_total += $record->patient_amount_paid;
|
||||
@endphp
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><strong>{{ __('cost_center_performance.total') }}</strong></td>
|
||||
<td>{{ ugandan_shillings($sum_total) }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
@endif
|
||||
</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/select2/select2.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 type="text/javascript">
|
||||
jQuery('#custom_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
</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>
|
||||
$('#staff_member').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
</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/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
message: '<?php echo __('cost_center_performance.cost_center_performance'); ?>',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3 ]
|
||||
},
|
||||
sheetName: '<?php echo __('cost_center_performance.cost_center_performance'); ?>'
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: '<?php echo __('cost_center_performance.cost_center_performance'); ?>',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3 ]
|
||||
},
|
||||
sheetName: '<?php echo __('cost_center_performance.cost_center_performance'); ?>'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: '<?php echo __('cost_center_performance.cost_center_performance'); ?>',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3 ]
|
||||
},
|
||||
sheetName: '<?php echo __('cost_center_performance.cost_center_performance'); ?>'
|
||||
},
|
||||
'print'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+226
@@ -0,0 +1,226 @@
|
||||
@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">{{ __('cost_center_performance.center_performance_details') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/finance_reports">{{ __('cost_center_performance.reports_dashboard') }}</a></li>
|
||||
<li class="active">{{ __('cost_center_performance.center_performance_details') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
|
||||
{{ Form::open(['method'=>'post','route' => 'cost_centers.store']) }}
|
||||
|
||||
<br/>
|
||||
<h3>{{ __('cost_center_performance.select_cost_center') }}</h3>
|
||||
<br/>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::select('cost_center',$cost_centers,'',['class' => 'form-control compulsory required']) }}
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<h3>{{ __('cost_center_performance.select_date_range') }}</h3>
|
||||
<br/>
|
||||
|
||||
<div class="form-group">
|
||||
<select class="form-control compulsory required" name="dates" id="dates" required>
|
||||
<option value="">-{{ __('cost_center_performance.select') }}-</option>
|
||||
<option value="today">{{ __('cost_center_performance.today') }}</option>
|
||||
<option value="yesterday">{{ __('cost_center_performance.yesterday') }}</option>
|
||||
<option value="custom_date">{{ __('cost_center_performance.custom_date') }}</option>
|
||||
<option value="custom_date_range">{{ __('cost_center_performance.date_range') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="sDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('cost_center_performance.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 id="eDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('end_date', __('cost_center_performance.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 class="form-group">
|
||||
{{ Form::submit(__('cost_center_performance.submit'), ['class'=>'btn btn-success pull-right']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-xs-1"></div> -->
|
||||
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="panel panel-default col-md-12">
|
||||
<div class="panel-body panel-primary">
|
||||
<br/>
|
||||
<h3 class="label label-info col-lg-5 offset-4"> {!! __('cost_center_performance.showing_performance_of') . " "!!}</h3>
|
||||
<br>
|
||||
<br/>
|
||||
<div class="table-responsive">
|
||||
<table id="table" class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('cost_center_performance.patient_number') }}</th>
|
||||
<th>{{ __('cost_center_performance.patient_name') }}</th>
|
||||
<th>{{ __('cost_center_performance.staff') }}</th>
|
||||
<th>{{ __('cost_center_performance.date') }}</th>
|
||||
<th>{{ __('cost_center_performance.receipt_number') }}</th>
|
||||
<th>{{ __('cost_center_performance.item_name') }}</th>
|
||||
<th>{{ __('cost_center_performance.amount') }}</th>
|
||||
<th>{{ __('cost_center_performance.amount_patient_paid') }}</th>
|
||||
<th>{{ __('cost_center_performance.donor_discount') }}</th>
|
||||
<th>{{ __('cost_center_performance.gen_discount') }}</th>
|
||||
<th>{{ __('cost_center_performance.action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($result as $item)
|
||||
<tr>
|
||||
<td>{{ get_name($item->patient_id, 'id', 'number', 'patients') }}</td>
|
||||
<td>{{ get_name($item->patient_id, 'id', 'first_name', 'patients') }} {{ get_name($item->patient_id, 'id', 'last_name', 'patients') }}</td>
|
||||
<td>{{ $staff_member[0]->first_name." ".$staff_member[0]->last_name }}</td>
|
||||
<td>{{ streamline_date($item->created_at) }}</td>
|
||||
<td>{{ $item->receipt_number }}</td>
|
||||
<td>
|
||||
@php
|
||||
$ids = explode(",",$item->items_ids);
|
||||
|
||||
for($i = 0; $i < count($ids); $i++){
|
||||
echo $i+1 ." ." . get_name($ids[$i], 'id', 'name', 'services') ."<br/>" ;
|
||||
}
|
||||
@endphp
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
$ids = explode(",",$item->items_ids);
|
||||
|
||||
for($i = 0; $i < count($ids); $i++){
|
||||
echo $i+1 ." ." . ugandan_shillings(get_name($ids[$i], 'id', 'non_insured_price', 'services')) ."<br/>" ;
|
||||
}
|
||||
@endphp
|
||||
</td>
|
||||
<td>{{ ugandan_shillings($item->patient_amount_paid) }}</td>
|
||||
|
||||
<td>{{ ugandan_shillings(get_name($item->receipt_number, 'receipt_number', 'donor_to_pay', 'donor_discount_details')) }}</td>
|
||||
<td>{{ ugandan_shillings(get_name($item->receipt_number, 'receipt_number', 'discount_amount', 'discounts')) }}</td>
|
||||
|
||||
<td>
|
||||
@php
|
||||
$id = $item->id;
|
||||
@endphp
|
||||
|
||||
<a href="{{ route('finance_reports.services_receipt_reprint', $item->id) }}" class="btn btn-default">
|
||||
{{ __('cost_center_performance.print_receipt') }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</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>
|
||||
|
||||
$('#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 type="text/javascript">
|
||||
jQuery('#custom_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
</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/bower_components/select2/select2.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('#staff_member').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+303
@@ -0,0 +1,303 @@
|
||||
@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" />
|
||||
<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">{{ __('cost_center_performance.center_performance') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/finance_reports">{{ __('cost_center_performance.reports_dashboard') }}</a></li>
|
||||
<li class="active">{{ __('cost_center_performance.center_performance') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
|
||||
{{ Form::open(['method'=>'post','route' => 'cost_centers.store']) }}
|
||||
|
||||
<br/>
|
||||
<h3>{{ __('cost_center_performance.select_cost_center') }}</h3>
|
||||
<br/>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::select('cost_center',$cost_centers,'',['class' => 'form-control compulsory required cost_centers']) }}
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<h3>{{ __('cost_center_performance.select_date_range') }}</h3>
|
||||
<br/>
|
||||
|
||||
<div class="form-group">
|
||||
<select class="form-control compulsory required" name="dates" id="dates" required>
|
||||
<option value="">-{{ __('cost_center_performance.select') }}-</option>
|
||||
<option value="today">{{ __('cost_center_performance.today') }}</option>
|
||||
<option value="yesterday">{{ __('cost_center_performance.yesterday') }}</option>
|
||||
<option value="custom_date">{{ __('cost_center_performance.custom_date') }}</option>
|
||||
<option value="custom_date_range">{{ __('cost_center_performance.date_range') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="sDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('cost_center_performance.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 id="eDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('end_date', __('cost_center_performance.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 class="form-group">
|
||||
{{ Form::submit('Submit', ['class'=>'btn btn-success pull-right']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-xs-1"></div> -->
|
||||
|
||||
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="panel panel-default col-md-12">
|
||||
<div class="panel-body panel-primary">
|
||||
|
||||
|
||||
@if($request != [])
|
||||
@if($request->dates != "-select-" || $request->cost_center != "0")
|
||||
@if(($request->dates == "today") || ($request->dates == "yesterday") || ($request->dates == "custom_date") || ($request->dates == "custom_date_range"))
|
||||
|
||||
<br/>
|
||||
@if(isset($display))
|
||||
<h3 class="label label-info col-lg-5 offset-4"> {!! isset($display) ? $display : '' !!}</h3>
|
||||
@endif
|
||||
<br>
|
||||
<br/>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="table" class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><strong>{{ __('cost_center_performance.item') }}</strong></th>
|
||||
<th><strong>{{ __('cost_center_performance.total') }}</strong></th>
|
||||
<th><strong>{{ __('cost_center_performance.action') }}</strong></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $total = 0; @endphp
|
||||
@if($request->cost_center == "")
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
@elseif($request->cost_center == "all_cost_centers")
|
||||
@foreach($per_wards_total_amounts_array as $ward => $amount)
|
||||
<tr>
|
||||
<td>{{ $ward == "OPD" ? "OPD" : get_name($ward, "id", "name", "wards") }}</td>
|
||||
@php
|
||||
$ward_amount = $ward == "OPD" ? $amount + $total_opd_debt_payments : $amount;
|
||||
@endphp
|
||||
<td>{{ ugandan_shillings($ward_amount) }}</td>
|
||||
@php $total += $ward_amount ; @endphp
|
||||
<td>
|
||||
@if($ward_amount > 0)
|
||||
{{ Form::open(['method'=>'post', 'route' => 'cost_centers.details']) }}
|
||||
{{ Form::hidden('ward_id', $ward) }}
|
||||
{{ Form::hidden('dates', ($request->start_date)."/".$request->end_date) }}
|
||||
{{ Form::hidden('date_type', $request->dates) }}
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
|
||||
{{ Form::close() }}
|
||||
@else
|
||||
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
@foreach($per_wards_total_amounts_array as $ward => $amount)
|
||||
<tr>
|
||||
<td>{{ $ward == "OPD" ? "OPD" : get_name($ward, "id", "name", "wards") }}</td>
|
||||
<td>{{ ugandan_shillings($amount) }}</td>
|
||||
@php $total += $amount ; @endphp
|
||||
<td>
|
||||
@if($amount > 0)
|
||||
{{ Form::open(['method'=>'post', 'route' => 'cost_centers.details']) }}
|
||||
{{ Form::hidden('ward_id', $ward) }}
|
||||
{{ Form::hidden('dates', ($request->start_date)."/".$request->end_date) }}
|
||||
{{ Form::hidden('date_type', $request->dates) }}
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
|
||||
{{ Form::close() }}
|
||||
@else
|
||||
<button class="btn btn-success" disabled="true">{{ __('cost_center_performance.details') }}</button>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td><strong>{{ __('cost_center_performance.total') }}</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($total) }}</strong></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="offset-5"></div>
|
||||
<div class="col-md-6" style="margin-top: 70px;">
|
||||
<h3 class="label label-warning"><strong>{{ __('cost_center_performance.select_valid_date') }}</strong></h3>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="offset-5"></div>
|
||||
<div class="col-md-6" style="margin-top: 70px;">
|
||||
<h3 class="label label-warning"><strong>{{ __('cost_center_performance.select_valid_date') }}</strong></h3>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="offset-5"></div>
|
||||
<div class="col-md-6" style="margin-top: 70px;">
|
||||
<h3 class="label label-warning"><strong>{{ __('cost_center_performance.select_valid_date') }}</strong></h3>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</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/select2/select2.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.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 type="text/javascript">
|
||||
jQuery('#custom_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
</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>
|
||||
$('#staff_member,.cost_centers').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
</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/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
message: 'COST CENTER PERFORMANCE',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1 ]
|
||||
},
|
||||
sheetName: 'COST CENTER PERFORMANCE ON STREAMLINE'
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: 'COST CENTER PERFORMANCE',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1 ]
|
||||
},
|
||||
sheetName: 'COST CENTER PERFORMANCE ON STREAMLINE'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: 'COST CENTER PERFORMANCE',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1 ]
|
||||
},
|
||||
sheetName: 'COST CENTER PERFORMANCE ON STREAMLINE'
|
||||
},
|
||||
'print'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+446
@@ -0,0 +1,446 @@
|
||||
@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">{{ __('cost_center_performance.investigation_performance') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/finance_reports">{{ __('cost_center_performance.reports_dashboard') }}</a></li>
|
||||
<li class="active">{{ __('cost_center_performance.investigation_performance') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
|
||||
{{ Form::open(['method'=>'post','route' => 'lab_performance.index']) }}
|
||||
|
||||
<br/>
|
||||
<h3>{{ __('cost_center_performance.select_date_range') }}</h3>
|
||||
<br/>
|
||||
|
||||
<div class="form-group">
|
||||
<select class="form-control compulsory required" name="date_type" id="dates" required>
|
||||
<option value="">-{{ __('cost_center_performance.select') }}-</option>
|
||||
<option value="today">{{ __('cost_center_performance.today') }}</option>
|
||||
<option value="yesterday">{{ __('cost_center_performance.yesterday') }}</option>
|
||||
<option value="custom_date">{{ __('cost_center_performance.custom_date') }}</option>
|
||||
<option value="custom_date_range">{{ __('cost_center_performance.date_range') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="sDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('cost_center_performance.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 id="eDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('end_date', __('cost_center_performance.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 class="form-group">
|
||||
{{ Form::submit(__('cost_center_performance.submit'), ['class'=>'btn btn-success pull-right']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-xs-1"></div> -->
|
||||
|
||||
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="panel panel-default col-md-12">
|
||||
<div class="panel-body panel-primary">
|
||||
|
||||
|
||||
@if($request != [])
|
||||
@if($request->date_type != "-select-")
|
||||
@if(($request->dates == "today") || ($request->date_type == "yesterday") || ($request->date_type == "custom_date") || ($request->date_type == "custom_date_range"))
|
||||
|
||||
<br/>
|
||||
@if(isset($display))
|
||||
<h3 class="label label-info col-lg-5 offset-4"> {!! isset($display) ? $display : '' !!}</h3>
|
||||
@endif
|
||||
<br>
|
||||
<br/>
|
||||
<div style="width:75%;">
|
||||
{!! $chartjs->render() !!}
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('cost_center_performance.investigation_type') }}</th>
|
||||
<th>{{ __('cost_center_performance.amount') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$grand_total = 0;
|
||||
$total = 0;
|
||||
foreach ($inv_lab as $item){
|
||||
$total += $item['cost_price'];
|
||||
}
|
||||
@endphp
|
||||
<tr>
|
||||
<th>{{ __('cost_center_performance.lab') }}</th>
|
||||
<th>{{ ugandan_shillings($total) }}</th>
|
||||
<th>
|
||||
{{ Form::open(['method'=>'post','route' => 'lab_performance.details']) }}
|
||||
|
||||
{{ Form::hidden('inv_type', "lab") }}
|
||||
|
||||
@foreach ($inv_lab as $item)
|
||||
{{ Form::hidden('investigations_array[]', $item['item']) }}
|
||||
|
||||
{{ Form::hidden('patient_names_array[]',get_full_name($item['patient_id'],'id', 'first_name', 'last_name', 'patients') ) }}
|
||||
|
||||
{{ Form::hidden('patients_array[]',get_name($item['patient_id'],'id','number', 'patients') ) }}
|
||||
{{ Form::hidden('receipt_number_array[]', $item['receipt_number'] ) }}
|
||||
{{ Form::hidden('investigations_name_array[]',get_name($item['item'], 'id', 'name', 'investigations') ) }}
|
||||
{{ Form::hidden('investigations_date_array[]',streamline_date($item['date']) ) }}
|
||||
{{ Form::hidden('investigations_amountpaid_array[]',ugandan_shillings($item['patient_amount_paid']) ) }}
|
||||
{{ Form::hidden('investigations_cost_array[]',ugandan_shillings($item['cost_price']) ) }}
|
||||
@endforeach
|
||||
|
||||
{{ Form::hidden('total', $total) }}
|
||||
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</th>
|
||||
@php $grand_total = $total; @endphp
|
||||
</tr>
|
||||
|
||||
@php
|
||||
$total = 0;
|
||||
foreach ($inv_x_ray as $item){
|
||||
$total += $item['cost_price'];
|
||||
}
|
||||
@endphp
|
||||
<tr>
|
||||
<th>{{ __('cost_center_performance.xray') }}</th>
|
||||
<th>{{ ugandan_shillings($total) }}</th>
|
||||
<th>
|
||||
{{ Form::open(['method'=>'post','route' => 'lab_performance.details']) }}
|
||||
|
||||
{{ Form::hidden('inv_type', "xray") }}
|
||||
|
||||
@foreach ($inv_x_ray as $item)
|
||||
{{ Form::hidden('investigations_array[]', $item['item']) }}
|
||||
|
||||
{{ Form::hidden('patient_names_array[]',get_full_name($item['patient_id'],'id', 'first_name', 'last_name', 'patients') ) }}
|
||||
|
||||
{{ Form::hidden('patients_array[]',get_name($item['patient_id'],'id','number', 'patients') ) }}
|
||||
{{ Form::hidden('receipt_number_array[]', $item['receipt_number'] ) }}
|
||||
{{ Form::hidden('investigations_name_array[]',get_name($item['item'], 'id', 'name', 'investigations') ) }}
|
||||
{{ Form::hidden('investigations_date_array[]',streamline_date($item['date']) ) }}
|
||||
{{ Form::hidden('investigations_amountpaid_array[]',ugandan_shillings($item['patient_amount_paid']) ) }}
|
||||
{{ Form::hidden('investigations_cost_array[]',ugandan_shillings($item['cost_price']) ) }}
|
||||
@endforeach
|
||||
|
||||
{{ Form::hidden('total', $total) }}
|
||||
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</th>
|
||||
@php $grand_total += $total; @endphp
|
||||
</tr>
|
||||
|
||||
@php
|
||||
$total = 0;
|
||||
foreach ($inv_ultrasound as $item){
|
||||
$total += $item['cost_price'];
|
||||
}
|
||||
@endphp
|
||||
<tr>
|
||||
<th>{{ __('cost_center_performance.ultrasound') }}</th>
|
||||
<th>{{ ugandan_shillings($total) }}</th>
|
||||
<th>
|
||||
{{ Form::open(['method'=>'post','route' => 'lab_performance.details']) }}
|
||||
|
||||
{{ Form::hidden('inv_type', "ultrasound") }}
|
||||
|
||||
@foreach ($inv_ultrasound as $item)
|
||||
{{ Form::hidden('investigations_array[]', $item['item']) }}
|
||||
|
||||
{{ Form::hidden('patient_names_array[]',get_full_name($item['patient_id'],'id', 'first_name', 'last_name', 'patients') ) }}
|
||||
|
||||
{{ Form::hidden('patients_array[]',get_name($item['patient_id'],'id','number', 'patients') ) }}
|
||||
{{ Form::hidden('receipt_number_array[]', $item['receipt_number'] ) }}
|
||||
{{ Form::hidden('investigations_name_array[]',get_name($item['item'], 'id', 'name', 'investigations') ) }}
|
||||
{{ Form::hidden('investigations_date_array[]',streamline_date($item['date']) ) }}
|
||||
{{ Form::hidden('investigations_amountpaid_array[]',ugandan_shillings($item['patient_amount_paid']) ) }}
|
||||
{{ Form::hidden('investigations_cost_array[]',ugandan_shillings($item['cost_price']) ) }}
|
||||
@endforeach
|
||||
|
||||
{{ Form::hidden('total', $total) }}
|
||||
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</th>
|
||||
@php $grand_total += $total; @endphp
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><strong>{{ __('cost_center_performance.total') }}</strong></th>
|
||||
<th><strong>{{ ugandan_shillings($grand_total) }}</strong></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div style="width:75%;">
|
||||
{!! $chartjs->render() !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@if(isset($display))
|
||||
<h3 class="label label-info col-lg-5 offset-4"> {!! __('cost_center_performance.') . "Records displayed are of ".streamline_date(date('Y-m-d')) !!}</h3>
|
||||
<br><br>
|
||||
@endif
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('cost_center_performance.investigation_type') }}</th>
|
||||
<th>{{ __('cost_center_performance.amount') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$grand_total = 0;
|
||||
$total = 0;
|
||||
foreach ($inv_lab as $item){
|
||||
$total += $item['cost_price'];
|
||||
}
|
||||
@endphp
|
||||
<tr>
|
||||
<th>{{ __('cost_center_performance.lab') }}</th>
|
||||
<th>{{ ugandan_shillings($total) }}</th>
|
||||
<th>
|
||||
{{ Form::open(['method'=>'post','route' => 'lab_performance.details']) }}
|
||||
|
||||
{{ Form::hidden('inv_type', "lab") }}
|
||||
|
||||
@foreach ($inv_lab as $item)
|
||||
{{ Form::hidden('investigations_array[]', $item['item']) }}
|
||||
|
||||
{{ Form::hidden('patient_names_array[]',get_full_name($item['patient_id'],'id', 'first_name', 'last_name', 'patients') ) }}
|
||||
|
||||
{{ Form::hidden('patients_array[]',get_name($item['patient_id'],'id','number', 'patients') ) }}
|
||||
{{ Form::hidden('receipt_number_array[]', $item['receipt_number'] ) }}
|
||||
{{ Form::hidden('investigations_name_array[]',get_name($item['item'], 'id', 'name', 'investigations') ) }}
|
||||
{{ Form::hidden('investigations_date_array[]',streamline_date($item['date']) ) }}
|
||||
{{ Form::hidden('investigations_amountpaid_array[]',ugandan_shillings($item['patient_amount_paid']) ) }}
|
||||
{{ Form::hidden('investigations_cost_array[]',ugandan_shillings($item['cost_price']) ) }}
|
||||
@endforeach
|
||||
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</th>
|
||||
@php $grand_total = $total; @endphp
|
||||
</tr>
|
||||
|
||||
@php
|
||||
$total = 0;
|
||||
foreach ($inv_x_ray as $item){
|
||||
$total += $item['cost_price'];
|
||||
}
|
||||
@endphp
|
||||
<tr>
|
||||
<th>{{ __('cost_center_performance.xray') }}</th>
|
||||
<th>{{ ugandan_shillings($total) }}</th>
|
||||
<th>
|
||||
{{ Form::open(['method'=>'post','route' => 'lab_performance.details']) }}
|
||||
|
||||
{{ Form::hidden('inv_type', "xray") }}
|
||||
|
||||
@foreach ($inv_x_ray as $item)
|
||||
{{ Form::hidden('investigations_array[]', $item['item']) }}
|
||||
{{ Form::hidden('patient_names_array[]',get_full_name($item['patient_id'],'id', 'first_name', 'last_name', 'patients') ) }}
|
||||
|
||||
{{ Form::hidden('patients_array[]',get_name($item['patient_id'],'id','number', 'patients') ) }}
|
||||
{{ Form::hidden('receipt_number_array[]', $item['receipt_number'] ) }}
|
||||
{{ Form::hidden('investigations_name_array[]',get_name($item['item'], 'id', 'name', 'investigations') ) }}
|
||||
{{ Form::hidden('investigations_date_array[]',streamline_date($item['date']) ) }}
|
||||
{{ Form::hidden('investigations_amountpaid_array[]',ugandan_shillings($item['patient_amount_paid']) ) }}
|
||||
{{ Form::hidden('investigations_cost_array[]',ugandan_shillings($item['cost_price']) ) }}
|
||||
@endforeach
|
||||
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</th>
|
||||
@php $grand_total += $total; @endphp
|
||||
</tr>
|
||||
|
||||
@php
|
||||
$total = 0;
|
||||
foreach ($inv_ultrasound as $item){
|
||||
$total += $item['cost_price'];
|
||||
}
|
||||
@endphp
|
||||
<tr>
|
||||
<th>{{ __('cost_center_performance.ultrasound') }}</th>
|
||||
<th>{{ ugandan_shillings($total) }}</th>
|
||||
<th>
|
||||
{{ Form::open(['method'=>'post','route' => 'lab_performance.details']) }}
|
||||
|
||||
{{ Form::hidden('inv_type', "ultrasound") }}
|
||||
|
||||
@foreach ($inv_ultrasound as $item)
|
||||
{{ Form::hidden('investigations_array[]', $item['item']) }}
|
||||
{{ Form::hidden('patient_names_array[]',get_full_name($item['patient_id'],'id', 'first_name', 'last_name', 'patients') ) }}
|
||||
|
||||
{{ Form::hidden('patients_array[]',get_name($item['patient_id'],'id','number', 'patients') ) }}
|
||||
{{ Form::hidden('receipt_number_array[]', $item['receipt_number'] ) }}
|
||||
{{ Form::hidden('investigations_name_array[]',get_name($item['item'], 'id', 'name', 'investigations') ) }}
|
||||
{{ Form::hidden('investigations_date_array[]',streamline_date($item['date']) ) }}
|
||||
{{ Form::hidden('investigations_amountpaid_array[]',ugandan_shillings($item['patient_amount_paid']) ) }}
|
||||
{{ Form::hidden('investigations_cost_array[]',ugandan_shillings($item['cost_price']) ) }}
|
||||
@endforeach
|
||||
|
||||
{{ Form::submit(__('cost_center_performance.details'), ['class'=>'btn btn-success ']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</th>
|
||||
@php $grand_total += $total; @endphp
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><strong>{{ __('cost_center_performance.total') }}</strong></th>
|
||||
<th><strong>{{ ugandan_shillings($grand_total) }}</strong></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="offset-5"></div>
|
||||
<div class="col-md-6" style="margin-top: 70px;">
|
||||
<h3 class="label label-warning"><strong>{{ __('cost_center_performance.select_valid_date') }}</strong></h3>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<div class="row">
|
||||
<div class="offset-5"></div>
|
||||
<div class="col-md-6" style="margin-top: 70px;">
|
||||
<h3 class="label label-warning"><strong>{{ __('cost_center_performance.select_valid_date') }}</strong></h3>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</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('js/chartjs/chart.bundle.js') }}"></script>
|
||||
<script src="{{ asset('js/chartjs/utils.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 type="text/javascript">
|
||||
jQuery('#custom_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
</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/bower_components/select2/select2.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('#staff_member').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
@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">{{ __('cost_center_performance.investigation_performance_details') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/finance_reports">{{ __('cost_center_performance.reports_dashboard') }}</a></li>
|
||||
<li class="active">{{ __('cost_center_performance.investigation_performance_details') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-default">
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
|
||||
{{ Form::open(['method'=>'post','route' => 'lab_performance.index']) }}
|
||||
|
||||
<br/>
|
||||
<h3>{{ __('cost_center_performance.select_date_range') }}</h3>
|
||||
<br/>
|
||||
|
||||
<div class="form-group">
|
||||
<select class="form-control compulsory required" name="date_type" id="dates" required>
|
||||
<option value="">-{{ __('cost_center_performance.select') }}-</option>
|
||||
<option value="today">{{ __('cost_center_performance.today') }}</option>
|
||||
<option value="yesterday">{{ __('cost_center_performance.yesterday') }}</option>
|
||||
<option value="custom_date">{{ __('cost_center_performance.custom_date') }}</option>
|
||||
<option value="custom_date_range">{{ __('cost_center_performance.date_range') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="sDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('cost_center_performance.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 id="eDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('end_date', __('cost_center_performance.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 class="form-group">
|
||||
{{ Form::submit(__('cost_center_performance.submit'), ['class'=>'btn btn-success pull-right']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="col-xs-1"></div> -->
|
||||
|
||||
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="panel panel-default col-md-12">
|
||||
<div class="panel-body panel-primary">
|
||||
|
||||
|
||||
<br/>
|
||||
@if(isset($display))
|
||||
<h3 class="label label-info col-lg-5 offset-4"> {!! isset($display) ? $display : '' !!}</h3>
|
||||
@endif
|
||||
<br>
|
||||
<br/>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="table" class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('cost_center_performance.patient_number') }}</th>
|
||||
<th>{{ __('cost_center_performance.patient_name') }}</th>
|
||||
<th>{{ __('cost_center_performance.receipt_number') }}</th>
|
||||
<th>{{ __('cost_center_performance.item_name') }}</th>
|
||||
<th>{{ __('cost_center_performance.date') }}</th>
|
||||
<th>{{ __('cost_center_performance.amount') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$amount_patient_paid_total = 0;
|
||||
$donor_discount_total = 0;
|
||||
$general_discount_total = 0;
|
||||
@endphp
|
||||
|
||||
@for($i=0; $i < count($investigations_array); $i++)
|
||||
<tr>
|
||||
<td>{{ $patient_names_array[$i] }}</td>
|
||||
<td>{{ $patients_array[$i] }}</td>
|
||||
<td>{{ $receipt_number_array[$i] }}</td>
|
||||
<td>{{ $investigations_name_array[$i] }}</td>
|
||||
<td>{{ $investigations_date_array[$i] }}</td>
|
||||
<td>
|
||||
{{ isset($investigations_cost_array[$i]) ? $investigations_cost_array[$i] : "" }}
|
||||
</td>
|
||||
</tr>
|
||||
@endfor
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><strong>{{ __('cost_center_performance.total') }}</strong></td>
|
||||
<td><strong>{{ ugandan_shillings($invs_grand_total) }}</strong></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</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('js/chartjs/chart.bundle.js') }}"></script>
|
||||
<script src="{{ asset('js/chartjs/utils.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 type="text/javascript">
|
||||
jQuery('#custom_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
</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/bower_components/select2/select2.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('#staff_member').select2({
|
||||
placeholder: "-- select --"
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+166
@@ -0,0 +1,166 @@
|
||||
@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" />
|
||||
<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">{{ __('cost_center_performance.top_performing_investigations') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="/finance_reports">{{ __('cost_center_performance.reports_dashboard') }}</a></li>
|
||||
<li class="active">{{ __('cost_center_performance.top_performing_investigations') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<!--Flash messages at the top -->
|
||||
@include('flash::message')
|
||||
|
||||
|
||||
{{ Form::open(['method'=>'post','route' => 'top_performing_investigations']) }}
|
||||
|
||||
<br/>
|
||||
<h3>{{ __('cost_center_performance.select_cost_center') }}</h3>
|
||||
<br/>
|
||||
|
||||
<div class="form-group">
|
||||
<select class="form-control compulsory required" name="date_type" id="dates" required>
|
||||
<option value="">-{{ __('cost_center_performance.select') }}-</option>
|
||||
<option value="today">{{ __('cost_center_performance.today') }}</option>
|
||||
<option value="yesterday">{{ __('cost_center_performance.yesterday') }}</option>
|
||||
<option value="custom_date">{{ __('cost_center_performance.custom_date') }}</option>
|
||||
<option value="custom_date_range">{{ __('cost_center_performance.date_range') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="sDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date', __('cost_center_performance.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 id="eDate" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('end_date', __('cost_center_performance.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 class="form-group">
|
||||
{{ Form::submit(__('cost_center_performance.submit'), ['class'=>'btn btn-success pull-right']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{!! isset($display) ? '<strong><font color="blue">'.$display.'</font></strong>' : '' !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@if($request != [])
|
||||
<div style="width:75%;">
|
||||
{!! $chartjs->render() !!}
|
||||
</div>
|
||||
@else
|
||||
<div class="offset-5"></div>
|
||||
<div class="col-md-6" style="margin-top: 70px;">
|
||||
<h3 class="label label-warning"><strong>{{ __('cost_center_performance.select_valid_date') }}</strong></h3>
|
||||
</div>
|
||||
@endif
|
||||
</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 src="{{ asset('js/chartjs/chart.bundle.js') }}"></script>
|
||||
<script src="{{ asset('js/chartjs/utils.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<script type="text/javascript">
|
||||
$('#drugs_selected').select2({
|
||||
placeholder: "Select drugs"
|
||||
});
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
|
||||
$('#datepicker-autoclose1,#datepicker-autoclose2').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy-mm-dd',
|
||||
});
|
||||
|
||||
$('#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();
|
||||
}
|
||||
});
|
||||
|
||||
jQuery('#custom_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
jQuery('#end_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
jQuery('#start_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,85 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('title', '| Add Equity')
|
||||
|
||||
@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">New Equity</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="/equities/">Equities</a></li>
|
||||
<li class="active">Register</li>
|
||||
</ol>
|
||||
</div>
|
||||
<!-- /.col-lg-12 -->
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('finance::equity.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<div class="panel panel-default" style="border-radius: 5px;">
|
||||
|
||||
<div class="panel-body">
|
||||
{{ Form::open(['route' => 'equities.store','data-toggle'=>'validator']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('name', 'Equity Name') }}
|
||||
{{ Form::text('name', '', ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('amount', 'Amount') }}
|
||||
{{ Form::number('amount', '', ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('account_id', 'Chart Of Account') }}
|
||||
{{ Form::select('account_id', $chart_of_accounts, '', ['class' => 'form-control compulsory' , 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposit_to', 'Deposit To ?') }}
|
||||
{{ Form::select('deposit_to', $banks, '', ['class' => 'form-control compulsory' , 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposit_date', 'Deposit Date ?') }}
|
||||
{{ Form::text('deposit_date', '', ['class' => 'form-control compulsory' , 'readonly', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-rounded btn-success pull-right" onclick="return confirm('Are you sure you wish to deposit this equity ?')">Submit Equity</button>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/js/validator.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
jQuery('#deposit_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,86 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('title', '| Add Equity')
|
||||
|
||||
@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">Edit Equity</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="/equities/">Equities</a></li>
|
||||
<li class="active">Edit</li>
|
||||
</ol>
|
||||
</div>
|
||||
<!-- /.col-lg-12 -->
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('finance::equity.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<div class="panel panel-default" style="border-radius: 5px;">
|
||||
|
||||
<div class="panel-body">
|
||||
{{ Form::model($equity, ['method' => 'PUT', 'route' => ['equities.update',$equity]]) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('name', 'Equity Name') }}
|
||||
{{ Form::text('name', $equity->name, ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('amount', 'Amount') }}
|
||||
{{ Form::number('amount', $equity->amount, ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ Form::label('account_id', 'Chart Of Account') }}
|
||||
{{ Form::select('account_id', $chart_of_accounts, $equity->account_id, ['class' => 'form-control compulsory' , 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposit_to', 'Deposit To ?') }}
|
||||
{{ Form::select('deposit_to', $banks, $equity->deposited_to, ['class' => 'form-control compulsory' , 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('deposit_date', 'Deposit Date ?') }}
|
||||
{{ Form::text('deposit_date', $equity->deposit_date, ['class' => 'form-control compulsory' , 'readonly', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button('Cancel',['type'=>'reset','class'=>'btn btn-default btn-rounded waves-effect waves-light']) }}
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/js/validator.js') }}"></script>
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
jQuery('#deposit_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
@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">Equities</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">Equities</li>
|
||||
</ol>
|
||||
</div>
|
||||
<!-- /.col-lg-12 -->
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('finance::equity.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<div class="panel panel-default" style="border-radius: 5px;">
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Amount</th>
|
||||
<th>Chart Of Account</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($equities as $equity)
|
||||
<tr>
|
||||
<td>{{ $equity->name }}</td>
|
||||
<td>{{ ugandan_shillings($equity->amount) }}</td>
|
||||
<td>{{ get_name($equity->account_id, 'id', 'name', 'chart_of_accounts') }}</td>
|
||||
<td>
|
||||
{{ Form::model($equity->id ,['method' => 'POST', 'route' => ['equities.activate', $equity->id]]) }}
|
||||
<button type="submit" class="btn btn-rounded 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>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('.table').DataTable();
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,78 @@
|
||||
@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">Equities</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">Equities</li>
|
||||
</ol>
|
||||
</div>
|
||||
<!-- /.col-lg-12 -->
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('finance::equity.menu')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<div class="panel panel-default" style="border-radius: 5px;">
|
||||
<div class="panel-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Amount</th>
|
||||
<th>Chart Of Account</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($equities as $equity)
|
||||
<tr>
|
||||
<td>{{ $equity->name }}</td>
|
||||
<td>{{ ugandan_shillings($equity->amount) }}</td>
|
||||
<td>{{ get_name($equity->account_id, 'id', 'name', 'chart_of_accounts') }}</td>
|
||||
<td>
|
||||
<a href="/equities/{{ $equity->id }}/edit/" class="btn btn-warning btn-rounded"><i class="fa fa-pencil"></i> Edit</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::model($equity->id ,['method' => 'DELETE', 'route' => ['equities.destroy', $equity->id]]) }}
|
||||
<button type="submit" class="btn btn-danger btn-rounded" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i> Delete</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('.table').DataTable({
|
||||
pageLength: 100
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,7 @@
|
||||
<div class="panel panel-default" style="border-radius: 5px;">
|
||||
<div class="panel-body">
|
||||
<a href="{{ route('equities.create') }}" class="nav-item btn btn-success"><i class="fa fa-plus"></i> <span style="margin-left: 10px;">Add Equity</span></a>
|
||||
<a href="{{ route('equities.index') }}" class="nav-item btn btn-info"><i class="fa fa-eye"></i> <span style="margin-left: 10px;">View Equities</span></a>
|
||||
<a href="{{ route('equities.inactive') }}" class="nav-item btn btn-danger"><i class="fa fa-trash"></i> <span style="margin-left: 10px;">Activate Equities</span></a>
|
||||
</div>
|
||||
</div>
|
||||
Executable
+255
@@ -0,0 +1,255 @@
|
||||
@php use Illuminate\Support\Facades\Auth; @endphp
|
||||
@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" />
|
||||
<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" />
|
||||
|
||||
<style type="text/css">
|
||||
.color-tr {
|
||||
background: #FFFF99;
|
||||
}
|
||||
</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">{{ __('finance.incoming_patient_payments') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('finance.home') }}</a></li>
|
||||
<li><a href="{{ url('finance') }}">{{ __('finance.finance_home') }}</a></li>
|
||||
<li><a class="active"> {{ __('finance.incoming_patient_payments') }}</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
{{ Form::open(['route' => 'finance.incoming_opd_payments', 'method' => 'ANY']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
{{ Form::label('clinic_id', __('finance.clinic')) }}
|
||||
{{ Form::select('clinic_id', $clinics, '', ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('search_by', __('finance.date')) }}
|
||||
{{ Form::select('search_by', ['0'=>'Today','1'=>'Yesterday','2'=>'Custom Date','3'=>'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', __('finance.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', __('finance.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">
|
||||
{{ Form::label('search_patient', 'Search By Patient') }}
|
||||
<div class="input-group">
|
||||
<select class="form-control" name="patient_number" id="patient_number"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group" style="padding-top: 5px;"><br>
|
||||
{{ Form::button('Filter',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('finance.patient_number') }}</th>
|
||||
<th>{{ __('finance.full_names') }}</th>
|
||||
<th>{{ __('finance.age') }}</th>
|
||||
<th>{{ __('finance.phone') }}</th>
|
||||
<th>{{ __('finance.category') }}</th>
|
||||
<th>{{ __('finance.un-billed_items') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($patient_episodes as $episode)
|
||||
@php
|
||||
$dob = new Carbon\Carbon($episode->date_of_birth);
|
||||
|
||||
$has_procedures = is_integer($episode->procedure_id) && $episode->procedures_payment_status == 0 && $episode->procedures_is_inpatient == 0;
|
||||
$has_investigations = is_integer($episode->investigation_id) && $episode->investigation_payment_status == 0 && $episode->invs_is_inpatient == 0;
|
||||
$has_sundries = is_integer($episode->sundries_id) && $episode->sundries_payment_status == 0 && $episode->sundry_is_inpatient == 0;
|
||||
$has_services = is_integer($episode->service_id) && $episode->service_payment_status == 0 && $episode->service_is_inpatient == 0;
|
||||
$has_treatment = is_integer($episode->treatment_id) && $episode->treatment_payment_status == 0 && $episode->treatment_is_inpatient == 0;
|
||||
@endphp
|
||||
|
||||
<tr>
|
||||
<td>{{ $episode->number }}</td>
|
||||
<td>{!! insurance_flag($episode->patient_id) !!}</td>
|
||||
<td>{{ $dob->diffInYears(Carbon\Carbon::now()) }} (yrs)</td>
|
||||
<td>{{ $episode->phone }}</td>
|
||||
<td>{{ $patient_categories[$episode->category_id] ?? "N/A" }}</td>
|
||||
<td>
|
||||
{{ Form::open(['route' => 'patient_finance.select_payment_option']) }}
|
||||
|
||||
{{ Form::hidden('episode_id', $episode->episode_id)}}
|
||||
{{ Form::hidden('patient_id', $episode->patient_id)}}
|
||||
<ol>
|
||||
@if($has_services && Auth::user()->can('make-consultation-deposits'))
|
||||
<li><button type="submit" name="consultation" class="btn btn-primary btn-xs btn-rounded" value="consultation">{{ __('finance.consultations') }}</button></li>
|
||||
<br>
|
||||
@endif
|
||||
@if($has_treatment && Auth::user()->can('make-treatment-deposits'))
|
||||
<li><button type="submit" name="treatment" class="btn btn-warning btn-xs btn-rounded" value="treatment">{{ __('finance.treatments') }}</button></li>
|
||||
<br>
|
||||
@endif
|
||||
@if($has_investigations && Auth::user()->can('make-investigations-deposits'))
|
||||
<li><button type="submit" name="investigations" class="btn btn-info btn-xs btn-rounded" value="investigations">{{ __('finance.investigations') }}</button></li>
|
||||
<br>
|
||||
@endif
|
||||
@if($has_procedures && Auth::user()->can('make-procedures-deposits'))
|
||||
<li><button type="submit" name="procedures" class="btn btn-default btn-xs btn-rounded" value="procedures">{{ __('finance.procedures') }}</button></li>
|
||||
<br>
|
||||
@endif
|
||||
@if($has_sundries && Auth::user()->can('make-sundries-deposits'))
|
||||
<li><button type="submit" name="sundries" class="btn btn-default btn-xs btn-rounded" value="sundries" style="background: #73bcdca6;">{{ __('finance.sundries') }}</button></li>
|
||||
<br>
|
||||
@endif
|
||||
@if(Auth::user()->can('make-central-billing'))
|
||||
<li><button type="submit" name="central_billing" class="btn btn-danger btn-xs btn-rounded" value="central_billing" style="background: #9e9627">{{ __('finance.pay_for_all_items') }}</button></li>
|
||||
@endif
|
||||
</ol>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::model($episode->patient_id ,['method' => 'POST', 'route' => ['patient_finance.set_patient_session', $episode->patient_id]]) }}
|
||||
<button type="submit" class="btn btn-success btn-sm">{{ __('finance.select') }}</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</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>
|
||||
|
||||
<!-- Date Picker Plugin JavaScript -->
|
||||
<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,
|
||||
pageLength: 100,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
|
||||
$('#patient_number').select2({
|
||||
placeholder: 'Search by patient details (names and number)',
|
||||
ajax: {
|
||||
url: '/patients/search_patient_by_name_number',
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: $.map(data, function (item) {
|
||||
return {
|
||||
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_by').change(function () {
|
||||
if ($(this).val() == 2) {
|
||||
$('#date_search').show();
|
||||
$('#date_range_search').hide();
|
||||
}
|
||||
else if ($(this).val() == 3) {
|
||||
$('#date_range_search').show();
|
||||
$('#date_search').hide();
|
||||
}
|
||||
else {
|
||||
$('#date_search,#date_range_search').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
bInfo: false,
|
||||
bPaginate: false,
|
||||
buttons: [
|
||||
{extend: 'pdf',
|
||||
exportOptions: {
|
||||
stripHtml: false,
|
||||
columns: [0, 1, 2, 3, 4, 5, 6]
|
||||
}
|
||||
},
|
||||
{extend: 'print',
|
||||
exportOptions: {
|
||||
stripHtml: false,
|
||||
columns: [0, 1, 2, 3, 4, 5, 6]
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
function show(episodeId) {
|
||||
$('#menu1').show();
|
||||
$('#row'+episodeId).addClass('color-tr');
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,524 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-12">
|
||||
<h5 class="page-title">{{ __('finance.finance') }}</h5>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('finance.home') }}</a></li>
|
||||
<li><a class="active"> {{ __('finance.finance_home') }}</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="white-box">
|
||||
|
||||
@if(Auth::user()->can('finance-patient-search') || Auth::user()->can('incoming-inpatient-bills') || Auth::user()->can('nssf-rate-edit')
|
||||
|| Auth::user()->can('streamline-bills-create') || Auth::user()->can('streamline-bills-index'))
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.patient_finance') }}</h3>
|
||||
<ul class="feeds">
|
||||
@if(Auth::user()->can('finance-patient-search'))
|
||||
<a href="{{ route('patient_finance.search_patients') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.select_patient') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
<a href="{{ route('finance.incoming_opd_payments') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.incoming_patient_payments') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->can('incoming-inpatient-bills'))
|
||||
<a href="{{ route('inpatient_bills.incoming') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>Incoming IPD Bills<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.streamline_bills') }}</h3>
|
||||
<ul class="feeds">
|
||||
@if(Auth::user()->can('streamline-bills-create'))
|
||||
<a href="{{ route('streamline_bill.create') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.generate_bills') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->can('streamline-bills-index'))
|
||||
<a href="{{ route('streamline_bill') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.view_generated_bills') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.payroll_defaults') }}</h3>
|
||||
<ul class="feeds">
|
||||
@if(Auth::user()->can('nssf-rate-edit'))
|
||||
<a href="{{ route('payroll_defaults.edit_nssf_rate') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.edit_social_security_rate') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->can('tax-rate-edit'))
|
||||
<a href="{{ route('payroll_defaults.edit_tax_rate') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.edit_tax_rate') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
@if(Auth::user()->can('payroll-category-create') || Auth::user()->can('payroll-category-view') || Auth::user()->can('payroll-category-delete'))
|
||||
<h3 class="box-title">{{ __('payroll_categories.payroll_categories') }}</h3>
|
||||
<ul class="feeds">
|
||||
@if(Auth::user()->can('payroll-category-create'))
|
||||
<a href="{{ route('payroll_categories.create') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('payroll_categories.add_category') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('payroll-category-view'))
|
||||
<a href="{{ route('payroll_categories.index') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('payroll_categories.view_category') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('payroll-category-delete'))
|
||||
<a href="{{ route('payroll_categories.inactive') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('payroll_categories.inactive_category') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
</ul>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.expenses_or_payments') }}</h3>
|
||||
<ul class="feeds">
|
||||
<!--start of payments-->
|
||||
@if(Auth::user()->can('Payments-create-payment-item') || Auth::user()->can('Payments-list-payment-items')|| Auth::user()->can('Payments-make-payment')
|
||||
|| Auth::user()->can('Payments-view-payments-history') || Auth::user()->can('Payments-activate-payment-item'))
|
||||
|
||||
@if(Auth::user()->can('Payments-make-payment'))
|
||||
<a href="{{ route('payments.new_payment') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.manage_bills_or_expenses') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->can('Payments-create-payment-item'))
|
||||
<a href="{{ route('payment_items.create') }}">
|
||||
<li>
|
||||
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.manage_payment_items') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
{{-- @if(Auth::user()->can('Payments-list-payment-items'))--}}
|
||||
{{-- <a href="{{ route('payment_items.index') }}">--}}
|
||||
{{-- <li>--}}
|
||||
{{-- <div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> View Payment Item<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>--}}
|
||||
{{-- </li>--}}
|
||||
{{-- </a>--}}
|
||||
{{-- @endif--}}
|
||||
{{-- @if(Auth::user()->can('Payments-activate-payment-item'))--}}
|
||||
{{-- <a href="{{ url('/payment_items/inactive') }}">--}}
|
||||
{{-- <li>--}}
|
||||
{{-- <div class="bg-danger"><i class="fa fa-plus-circle text-white"></i></div> Inactive Payment Items<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>--}}
|
||||
{{-- </li>--}}
|
||||
{{-- </a>--}}
|
||||
{{-- @endif--}}
|
||||
|
||||
@if(Auth::user()->can('Payments-view-payments-history'))
|
||||
<a href="{{ route('payments.view_payments') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_expenses_report') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@endif
|
||||
<!--end of payments-->
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
@if(Auth::user()->can('price-list-category-create') || Auth::user()->can('price-list-category-view') || Auth::user()->can('price-list-category-delete'))
|
||||
<h3 class="box-title">{{ __('finance.price_list') }}</h3>
|
||||
<ul class="feeds">
|
||||
@if(Auth::user()->can('price-list-category-create'))
|
||||
<a href="{{ route('price_list_category.create') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.add_category') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('price-list-category-view'))
|
||||
<a href="{{ route('price_list_category.index') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.view_categories') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('price-list-category-delete'))
|
||||
<a href="{{ route('price_list_category.inactive') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.inactive_categories') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
</ul>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.chart_of_accounts') }}</h3>
|
||||
<ul class="feeds">
|
||||
<!--start of chart of accounts listing-->
|
||||
@if(Auth::user()->can('chart-of-accounts-list') || Auth::user()->can('create-chart-of-accounts') || Auth::user()->can('view-of-account-details') || Auth::user()->can('activate-chart-of-accounts'))
|
||||
|
||||
@if(Auth::user()->can('create-chart-of-accounts'))
|
||||
<a href="{{ route('chart_of_accounts.create') }}">
|
||||
<li>
|
||||
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.add_account') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('view-chart-of-account-details'))
|
||||
<a href="{{ route('chart_of_accounts.index') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_accounts') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('activate-chart-of-accounts') || Auth::user()->can('de-activate-chart-of-accounts'))
|
||||
<a href="{{ route('chart_of_accounts.inactive') }}">
|
||||
<li>
|
||||
<div class="bg-danger"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.inactive_accounts') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@endif
|
||||
<!--end of chart of accounts listing-->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.account_types') }}</h3>
|
||||
<ul class="feeds">
|
||||
<!--start of account types listing-->
|
||||
@if(Auth::user()->can('account-types-list') || Auth::user()->can('create-account-types') || Auth::user()->can('view-account-type-details') || Auth::user()->can('activate-account-types'))
|
||||
<!-- NO ONE SHOULD BE ABLE TO ADD A NEW ACCOUNT TYPE -->
|
||||
<!-- @if(Auth::user()->can('create-account-types'))
|
||||
<a href="{{ route('account_types.create') }}">
|
||||
<li>
|
||||
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.add_account_type') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif -->
|
||||
@if(Auth::user()->can('account-types-list'))
|
||||
<a href="{{ route('account_types.index') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_account_types') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('activate-account-types'))
|
||||
<a href="{{ route('account_types.inactive') }}">
|
||||
<li>
|
||||
<div class="bg-danger"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.inactive_account_types') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@endif
|
||||
<!--end of account types listing-->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.banking') }}</h3>
|
||||
<ul class="feeds">
|
||||
<!--start of banking-->
|
||||
@if(Auth::user()->can('banking-make-deposit'))
|
||||
<a href="{{ route('banking.deposit') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.make_bank_deposit') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('banking-make-transfers'))
|
||||
<a href="{{ route('banking.transfer') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.make_bank_transfer') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('banking-make-deposit'))
|
||||
<a href="{{ route('banking.deposit_history') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.bank_deposit_history') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('banking-view-history'))
|
||||
<a href="{{ route('banking.transfer_history') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.bank_transfer_history') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('banking-register'))
|
||||
<a href="{{ route('banking.register') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.bank_register_report') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('banking-reconciliation'))
|
||||
<a href="{{ route('banking.reconcile') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.bank_reconciliation') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
<a href="{{ route('banking.reconcile.reports') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.bank_reconciliation_reports') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
<!--end of banking-->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@if( Auth::user()->can('payroll-create') || Auth::user()->can('payroll-list') || Auth::user()->can('payroll-delete'))
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.payrolls') }}</h3>
|
||||
<ul class="feeds">
|
||||
@if( Auth::user()->can('payroll-create'))
|
||||
<a href="{{ route('payroll.create') }}">
|
||||
<li>
|
||||
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('payroll.add_payroll_employee') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if( Auth::user()->can('payroll-create'))
|
||||
<a href="{{ route('payroll.bulk_create') }}">
|
||||
<li>
|
||||
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('payroll.add_multiple_payroll_employees') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if( Auth::user()->can('payroll-list'))
|
||||
<a href="{{ route('payroll.index') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('payroll.view_payrolls') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if( Auth::user()->can('payroll-delete'))
|
||||
<a href="{{ route('payroll.inactive') }}">
|
||||
<li>
|
||||
<div class="bg-danger"><i class="fa fa-plus-circle text-white"></i></div> {{ __('payroll.inactive_payrolls') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if( Auth::user()->can('payroll-list'))
|
||||
<a href="{{ route('payroll.view_payroll_payments') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_payslips') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if( Auth::user()->can('payroll-delete'))
|
||||
<a href="{{ route('payroll.inactive_payslips') }}">
|
||||
<li>
|
||||
<div class="bg-danger"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.deleted_payslips') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.items') }}</h3>
|
||||
<ul class="feeds">
|
||||
@if(Auth::user()->can('fixed-assets-list') || Auth::user()->can('view-family-account'))
|
||||
|
||||
<a href="{{ route('equities.index') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.equity_management') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@if(Auth::user()->can('fixed-assets-list'))
|
||||
<a href="{{ route('fixed_assets.index') }}">
|
||||
<li>
|
||||
<div class="bg-danger"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.fixed_assets') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(is_family_account_feature_enabled())
|
||||
@if(Auth::user()->can('view-family-account'))
|
||||
<a href="{{ route('family_accounts.index') }}">
|
||||
<li>
|
||||
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.family_accounts') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
<a href="{{ route('family_accounts.consumption_report') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.family_accounts_consumption_report') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
<a href="{{ route('family_accounts.deposit_report') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.family_accounts_deposit_report') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
<!--end of chart of accounts listing-->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.discounts') }}</h3>
|
||||
<ul class="feeds">
|
||||
<!--start of discounts-->
|
||||
@if( Auth::user()->can('discount-create') || Auth::user()->can('discount-list') || Auth::user()->can('discount-category-list') ||
|
||||
Auth::user()->can('discount-category-create') || Auth::user()->can('discount-category-delete') || Auth::user()->can('change-drugs-covered-by-category'))
|
||||
@if(Auth::user()->can('discount-create'))
|
||||
<a href="{{ route('discounts.create') }}">
|
||||
<li>
|
||||
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.new_patient_discount') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('discount-list') || Auth::user()->can('change-drugs-covered-by-category'))
|
||||
<a href="{{ route('discounts.index') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_patient_discounts') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('discount-category-list'))
|
||||
<a href="{{ route('discount_category.create') }}">
|
||||
<li>
|
||||
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.new_discount_category') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('discount-category-create'))
|
||||
<a href="{{ route('discount_category.index') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_discount_categories') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@if(Auth::user()->can('discount-category-delete'))
|
||||
<a href="{{ route('discount_category.inactive') }}">
|
||||
<li>
|
||||
<div class="bg-warning"><i class="fa fa-plus-circle text-white"></i></div> {{ __('finance.view_inactive_discount_categories') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
@endif
|
||||
<!--end of discounts-->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.reports_title') }}</h3>
|
||||
<ul class="feeds">
|
||||
@if(Auth::user()->can('finance-reports-activate'))
|
||||
<a href="{{ route('finance_reports.index') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.reports') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.invoices_title') }}</h3>
|
||||
<ul class="feeds">
|
||||
@if(Auth::user()->can('Invoices-generate') || Auth::user()->can('Invoices-receive-payments') || Auth::user()->can('Invoices-view-payments-history'))
|
||||
<a href="{{ route('invoices') }}">
|
||||
<li>
|
||||
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.invoices') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@if( Auth::user()->can('journals-view') )
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.journals_title') }}</h3>
|
||||
<ul class="feeds">
|
||||
<a href="{{ route('journals') }}">
|
||||
<li>
|
||||
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.journals') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if( Auth::user()->can('budget-list') )
|
||||
<div class="col-md-3">
|
||||
<h3 class="box-title">{{ __('finance.title_budgets') }}</h3>
|
||||
<ul class="feeds">
|
||||
<a href="{{ route('budgets.index') }}">
|
||||
<li>
|
||||
<div class="bg-info"><i class="fa fa-plus-circle text-white"></i></div>{{ __('finance.budgets') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
|
||||
</li>
|
||||
</a>
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
+206
@@ -0,0 +1,206 @@
|
||||
@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">{{ __('fixed_assets.fixed_assets') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('fixed_assets.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('fixed_assets.index') }}">{{ __('fixed_assets.fixed_assets') }}</a></li>
|
||||
<li class="active">{{ __('fixed_assets.add') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@include('finance::fixed_assets.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box">
|
||||
{{ Form::open(['route' => 'fixed_assets.store','data-toggle'=>'validator']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('name', __('fixed_assets.asset_name')) }}
|
||||
{{ Form::text('name', '', ['class'=>'form-control compulsory','required']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('serial_number', __('fixed_assets.serial_number')) }}
|
||||
{{ Form::text('serial_number', '', ['class'=>'form-control']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('cost_price', __('fixed_assets.cost_price') ." / Asset Value") }}
|
||||
{{ Form::number('cost_price', '', ['class'=>'form-control compulsory', 'id'=>'cost_price', 'required']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('acquisition_date', __('fixed_assets.acquisition_date')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('acquisition_date','',['class' => 'form-control compulsory','required'=>'true','readonly'=>'true','id'=>'datepicker-autoclose']) }}
|
||||
<span class="input-group-addon" required><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('depreciation', __('fixed_assets.depreciation')) }}
|
||||
{{ Form::number('depreciation', '', ['class'=>'form-control', 'step' => 'any']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('item_condition',__('fixed_assets.item_condition')) }}
|
||||
<br>
|
||||
<div>
|
||||
{{ Form::radio('item_condition', 1, false, ["required"]) }} New
|
||||
{{ Form::radio('item_condition', 0, false, ["required"]) }} Used
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('supplier', __('fixed_assets.supplier')) }}
|
||||
{{ Form::select('supplier', $suppliers, null, ['class'=>'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('fixed_asset_account', __('fixed_assets.fixed_asset_account')) }}
|
||||
{{ Form::select('fixed_asset_account', $fixed_asset_chart_of_accounts, null, ['class'=>'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('warranty_expiration_date',__('fixed_assets.warranty_expiry')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('warranty_expiration_date','',['class' => 'form-control','readonly'=>'true','id'=>'datepicker-autoclose2']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php $payment_type = array(''=>'-select-','cash'=>'Cash / EFT / CHEQUE', 'bill'=>'Bill', 'asset_exists'=>'Already Existing Asset'); @endphp
|
||||
<div class="form-group">
|
||||
{{ Form::label('payment_type', 'Payment Type') }}
|
||||
{{ Form::select('payment_type', $payment_type, null, ['class'=>'form-control compulsory', 'required', 'id'=>'payment_type']) }}
|
||||
</div>
|
||||
|
||||
<div id="cash_div" style="display: none">
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('bank_account_id', __('fixed_assets.bank_account')) }}
|
||||
{{ Form::select('bank_account_id', $bank_chart_of_accounts, null, ['class'=>'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('amount_paid', 'Amount Paid') }}
|
||||
{{ Form::number('amount_paid', 0, ['class'=>'form-control compulsory', 'required', 'id'=>'amount_paid', 'onkeyup'=>'get_balance()']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('balance', 'balance') }}
|
||||
{{ Form::number('balance', 0, ['class'=>'form-control', 'readonly', 'id'=>'balance']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="bill_div" style="display: none">
|
||||
<div class="form-group">
|
||||
{{ Form::label('payable_account', 'Payable Account') }}
|
||||
{{ Form::select('payable_account', $payable_accounts, 14, ['class'=>'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('description', __('fixed_assets.description')) }}
|
||||
{{ Form::textArea('description', '', ['class'=>'form-control', 'rows' => 4]) }}
|
||||
</div>
|
||||
|
||||
<button class="btn btn-rounded btn-success pull-right" onclick="return confirm('Are you sure you wish to purchase this asset ?')">{{ __('fixed_assets.create_fixed_asset') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</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>
|
||||
|
||||
<!-- data time piker dependency -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<!-- -->
|
||||
|
||||
<script>
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
|
||||
$('#datepicker-autoclose,#datepicker-autoclose2').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy',
|
||||
setDate: new Date(),
|
||||
readOnly: true
|
||||
});
|
||||
$('#payment_type').change(function() {
|
||||
if (this.value === 'cash') {
|
||||
$('#cash_div').show();
|
||||
$('#bill_div').hide();
|
||||
} else if (this.value === 'bill') {
|
||||
$('#cash_div').hide()
|
||||
$('#bill_div').show()
|
||||
} else {
|
||||
$('#cash_div').hide()
|
||||
$('#bill_div').hide()
|
||||
}
|
||||
});
|
||||
|
||||
function get_balance() {
|
||||
var bill_div = $('#bill_div');
|
||||
let cost_price = $('#cost_price').val();
|
||||
let amount_paid = $('#amount_paid').val();
|
||||
let balance = parseInt(cost_price) - parseInt(amount_paid);
|
||||
$('#balance').val(balance);
|
||||
|
||||
(balance > 0) ? bill_div.show(): bill_div.hide();
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+248
@@ -0,0 +1,248 @@
|
||||
@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">{{ __('fixed_assets.fixed_assets') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('fixed_assets.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('fixed_assets.index') }}">{{ __('fixed_assets.fixed_assets') }}</a></li>
|
||||
<li class="active">{{ __('fixed_assets.edit') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
@include('finance::fixed_assets.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box">
|
||||
{{ Form::model($fixed_asset, ['method' => 'PUT', 'route' => ['fixed_assets.update',$fixed_asset], 'data-toggle' => 'validator']) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('name', __('fixed_assets.asset_name')) }}
|
||||
{{ Form::text('name', $fixed_asset->name, ['class'=>'form-control compulsory','required']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('serial_number', __('fixed_assets.serial_number')) }}
|
||||
{{ Form::text('serial_number', $fixed_asset->serial_number , ['class'=>'form-control']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('cost_price', __('fixed_assets.cost_price')) }}
|
||||
{{ Form::number('cost_price', $fixed_asset->cost_price , ['class'=>'form-control', 'readonly','onkeyup'=>'get_balance()']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group"> @php $acquisition_date = \Carbon\Carbon::parse($fixed_asset->acquisition_date)->format('d-m-Y'); @endphp
|
||||
{{ Form::label('acquisition_date', __('fixed_assets.acquisition_date')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('acquisition_date', $acquisition_date, ['class' => 'form-control compulsory', 'required','readonly'=>'true','id'=>'datepicker-autoclose']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('depreciation', __('fixed_assets.depreciation')) }}
|
||||
{{ Form::number('depreciation', $fixed_asset->depreciation , ['class'=>'form-control', 'step' => 'any']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('item_condition',__('fixed_assets.item_condition')) }}
|
||||
<br>
|
||||
<div>
|
||||
{{ Form::radio('item_condition', 1, false, ["required"]) }} New
|
||||
{{ Form::radio('item_condition', 0, false, ["required"]) }} Used
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('supplier', __('fixed_assets.supplier')) }}
|
||||
{{ Form::select('supplier', $suppliers, $fixed_asset->supplier_id, ['class'=>'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('fixed_asset_account', __('fixed_assets.fixed_asset_account')) }}
|
||||
{{ Form::select('fixed_asset_account', $fixed_asset_chart_of_accounts, $fixed_asset->fixed_asset_account_id, ['class'=>'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
{{ Form::label('warranty_expiration_date',__('fixed_assets.warranty_expiry')) }}
|
||||
<div class="input-group">
|
||||
{{ Form::text('warranty_expiration_date',$fixed_asset->warranty_expiration_date,['class' => 'form-control compulsory', 'required','readonly'=>'true','id'=>'datepicker-autoclose2']) }}
|
||||
<span class="input-group-addon"><i class="icon-calender"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('edit_payment_type', 'Edit payment options') }}
|
||||
<br>
|
||||
<div>
|
||||
{{ Form::radio('edit_payment_type', 1, false, ["required", "id" => "edit_payment"]) }} Yes
|
||||
{{ Form::radio('edit_payment_type', 0, false, ["required", "id" => "do_not_edit_payment"]) }} No
|
||||
</div>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$payment_type = array(''=>'-select-','cash'=>'Cash / EFT / CHEQUE', 'bill'=>'Bill', 'asset_exists'=>'Already Existing Asset');
|
||||
|
||||
$balance = 0;
|
||||
$payable_account_id = 14; //default payable
|
||||
|
||||
$bill = \Streamline\Models\HospitalBill::where(['item_ids' => $fixed_asset->id, 'bill_type' => 'ASSETS'])->first();
|
||||
|
||||
if ($bill) {
|
||||
$balance = (int)$bill->total_amount;
|
||||
$payable_account_id = $bill->payable_account;
|
||||
}
|
||||
@endphp
|
||||
<div id="edit_payment_type_div" style="display: none;">
|
||||
@if($fixed_asset->payment_type != null)
|
||||
<div class="form-group">
|
||||
{{ Form::label('payment_type', 'Payment Type') }}
|
||||
{{ Form::select('payment_type', $payment_type, $fixed_asset->payment_type, ['class'=>'form-control compulsory', 'required', 'id'=>'payment_type']) }}
|
||||
</div>
|
||||
|
||||
<div id="cash_div" @if($fixed_asset->payment_type != "cash") style="display: none" @endif>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('bank_account_id', __('fixed_assets.bank_account')) }}
|
||||
{{ Form::select('bank_account_id', $bank_chart_of_accounts, $fixed_asset->bank_account_id, ['class'=>'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('amount_paid', 'Amount Paid') }}
|
||||
{{ Form::number('amount_paid', $fixed_asset->cost_price-$balance, ['class'=>'form-control compulsory', 'required', 'id'=>'amount_paid', 'onkeyup'=>'get_balance()']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('balance', 'balance') }}
|
||||
{{ Form::number('balance', $balance, ['class'=>'form-control', 'readonly', 'id'=>'balance']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="bill_div" @if($fixed_asset->payment_type != "bill") style="display: none" @endif>
|
||||
<div class="form-group">
|
||||
{{ Form::label('payable_account', 'Payable Account') }}
|
||||
{{ Form::select('payable_account', $payable_accounts, $payable_account_id, ['class'=>'form-control']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('description', __('fixed_assets.description')) }}
|
||||
{{ Form::textArea('description', $fixed_asset->description , ['class'=>'form-control', 'rows' => 4]) }}
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-info">Can not edit payment type</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::button(__('fixed_assets.update'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button(__('fixed_assets.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</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>
|
||||
|
||||
<!-- data time piker dependency -->
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
<!-- -->
|
||||
|
||||
<script>
|
||||
window.onload = function(){
|
||||
var fixed_asset = {!! json_encode($fixed_asset) !!};
|
||||
console.log(fixed_asset);
|
||||
$('#datepicker-autoclose').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy',
|
||||
setDate: fixed_asset.acquisition_date,
|
||||
readOnly: true
|
||||
});
|
||||
$('#datepicker-autoclose2').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd-mm-yyyy',
|
||||
setDate: fixed_asset.warranty_expiration_date,
|
||||
readOnly: true
|
||||
});
|
||||
}
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
|
||||
$('#payment_type').change(function() {
|
||||
if (this.value === 'cash') {
|
||||
$('#cash_div').show();
|
||||
$('#bill_div').hide();
|
||||
} else if (this.value === 'bill') {
|
||||
$('#cash_div').hide()
|
||||
$('#bill_div').show()
|
||||
} else {
|
||||
$('#cash_div').hide()
|
||||
$('#bill_div').hide()
|
||||
}
|
||||
});
|
||||
|
||||
$('#edit_payment,#do_not_edit_payment').click(function(){
|
||||
if($('#edit_payment').is(':checked')) {
|
||||
$('#edit_payment_type_div').show();
|
||||
$("#cost_price").removeAttr("readonly");
|
||||
}
|
||||
|
||||
if($('#do_not_edit_payment').is(':checked')) {
|
||||
$('#edit_payment_type_div').hide();
|
||||
}
|
||||
});
|
||||
|
||||
function get_balance() {
|
||||
var bill_div = $('#bill_div');
|
||||
let cost_price = $('#cost_price').val();
|
||||
let amount_paid = $('#amount_paid').val();
|
||||
let balance = parseInt(cost_price) - parseInt(amount_paid);
|
||||
$('#balance').val(balance);
|
||||
|
||||
(balance > 0) ? bill_div.show(): bill_div.hide();
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
@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">{{ __('fixed_assets.fixed_assets') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('fixed_assets.dashboard') }}</a></li>
|
||||
<li><a href="/service_items/index">{{ __('fixed_assets.fixed_assets') }}</a></li>
|
||||
<li class="active">{{ __('fixed_assets.view') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
@include('finance::fixed_assets.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box">
|
||||
<p class="text-muted m-b-30">{{ __('fixed_assets.export_to_pdf') }}</p>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('fixed_assets.asset_name') }}</th>
|
||||
<th>{{ __('fixed_assets.serial_number') }}</th>
|
||||
<th>{{ __('fixed_assets.cost_price') }}</th>
|
||||
<th>{{ __('fixed_assets.acquisition_date') }}</th>
|
||||
<th>{{ __('fixed_assets.description') }}</th>
|
||||
<th>{{ __('fixed_assets.warranty_expiry') }}</th>
|
||||
<th>{{ __('fixed_assets.item_condition') }}</th>
|
||||
<th>{{ __('fixed_assets.supplier') }}</th>
|
||||
<th>{{ __('fixed_assets.payment_type') }}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@php $total_fixed_assets_value = 0; @endphp
|
||||
@if(count($fixed_assets) > 0)
|
||||
@foreach($fixed_assets as $fixed_asset)
|
||||
@php $total_fixed_assets_value += $fixed_asset->cost_price; @endphp
|
||||
<tr>
|
||||
<td>{{ $fixed_asset->name }}</td>
|
||||
<td>{{ $fixed_asset->serial_number }}</td>
|
||||
<td>{{ ugandan_shillings($fixed_asset->cost_price) }}</td>
|
||||
<td>{{ $fixed_asset->acquisition_date }}</td>
|
||||
<td>{{ $fixed_asset->description }}</td>
|
||||
<td>{{ $fixed_asset->warranty_expiration_date }}</td>
|
||||
<td>{{ $fixed_asset->item_condition == 1 ? 'New' : 'Used' }}</td>
|
||||
<td>{{ isset($suppliers[$fixed_asset->supplier_id]) ? $suppliers[$fixed_asset->supplier_id] : "" }}</td>
|
||||
<td>
|
||||
@switch($fixed_asset->payment_type)
|
||||
@case("cash")
|
||||
<span>Cash/EFT/Cheque</span>
|
||||
@break
|
||||
@case("bill")
|
||||
<span>Bill</span>
|
||||
@break
|
||||
@case("asset_exists")
|
||||
<span>Already existing asset</span>
|
||||
@break
|
||||
@default
|
||||
|
||||
@endswitch
|
||||
</td>
|
||||
<td>
|
||||
@if(Auth::user()->can('edit-fixed-assets'))
|
||||
<a href="/fixed_assets/{{ $fixed_asset->id }}/edit/" class="btn btn-default btn-sm"><i class="fa fa-pencil"></i> {{ __('fixed_assets.edit') }}</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if(Auth::user()->can('delete-fixed-assets'))
|
||||
{{ Form::model($fixed_asset->id ,['method' => 'DELETE', 'route' => ['fixed_assets.destroy', $fixed_asset->id]]) }}
|
||||
<button type="submit" class="btn btn-danger btn-sm deleteButton" value="{{$fixed_asset->id}}"><i class="fa fa-trash"></i>
|
||||
{{ __('fixed_assets.delete') }}</button>
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>{{ __('family_accounts.total') }}</strong></td>
|
||||
<td colspan="9"><strong>{{ ugandan_shillings($total_fixed_assets_value) }}</strong></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>
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 50,
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});
|
||||
|
||||
$(".deleteButton").click(function(e){
|
||||
//e.preventDefault();
|
||||
var fixedAssetId = $(this).val();
|
||||
console.log(fixedAssetId);
|
||||
checkBeforeSubmission(fixedAssetId);
|
||||
})
|
||||
|
||||
function checkBeforeSubmission(fixedAssetId) {
|
||||
$.ajax({
|
||||
url: '/is_fixed_asset_attached_to_bill',
|
||||
data: {'fixed_asset_id':fixedAssetId},
|
||||
success: function(response){
|
||||
if (response == "has_attached_bill") {
|
||||
return confirm('The corresponding bill attached to this asset will also be deleted. Do you want to proceed');
|
||||
} else {
|
||||
return confirm('The corresponding chart of accounts will be affected by this action. Do you want to proceed');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<a href="\fixed_assets\create" class="nav-item btn btn-default ti-plus"> {{ __('fixed_assets.add_fixed_asset') }}</a>
|
||||
<!-- <a href="\fixed_assets\edit" class="nav-item btn btn-default ti-pencil"> Edit Fixed Asset</a> -->
|
||||
<a href="\fixed_assets" class="nav-item btn btn-default ti-pencil"> {{ __('fixed_assets.view_fixed_assets') }}</a>
|
||||
<!-- <a href="#" class="nav-item btn btn-danger ti-pencil"> Delete Fixed Asset</a> -->
|
||||
</div>
|
||||
</div>
|
||||
Executable
+188
@@ -0,0 +1,188 @@
|
||||
@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" />
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</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">{{ __('markup_tags.create_markup_tag') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('markup_tags.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
|
||||
<li class="active">{{ __('markup_tags.create_markup_tag') }}</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>{{ __('markup_tags.existing_markups') }}</strong>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('markup_tags.name') }}</th>
|
||||
<th>{{ __('markup_tags.percentage') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($tags as $tag)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $tag->name }}</a></td>
|
||||
<td>{{ $tag->percentage }}%</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
{{ Form::open(['route' => 'markup_tag.drug_markup_search', 'method' => 'ANY', 'role' => 'search']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group" id="drug_names">
|
||||
{{ Form::text('drug_name', '', ['class' => 'form-control typeahead', 'placeholder' => __('markup_tags.search_name'), 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-search"></span> {{ __('markup_tags.search') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(isset($criteria) && isset($resultCount))
|
||||
<p>
|
||||
{{ __('markup_tags.search_criteria') }} : <code>{{ $criteria }}</code> {{ __('markup_tags.total_results') }} : <code>{{ $resultCount }}</code> <a href="{{ route('drugs.index') }}">{{ __('markup_tags.clear_search') }}</a>
|
||||
</p>
|
||||
@endif
|
||||
{{ Form::close() }}
|
||||
|
||||
{{ Form::open(['route' => 'markup_tag.update_mark_up_to_drug', 'data-toggle' => 'validator']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('markup_tag', __('markup_tags.select_markup')) }}
|
||||
{{ 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"> {{ __('markup_tags.select_all_drugs') }}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%">#</th>
|
||||
<th style="width: 60%">{{ __('markup_tags.name') }}</th>
|
||||
<th style="width: 30%">{{ __('markup_tags.current_markup') }}</th>
|
||||
<th style="width: 5%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($drugs as $drug)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $drug->name }}</td>
|
||||
<td><font color="blue">{{ isset($tags_array[$drug->markup_tag_id]) ? $tags_array[$drug->markup_tag_id] : "" }}</font></td>
|
||||
<td><input type="checkbox" name="checked_drug[]" value="{{ $drug->id }}" class="item_checkbox"></td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{ Form::button(__('markup_tags.apply'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button(__('markup_tags.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/typeahead.js-master/dist/typeahead.bundle.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>
|
||||
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);
|
||||
};
|
||||
};
|
||||
|
||||
$('#drug_names .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'drug_names',
|
||||
source: substringMatcher(<?php echo json_encode($names_array); ?>)
|
||||
}
|
||||
);
|
||||
/*$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});*/
|
||||
$('#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
+187
@@ -0,0 +1,187 @@
|
||||
@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" />
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</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">{{ __('markup_tags.create_markup_tag') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('markup_tags.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
|
||||
<li class="active">{{ __('markup_tags.create_markup_tag') }}</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>{{ __('markup_tags.existing_markups') }}</strong>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('markup_tags.name') }}</th>
|
||||
<th>{{ __('markup_tags.percentage') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($tags as $tag)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $tag->name }}</a></td>
|
||||
<td>{{ $tag->percentage }}%</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
{{ Form::open(['route' => 'markup_tag.sundry_markup_search', 'method' => 'ANY', 'role' => 'search']) }}
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group" id="sundry_names">
|
||||
{{ Form::text('sundry_name', '', ['class' => 'form-control typeahead', 'placeholder' => __('markup_tags.search_name'), 'autocomplete' => 'off', 'spellcheck' => false]) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<button type="submit" class="btn btn-success"><span class="glyphicon glyphicon-search"></span> {{ __('markup_tags.search') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(isset($criteria) && isset($resultCount))
|
||||
<p>
|
||||
{{ __('markup_tags.search_criteria') }} : <code>{{ $criteria }}</code> {{ __('markup_tags.total_results') }} : <code>{{ $resultCount }}</code> <a href="{{ route('sundries.index') }}">{{ __('markup_tags.clear_search') }}</a>
|
||||
</p>
|
||||
@endif
|
||||
{{ Form::close() }}
|
||||
|
||||
{{ Form::open(['route' => 'markup_tag.update_mark_up_to_sundry', 'data-toggle' => 'validator']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('markup_tag', __('markup_tags.select_markup')) }}
|
||||
{{ 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"> {{ __('markup_tags.select_all_drugs') }}
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%">#</th>
|
||||
<th style="width: 60%">{{ __('markup_tags.name') }}</th>
|
||||
<th style="width: 30%">{{ __('markup_tags.current_markup') }}</th>
|
||||
<th style="width: 5%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($sundries as $sundry)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $sundry->name }}</td>
|
||||
<td><font color="blue">{{ isset($tags_array[$sundry->markup_tag_id]) ? $tags_array[$sundry->markup_tag_id] : "" }}</font></td>
|
||||
<td><input type="checkbox" name="checked_sundry[]" value="{{ $sundry->id }}" class="item_checkbox"></td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{ Form::button(__('markup_tags.apply'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button(__('markup_tags.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/typeahead.js-master/dist/typeahead.bundle.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>
|
||||
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);
|
||||
};
|
||||
};
|
||||
|
||||
$('#sundry_names .typeahead').typeahead(
|
||||
{
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'sundry_names',
|
||||
source: substringMatcher(<?php echo json_encode($names_array); ?>)
|
||||
}
|
||||
);
|
||||
/*$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
]
|
||||
});*/
|
||||
$('#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
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
@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" />
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</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">{{ __('markup_tags.create_markup_tag') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('markup_tags.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
|
||||
<li class="active">{{ __('markup_tags.create_markup_tag') }}</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">
|
||||
<h3>{{ __('markup_tags.create_new_markup_tag') }}</h3>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
{{ Form::open(['route' => 'markup_tag.store', 'data-toggle' => 'validator']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('name', __('markup_tags.name')) }}
|
||||
{{ Form::text('name', '', ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('percentage', __('markup_tags.percentage')) }}
|
||||
{{ Form::number('percentage', '', ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
{{ Form::button(__('markup_tags.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button(__('markup_tags.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4">
|
||||
</div>
|
||||
<div class="col-sm-1"></div>
|
||||
{{ Form::close() }}
|
||||
</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
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
@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" />
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</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">{{ __('markup_tags.edit_markup_tag') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('markup_tags.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
|
||||
<li class="active">{{ __('markup_tags.edit_markup_tag') }}</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">
|
||||
<h3>{{ __('markup_tags.edit_markup_tag_per') }}</h3>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
{{ Form::model($tag, ['method' => 'PUT', 'route' => ['markup_tag.update',$tag] , 'data-toggle' => 'validator']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('name', __('markup_tags.name')) }}
|
||||
{{ Form::text('name', $tag->name, ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('percentage', __('markup_tags.percentage')) }}
|
||||
{{ Form::number('percentage', $tag->percentage, ['class' => 'form-control compulsory', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
|
||||
{{ Form::button(__('markup_tags.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
{{ Form::button(__('markup_tags.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4">
|
||||
</div>
|
||||
<div class="col-sm-1"></div>
|
||||
{{ Form::close() }}
|
||||
</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
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
@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" />
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</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">{{ __('markup_tags.inactive_markup_tag') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
|
||||
<li class="active">{{ __('markup_tags.inactive_markup_tag') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('finance::markup_tags.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('flash::message')
|
||||
<div class="white-box">
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('markup_tags.name') }}</th>
|
||||
<th>{{ __('markup_tags.percentage') }}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($tags as $tag)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td><a href="#">{{ $tag->name }}</a></td>
|
||||
<td>{{ $tag->percentage }}%</td>
|
||||
<td>
|
||||
<a href="/markup_tag/{{ $tag->id }}/edit/" class="btn btn-info btn-sm"><i class="fa fa-pencil"></i> {{ __('markup_tags.edit') }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::model($tag->id ,['method' => 'DELETE', 'route' => ['markup_tag.destroy', $tag->id]]) }}
|
||||
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i> {{ __('markup_tags.delete') }}</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@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
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
@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" />
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</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">{{ __('markup_tags.markup_tags') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('markup_tags.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
|
||||
<li class="active">{{ __('markup_tags.markup_tags') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('finance::markup_tags.menu')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('flash::message')
|
||||
<div class="white-box">
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('markup_tags.name') }}</th>
|
||||
<th>{{ __('markup_tags.percentage') }}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($markup_tags as $tag)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td><a href="{{ url('view_markup_drugs') }}/{{ $tag->id }}">{{ $tag->name }}</a> <small>({{ __('markup_tags.click_view_drug_list') }})</small></td>
|
||||
<td>{{ $tag->percentage }}%</td>
|
||||
<td>
|
||||
<a href="/markup_tag/{{ $tag->id }}/edit/" class="btn btn-info btn-sm"><i class="fa fa-pencil"></i> {{ __('markup_tags.edit') }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::model($tag->id ,['method' => 'DELETE', 'route' => ['markup_tag.destroy', $tag->id]]) }}
|
||||
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure?')"><i class="fa fa-trash"></i> {{ __('markup_tags.delete') }}</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@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
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<a href="{{ route('markup_tag.create') }}" class="nav-item btn btn-default ti-plus"> {{ __('markup_tags.create_markup_tag') }}</a>
|
||||
<a href="{{ route('markup_tag.index') }}" class="nav-item btn btn-default ti-pencil"> {{ __('markup_tags.view_markup_tag') }}</a>
|
||||
<a href="{{ route('markup_tag.inactive') }}" class="nav-item btn btn-default ti-pencil"> {{ __('markup_tags.activate_markup_tag') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
Executable
+98
@@ -0,0 +1,98 @@
|
||||
@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" />
|
||||
<style type="text/css">
|
||||
.color-bordered-table.success-bordered-table {
|
||||
border-top: 0px;
|
||||
}
|
||||
</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">{{ __('markup_tags.markup_tags') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('markup_tags.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('stores.index') }}">{{ __('markup_tags.stores') }}</a></li>
|
||||
<li class="active">{{ __('markup_tags.markup_tags') }}</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>{{ __('markup_tags.markup') }}</strong>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('markup_tags.name') }}</th>
|
||||
<th>{{ __('markup_tags.percentage') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr style="color: blue;">
|
||||
<td>{{ $tag->name }}</a></td>
|
||||
<td>{{ $tag->percentage }}%</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 5%">#</th>
|
||||
<th style="width: 45%">{{ __('markup_tags.name') }}</th>
|
||||
<th style="width: 25%">{{ __('markup_tags.cost_price') }}</th>
|
||||
<th style="width: 25%">{{ __('markup_tags.sell_price') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $counter = 1; @endphp
|
||||
@foreach($drugs as $drug)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>{{ $drug->name }}</td>
|
||||
<td>{{ ugandan_shillings($drug->cost_price) }}</td>
|
||||
<td>{{ ugandan_shillings($drug->non_insured_price) }}</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.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>
|
||||
@endpush
|
||||
Executable
+328
@@ -0,0 +1,328 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<style>
|
||||
.no-padding {
|
||||
padding: 0px;
|
||||
}
|
||||
</style>
|
||||
<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-4 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('general_settings.create_staff_payment_configuration') }} {!! (is_null($price_list_category_id) || $price_list_category_id == 0) ? "<font color='blue'>Cash</font>" : "<font color='blue'>".get_name(get_name($price_list_category_id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories')."</font>" !!}</h4>
|
||||
</div>
|
||||
<div class="col-lg-8 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('general_settings.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('staff_payment_configuration.index') }}">{{ __('general_settings.view_staff_payment_configurations') }}</a></li>
|
||||
<li class="active">{{ __('general_settings.create_staff_payment_configuration') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('flash::message')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::open(['route' => 'staff_payment_configuration.store']) }}
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
{{ Form::label('staff', 'Staff:') }}
|
||||
{{ Form::select('user_id', $users_array, '', ['class' => 'form-control', 'id' => 'staff_id']) }}
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
{{ Form::label('price_list', 'Price List:') }}
|
||||
<select name="price_list_category_id" class="form-control" id="price_list_id">
|
||||
<option value="0"> {{ __('general_settings.cash') }} </option>
|
||||
@foreach($price_list_categories as $record)
|
||||
<option value="{{ $record->id }}" {!! (!is_null($price_list_category_id) && $price_list_category_id == $record->id) ? 'selected' : '' !!}>{{ get_name($record->patient_category_id, 'id', 'name', 'patient_categories') }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
{{ Form::label('payment_type', 'Payment Type:') }}<br>
|
||||
{{ Form::radio('payment_type', 0, false, ['id'=> 'fixed_amount','onclick'=>'setRangeOrOptions()']) }} {{ __('general_settings.fixed_amount') }}
|
||||
{{ Form::radio('payment_type', 1, false, ['id'=> 'percentage','onclick'=>'setRangeOrOptions()']) }} {{ __('general_settings.percentage') }}
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<br>
|
||||
{{ Form::button('Change Price List',['type'=>'submit','class'=>'btn btn-success btn-rounded','name'=>'submit-btn','value'=>'change_pricing']) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<br>
|
||||
<h5><b>You are setting price for category :</b><font color='blue'> {!! (is_null($price_list_category_id) || $price_list_category_id == 0) ? "Cash" : get_name(get_name($price_list_category_id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories') !!}</font></h5>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active nav-item"> <a href="#procedures_section" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> Procedures</a> </li>
|
||||
<li role="presentation" class="nav-item"> <a href="#consultations_section" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> Consultation and services</a> </li>
|
||||
<li role="presentation" class="nav-item"> <a href="#investigations_section" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> Investigations</a> </li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="card-block">
|
||||
<div class="tab-content">
|
||||
<div id="procedures_section" class="tab-pane active">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Price</th>
|
||||
<th class="staff_fixed_amount">Staff Fee</th>
|
||||
<th style="display: none;" class="staff_percentage">Staff Percentage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($procedures) > 0)
|
||||
@foreach($procedures as $procedure)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $procedure->name }}
|
||||
</td>
|
||||
<td>
|
||||
@if(!is_null($price_list_category_id))
|
||||
@php
|
||||
$key = array_search($price_list_category_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
|
||||
|
||||
{{ ugandan_shillings($price_list_price) }}
|
||||
|
||||
<input type="hidden" name="selected_price_list_category_id" value="{{ $price_list_category_id }}">
|
||||
@else
|
||||
{{ ugandan_shillings($procedure->non_insured_price) }}
|
||||
@endif
|
||||
</td>
|
||||
<td class="staff_fixed_amount">
|
||||
{{ Form::hidden('procedure_id[]', $procedure->id) }}
|
||||
{{ Form::number('procedure_fee[]', '', ['class' => 'form-control']) }}
|
||||
</td>
|
||||
<td style="display: none" class="staff_percentage">
|
||||
{{ Form::number('procedure_percentage[]', '', ['class' => 'form-control', 'max' => '100']) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="consultations_section" class="tab-pane">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Price</th>
|
||||
<th class="staff_fixed_amount">Staff Fee</th>
|
||||
<th style="display: none;" class="staff_percentage">Staff Percentage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($services) > 0)
|
||||
@foreach($services as $service)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $service->name }}
|
||||
</td>
|
||||
<td>
|
||||
@if(!is_null($price_list_category_id))
|
||||
@php
|
||||
$key = array_search($price_list_category_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
|
||||
|
||||
{{ ugandan_shillings($price_list_price) }}
|
||||
|
||||
<input type="hidden" name="selected_price_list_category_id" value="{{ $price_list_category_id }}">
|
||||
@else
|
||||
{{ ugandan_shillings($service->cost_price) }}
|
||||
@endif
|
||||
</td>
|
||||
<td class="staff_fixed_amount">
|
||||
{{ Form::hidden('service_id[]', $service->id) }}
|
||||
{{ Form::number('service_fee[]', '', ['class' => 'form-control']) }}
|
||||
</td>
|
||||
<td style="display: none" class="staff_percentage">
|
||||
{{ Form::number('service_percentage[]', '', ['class' => 'form-control', 'max' => '100']) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="investigations_section" class="tab-pane">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Price</th>
|
||||
<th class="staff_fixed_amount">Staff Fee</th>
|
||||
<th style="display: none;" class="staff_percentage">Staff Percentage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($investigations) > 0)
|
||||
@foreach($investigations as $investigation)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $investigation->name }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if(!is_null($price_list_category_id))
|
||||
@php
|
||||
$key = array_search($price_list_category_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
|
||||
|
||||
{{ ugandan_shillings($price_list_price) }}
|
||||
|
||||
<input type="hidden" name="selected_price_list_category_id" value="{{ $price_list_category_id }}">
|
||||
@else
|
||||
{{ ugandan_shillings($investigation->non_insured_price) }}
|
||||
@endif
|
||||
</td>
|
||||
<td class="staff_fixed_amount">
|
||||
{{ Form::hidden('investigation_id[]', $investigation->id) }}
|
||||
{{ Form::number('investigation_fee[]', '', ['class' => 'form-control']) }}
|
||||
</td>
|
||||
<td style="display: none" class="staff_percentage">
|
||||
{{ Form::number('investigation_percentage[]', '', ['class' => 'form-control', 'max' => '100']) }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::button('Save Fees', ['type' => 'submit', 'name' => 'submit_fees', 'class' => 'btn btn-success', 'id' => 'save_fees']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
|
||||
<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/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/js/validator.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('#staff_id,#procedures,#investigations,#price_list_id').select2({
|
||||
placeholder: "Select",
|
||||
width: "100%"
|
||||
});
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
message: 'STAFF PAYMENTS'
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: 'STAFF PAYMENTS',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4, 5 ]
|
||||
},
|
||||
sheetName: 'STAFF PAYMENTS ON STREAMLINE'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: 'STAFF PAYMENTS',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4, 5 ]
|
||||
},
|
||||
customize: function(doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
}
|
||||
},
|
||||
{ extend: 'print',
|
||||
message: 'STAFF PAYMENTS',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4, 5 ]
|
||||
},
|
||||
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');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
function setRangeOrOptions() {
|
||||
if (document.getElementById("fixed_amount").checked) {
|
||||
$(".staff_fixed_amount").show();
|
||||
$(".staff_percentage").hide();
|
||||
}
|
||||
|
||||
if (document.getElementById("percentage").checked) {
|
||||
$(".staff_percentage").show();
|
||||
$(".staff_fixed_amount").hide();
|
||||
}
|
||||
}
|
||||
|
||||
$('#save_fees').click(function() {
|
||||
if (!$("input[name='payment_type']:checked").val() || $("#staff_id").val() == "") {
|
||||
alert('Please make sure you select the payment type and staff');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Executable
+555
@@ -0,0 +1,555 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
|
||||
<style>
|
||||
.no-padding {
|
||||
padding: 0px;
|
||||
}
|
||||
</style>
|
||||
<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-6 col-sm-6 col-xs-12">
|
||||
<h4 class="page-title">
|
||||
{{ __('general_settings.view_staff_payment_configurations') }} <font color="blue">{{ isset($searched_staff_name) ? $searched_staff_name : "" }}</font> {!! (is_null($price_list_category_id) || $price_list_category_id == 0) ? "" : " for <font color='blue'>".get_name(get_name($price_list_category_id, 'id', 'patient_category_id', 'price_list_categories'), 'id', 'name', 'patient_categories')."</font>" !!}
|
||||
|
||||
<!-- display cash category -->
|
||||
{!! $price_list_category_id == 0 ? "for <font color='blue'>Cash</font>" : "" !!}
|
||||
</h4>
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-6 col-md-6 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}">{{ __('general_settings.dashboard') }}</a></li>
|
||||
<li><a href="{{ route('staff_payment_configuration.create') }}">{{ __('general_settings.create_staff_payment_configuration') }}</a></li>
|
||||
<li class="active">{{ __('general_settings.view_staff_payment_configurations') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('flash::message')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
{{ Form::open(['method'=>'post','route' => 'staff_payment_configuration.search']) }}
|
||||
<div class="form-group">
|
||||
{{ Form::label('staff_id', 'Staff') }}
|
||||
{{ Form::select('staff_id', $users_array, null, ['class' => 'form-control', 'id' => 'staff_member', 'required']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('price_list', 'Price List:') }}
|
||||
<select name="price_list_category_id" class="form-control" id="price_list_id">
|
||||
<option value="0">{{ __('general_settings.cash') }}</option>
|
||||
@foreach($price_list_categories as $record)
|
||||
<option value="{{ $record->id }}">{{ get_name($record->patient_category_id, 'id', 'name', 'patient_categories') }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::submit('Submit', ['class'=>'btn btn-success pull-right']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
<div class="row">
|
||||
<div class="panel panel-default col-md-12">
|
||||
<div class="panel-body panel-primary">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active nav-item"> <a href="#procedures_section" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> Procedures</a> </li>
|
||||
<li role="presentation" class="nav-item"> <a href="#consultations_section" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> Consultation and services</a> </li>
|
||||
<li role="presentation" class="nav-item"> <a href="#investigations_section" class="nav-link" aria-controls="home" role="tab" data-toggle="tab" aria-expanded="true"> Investigations</a> </li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$counter = 0;
|
||||
$consultations_counter = 0;
|
||||
$invs_counter = 0;
|
||||
@endphp
|
||||
|
||||
<div class="card-block">
|
||||
<div class="tab-content">
|
||||
<div id="procedures_section" class="tab-pane active">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Price</th>
|
||||
<th class="staff_fixed_amount">Staff Fee</th>
|
||||
<th style="display: none;" class="staff_percentage">Staff Percentage</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- procedures -->
|
||||
@if(isset($search_complete))
|
||||
@if(count($staff_payment_configurations) > 0)
|
||||
@foreach($staff_payment_configurations as $config_record)
|
||||
@if($config_record->item_category == 1)
|
||||
@php
|
||||
$procedure = \Streamline\Models\Procedure::withTrashed()->find($config_record->item_id);
|
||||
@endphp
|
||||
|
||||
@if(!is_null($procedure))
|
||||
<tr>
|
||||
<td>
|
||||
{{ $procedure->name }}
|
||||
</td>
|
||||
<td>
|
||||
@if(!is_null($price_list_category_id) && $price_list_category_id != 0)
|
||||
@php
|
||||
$key = array_search($price_list_category_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
|
||||
|
||||
{{ ugandan_shillings($price_list_price) }}
|
||||
@else
|
||||
{{ ugandan_shillings($procedure->non_insured_price) }}
|
||||
@endif
|
||||
</td>
|
||||
<td @if(is_null($config_record->amount_fee)) style="display: none" @endif class="staff_fixed_amount">
|
||||
{{ Form::hidden('procedure_id[]', $procedure->id) }}
|
||||
{{ Form::number('procedure_fee[]', $config_record->amount_fee, ['class' => 'form-control', 'readonly', 'id' => 'procedures' . $counter]) }}
|
||||
</td>
|
||||
<td @if(is_null($config_record->amount_percentage)) style="display: none" @endif class="staff_percentage">
|
||||
Percentage
|
||||
{{ Form::number('procedure_percentage[]', $config_record->amount_percentage, ['class' => 'form-control', 'max' => '100', 'readonly']) }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="row" id="procedures_button_group{{$counter}}">
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-sm btn-info" onclick="edit_configuration({{ $counter }})">Edit</a>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-sm btn-danger" onclick="delete_staff_payment({{ $config_record->id }})">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="display: none" id="procedures_save_button{{$counter}}">
|
||||
<div class="col-md-12">
|
||||
<a class="btn btn-success btn-block" onclick="save_edited_staff_config({{ $config_record->id }})">Save</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@php $counter++; @endphp
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="consultations_section" class="tab-pane">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Price</th>
|
||||
<th class="staff_fixed_amount">Staff Fee</th>
|
||||
<th style="display: none;" class="staff_percentage">Staff Percentage</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(isset($search_complete))
|
||||
@if(count($staff_payment_configurations) > 0)
|
||||
@foreach($staff_payment_configurations as $config_record)
|
||||
@if($config_record->item_category == 3)
|
||||
@php
|
||||
$service = \Streamline\Models\Services::withTrashed()->find($config_record->item_id);
|
||||
@endphp
|
||||
|
||||
@if(!is_null($service))
|
||||
<tr>
|
||||
<td>
|
||||
{{ $service->name }}
|
||||
</td>
|
||||
<td>
|
||||
@if(!is_null($price_list_category_id) && $price_list_category_id != 0)
|
||||
@php
|
||||
$key = array_search($price_list_category_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
|
||||
|
||||
{{ ugandan_shillings($price_list_price) }}
|
||||
@else
|
||||
{{ ugandan_shillings($service->cost_price) }}
|
||||
@endif
|
||||
</td>
|
||||
<td @if(is_null($config_record->amount_fee)) style="display: none" @endif class="staff_fixed_amount">
|
||||
{{ Form::hidden('service_id[]', $service->id) }}
|
||||
{{ Form::number('service_fee[]', $config_record->amount_fee, ['class' => 'form-control', 'readonly','id' => 'consultations' . $consultations_counter]) }}
|
||||
</td>
|
||||
<td @if(is_null($config_record->amount_percentage)) style="display: none" @endif class="staff_percentage">
|
||||
{{ Form::number('service_percentage[]', $config_record->amount_percentage, ['class' => 'form-control', 'max' => '100', 'readonly']) }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="row" id="consultations_button_group{{$consultations_counter}}">
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-sm btn-info" onclick="edit_consultation_configuration({{ $consultations_counter }})">Edit</a>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-sm btn-danger" onclick="delete_consultation_staff_payment({{ $config_record->id }})">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="display: none" id="consultations_save_button{{$consultations_counter}}">
|
||||
<div class="col-md-12">
|
||||
<a class="btn btn-success btn-block" onclick="save_edited_consultation_staff_config({{ $config_record->id }})">Save</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endif
|
||||
@php $consultations_counter++; @endphp
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="investigations_section" class="tab-pane">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped color-bordered-table success-bordered-table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Price</th>
|
||||
<th class="staff_fixed_amount">Staff Fee</th>
|
||||
<th style="display: none;" class="staff_percentage">Staff Percentage</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(isset($search_complete))
|
||||
@if(count($staff_payment_configurations) > 0)
|
||||
@foreach($staff_payment_configurations as $config_record)
|
||||
@if($config_record->item_category == 2)
|
||||
@php
|
||||
$investigation = \Streamline\Models\Investigation::withTrashed()->find($config_record->item_id);
|
||||
@endphp
|
||||
|
||||
@if(!is_null($investigation))
|
||||
<tr>
|
||||
<td>
|
||||
{{ $investigation->name }}
|
||||
</td>
|
||||
<td>
|
||||
@if(!is_null($price_list_category_id) && $price_list_category_id != 0)
|
||||
@php
|
||||
$key = array_search($price_list_category_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
|
||||
|
||||
{{ ugandan_shillings($price_list_price) }}
|
||||
@else
|
||||
{{ ugandan_shillings($investigation->non_insured_price) }}
|
||||
@endif
|
||||
</td>
|
||||
<td @if(is_null($config_record->amount_fee)) style="display: none" @endif class="staff_fixed_amount">
|
||||
{{ Form::hidden('investigation_id[]', $investigation->id) }}
|
||||
{{ Form::number('investigation_fee[]', $config_record->amount_fee, ['class' => 'form-control', 'readonly','id' => 'investigations' . $invs_counter]) }}
|
||||
</td>
|
||||
<td @if(is_null($config_record->amount_percentage)) style="display: none" @endif class="staff_percentage">
|
||||
{{ Form::number('investigation_percentage[]', $config_record->amount_percentage, ['class' => 'form-control', 'max' => '100', 'readonly']) }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="row" id="investigations_button_group{{$invs_counter}}">
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-sm btn-info" onclick="edit_investigation_configuration({{ $invs_counter }})">Edit</a>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-sm btn-danger" onclick="delete_investigation_staff_payment({{ $config_record->id }})">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="display: none" id="investigations_save_button{{$counter}}">
|
||||
<div class="col-md-12">
|
||||
<a class="btn btn-success btn-block" onclick="save_edited_investigation_staff_config({{ $config_record->id }})">Save</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endif
|
||||
@php $invs_counter++; @endphp
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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/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/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/js/validator.js') }}"></script>
|
||||
|
||||
<script>
|
||||
// is there any config under edit 0 - no, any other is the id
|
||||
let is_edit_active = 0;
|
||||
|
||||
$('#staff_id,#procedures,#investigations,#staff_member').select2({
|
||||
placeholder: "Select",
|
||||
width: "100%"
|
||||
});
|
||||
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
message: 'STAFF PAYMENTS'
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: 'STAFF PAYMENTS',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4, 5 ]
|
||||
},
|
||||
sheetName: 'STAFF PAYMENTS ON STREAMLINE'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: 'STAFF PAYMENTS',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4, 5 ]
|
||||
},
|
||||
customize: function(doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
}
|
||||
},
|
||||
{ extend: 'print',
|
||||
message: 'STAFF PAYMENTS',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 4, 5 ]
|
||||
},
|
||||
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');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
function setRangeOrOptions() {
|
||||
if (document.getElementById("fixed_amount").checked) {
|
||||
$(".staff_fixed_amount").show();
|
||||
$(".staff_percentage").hide();
|
||||
}
|
||||
|
||||
if (document.getElementById("percentage").checked) {
|
||||
$(".staff_percentage").show();
|
||||
$(".staff_fixed_amount").hide();
|
||||
}
|
||||
}
|
||||
|
||||
function delete_staff_payment(config_id) {
|
||||
if (confirm("Are you sure you want to delete this record?")) {
|
||||
$.ajax({
|
||||
url: '/delete_staff_configuration',
|
||||
data: {'config_id':config_id},
|
||||
success: function(response){
|
||||
if (response == 1) {
|
||||
alert("Staff configuration record has been deleted");
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert("Staff configuration record deletion failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function edit_configuration(id) {
|
||||
if (is_edit_active === 0) {
|
||||
is_edit_active = id;
|
||||
} else {
|
||||
$(".under_edit").attr("readonly", true);
|
||||
$("#procedures" + is_edit_active).removeClass('under_edit');
|
||||
$('#procedures_button_group' + is_edit_active).show();
|
||||
$('#procedures_save_button' + is_edit_active).hide();
|
||||
}
|
||||
|
||||
$('#procedures_save_button' + id).show();
|
||||
$('#procedures_button_group' + id).hide();
|
||||
$("#procedures" + id).attr("readonly", false);
|
||||
$("#procedures" + id).addClass('under_edit');
|
||||
}
|
||||
|
||||
function save_edited_staff_config(config_id) {
|
||||
let amount_fee = $("#procedures" + is_edit_active).val();
|
||||
$.ajax({
|
||||
url: '/edit_staff_configuration',
|
||||
data: {'config_id':config_id, 'amount_fee':amount_fee},
|
||||
success: function(response){
|
||||
if (response == 1) {
|
||||
alert("Staff configuration record has been edited");
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert("Staff configuration record editing failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function delete_consultation_staff_payment(config_id) {
|
||||
if (confirm("Are you sure you want to delete this record?")) {
|
||||
$.ajax({
|
||||
url: '/delete_staff_configuration',
|
||||
data: {'config_id':config_id},
|
||||
success: function(response){
|
||||
if (response == 1) {
|
||||
alert("Staff configuration record has been deleted");
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert("Staff configuration record deletion failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function edit_consultation_configuration(id) {
|
||||
if (is_edit_active === 0) {
|
||||
is_edit_active = id;
|
||||
} else {
|
||||
$(".under_edit").attr("readonly", true);
|
||||
$("#consultations" + is_edit_active).removeClass('under_edit');
|
||||
$('#consultations_button_group' + is_edit_active).show();
|
||||
$('#consultations_save_button' + is_edit_active).hide();
|
||||
}
|
||||
|
||||
$('#consultations_save_button' + id).show();
|
||||
$('#consultations_button_group' + id).hide();
|
||||
$("#consultations" + id).attr("readonly", false);
|
||||
$("#consultations" + id).addClass('under_edit');
|
||||
}
|
||||
|
||||
function save_edited_consultation_staff_config(config_id) {
|
||||
let amount_fee = $("#consultations" + is_edit_active).val();
|
||||
$.ajax({
|
||||
url: '/edit_staff_configuration',
|
||||
data: {'config_id':config_id, 'amount_fee':amount_fee},
|
||||
success: function(response){
|
||||
if (response == 1) {
|
||||
alert("Staff configuration record has been edited");
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert("Staff configuration record editing failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function delete_investigation_staff_payment(config_id) {
|
||||
if (confirm("Are you sure you want to delete this record?")) {
|
||||
$.ajax({
|
||||
url: '/delete_staff_configuration',
|
||||
data: {'config_id':config_id},
|
||||
success: function(response){
|
||||
if (response == 1) {
|
||||
alert("Staff configuration record has been deleted");
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert("Staff configuration record deletion failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function edit_investigation_configuration(id) {
|
||||
if (is_edit_active === 0) {
|
||||
is_edit_active = id;
|
||||
} else {
|
||||
$(".under_edit").attr("readonly", true);
|
||||
$("#investigations" + is_edit_active).removeClass('under_edit');
|
||||
$('#investigations_button_group' + is_edit_active).show();
|
||||
$('#investigations_save_button' + is_edit_active).hide();
|
||||
}
|
||||
|
||||
$('#investigations_save_button' + id).show();
|
||||
$('#investigations_button_group' + id).hide();
|
||||
$("#investigations" + id).attr("readonly", false);
|
||||
$("#investigations" + id).addClass('under_edit');
|
||||
}
|
||||
|
||||
function save_edited_investigation_staff_config(config_id) {
|
||||
let amount_fee = $("#investigations" + is_edit_active).val();
|
||||
$.ajax({
|
||||
url: '/edit_staff_configuration',
|
||||
data: {'config_id':config_id, 'amount_fee':amount_fee},
|
||||
success: function(response){
|
||||
if (response == 1) {
|
||||
alert("Staff configuration record has been edited");
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert("Staff configuration record editing failed");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+382
@@ -0,0 +1,382 @@
|
||||
@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/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-6 col-md-7 col-sm-7 col-xs-12">
|
||||
<h4 class="page-title">{{ __('general_settings.payments_report') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-5 col-md-5 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">{{ __('general_settings.payments_report') }}</li>
|
||||
@if(Auth::user()->can('record-staff-service-performance'))
|
||||
<li><a href="{{ url('record_staff_service_performance') }}">Record staff performance</a></li>
|
||||
@endif
|
||||
<li><a href="{{ url('finance') }}">Finance Home</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('flash::message')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{{ Form::open(['route' => 'staff_payments.payments_report' , 'data-toggle' => 'validator']) }}
|
||||
<div class="white-box">
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
{{ Form::label('report_by', __('general_settings.report_by')) }}
|
||||
{{ Form::select('report_by', ['' => __('ward_consumption.select'), 1 => __('general_settings.staff'), 2 => __('general_settings.services')], '', ['class' => 'form-control', 'id'=>'report_by', 'required']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div id="staff_div" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('staff', __('general_settings.staff')) }}
|
||||
{{ Form::select('staff', $users_array, '', ['class' => 'form-control col-sm-12', 'id' => 'staff_select']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="services_div" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('services_rendered_id', __('general_settings.services')) }}
|
||||
{{ Form::select('services_rendered_id', $services_rendered_array, '', ['class' => 'form-control col-sm-12', 'id' => 'services_select']) }}
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group" id="searchby">
|
||||
{{ Form::label('search_by', __('ward_consumption.date')) }}
|
||||
{{ Form::select('search_by', ['0'=>__('ward_consumption.last_24_hours'),'1'=>__('ward_consumption.custom_date'),'2'=>__('ward_consumption.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', __('ward_consumption.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', __('ward_consumption.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-2">
|
||||
<br>
|
||||
{{ Form::button(__('ward_consumption.search'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($search_complete)
|
||||
@if($report_by == 1)
|
||||
<!-- show the report based on staff -->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
<!-- show the lable -->
|
||||
<div><h3 style="color: blue">{{ $search_text }}</h3></div>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Staff</th>
|
||||
<th>Amount</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$grand_total = 0;
|
||||
$counter = 1;
|
||||
@endphp
|
||||
|
||||
@if(count($staff_performed_items_array) > 0)
|
||||
@foreach($staff_performed_items_array as $staff_id => $amount)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>
|
||||
{{ get_full_name($staff_id, "id", "first_name", "last_name", "users") }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings((int)$amount) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::open(['route' => 'staff_payments.payments_details_report']) }}
|
||||
{{ Form::hidden('details_report_by', $details_report_by) }}
|
||||
{{ Form::hidden('details_staff', $staff_id) }}
|
||||
{{ Form::hidden('details_services_rendered_id', $details_services_rendered_id) }}
|
||||
{{ Form::hidden('details_search_by', $details_search_by) }}
|
||||
{{ Form::hidden('details_reg_date', $details_reg_date) }}
|
||||
{{ Form::hidden('details_start_date', $details_start_date) }}
|
||||
{{ Form::hidden('details_end_date', $details_end_date) }}
|
||||
<button type="submit" class="btn btn-success">Details</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@php
|
||||
$grand_total += $amount;
|
||||
$counter++;
|
||||
@endphp
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<td></td>
|
||||
<td><strong>Total</strong></td>
|
||||
<td><strong>{{ ugandan_shillings((int)$grand_total) }}</strong></td>
|
||||
<td></td>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@elseif($report_by == 2)
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
<!-- show the label for search -->
|
||||
<div><h3 style="color: blue">{{ $search_text }}</h3></div>
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Category</th>
|
||||
<th>Amount</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$grand_total = 0;
|
||||
$counter = 1;
|
||||
@endphp
|
||||
|
||||
@if(count($staff_performed_items_array) > 0)
|
||||
@foreach($staff_performed_items_array as $item_category => $amount)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>
|
||||
@if($item_category == 1)
|
||||
Procedures
|
||||
@elseif($item_category == 2)
|
||||
Investigations
|
||||
@elseif($item_category == 3)
|
||||
Consultations
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings((int)$amount) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ Form::open(['route' => 'staff_payments.payments_details_report']) }}
|
||||
{{ Form::hidden('details_report_by', $details_report_by) }}
|
||||
{{ Form::hidden('details_staff', $details_staff) }}
|
||||
{{ Form::hidden('details_services_rendered_id', $item_category) }}
|
||||
{{ Form::hidden('details_search_by', $details_search_by) }}
|
||||
{{ Form::hidden('details_reg_date', $details_reg_date) }}
|
||||
{{ Form::hidden('details_start_date', $details_start_date) }}
|
||||
{{ Form::hidden('details_end_date', $details_end_date) }}
|
||||
<button type="submit" class="btn btn-success">Details</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
</tr>
|
||||
@php
|
||||
$grand_total += $amount;
|
||||
$counter++;
|
||||
@endphp
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><strong>Total</strong></td>
|
||||
<td><strong>{{ ugandan_shillings((int)$grand_total) }}</strong></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
@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 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>
|
||||
$(document).ready(function() {
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
footer: true,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
footer: true,
|
||||
message: '<?php echo __('general_settings.staff_payments_report');?>'
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: '<?php echo __('general_settings.staff_payments_report');?>',
|
||||
footer: true,
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
|
||||
},
|
||||
sheetName: '<?php echo __('general_settings.staff_payments_report');?>'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: '<?php echo __('general_settings.staff_payments_report');?>',
|
||||
footer: true,
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
|
||||
},
|
||||
customize: function(doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
// doc.styles.tableHeader.alignment = 'left';
|
||||
}
|
||||
},
|
||||
{ extend: 'print',
|
||||
message: '<?php echo __('general_settings.staff_payments_report');?>',
|
||||
footer: true,
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4, 5, 6 ]
|
||||
},
|
||||
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: 'yyyy-mm-dd'
|
||||
});
|
||||
|
||||
$('#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();
|
||||
}
|
||||
});
|
||||
|
||||
$('#start_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy/mm/dd',
|
||||
orientation: 'bottom'
|
||||
});
|
||||
|
||||
$('#end_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'yyyy/mm/dd',
|
||||
orientation: 'bottom'
|
||||
});
|
||||
|
||||
$('#report_by').change(function () {
|
||||
if ($(this).val() == 1) {
|
||||
$('#staff_div').show();
|
||||
$('#services_div').hide();
|
||||
//$('.select2-selection.select2-selection--single').css('height','calc(3.85rem)');
|
||||
$('.select2-selection.select2-selection--single').css('max-width','100%');
|
||||
$('.select2-selection.select2-selection--single').css('padding','7px 12px');
|
||||
}
|
||||
else if ($(this).val() == 2) {
|
||||
$('#services_div').show();
|
||||
$('#staff_div').hide();
|
||||
}
|
||||
else {
|
||||
$('#staff_div,#services_div').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#services_select,#staff_select').select2({
|
||||
placeholder: "-- select --",
|
||||
width: "100%"
|
||||
});
|
||||
|
||||
$('.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');
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+336
@@ -0,0 +1,336 @@
|
||||
@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/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-6 col-md-7 col-sm-7 col-xs-12">
|
||||
<h4 class="page-title">{{ __('general_settings.payments_report_details') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-5 col-md-5 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('staff_payments.payments_report') }}">{{ __('general_settings.payments_report') }}</a></li>
|
||||
<li class="active">{{ __('general_settings.payments_report_details') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('flash::message')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- show the report based on staff -->
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="white-box">
|
||||
{!! $search_string ?? $search_string !!}
|
||||
<!-- show the lable -->
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{{ __('general_settings.patient_name') }}</th>
|
||||
<th>{{ __('general_settings.patient_category') }}</th>
|
||||
<th>{{ __('general_settings.staff_payment_status') }}</th>
|
||||
<th>{{ __('general_settings.patient_payment_status') }}</th>
|
||||
<th>{{ __('general_settings.date') }}</th>
|
||||
<th>{{ __('general_settings.item_name') }}</th>
|
||||
<th>{{ __('general_settings.item_price') }}</th>
|
||||
<th>{{ __('general_settings.staff_name') }}</th>
|
||||
<th>{{ __('general_settings.amount_for_staff') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$grand_staff_amount_total = 0;
|
||||
$grand_prices_amount_total = 0;
|
||||
$counter = 1;
|
||||
@endphp
|
||||
|
||||
@if(count($staff_performed_services) > 0)
|
||||
@foreach($staff_performed_services as $record)
|
||||
@php
|
||||
if ($record->item_category == 1){
|
||||
$procedure = \Streamline\Models\Procedure::withTrashed()->find($record->item_id);
|
||||
$non_insured_price = $procedure->non_insured_price;
|
||||
$item_name = $procedure->name;
|
||||
}elseif ($record->item_category == 2){
|
||||
$investigation = \Streamline\Models\Investigation::withTrashed()->find($record->item_id);
|
||||
$non_insured_price = $investigation->non_insured_price;
|
||||
$item_name = $investigation->name;
|
||||
}elseif ($record->item_category == 3){
|
||||
$service = \Streamline\Models\Services::withTrashed()->find($record->item_id);
|
||||
$non_insured_price = $service->cost_price;
|
||||
$item_name = $service->name;
|
||||
}
|
||||
@endphp
|
||||
|
||||
<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>
|
||||
{{ get_name(get_name($record->patient_id, "id", "category_id", "patients"), "id", "name", "patient_categories") }}
|
||||
</td>
|
||||
<td>
|
||||
@if($record->is_staff_paid == 0)
|
||||
<font color='red'>{{ __('investigations.not_paid') }}</font>
|
||||
@else
|
||||
<font color='green'>{{ __('investigations.paid') }}</font>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if(is_null($record->patient_receipt_number))
|
||||
<font color='red'>{{ __('investigations.not_paid') }}</font>
|
||||
@else
|
||||
<font color='green'>{{ __('investigations.paid') }}</font>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ streamline_date($record->created_at) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $item_name }}
|
||||
</td>
|
||||
<td>
|
||||
@php
|
||||
//handle previous records b4 i added performace fee column
|
||||
$item_price = 0;
|
||||
if(is_null($record->item_price)){
|
||||
$item_price = $non_insured_price;
|
||||
} else {
|
||||
$item_price = $record->item_price;
|
||||
}
|
||||
@endphp
|
||||
|
||||
{{ ugandan_shillings((int)$item_price) }}
|
||||
|
||||
@php
|
||||
$grand_prices_amount_total += $item_price;
|
||||
@endphp
|
||||
</td>
|
||||
<td>
|
||||
{{ get_full_name($record->performed_by, "id", "first_name", "last_name", "users") }}
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
//$staff_fee_amount = $record->performance_fee;
|
||||
//handle previous records b4 i added performace fee column
|
||||
if(is_null($record->performance_fee)){
|
||||
if ($report_based_on_staff_or_category == 1 /*staff*/) {
|
||||
$staff_fee_amount = get_fee_owed_to_staff_for_perfomed_service($record->item_id, $record->item_category, $record->performed_by);
|
||||
}
|
||||
|
||||
if ($report_based_on_staff_or_category == 2 /*item_categ*/) {
|
||||
$staff_fee_amount = get_fee_owed_to_staff_for_perfomed_service_based_on_category($record->item_id, $record->performed_by, $record->item_category);
|
||||
}
|
||||
|
||||
$staff_fee_amount = is_numeric($staff_fee_amount) ? $staff_fee_amount : 0;
|
||||
} else {
|
||||
$staff_fee_amount = $record->performance_fee;
|
||||
}
|
||||
|
||||
$grand_staff_amount_total += $staff_fee_amount;
|
||||
?>
|
||||
|
||||
{{ ugandan_shillings((int)$staff_fee_amount) }}
|
||||
</td>
|
||||
</tr>
|
||||
@php
|
||||
$counter++;
|
||||
@endphp
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if (count($ward_procedures_records) > 0)
|
||||
@foreach ($ward_procedures_records as $ward_procedure)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>
|
||||
{{ get_full_name($ward_procedure->patient_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($ward_procedure->patient_id, "id", "number", "patients") }})
|
||||
</td>
|
||||
<td>
|
||||
{{ get_name(get_name($ward_procedure->patient_id, "id", "category_id", "patients"), "id", "name", "patient_categories") }}
|
||||
</td>
|
||||
<td>
|
||||
<span class="label label-info">{{ get_name($ward_procedure->ward_id, "id", "name", "wards") }}</span>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
{{ streamline_date($ward_procedure->created_at) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ get_name($ward_procedure->procedure_id, "id", "name", "procedures") }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($ward_procedure->hospital_fee + $ward_procedure->staff_fee) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ get_full_name($ward_procedure->performed_by, "id", "first_name", "last_name", "users") }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings((int)$ward_procedure->staff_fee) }}
|
||||
</td>
|
||||
</tr>
|
||||
@php
|
||||
$ward_procedure_cost = $ward_procedure->hospital_fee + $ward_procedure->staff_fee;
|
||||
$grand_prices_amount_total += $ward_procedure_cost;
|
||||
$grand_staff_amount_total += $ward_procedure->staff_fee;
|
||||
$counter++;
|
||||
@endphp
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if (count($ward_services_records) > 0)
|
||||
@foreach ($ward_services_records as $ward_service)
|
||||
<tr>
|
||||
<td>{{ $counter }}</td>
|
||||
<td>
|
||||
{{ get_full_name($ward_service->patient_id, "id", "first_name", "last_name", "patients") }} ({{ get_name($ward_service->patient_id, "id", "number", "patients") }})
|
||||
</td>
|
||||
<td>
|
||||
{{ get_name(get_name($ward_service->patient_id, "id", "category_id", "patients"), "id", "name", "patient_categories") }}
|
||||
</td>
|
||||
<td>
|
||||
<span class="label label-info">{{ get_name($ward_service->ward_id, "id", "name", "wards") }}</span>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
{{ streamline_date($ward_service->created_at) }}
|
||||
</td>
|
||||
@php
|
||||
$service_consumed = $ward_service->service_id;
|
||||
$performed_by = null;
|
||||
if (str_contains($service_consumed, '__')){
|
||||
$service_and_performed_by_array = explode("__", $service_consumed);
|
||||
$service_id = $service_and_performed_by_array[0];
|
||||
$performed_by = $service_and_performed_by_array[1];
|
||||
} else{
|
||||
$service_id = $service_consumed;
|
||||
}
|
||||
@endphp
|
||||
<td>
|
||||
{{ get_name($service_id, "id", "name", "services") }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings($ward_service->unit_price) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ get_full_name($performed_by, "id", "first_name", "last_name", "users") }}
|
||||
</td>
|
||||
<td>
|
||||
{{ ugandan_shillings((int)$ward_service->staff_fee) }}
|
||||
</td>
|
||||
</tr>
|
||||
@php
|
||||
$ward_service_cost = $ward_service->unit_price;
|
||||
$grand_prices_amount_total += $ward_service_cost;
|
||||
$grand_staff_amount_total += $ward_service->staff_fee;
|
||||
$counter++;
|
||||
@endphp
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<td></td>
|
||||
<td><strong>Total</strong></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><strong>{{ ugandan_shillings($grand_prices_amount_total) }}</strong></td>
|
||||
<td></td>
|
||||
<td><strong>{{ ugandan_shillings($grand_staff_amount_total) }}</strong></td>
|
||||
</tfoot>
|
||||
</table>
|
||||
</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 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>
|
||||
$(document).ready(function() {
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
footer: true,
|
||||
buttons: [
|
||||
'copy',
|
||||
{ extend: 'csv',
|
||||
footer: true,
|
||||
message: '<?php echo __('general_settings.staff_payments_report');?>'
|
||||
},
|
||||
{ extend: 'excel',
|
||||
message: '<?php echo __('general_settings.staff_payments_report');?>',
|
||||
footer: true,
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
|
||||
},
|
||||
sheetName: '<?php echo __('general_settings.staff_payments_report');?>'
|
||||
},
|
||||
{ extend: 'pdf',
|
||||
message: '<?php echo __('general_settings.staff_payments_report');?>',
|
||||
footer: true,
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LETTER',
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
|
||||
},
|
||||
customize: function(doc) {
|
||||
doc.defaultStyle.fontSize = 10;
|
||||
}
|
||||
},
|
||||
{ extend: 'print',
|
||||
message: '<?php echo __('general_settings.staff_payments_report');?>',
|
||||
footer: true,
|
||||
exportOptions: {
|
||||
columns: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
|
||||
},
|
||||
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');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('.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');
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+478
@@ -0,0 +1,478 @@
|
||||
@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/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-6 col-md-7 col-sm-7 col-xs-12">
|
||||
<h4 class="page-title">Record performed services</h4>
|
||||
</div>
|
||||
<div class="col-lg-6 col-sm-5 col-md-5 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">Record performed services</li>
|
||||
<li><a href="{{ url('staff_payments_report') }}">Staff payments report</a></li>
|
||||
<li><a href="{{ url('finance') }}">Finance Home</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
@include('flash::message')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="white-box">
|
||||
{{ Form::open(['method'=>'post','url' => 'store_recorded_performed_service']) }}
|
||||
|
||||
@php $patient_insurance_status = patient_insurance_status($patient_id); @endphp
|
||||
|
||||
{{ Form::hidden('patient_id', $patient_id, ['id' => 'patient_id'])}}
|
||||
{{ Form::hidden('patient_insurance_status', $patient_insurance_status, ['id' => 'patient_insurance_status'])}}
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-md-12'>
|
||||
<div id='payments_items'>
|
||||
<table class='table color-bordered-table success-bordered-table'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<div class='row'>
|
||||
<div class='col-2'>Item Category</div>
|
||||
<div class='col-2'>Performed Item</div>
|
||||
<div class='col-1'>Item Unit Price</div>
|
||||
<div class='col-1'>Item Total Price</div>
|
||||
<div class='col-1'>Quantity</div>
|
||||
<div class='col-2'>Performed By</div>
|
||||
<div class='col-2'>Performance Fee</div>
|
||||
<div class='col-1'></div>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@php
|
||||
$option_employees = "<option value=''>-select-</option>";
|
||||
foreach ($employees as $employee){
|
||||
$employee_first_name = str_replace("'", '', $employee->first_name);
|
||||
$employee_first_name = str_replace("\"", '', $employee_first_name);
|
||||
$employee_last_name = str_replace("'", '', $employee->last_name);
|
||||
$employee_last_name = str_replace("\"", '', $employee_last_name);
|
||||
$option_employees .= "<option value='$employee->id'>$employee_first_name $employee_last_name</option>";
|
||||
}
|
||||
|
||||
$option_procedures = "<option value=''>-select-</option>";
|
||||
foreach ($procedures as $procedure){
|
||||
$procedure_name = str_replace("'", '', $procedure->name);
|
||||
$procedure_name = str_replace("\"", '', $procedure_name);
|
||||
$procedure_name = preg_replace('/[^A-Za-z0-9\-]/', '', $procedure_name);
|
||||
$option_procedures .= "<option value='$procedure->id'>$procedure_name</option>";
|
||||
}
|
||||
|
||||
$option_investigations = "<option value=''>-select-</option>";
|
||||
foreach ($investigations as $investigation){
|
||||
$inv_name = str_replace("'", '', $investigation->name);
|
||||
$inv_name = str_replace("\"", '', $inv_name);
|
||||
$inv_name = preg_replace('/[^A-Za-z0-9\-]/', '', $inv_name);
|
||||
$option_investigations .= "<option value='$investigation->id'>$inv_name</option>";
|
||||
}
|
||||
|
||||
$option_services = "<option value=''>-select-</option>";
|
||||
foreach ($services as $service){
|
||||
$service_name = str_replace("'", '', $service->name);
|
||||
$service_name = str_replace("\"", '', $service_name);
|
||||
$service_name = str_replace("+", '', $service_name);
|
||||
$service_name = preg_replace('/[^A-Za-z0-9\-]/', '', $service_name);
|
||||
$option_services .= "<option value='$service->id'>$service_name</option>";
|
||||
}
|
||||
|
||||
$option_sundries = "<option value=''>-select-</option>";
|
||||
foreach ($sundries as $sundry){
|
||||
$sundry_name = str_replace("'", '', $sundry->name);
|
||||
$sundry_name = str_replace("\"", '', $sundry_name);
|
||||
$sundry_name = preg_replace('/[^A-Za-z0-9\-]/', '', $sundry_name);
|
||||
$option_sundries .= "<option value='$sundry->id'>$sundry->name</option>";
|
||||
}
|
||||
@endphp
|
||||
|
||||
<tbody class='input_fields_wrap'>
|
||||
<tr>
|
||||
<td>
|
||||
<div class='row'>
|
||||
<div class='col-2'>
|
||||
<div class='control-group'>
|
||||
<div class='form-group'>
|
||||
<select name='item_category[]' id='item_category_0' class='form-control compulsory required item_category_select' required>
|
||||
<option value=''>-Select-</option>
|
||||
<option value='1'>Procedure</option>
|
||||
<option value='2'>Investigation</option>
|
||||
<option value='3'>Service Or Consultation</option>
|
||||
<option value='4'>Sundry</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-2'>
|
||||
<div class='form-group'>
|
||||
<div class='controls' id="investigations_div_0">
|
||||
<select name='performed_investigation_item[]' id='performed_inv_item_0' class='form-control compulsory required performed_item_select'>
|
||||
@php echo $option_investigations; @endphp
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class='controls' id="procedures_div_0" style="display: none;">
|
||||
<select name='performed_procedure_item[]' id='performed_pro_item_0' class='form-control compulsory required performed_item_select'>
|
||||
@php echo $option_procedures; @endphp
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class='controls' id="services_div_0" style="display: none;">
|
||||
<select name='performed_service_item[]' id='performed_serv_item_0' class='form-control compulsory required performed_item_select'>
|
||||
@php echo $option_services; @endphp
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class='controls' id="sundries_div_0" style="display: none;">
|
||||
<select name='performed_sundry_item[]' id='performed_sundry_item_0' class='form-control compulsory required performed_item_select'>
|
||||
@php echo $option_sundries; @endphp
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-1'>
|
||||
<div class='form-group'>
|
||||
<div class='controls'>
|
||||
<input type='number' name='item_price[]' id='item_price_0' class='form-control item_price compulsory' required/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-1'>
|
||||
<div class='form-group'>
|
||||
<div class='controls'>
|
||||
<input type='number' name='item_total_price[]' id='item_total_price_0' class='form-control item_total_price compulsory' required readonly/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-1'>
|
||||
<div class='form-group'>
|
||||
<div class='controls'>
|
||||
<input type='number' name='item_quantity[]' id='item_quantity_0' class='form-control item_quantity compulsory' required/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-2'>
|
||||
<div class='control-group'>
|
||||
<div id='performed_by_div_0' class='form-group'>
|
||||
<select name='performed_by_id[]' id='performed_by_0' class='form-control performed_by_select'>
|
||||
@php echo $option_employees; @endphp
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-2'>
|
||||
<div class='control-group'>
|
||||
<div id='performance_fee_0' class='form-group name_select'>
|
||||
<input name='performance_fee[]' id='performance_fee_0' class='form-control item_select'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='col-1'>
|
||||
<div class='form-group' style='margin-top: 10px;'>
|
||||
<button class='btn btn-sm btn-rounded btn-success add_item' style='color: white; margin-left: 25px;'><i class='fa fa-plus'></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class='row'>
|
||||
<div style="float: right;">
|
||||
<h3>Total:<span id="itemGrandTotal"></span></h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-md-9'>
|
||||
</div>
|
||||
<div class='col-md-3'>
|
||||
<button class='btn btn-rounded btn-info pull-right' id='save_performances_action' name='save_performances_action' value='save'>Save Performances</button>
|
||||
</div>
|
||||
</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 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>
|
||||
var max_rows = 20;
|
||||
var wrapper = $(".input_fields_wrap"); //Fields wrapper
|
||||
var add_button = $(".add_item");
|
||||
|
||||
var x = 1; // initial row count
|
||||
|
||||
add_button.click(function (e) { // on add input button click
|
||||
e.preventDefault();
|
||||
if (x < max_rows) {
|
||||
$(wrapper).append("\
|
||||
\<tr>\
|
||||
<td>\
|
||||
<div class='row'>\
|
||||
\
|
||||
<div class='col-2'>\
|
||||
<div class='control-group'>\
|
||||
<div class='form-group'>\
|
||||
<select name='item_category[]' id='item_category_" + x + "' class='form-control compulsory required item_category_select' required><option value=''>-Select-</option><option value='1'>Procedure</option><option value='2'>Investigation</option><option value='3'>Service Or Consultation</option><option value='4'>Sundry</option>" +
|
||||
"</select>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
\
|
||||
<div class='col-2'>\
|
||||
<div class='form-group'>\
|
||||
<div class='controls' id='investigations_div_" + x + "'>\
|
||||
<div id='performed_item_div_" + x + "' class='form-group'>\
|
||||
<select name='performed_investigation_item[]' id='performed_inv_item_" + x + "' class='form-control compulsory required performed_item_select'>" +
|
||||
"<?php echo $option_investigations ?>" +
|
||||
"</select>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class='controls' id='procedures_div_" + x + "' style='display:none;'>\
|
||||
<div id='performed_item_div_" + x + "' class='form-group'>\
|
||||
<select name='performed_procedure_item[]' id='performed_pro_item_" + x + "' class='form-control compulsory required performed_item_select'>" +
|
||||
"<?php echo $option_procedures ?>" +
|
||||
"</select>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class='controls' id='services_div_" + x + "' style='display:none;'>\
|
||||
<div id='performed_item_div_" + x + "' class='form-group'>\
|
||||
<select name='performed_service_item[]' id='performed_serv_item_" + x + "' class='form-control compulsory required performed_item_select'>" +
|
||||
"<?php echo $option_services ?>" +
|
||||
"</select>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class='controls' id='sundries_div_" + x + "' style='display:none;'>\
|
||||
<div id='performed_item_div_" + x + "' class='form-group'>\
|
||||
<select name='performed_sundry_item[]' id='performed_sundry_item_" + x + "' class='form-control compulsory required performed_item_select'>" +
|
||||
"<?php echo $option_sundries ?>" +
|
||||
"</select>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
\
|
||||
<div class='col-1'>\
|
||||
<div class='form-group'>\
|
||||
<div class='controls'>\
|
||||
<input type='number' name='item_price[]' id ='item_price_" + x + "' class='form-control item_price compulsory' required>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
<div class='col-1'>\
|
||||
<div class='form-group'>\
|
||||
<div class='controls'>\
|
||||
<input type='number' name='item_total_price[]' id ='item_total_price_" + x + "' class='form-control item_total_price compulsory' required readonly>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
\
|
||||
<div class='col-1'>\
|
||||
<div class='form-group'>\
|
||||
<div class='controls'>\
|
||||
<input type='number' name='item_quantity[]' id ='item_quantity_" + x + "' class='form-control item_quantity compulsory' required>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
\
|
||||
<div class='col-2'>\
|
||||
<div class='control-group'>\
|
||||
<div id='performed_by_div_" + x + "' class='form-group'>\
|
||||
<select name='performed_by_id[]' id='performed_by_" + x + "' class='form-control performed_by_select'>" +
|
||||
"<?php echo $option_employees ?>" +
|
||||
"</select>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
\
|
||||
<div class='col-2'>\
|
||||
<div class='control-group'>\
|
||||
<div id='performance_fee_" + x + "' class='form-group name_select'>\
|
||||
<input type='number' name='performance_fee[]' id='performance_fee_" + x + "' class='form-control item_select'>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
\
|
||||
<div class='col-1'>\
|
||||
<div class='form-group' style='margin-top: 10px;'>\
|
||||
<button class='remove_field btn btn-sm btn-rounded btn-danger' style='color: white; margin-left: 25px;'><i class='fa fa-trash'></i></button>\
|
||||
</div>\
|
||||
</div>\
|
||||
</div>\
|
||||
</td>\
|
||||
</tr>"); // add row
|
||||
generalSelect2Set('performed_by_'+x);
|
||||
generalSelect2Set('performed_inv_item_'+x);
|
||||
generalSelect2Set('performed_pro_item_'+x);
|
||||
generalSelect2Set('performed_serv_item_'+x);
|
||||
generalSelect2Set('performed_sundry_item_'+x);
|
||||
|
||||
$("select.item_select").change(function(){
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
var name_selected = $(this).children("option:selected").val();
|
||||
$("#name_" + id).val(parseInt(name_selected));
|
||||
});
|
||||
|
||||
x++;
|
||||
}
|
||||
});
|
||||
|
||||
$(wrapper).on("click", ".remove_field", function (e) {
|
||||
e.preventDefault();
|
||||
$(this).parent('div').parent('div').parent('div').parent('td').parent('tr').remove();
|
||||
|
||||
// x--; // decrementing messes up the id referencing. If you're decrementing in this way, you're probably not submitting some data!!!!!!
|
||||
});
|
||||
|
||||
$(".input_fields_wrap").on('change', ".performed_item_select", function () {
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
|
||||
var category = $("#item_category_" + id).val();
|
||||
var item = 0;
|
||||
if(category === "1"){
|
||||
item = $("#performed_pro_item_" + id).val();
|
||||
} else if(category === "2"){
|
||||
item = $("#performed_inv_item_" + id).val();
|
||||
} else if(category === "3"){
|
||||
item = $("#performed_serv_item_" + id).val();
|
||||
} else if(category === "4"){
|
||||
item = $("#performed_sundry_item_" + id).val();
|
||||
}
|
||||
|
||||
let patient_id = $('#patient_id').val();
|
||||
let patient_insurance_status = $('#patient_insurance_status').val();
|
||||
|
||||
$.ajax({
|
||||
url: '/get_item_price',
|
||||
data: {'category':category, 'item':item, 'patient_id': patient_id, 'patient_insurance_status': patient_insurance_status},
|
||||
success: function(response){
|
||||
$("#item_price_"+id).val(response);
|
||||
$("#item_total_price_"+id).val(response);
|
||||
|
||||
calculateItemsTotal();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".performed_item_select,.performed_by_select").select2({
|
||||
width: "100%"
|
||||
});
|
||||
|
||||
$(".input_fields_wrap").on('change', ".item_category_select", function () {
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
console.log("The selected category row id ==" + id);
|
||||
|
||||
//change the drop down options
|
||||
var category = $("#item_category_" + id).val();
|
||||
if (category === "1") {
|
||||
$("#procedures_div_"+id).show();
|
||||
$("#investigations_div_"+id).hide();
|
||||
$("#services_div_"+id).hide();
|
||||
$("#sundries_div_"+id).hide();
|
||||
$("#item_quantity_"+id).attr('readonly', 'true');
|
||||
$("#item_quantity_"+id).attr('value', 1);
|
||||
} else if(category === "2"){
|
||||
$("#procedures_div_"+id).hide();
|
||||
$("#investigations_div_"+id).show();
|
||||
$("#services_div_"+id).hide();
|
||||
$("#sundries_div_"+id).hide();
|
||||
$("#item_quantity_"+id).attr('readonly', 'true');
|
||||
$("#item_quantity_"+id).attr('value', 1);
|
||||
} else if(category === "3"){
|
||||
$("#procedures_div_"+id).hide();
|
||||
$("#investigations_div_"+id).hide();
|
||||
$("#services_div_"+id).show();
|
||||
$("#sundries_div_"+id).hide();
|
||||
$("#item_quantity_"+id).removeAttr('readonly');
|
||||
} else if(category === "4"){
|
||||
$("#sundries_div_"+id).show();
|
||||
$("#procedures_div_"+id).hide();
|
||||
$("#investigations_div_"+id).hide();
|
||||
$("#services_div_"+id).hide();
|
||||
$("#item_quantity_"+id).removeAttr('readonly');
|
||||
}
|
||||
var item1 = $("#performed_inv_item_" + id).val();
|
||||
var item2 = $("#performed_pro_item_" + id).val();
|
||||
var item3 = $("#performed_serv_item_" + id).val();
|
||||
});
|
||||
|
||||
$(".input_fields_wrap").on('change', ".item_quantity", function () {
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
var quantity = $("#item_quantity_" + id).val();
|
||||
var unit_price = $("#item_price_" + id).val();
|
||||
|
||||
var total_price = quantity * unit_price;
|
||||
$("#item_total_price_" + id).val(total_price);
|
||||
|
||||
calculateItemsTotal();
|
||||
});
|
||||
|
||||
$(".input_fields_wrap").on('keyup', ".item_price", function () {
|
||||
var id = /\d+(?=\D*$)/.exec($(this).attr('id'));
|
||||
var quantity = $("#item_quantity_" + id).val();
|
||||
var unit_price = $("#item_price_" + id).val();
|
||||
|
||||
var total_price = quantity * unit_price;
|
||||
$("#item_total_price_" + id).val(total_price);
|
||||
|
||||
calculateItemsTotal();
|
||||
});
|
||||
|
||||
function calculateItemsTotal() {
|
||||
//loop through the prices
|
||||
var auto_price_grand_total = 0;
|
||||
$("[id^=item_total_price_]").each(function(){
|
||||
var auto_price = $(this).val();
|
||||
auto_price_grand_total += parseInt(auto_price);
|
||||
});
|
||||
|
||||
//recalculate the grand total
|
||||
$("#itemGrandTotal").html(auto_price_grand_total);
|
||||
}
|
||||
|
||||
function generalSelect2Set(id) {
|
||||
$('#'+id).select2({
|
||||
width: "100%"
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
+275
@@ -0,0 +1,275 @@
|
||||
@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/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" />
|
||||
<style type="text/css">
|
||||
#discounts_table td{
|
||||
border-left: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
#paid_services_table td{
|
||||
border-left: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
#services_table td{
|
||||
border-left: 1px solid #dddddd;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-7">
|
||||
<h4>{{ __('streamline_bills.streamline_bills') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('streamline_bills.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('streamline_bills.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-bil"></i> {{ __('streamline_bills.streamline_bills') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<div class="white-box" style="background-color: #F5FFFA">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="pull-left">
|
||||
<address>
|
||||
<h3> <b class="text-danger">{{ $hospital_information->name }}</b></h3>
|
||||
<p class="text-muted m-l-5">{{ $hospital_information->phone_number }}, {{ $hospital_information->email }},
|
||||
<br/> {{ get_name($hospital_information->sub_county,'id', 'name', 'subcounties') }}, {{ get_name($hospital_information->district,'id', 'name', 'districts') }},
|
||||
<br/> {{ $hospital_information->country }}.</p>
|
||||
</address>
|
||||
</div>
|
||||
<div class="pull-right text-right">
|
||||
<address>
|
||||
<p class="m-t-30"><b> {{ __('streamline_bills.date') }} : </b> <i class="fa fa-calendar"></i> {{ streamline_date_time(\Carbon\Carbon::now()->toDateTimeString()) }}</p>
|
||||
</address>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col text-left">
|
||||
{{ __('streamline_bills.details') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::open(['method'=>'post','route' => 'streamline_bill.generate']) }}
|
||||
<div class="panel-body">
|
||||
<div class="input_fields_wrap">
|
||||
<div class="row">
|
||||
<div class="span1"></div>
|
||||
<div class="col">
|
||||
<div class=" control-group">
|
||||
<label class="control-label" for="dates">{{ __('streamline_bills.processed_by') }}:</label>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
{{ Form::text('processed_by', get_full_name($user, 'id', 'first_name', 'last_name', 'users'),
|
||||
['class'=>'form-control required compulsory', 'readonly', 'id'=>'processed_by']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col">
|
||||
<label class="control-label" for="dates">{{ __('streamline_bills.date_type') }}:</label>
|
||||
<select class="form-control compulsory required" name="dates" id="dates" required>
|
||||
<option value="">{{ __('streamline_bills.select') }}</option>
|
||||
<option value="today">{{ __('streamline_bills.today') }}</option>
|
||||
<option value="yesterday">{{ __('streamline_bills.yesterday') }}</option>
|
||||
<option value="custom_date">{{ __('streamline_bills.custom_date') }}</option>
|
||||
<option value="custom_date_range">{{ __('streamline_bills.date_range') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="sDate" class="col" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('start_date',__('streamline_bills.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 id="eDate" class="col" style="display: none;">
|
||||
<div class="form-group">
|
||||
{{ Form::label('end_date',__('streamline_bills.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 class='col'>
|
||||
<div class="input-group" style="margin-top: 28px">
|
||||
<button class="btn btn-success btn-block btn-rounded">submit</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col panel">
|
||||
<div class="panel-body">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('streamline_bills.patient_name') }}</th>
|
||||
<th>{{ __('streamline_bills.patient_number') }}</th>
|
||||
<th>{{ __('streamline_bills.first_visit') }}</th>
|
||||
<th class="text-center">{{ __('streamline_bills.recorded_by') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@if(count($patients) > 0)
|
||||
@foreach($patients as $id)
|
||||
<tr>
|
||||
<th>{{ get_name($id, 'id', 'first_name', 'patients') }} {{ get_name($id, 'id', 'last_name', 'patients') }}</th>
|
||||
<th>{{ get_name($id, 'id', 'number', 'patients') }}</th>
|
||||
<th>{{ streamline_date(get_name($id, 'id', 'created_at', 'patients')) }}</th>
|
||||
@php $created_by = get_name($id, 'id', 'created_by', 'patients'); @endphp
|
||||
<th class="text-center">{{ get_full_name($created_by, 'id', 'first_name', 'last_name', 'users') }}</th>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<th>{{ __('streamline_bills.no_results_found') }}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="text-right">
|
||||
|
||||
<h5><strong>{{ __('streamline_bills.number_of_patients') }}: <div class="label label-success">{{ count($patients) }}</div></strong></h5> <br>
|
||||
<h5><strong>{{ __('streamline_bills.cost_per_patient_annually') }} : <div class="label label-success">{{ ugandan_shillings(1000) }}</div></strong></h5><br>
|
||||
@php
|
||||
$total = count($patients) * 1000;
|
||||
@endphp
|
||||
<h2><strong>{{ __('streamline_bills.total') }} : {{ ugandan_shillings($total) }}</strong></h2><br>
|
||||
|
||||
{{ Form::open(['method'=>'post', 'route'=>'streamline_bill.transfer']) }}
|
||||
|
||||
<input type="hidden" name="patient_string" value="{{ $patient_string }}">
|
||||
<input type="hidden" name="total" value="{{ $total }}">
|
||||
<button class="btn-danger btn btn-rounded">{{ __('streamline_bills.save_bill') }}</button>
|
||||
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/js/validator.js') }}"></script>
|
||||
|
||||
<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/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'
|
||||
],
|
||||
"aoColumnDefs": [{
|
||||
"aTargets": [2,3],
|
||||
"defaultContent": "",
|
||||
}]
|
||||
});
|
||||
</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>
|
||||
|
||||
$('#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>
|
||||
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
@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-md-7">
|
||||
<h4>{{ __('streamline_bills.streamline_bills') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('streamline_bills.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('streamline_bills.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-bil"></i> {{ __('streamline_bills.streamline_bills') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div style="float: right;">
|
||||
<button class="btn btn-rounded" style="background-color: #03C03C; color: white;" id="printPurchaseOrderReceipt">
|
||||
<i class="fa fa-print"></i>
|
||||
<span style="margin-left: 10px;">{{ __('streamline_bills.print') }}</span>
|
||||
</button>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div><br>
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<div class="white-box" style="background-color: #F5FFFA" id="printableContent">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="pull-left">
|
||||
<address>
|
||||
<h3> <b class="text-danger">{{ $hospital_information->name }}</b></h3>
|
||||
<p class="text-muted m-l-5">{{ $hospital_information->phone_number }}, {{ $hospital_information->email }},
|
||||
<br/> {{ get_name($hospital_information->sub_county,'id', 'name', 'subcounties') }}, {{ get_name($hospital_information->district,'id', 'name', 'districts') }},
|
||||
<br/> {{ $hospital_information->country }}.</p>
|
||||
</address>
|
||||
</div>
|
||||
<div class="pull-right text-right">
|
||||
<address>
|
||||
<p class="m-t-30"><b> {{ __('streamline_bills.date') }} : </b> <i class="fa fa-calendar"></i> {{ streamline_date_time(\Carbon\Carbon::now()->toDateTimeString()) }}</p>
|
||||
</address>
|
||||
<button class="btn-success btn btn-rounded" disabled>{{ __('streamline_bills.bill_generated') }}</button>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="row">
|
||||
<div class="col panel">
|
||||
<div class="panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col text-left">
|
||||
{{ __('streamline_bills.billing_date') }}
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
@php
|
||||
if(isset($report->time_frame)){ $time_frame = explode("&", $report->time_frame);}
|
||||
@endphp
|
||||
<div class="btn btn-info btn-rounded">{{ streamline_date(isset($time_frame[0]) ? streamline_date($time_frame[0]) : "" ) }}
|
||||
@if(isset($time_frame[1]))
|
||||
<b>{{ __('streamline_bills.to') }}</b>
|
||||
{{ streamline_date($time_frame[1]) }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col panel">
|
||||
<div class="panel-body">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('streamline_bills.patient_name') }}</th>
|
||||
<th>{{ __('streamline_bills.patient_number') }}</th>
|
||||
<th>{{ __('streamline_bills.first_visit') }}</th>
|
||||
<th class="text-center">{{ __('streamline_bills.recorded_by') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@if(isset($report) > 0)
|
||||
@php
|
||||
$patients = explode("/", $report->patients);
|
||||
@endphp
|
||||
@foreach($patients as $id)
|
||||
<tr>
|
||||
<td>{{ get_full_name($id, 'id', 'first_name', 'last_name', 'patients') }}</td>
|
||||
<td>{{ get_name($id, 'id', 'number', 'patients') }}r</td>
|
||||
<td>
|
||||
@php
|
||||
$episode_date = \Streamline\Models\PatientEpisode::where('patient_id', $id)->pluck('created_at')->first();
|
||||
echo streamline_date($episode_date);
|
||||
@endphp
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@php
|
||||
$recorded_by = \Streamline\Models\PatientEpisode::where('patient_id', $id)->pluck('created_by')->first();
|
||||
echo get_full_name($recorded_by, 'id', 'first_name', 'last_name', 'users');
|
||||
@endphp
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<th>{{ __('streamline_bills.no_records_found') }}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="text-right">
|
||||
|
||||
<h5><strong>{{ __('streamline_bills.number_of_patients') }}: <div class="label label-success"></div></strong></h5> <br>
|
||||
<h5><strong>{{ __('streamline_bills.cost_per_patient_annually') }} : <div class="label label-success">{{ ugandan_shillings(1000) }}</div></strong></h5><br>
|
||||
@php
|
||||
$total = count($patients) * 1000;
|
||||
@endphp
|
||||
<h2><strong>Total : {{ ugandan_shillings($total) }}</strong></h2><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function printElementContent(elem,title){
|
||||
var mywindow = window.open('', 'PRINT', 'height=400,width=600');
|
||||
var css = '<link href="/elite/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">';
|
||||
|
||||
mywindow.document.write('<html><head><title></title>');
|
||||
mywindow.document.write('</head><body >');
|
||||
mywindow.document.write(css);
|
||||
mywindow.document.write('<center><h3>' + title + '</h3></center>');
|
||||
mywindow.document.write(document.getElementById(elem).innerHTML);
|
||||
mywindow.document.write('</body></html>');
|
||||
mywindow.document.close(); // necessary for IE >= 10
|
||||
//mywindow.focus(); // necessary for IE >= 10*/
|
||||
setTimeout(function () {
|
||||
mywindow.focus();
|
||||
mywindow.print();
|
||||
mywindow.remove();
|
||||
}, 500);
|
||||
return true;
|
||||
}
|
||||
|
||||
$("#printPurchaseOrderReceipt").click(function(e){
|
||||
printElementContent('printableContent','Stre@mline Bill');
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
+232
@@ -0,0 +1,232 @@
|
||||
@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/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" />
|
||||
<style type="text/css">
|
||||
#discounts_table td{
|
||||
border-left: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
#paid_services_table td{
|
||||
border-left: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
#services_table td{
|
||||
border-left: 1px solid #dddddd;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-md-7">
|
||||
<h4>{{ __('streamline_bills.streamline_bills') }}</h4>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('streamline_bills.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('streamline_bills.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-bil"></i> {{ __('streamline_bills.streamline_bills') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@include('flash::message')
|
||||
|
||||
<div class="white-box" style="background-color: #F5FFFA">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="pull-left">
|
||||
<address>
|
||||
<h3> <b class="text-danger">{{ $hospital_information->name }}</b></h3>
|
||||
<p class="text-muted m-l-5">{{ $hospital_information->phone_number }}, {{ $hospital_information->email }},
|
||||
<br/> {{ get_name($hospital_information->sub_county,'id', 'name', 'subcounties') }}, {{ get_name($hospital_information->district,'id', 'name', 'districts') }},
|
||||
<br/> {{ $hospital_information->country }}.</p>
|
||||
</address>
|
||||
<br/>
|
||||
<a role="button" class="btn btn-success btn-rounded btn-block" href="{{ route('streamline_bill.create') }}">{{ __('streamline_bills.generate_bill') }}</a>
|
||||
</div>
|
||||
<div class="pull-right text-right">
|
||||
<address>
|
||||
<p class="m-t-30"><b> {{ __('streamline_bills.date') }} : </b> <i class="fa fa-calendar"></i> {{ streamline_date_time(\Carbon\Carbon::now()->toDateTimeString()) }}</p>
|
||||
</address>
|
||||
</div>
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="row">
|
||||
<div class="col panel">
|
||||
<div class="panel-body">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('streamline_bills.number_of_patients') }}</th>
|
||||
<th>{{ __('streamline_bills.time_frame') }}</th>
|
||||
<th>{{ __('streamline_bills.amount_to_be_paid') }}</th>
|
||||
<th>{{ __('streamline_bills.amount_paid') }}</th>
|
||||
<th>{{ __('streamline_bills.generated_by') }}</th>
|
||||
<th></th>
|
||||
<th>{{ __('streamline_bills.action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@if(count($reports) > 0)
|
||||
@foreach($reports as $item)
|
||||
@php
|
||||
$ids = explode('/', $item['patients']);
|
||||
$dates = explode('&', $item['time_frame']);
|
||||
$count = count($ids);
|
||||
@endphp
|
||||
<tr>
|
||||
<td>
|
||||
<button onclick="view_patients('{{$item['id']}}')" class="btn btn-info btn-rounded">{{ $count }}</button>
|
||||
</td>
|
||||
<td>
|
||||
<div class="label label-info">
|
||||
{{ streamline_date($dates[0]) }} to @php if(isset($dates[1])){ echo streamline_date($dates[1]); }else{ echo ""; } @endphp
|
||||
</div>
|
||||
</td>
|
||||
<td>{{ ugandan_shillings($item['amount_to_be_paid']) }}</td>
|
||||
<td>{{ ugandan_shillings($item['amount_paid']) }}</td>
|
||||
<td>{{ get_full_name($item['created_by'], 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
<td><a href="{{ route('streamline_bill.detail', $item->id) }}" class="btn btn-primary btn-sm btn-rounded"><i class="fa fa-eye"></i> {{ __('streamline_bills.view_invoice') }}</a></td>
|
||||
<td>
|
||||
<a href="{{ url('/streamline_bill/delete', $item['id']) }}" onclick="return confirm('Are you sure?')" class="btn btn-danger btn-sm btn-rounded" role="button">
|
||||
<i class="fa fa-trash"></i>
|
||||
{{ __('streamline_bills.delete') }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<th>{{ __('streamline_bills.no_results_found') }}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="displayPatientsModal" tabindex="-1" role="dialog" aria-labelledby="displayPatientsModalLabel" aria-hidden="true" style="border-radius: 10px; margin-top: 200px ">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Patient on this Bill</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="patients_listing"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/js/validator.js') }}"></script>
|
||||
|
||||
<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/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>
|
||||
function view_patients(id) {
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/streamline_bill/view_patients',
|
||||
data: {
|
||||
'id':id
|
||||
},
|
||||
success: function(response){
|
||||
patients = "<ol>"+response+"</ol>";
|
||||
$('#patients_listing').html(patients);
|
||||
$('#displayPatientsModal').modal('show');
|
||||
},
|
||||
error: function (error) {
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'copy', 'csv', 'excel', 'pdf', 'print'
|
||||
],
|
||||
"aoColumnDefs": [{
|
||||
"aTargets": [2,3],
|
||||
"defaultContent": "",
|
||||
}]
|
||||
});
|
||||
</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>
|
||||
|
||||
@endpush
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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('/finance', function () {
|
||||
return "Finance";
|
||||
});
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::group(['middleware' => ['auth', 'disablebackbutton', 'user-locale','subscription-tracking', 'password-expiry']], function () {
|
||||
/* cost centers */
|
||||
Route::resource('cost_centers', 'CostCenterController');
|
||||
Route::any('cost_centers_details', 'CostCenterController@cost_center_details')->name('cost_centers.details');
|
||||
Route::any('lab_performance', 'CostCenterController@labPerformanceReport')->name('lab_performance.index');
|
||||
Route::any('lab_performance_details', 'CostCenterController@labPerformanceReportDetails')->name('lab_performance.details');
|
||||
Route::any('top_performing_investigations', 'CostCenterController@topPerformingInvestigationsReport')->name('top_performing_investigations');
|
||||
Route::any('cost_center_income_details', 'CostCenterController@costCenterIncomeDetailedReport')->name('cost_center.income_detailed_report');
|
||||
Route::any('opd_details_drilldown', 'CostCenterController@opd_details_drilldown')->name('cost_centers.opd_details_drilldown');
|
||||
|
||||
/* Equities */
|
||||
Route::get('/inactive/equities', 'EquityController@inactive')->name('equities.inactive');
|
||||
Route::post('/equities/activate/{id}', 'EquityController@activate')->name('equities.activate');
|
||||
Route::resource('equities', 'EquityController');
|
||||
|
||||
/* Finance Home */
|
||||
Route::get('finance', 'FinanceController@index')->name('finance');
|
||||
Route::any('incoming_opd_payments', 'FinanceController@incoming_opd_payments')->name('finance.incoming_opd_payments');
|
||||
|
||||
/* Fixed Assets */
|
||||
Route::resource('fixed_assets', 'FixedAssetsController');
|
||||
Route::any('is_fixed_asset_attached_to_bill', 'FixedAssetsController@is_fixed_asset_attached_to_bill');
|
||||
|
||||
/* staff payment configuration */
|
||||
Route::any('/staff_payment_configuration/fetch_performed_by_info/{id}', 'StaffPaymentsConfigurationController@fetch_performed_by_info');
|
||||
Route::any('/staff_payment_configuration/edit_performed_by_info', 'StaffPaymentsConfigurationController@edit_performed_by_info');
|
||||
Route::any('/staff_payment_configuration/delete_performed_by/{id}/{position}/{order_id}/{type}', 'StaffPaymentsConfigurationController@delete_performed_by');
|
||||
Route::resource('staff_payment_configuration', 'StaffPaymentsConfigurationController');
|
||||
Route::any('staff_payment_configuration_search', 'StaffPaymentsConfigurationController@staff_payment_configuration_search')->name('staff_payment_configuration.search');
|
||||
Route::any('delete_staff_configuration', 'StaffPaymentsConfigurationController@delete_staff_configuration')->name('staff_payment_configuration.delete_staff_configuration');
|
||||
Route::any('edit_staff_configuration', 'StaffPaymentsConfigurationController@edit_staff_configuration')->name('staff_payment_configuration.edit_staff_configuration');
|
||||
|
||||
/* report for incomes owed to staff */
|
||||
Route::any('staff_payments_report', 'StaffPaymentsConfigurationController@payments_report')->name('staff_payments.payments_report');
|
||||
Route::any('staff_payments_details_report', 'StaffPaymentsConfigurationController@payments_details_report')->name('staff_payments.payments_details_report');
|
||||
Route::any('record_staff_service_performance', 'StaffPaymentsConfigurationController@record_staff_service_performance')->name('staff_performance.create_record');
|
||||
Route::post('store_recorded_performed_service', 'StaffPaymentsConfigurationController@store_recorded_performed_service');
|
||||
Route::any('get_item_price', 'StaffPaymentsConfigurationController@get_item_price');
|
||||
|
||||
/* Streamline Bills */
|
||||
Route::any('/streamline_bill', 'StreamlineBillsController@index')->name('streamline_bill');
|
||||
Route::any('/streamline_bill/create', 'StreamlineBillsController@create')->name('streamline_bill.create');
|
||||
Route::any('/streamline_bill/detail/{id}', 'StreamlineBillsController@detail')->name('streamline_bill.detail');
|
||||
Route::any('/streamline_bill/generate', 'StreamlineBillsController@generate')->name('streamline_bill.generate');
|
||||
Route::any('/streamline_bill/transfer', 'StreamlineBillsController@transfer')->name('streamline_bill.transfer');
|
||||
Route::any('/streamline_bill/delete/{id}', 'StreamlineBillsController@delete')->name('streamline_bill.delete');
|
||||
Route::post('/streamline_bill/view_patients', 'StreamlineBillsController@view_patients')->name('streamline_bill.view_patients');
|
||||
|
||||
/* markup tags */
|
||||
Route::get('/markup_tag/inactive', 'MarkupTagController@inactive')->name('markup_tag.inactive');
|
||||
Route::post('/markup_tag/activate{id}', 'MarkupTagController@activate')->name('markup_tag.activate');
|
||||
Route::resource('markup_tag', 'MarkupTagController');
|
||||
/* markup tags to drugs*/
|
||||
Route::any('add_markups_to_drugs', 'MarkupTagController@add_markups_to_drugs');
|
||||
Route::any('update_mark_up_to_drug', 'MarkupTagController@update_mark_up_to_drug')->name('markup_tag.update_mark_up_to_drug');
|
||||
Route::any('drug_markup_search', 'MarkupTagController@drug_markup_search')->name('markup_tag.drug_markup_search');
|
||||
Route::any('view_markup_drugs/{id}', 'MarkupTagController@view_markup_drugs');
|
||||
|
||||
/* markup tags to sundries*/
|
||||
Route::any('add_markups_to_sundries', 'MarkupTagController@add_markups_to_sundries');
|
||||
Route::any('update_mark_up_to_sundry', 'MarkupTagController@update_mark_up_to_sundry')->name('markup_tag.update_mark_up_to_sundry');
|
||||
Route::any('sundry_markup_search', 'MarkupTagController@sundry_markup_search')->name('markup_tag.sundry_markup_search');
|
||||
});
|
||||
@@ -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": "Finance",
|
||||
"alias": "finance",
|
||||
"description": "Finance",
|
||||
"keywords": [],
|
||||
"priority": 0,
|
||||
"providers": [
|
||||
"Modules\\Finance\\Providers\\FinanceServiceProvider"
|
||||
],
|
||||
"files": []
|
||||
}
|
||||
Reference in New Issue
Block a user