本文整理汇总了PHP中app\Branch::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Branch::find方法的具体用法?PHP Branch::find怎么用?PHP Branch::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Branch
的用法示例。
在下文中一共展示了Branch::find方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getChangeStatus
public function getChangeStatus($status, $id)
{
$branch = Branch::find($id);
if ($branch['status'] == $status) {
$branch->status = $status == 'Activate' ? 'Deactivate' : 'Activate';
$branch->save();
}
return new JsonResponse(array('id' => $branch['id'], 'status' => $branch['status']));
}
示例2: edit
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit(Request $request)
{
$branch = Branch::find($request['branchId']);
$branch->name = $request['branchName'];
$branch->location = $request['branchLocation'];
$branch->delivery_charge = $request['delivery_charge'];
if ($branch->save()) {
$returnData = array('status' => 'ok', 'message' => 'Branch edited', 'branch' => $branch, 'code' => 200);
return Response::json($returnData, 200);
} else {
$returnData = array('status' => 'fail', 'message' => 'Branch not edited', 'code' => 500);
return Response::json($returnData, 200);
}
}
示例3:
<td>{{$fromAccount->name}}</td>
<td>{{$toBranch->name}}</td>
<td>{{$toAccount->name}}</td>
<td style="text-align: right;">{{$result->amount}}</td>
<td>{{$result->remarks}}</td>
<td>{{$user->name}}</td>
</tr>
<?php
$total = $total + $result->amount;
?>
@endforeach
@foreach($results2 as $result )
<?php
$user = \App\User::find($result->user_id);
$fromBranch = \App\Branch::find($result->fromBranch);
$toBranch = \App\Branch::find($result->toBranch);
$fromAccount = \App\NameOfAccount::find($result->fromAccount);
$toAccount = \App\NameOfAccount::find($result->toAccount);
?>
<tr class="odd gradeX">
<td>{{$result->date}}</td>
<td>{{$fromBranch->name}}</td>
<td>{{$fromAccount->name}}</td>
<td>{{$toBranch->name}}</td>
<td>{{$toAccount->name}}</td>
<td style="text-align: right;">{{$result->amount}}</td>
<td>{{$result->remarks}}</td>
<td>{{$user->name}}</td>
</tr>
<?php
示例4:
<th width="">Product Type</th>
<th width="">Product Name</th>
<th width="">Price</th>
<th width="">Quantity</th>
<th width="">Remarks</th>
<th width="">Action</th>
</tr>
</thead>
@foreach($saleDetails as $saleDetail)
<?php
$branch = new \App\Branch();
$stocks = new \App\StockInfo();
$stockName = \App\StockInfo::find($saleDetail->stock_info_id);
$branchName = \App\Branch::find($saleDetail->branch_id);
?>
<tr>
<td> {{ $stockName->name }}</td>
<td> {{ $saleDetail->product_type }}</td>
<td> {{ $saleDetail->product->name }}</td>
<td> {{ $saleDetail->price }}</td>
<td> {{ $saleDetail->quantity }}</td>
<td>
@if($saleDetail->remarks)
{{ $saleDetail->remarks }}
@else
{{"Not Available"}}
@endif
</td>
<td> <input type="button" style="width:63px;" value="delete" class="btn red deleteSaleDetail" rel={{$saleDetail->id}} /></td>
示例5: saleDetailConvertToArray
private function saleDetailConvertToArray($salesDetails)
{
$array = array();
$stockName = StockInfo::find($salesDetails->stock_info_id);
$branchName = Branch::find($salesDetails->branch_id);
$array['id'] = $salesDetails->id;
$array['branch_id'] = $branchName->name;
$array['stock_info_id'] = $stockName->name;
$array['product_type'] = $salesDetails->product_type;
$array['product_id'] = $salesDetails->product->name;
$array['price'] = $salesDetails->price;
$array['quantity'] = $salesDetails->quantity;
$array['remarks'] = $salesDetails->remarks;
return $array;
}
示例6:
<th>Quantity</th>
<th>Amount</th>
<th>Remarks</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$total = 0;
?>
@foreach($purchaseInvoiceDetails as $purchaseInvoiceDetail )
<?php
$stocks = new \App\StockInfo();
$branch = new \App\Branch();
$stockName = \App\StockInfo::find($purchaseInvoiceDetail->stock_info_id);
$branchName = \App\Branch::find($purchaseInvoiceDetail->branch_id);
$categoryName = \App\Category::find($purchaseInvoiceDetail->product->category_id);
$subCategoryName = \App\SubCategory::find($purchaseInvoiceDetail->product->sub_category_id);
?>
<tr class="odd gradeX">
<td>{{$branchName->name}}</td>
<td>{{$stockName->name}}</td>
<td>{{$purchaseInvoiceDetail->product_type}}</td>
<td>{{$purchaseInvoiceDetail->product->name.'('.$categoryName->name.')'.'('.$subCategoryName->name.')'}}</td>
<td>{{$purchaseInvoiceDetail->price}}</td>
<td>{{$purchaseInvoiceDetail->quantity}}</td>
<td>{{$purchaseInvoiceDetail->quantity * $purchaseInvoiceDetail->price}}</td>
<td>
@if($purchaseInvoiceDetail->remarks)
{{ $purchaseInvoiceDetail->remarks }}
@else
示例7:
<!-- BEGIN PAGE TITLE & BREADCRUMB-->
<h3 class="page-title">
Stock Search Result
</h3>
</div>
</div>
<div class="row">
<div class="col-md-12">
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet box light-grey">
<div class="portlet-title">
<?php
$branch = \App\Branch::find($branch);
?>
<div class="caption"><i class="fa fa-reorder"></i> Stock Search Result for {{$branch->name}}</div>
<div class="actions">
<a class="btn blue" href="/entry">Back</a>
</div>
</div>
<div class="portlet-body">
@if($results)
<table class="table table-striped table-bordered table-hover" id="stock_search_result_table">
<thead style="background-color:royalblue">
<tr>
<th>Product Name</th>
示例8:
<?php
use App\Institution;
use App\UserLevel;
use App\Worker;
use App\Branch;
$worker = Worker::find(Auth::user()->TypeId);
$branch = Branch::find($worker->BranchId);
$regimen = json_decode($branch->DefaultExpenses)->regimen;
$permissions = json_decode(UserLevel::find(Auth::user()->UserLevel)->Permissions);
?>
<script>
var maxDiscount = {{ $permissions->permissions->sales->discount->limit }};
var regimen = "{{ $regimen }}";
</script>
<script src="{{ URL::to('/') }}/js/ventas.js"></script>
@include('mortuary.forms.payTab')
@include('mortuary.forms.createClientInstitutionForm')
@include('mortuary.forms.serviceForm')
@include('mortuary.forms.cremationForm')
@include('mortuary.forms.reservationForm')
@include('mortuary.forms.contractForm')
<div class="main hideable hide" id="ventas">
<div class="main-inner">
<div class="container">
<div class="row">
<div class="span6">
<div class="row-fluid form-horizontal">
<div class="control-group span12">
<label class="control-label" for="salesClient">Cliente:</label>
<div class="controls">
示例9: purchaseInvoiceDetailConvertToArray
private function purchaseInvoiceDetailConvertToArray($purchaseInvoiceDetails)
{
$array = array();
$stockName = StockInfo::find($purchaseInvoiceDetails->stock_info_id);
$branchName = Branch::find($purchaseInvoiceDetails->branch_id);
$array['id'] = $purchaseInvoiceDetails->id;
$array['branch_id'] = $branchName->name;
$array['stock_info_id'] = $stockName->name;
$array['product_type'] = $purchaseInvoiceDetails->product_type;
$categoryName = \App\Category::find($purchaseInvoiceDetails->product->category_id);
$subCategoryName = \App\SubCategory::find($purchaseInvoiceDetails->product->sub_category_id);
$array['product_id'] = $purchaseInvoiceDetails->product->name . '(' . $categoryName->name . ')' . '(' . $subCategoryName->name . ')';
$array['price'] = $purchaseInvoiceDetails->price;
$array['quantity'] = $purchaseInvoiceDetails->quantity;
$array['remarks'] = $purchaseInvoiceDetails->remarks;
return $array;
}
示例10: getName
<?php
use App\AIOrder;
use App\AIOrderBreakdown;
use App\Provider;
use App\Branch;
use App\Stock;
// Get the provider and branch.
$provider = Provider::find($order['ProviderId']);
$branch = Branch::find($order['BranchId']);
function getName($code, $branchId)
{
// Get product.
$product = Stock::where('Code', '=', $code)->where('BranchId', '=', $branchId)->first();
return $product->Description;
}
?>
<p>{{ $provider->Name }},</p>
<p>Les enviamos el siguiente correo para realizar una orden a su empresa para los siguientes productos:</p>
<table width="600" align="center" style="border:1px solid black;">
<thead>
<tr><th>Descripcion</th><th>Cantidad</th></tr>
</thead>
<tbody>
@foreach($breakdown as $product)
<tr><td style="text-align:center;">{{ getName($product['Code'], $branch->Id) }}</td><td style="text-align:center;">{{ $product['Quantity'] }}</td></tr>
@endforeach
</tbody>
</table>
<p>Por favor enviar los productos a {{ $branch->Name }} ubicados en {{ $branch->Address }}. Recuerde responder a este correo con la palabra: Recibido. Esto es para permitirnos saber de que han recibido la orden exitosamente.</p>
<p>Se despide cordialmente,</p>
示例11: saveDefaultExpenses
/**
* Function that saves default expenses.
*
* @return Response
*/
public function saveDefaultExpenses()
{
// Validate Input.
$validator = Validator::make(Input::all(), array('electricity' => 'required', 'water' => 'required', 'phone' => 'required', 'rent' => 'required', 'government' => 'required', 'depreciation' => 'required', 'taxes' => 'required', 'security' => 'required', 'regimen' => 'required'));
if ($validator->fails()) {
return response()->json(['error' => 'Informacion incompleta!']);
}
// Check that user is part of authorized staff.
if (Auth::user()->Type != 1) {
// If they are unauthorized no point in returning anything.
return response()->json(array());
}
// Get user branch.
$branch = Branch::find(Worker::find(Auth::user()->TypeId)->BranchId);
// Get expenses.
$expenses = array('electricity' => Input::get('electricity'), 'water' => Input::get('water'), 'phone' => Input::get('phone'), 'rent' => Input::get('rent'), 'government' => Input::get('government'), 'depreciation' => Input::get('depreciation'), 'taxes' => Input::get('taxes'), 'security' => Input::get('security'), 'regimen' => Input::get('regimen'));
$branch->DefaultExpenses = json_encode($expenses);
$branch->save();
$response['state'] = 'Success';
$response['message'] = 'Gastos guardados exitosamente!';
return response()->json($response);
}
示例12:
<th>Cheque Date</th>
<th>Amount</th>
<th>Received By</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$sl = 1;
?>
@foreach($register as $reg )
<?php
$sale = \App\Sale::where('invoice_id', '=', $reg->invoice_id)->first();
$partyname = \App\Party::find($sale->party_id);
$brnachName = \App\Branch::find($reg->branch_id);
?>
<tr class="odd gradeX">
<td><?php
echo $sl;
?>
</td>
<td>{{$partyname->name}}</td>
<td>{{$reg->cheque_bank}}</td>
<td>{{$brnachName->name}}</td>
<td>{{$reg->cheque_no}}</td>
<td>{{$reg->cheque_date}}</td>
<td>{{$reg->amount}}</td>
<td>{{$reg->user->username}}</td>
@if($reg->cheque_status == 1)
<td class="party-status"><span class="label label-sm label-success">Completed</span></td>
示例13:
<th>Branch Name</th>
<th>Name</th>
<th>Category</th>
<th>Balance</th>
<th>Created By</th>
<th >Action</th>
</tr>
</thead>
<tbody>
<?php
$sl = 1;
?>
@foreach($accountNames as $accountName)
<?php
$accounts = \App\AccountCategory::find($accountName->account_category_id);
$branch = \App\Branch::find($accountName->branch_id);
?>
<tr class="odd gradeX">
<td><?php
echo $sl;
?>
</td>
<td>{{$branch->name}}</td>
<td>{{$accountName->name}}</td>
<td>{{$accounts->name}}</td>
<td>{{$accountName->opening_balance}}</td>
<td>{{$accountName->user->username}}</td>
<td>
<a class="btn blue btn-sm editAccountName" data-toggle="modal" data-target="#ajax2" href="{{URL::to('accountnames/edit',$accountName->id )}}" >
<i class="fa fa-edit"></i> Edit Account Name</a>
<a class="btn red btn-sm" href="{{ URL::to('accountnames/delete',$accountName->id)}}"
示例14:
<a href="{{URL::to('dashboard')}}">Home</a>
<i class="fa fa-angle-right"></i>
</li>
<li><a href="#" >Profile</a></li>
<div class="actions" style="float: right;margin-top: -7px;">
<a class="btn blue" href="{{ URL::to('edit/'. $profile->id) }}">Update Profile</a>
</div>
</ul>
<!-- END PAGE TITLE & BREADCRUMB-->
</div>
</div>
<div class="col-md-16">
<?php
$branch = \App\Branch::find($profile->branch_id);
?>
<b>Name: </b>{{$profile->name}}<br><br>
<b>Email:</b>{{$profile->email}}<br><br>
<b>UserName: </b>{{$profile->username}}<br><br>
<b>Branch: </b>{{$branch->name}}<br><br>
<b>Phone: </b>{{$profile->phone}}<br><br>
<b>Role: </b> @if($profile->role == 'admin')
Admin
@elseif($profile->role == 'manager')
Stock InCharge
@else
Office Manager
@endif <br><br>
<b>Address: </b>{{$profile->address}}
示例15: makeReservation
/**
* Function that makes a reservation.
*
* @return Response
*/
public function makeReservation()
{
// Validate Input.
$validator = Validator::make(Input::all(), array('items' => 'required', 'institution' => 'required', 'discount' => 'required', 'reservationAmount' => 'required'));
if ($validator->fails()) {
return response()->json(['error' => 'No se envio la informacion completa!']);
}
// Check that user is part of authorized staff.
if (Auth::user()->Type != 1) {
// If they are unauthorized no point in returning anything.
return response()->json(['state' => 'Unauthorized']);
}
// Get user branch.
$worker = Worker::find(Auth::user()->TypeId);
$userBranch = $worker->BranchId;
$reservationPrice = 0;
$branch = Branch::find($userBranch);
// Get the user's cashbox.
$cashbox = Cashbox::where('UserId', '=', Auth::user()->Id)->where('Close', '=', NULL)->first();
// Check that we actually have a cashbox open.
if (!$cashbox) {
$response['state'] = 'Error';
$response['error'] = 'La caja no esta abierta o por lo tanto no se puede realizar la reservacion!';
return response()->json($response);
}
// Check discount is not greater than what user is allowed.
$permissions = json_decode(UserLevel::find(Auth::user()->UserLevel)->Permissions);
if (Input::get('discount') > $permissions->permissions->sales->discount->limit) {
// Check if we have an auth code we can use.
if (Input::get('authCode') == 0) {
$response['state'] = 'Error';
$response['error'] = 'No tiene permiso para otorgar este descuento!';
return response()->json($response);
}
$request = Request::find(Input::get('authCode'));
if ($request->Used == 1) {
$response['state'] = 'Error';
$response['error'] = 'No tiene permiso para otorgar este descuento!';
return response()->json($response);
}
if ($request->Amount != Input::get('discount')) {
$response['state'] = 'Error';
$response['error'] = 'No tiene permiso para otorgar este descuento!';
return response()->json($response);
}
$request->Used = 1;
$request->save();
}
// Get client.
$client = Client::where('Cedula', '=', Input::get('client'))->first();
// Get institution if defined.
$institution;
if (Input::get('institution') != 0) {
$institution = Institution::find(Input::get('institution'));
if (!$institution) {
$response['state'] = 'Error';
$response['error'] = 'La institucion definida no fue encontrada en el sistema!';
return response()->json($response);
}
}
// Loop through products and services and get prices.
$items = json_decode(Input::get('items'));
foreach ($items as $code => $info) {
// Check if it is a product.
$product = Stock::where('Code', '=', $code)->where('BranchId', '=', $userBranch)->first();
if (!$product) {
// Check if it is a service.
$service = Service::where('Code', '=', $code)->where('BranchId', '=', $userBranch)->first();
if (!$service) {
$response['state'] = 'Error';
$response['error'] = 'No se reconocio uno de los productos o servicios!';
return response()->json($response);
}
// Add price to total of quotation.
$reservationPrice += $service->Price * $info->quantity;
} else {
// Add price to total of quotation.
$reservationPrice += $product->Price * $info->quantity;
}
}
$subTotal = $reservationPrice;
$discount = $reservationPrice * (Input::get('discount') / 100);
// Give discount.
$reservationPrice = $reservationPrice * (1 - Input::get('discount') / 100);
// Calculate tax if required.
$tax = 0;
if (json_decode($branch->DefaultExpenses)->regimen == 'cuotageneral') {
if (Input::get('institution') != 0) {
if (!$institution->Excempt) {
$tax = $salePrice * 0.15;
}
} else {
if (!$client || !$client->Excempt) {
$tax = $salePrice * 0.15;
}
//.........这里部分代码省略.........