7 Julio Commit
7 Julio Commit
Se agrega variable que establezca si una sucursal tiene su propia cuenta de...
Se agrega variable que establezca si una sucursal tiene su propia cuenta de recaudo en linea. El portal de clientes pide
cédula de ciudadania al iniciar sesion por primera vez
app/Http/Controllers/Admin/BranchController.php
... ... @@ -47,6 +47,7 @@ class BranchController extends Controller
47 47 ],
48 48 'name' => $request->get('name'),
49 49 'phone' => $request->get('phone'),
50 + 'ownMoneyCollection' => (bool)$request->has('ownMoneyCollection'),
50 51 'state' => 'Activo',
51 52 'uidAdmin' => null,
52 53 ]);
... ... @@ -77,6 +78,7 @@ class BranchController extends Controller
77 78 ['path' => 'location.lat', 'value' => $request->get('lat')],
78 79 ['path' => 'location.lng', 'value' => $request->get('lng')],
79 80 ['path' => 'phone', 'value' => $request->get('phone')],
81 + ['path' => 'ownMoneyCollection', 'value' => (bool)$request->has('ownMoneyCollection')],
80 82 ['path' => 'state', 'value' => $request->get('state')],
81 83 ]);
82 84
... ...
app/Http/Controllers/Admin/PaymentController.php
... ... @@ -5,6 +5,7 @@ namespace App\Http\Controllers\Admin;
5 5 use App\Http\Controllers\Controller;
6 6 use App\Invoice;
7 7 use App\InvoicePaid;
8 + use App\PaymentServiceInfo;
8 9 use App\Service;
9 10 use Illuminate\Http\Request;
10 11
... ... @@ -12,7 +13,7 @@ class PaymentController extends Controller
12 13 {
13 14 public function index()
14 15 {
15 - $invoicesPaid = InvoicePaid::getMostRecent(\State::get('branch.id'));
16 + $invoicesPaid = InvoicePaid::getMostRecent(\State::get('branch.id'), 7);
16 17
17 18 $invoicesIds = $invoicesPaid->map(fn($ip) => $ip->field('idInvoice'))->toArray();
18 19 $invoices = Invoice::whereIdIn($invoicesIds);
... ... @@ -20,7 +21,14 @@ class PaymentController extends Controller
20 21 $servicesIds = $invoicesPaid->map(fn($ip) => $ip->field('idService'))->toArray();
21 22 $services = Service::whereIdIn($servicesIds);
22 23
23 - return view('admin.payments.index', compact('invoicesPaid', 'invoices', 'services'));
24 + $paymentInfo = PaymentServiceInfo::first('idBranch', '=', \State::get('branch.id'));
25 +
26 + return view('admin.payments.index', compact(
27 + 'invoicesPaid',
28 + 'invoices',
29 + 'services',
30 + 'paymentInfo'
31 + ));
https://gitlab.com/guille.agudelo/transito-frontend/-/commit/3b96018751a50be7d123742e543e609180c4228a 1/10
1/8/2020 Se agrega variable que establezca si una sucursal tiene su propia cuenta de... (3b960187) · Commits · Guillermo Agudelo / transito-frontend · GitLab
24 32 }
25 33
26 34 public function updateInfo(Request $request)
... ... @@ -31,6 +39,25 @@ class PaymentController extends Controller
31 39 'ref3' => 'required'
32 40 ]);
33 41
34 -
42 + $paymentInfo = PaymentServiceInfo::first('idBranch', '=', \State::get('branch.id'));
43 +
44 + if (!$paymentInfo) {
45 + PaymentServiceInfo::create([
46 + 'idBranch' => \State::get('branch.id'),
47 + 'reference1' => $request->get('ref1'), //PayULatam MerchantId
48 + 'reference2' => $request->get('ref2'), //PayULatam AccountId
49 + 'reference3' => $request->get('ref3'), //PayULatam API Key
50 + ]);
51 + } else {
52 + $paymentInfo->updateInstance([
53 + ['path' => 'reference1', 'value' => $request->get('ref1')],
54 + ['path' => 'reference2', 'value' => $request->get('ref2')],
55 + ['path' => 'reference3', 'value' => $request->get('ref3')],
56 + ]);
57 + }
58 +
59 + feedback('success', 'Se actualizó la información de recaudo');
60 +
61 + return redirect()->route('admin.payments.index');
35 62 }
36 63 }
app/Http/Controllers/Portal/PaymentController.php
https://gitlab.com/guille.agudelo/transito-frontend/-/commit/3b96018751a50be7d123742e543e609180c4228a 2/10
1/8/2020 Se agrega variable que establezca si una sucursal tiene su propia cuenta de... (3b960187) · Commits · Guillermo Agudelo / transito-frontend · GitLab
app/Http/Controllers/Portal/PortalController.php
app/InvoicePaid.php
... ... @@ -8,11 +8,11 @@ class InvoicePaid extends LarafireModel
8 8 {
9 9 protected $collectionName = 'invoicesPaids';
10 10
11 - public static function getMostRecent($branchId)
11 + public static function getMostRecent($branchId, $limit)
12 12 {
13 13 $invoices = InvoicePaid::where('idBranch', '=', $branchId)
14 14 ->orderBy('createAt', 'DESC')
15 - ->limit(10)
15 + ->limit($limit)
16 16 ->documents()
17 17 ->rows();
18 18
... ...
app/PaymentServiceInfo.php
... ... @@ -6,5 +6,5 @@ use App\Support\LarafireModel;
6 6
7 7 class PaymentServiceInfo extends LarafireModel
8 8 {
9 - protected $collectionName = 'invoicesDetails';
9 + protected $collectionName = 'paymentServiceInfos';
10 10 }
app/Providers/BladeServiceProvider.php
... ... @@ -61,6 +61,10 @@ class BladeServiceProvider extends ServiceProvider
61 61 return "<?php echo strftime('%e de %B', strtotime(\Carbon\Carbon::make($expression))); ?>";
62 62 });
63 63
64 + \Blade::directive('shortdate', function ($expression) {
65 + return "<?php echo \Carbon\Carbon::make($expression)->format('d/m/Y'); ?>";
https://gitlab.com/guille.agudelo/transito-frontend/-/commit/3b96018751a50be7d123742e543e609180c4228a 3/10
1/8/2020 Se agrega variable que establezca si una sucursal tiene su propia cuenta de... (3b960187) · Commits · Guillermo Agudelo / transito-frontend · GitLab
66 + });
67 +
64 68 \Blade::directive('money', function($value) {
65 69 return "<?php echo '$' . number_format((int)$value); ?>";
66 70 });
... ...
app/Support/LarafireUserModel.php
... ... @@ -199,6 +199,13 @@ class LarafireUserModel implements JsonSerializable
199 199 return $instance;
200 200 }
201 201
202 + public static function update($userId, $data)
203 + {
204 + $instance = self::getNewInstance();
205 + $instance->firebaseObject = $instance->auth->updateUser($userId, $data);
206 + return $this;
207 + }
208 +
202 209 public function updateInstance($data)
203 210 {
204 211 $this->firebaseObject = $this->auth->updateUser($this->id(), $data);
... ...
bootstrap/cache/config.php
... ... @@ -740,6 +740,12 @@
740 740 'secret' => '',
741 741 'region' => 'us-east-1',
742 742 ),
743 + 'payulatam' =>
744 + array (
745 + 'merchantId' => '508029',
746 + 'accountId' => '512321',
747 + 'apiKey' => '4Vj8eK4rloUd272L48hsrarnUA',
748 + ),
743 749 ),
744 750 'session' =>
745 751 array (
... ...
notas.txt
... ... @@ -4,14 +4,12 @@
4 4 . que la importacion de facturas y conceptos se haga en una transaction
5 5 . que muestre ayuda sobre los .csv en admin.invoices
6 6 . portal: que no permite crear mas de un turno para hoy ni agendar mas de uno para el mismo dia
7 - . terminar seccion "Recaudos en linea"
8 7
9 8 notas edwin
10 9 .mandar mensaje de archivo de cargue con mal formato
11 - .variable que indique si la sucursal recauda o no
12 - .pedir cedula en primer inicio sesion
13 10
14 11 ui
12 + . que el menu sidear muestre seccion activa
15 13
16 14 fix
17 15 . usuario final no puede agendar para mañana si lo hace tarde en la noche
... ... @@ -30,9 +28,8 @@ preguntas
30 28
31 29
32 30 hecho
33 - . importar facturas y conceptos
34 - . que se puedan ver las facturas activas y sin conceptos asociados en admin.invoices
35 - . portal: cliente puede consultar facturas
31 + .variable que indique si la sucursal recauda o no
32 + .pedir cedula en primer inicio sesion
36 33
37 34
38 35
... ...
resources/views/admin/branches/index.blade.php
https://gitlab.com/guille.agudelo/transito-frontend/-/commit/3b96018751a50be7d123742e543e609180c4228a 4/10
1/8/2020 Se agrega variable que establezca si una sucursal tiene su propia cuenta de... (3b960187) · Commits · Guillermo Agudelo / transito-frontend · GitLab
https://gitlab.com/guille.agudelo/transito-frontend/-/commit/3b96018751a50be7d123742e543e609180c4228a 5/10
1/8/2020 Se agrega variable que establezca si una sucursal tiene su propia cuenta de... (3b960187) · Commits · Guillermo Agudelo / transito-frontend · GitLab
resources/views/admin/dashboard.blade.php
https://gitlab.com/guille.agudelo/transito-frontend/-/commit/3b96018751a50be7d123742e543e609180c4228a 6/10
1/8/2020 Se agrega variable que establezca si una sucursal tiene su propia cuenta de... (3b960187) · Commits · Guillermo Agudelo / transito-frontend · GitLab
resources/views/admin/payments/index.blade.php
... ... @@ -10,6 +10,7 @@
10 10 <th>Trámite</th>
11 11 <th>Periodo</th>
12 12 <th class="text-center">Valor</th>
13 + <th class="text-center">Fecha Pago</th>
13 14 <th class="text-center">Estado</th>
14 15 </thead>
15 16 <tbody>
... ... @@ -26,6 +27,7 @@
26 27 <td class="text-right">
27 28 @money($invoice->foreign($invoices, 'idInvoice')->field('valor'))
28 29 </td>
30 + <td class="text-center ">@shortdate($invoice->field('createAt'))</td>
29 31 <td class="text-center">
30 32 <span class="badge badge-success">
31 33 {{$invoice->foreign($invoices, 'idInvoice')->field('state')}}
... ... @@ -41,18 +43,37 @@
41 43 </table>
42 44 </div>
43 45
46 + @if(\State::get('branch.ownMoneyCollection'))
47 + <h3 class="mb-0">Datos de la pasarela de pago PayULatam</h3>
48 + <p class="mb-1">
49 + <small>Estos datos son los que usará la app para registrar los recaudos a nombre de esta
sucursal.
50 + Busque esta información en las configuraciones de su cuenta PayULatam</small>
51 + </p>
52 + <form class="form-inline" action="{{route('admin.payments.info')}}" method="post">
53 + @csrf
54 + <input class="form-control mb-2 mr-sm-2"
55 + type="text"
56 + name="ref1"
57 + placeholder="MerchantId"
58 + required
59 + value="{{$paymentInfo ? $paymentInfo->field('reference1') : ''}}">
44 60
45 - <h3 class="mb-0">Datos de la pasarela de pago PayULatam</h3>
46 - <p class="mb-1">
47 - Estos datos son los que usará la app para registrar los recaudos a nombre de esta sucursal.
48 - Busque esta información en las configuraciones de su cuenta PayULatam
49 - </p>
50 - <form class="form-inline" action="{{route('admin.payments.info')}}" method="post">
51 - @csrf
52 - <input class="form-control mb-2 mr-sm-2" type="text" name="ref1" placeholder="MerchantId">
53 - <input class="form-control mb-2 mr-sm-2" type="text" name="ref2" placeholder="AccountId">
54 - <input class="form-control mb-2 mr-sm-2" type="text" name="ref3" placeholder="API Key">
55 - <button type="submit" class="btn btn-primary mb-2">Guardar</button>
56 - </form>
61 + <input class="form-control mb-2 mr-sm-2"
62 + type="text"
63 + name="ref2"
64 + placeholder="AccountId"
https://gitlab.com/guille.agudelo/transito-frontend/-/commit/3b96018751a50be7d123742e543e609180c4228a 7/10
1/8/2020 Se agrega variable que establezca si una sucursal tiene su propia cuenta de... (3b960187) · Commits · Guillermo Agudelo / transito-frontend · GitLab
65 + required
66 + value="{{$paymentInfo ? $paymentInfo->field('reference2') : ''}}">
67 +
68 + <input class="form-control mb-2 mr-sm-2"
69 + type="text"
70 + name="ref3"
71 + placeholder="API Key"
72 + required
73 + value="{{$paymentInfo ? $paymentInfo->field('reference3') : ''}}">
74 +
75 + <button type="submit" class="btn btn-primary mb-2">Guardar</button>
76 + </form>
77 + @endif
57 78 </div>
58 79 @endsection
resources/views/dashboard.blade.php
... ... @@ -11,21 +11,23 @@
11 11
12 12 <div class="mt-4 d-flex flex-column align-items-center">
13 13 <span class="mb-3">¿Qué quieres hacer hoy?</span>
14 - <a href="{{ route('queue.index') }}" class="btn btn-outline-primary btn-xl mb-3">
15 - <i class="fa fa-angle-double-right text-orange"></i>
16 - Generar Turnos
17 - </a>
18 - <a href="{{ route('turns.index') }}" class="btn btn-outline-primary btn-xl mb-3">
19 - <i class="fa fa-users text-success"></i>
20 - Atender Turnos
21 - </a>
22 - <a href="{{ route('tv') }}" class="btn btn-outline-primary btn-xl mb-3">
23 - <i class="ni ni-tv-2 text-danger"></i>
24 - Mostrar el Modo TV
25 - </a>
14 + <div class="d-flex flex-wrap justify-content-center w-75">
15 + <a href="{{ route('queue.index') }}" class="btn btn-outline-primary btn-xl mb-3 mb-3
dashboard-button mx-3 py-3">
16 + <i class="mb-2 fa-lg fa fa-angle-double-right text-orange"></i>
17 + <span>Generar Turnos</span>
18 + </a>
19 + <a href="{{ route('turns.index') }}" class="btn btn-outline-primary btn-xl mb-3 mb-3
dashboard-button mx-3 py-3">
20 + <i class="mb-2 fa-lg fa fa-users text-success"></i>
21 + <span>Atender Turnos</span>
22 + </a>
23 + <a href="{{ route('tv') }}" class="btn btn-outline-primary btn-xl mb-3 mb-3 dashboard-
button mx-3 py-3">
24 + <i class="mb-2 fa-lg ni ni-tv-2 text-danger"></i>
25 + <span>Mostrar el Modo TV</span>
26 + </a>
27 + </div>
26 28 </div>
27 29
28 - <div class="text-center mt-6">
30 + <div class="text-center mt-8">
29 31 <h2>
30 32 <img src="{{ \State::get('company.logo') }}" style="vertical-align:bottom" width="40">
31 33 {{ \State::get('company.name') }}
... ...
resources/views/layouts/includes/css.blade.php
https://gitlab.com/guille.agudelo/transito-frontend/-/commit/3b96018751a50be7d123742e543e609180c4228a 8/10
1/8/2020 Se agrega variable que establezca si una sucursal tiene su propia cuenta de... (3b960187) · Commits · Guillermo Agudelo / transito-frontend · GitLab
resources/views/portal/dashboard.blade.php
... ... @@ -11,14 +11,16 @@
11 11
12 12 <div class="mt-4 d-flex flex-column align-items-center">
13 13 <span class="mb-3">¿Qué quieres hacer hoy?</span>
14 - <a href="{{ route('portal.queue.index') }}" class="btn btn-outline-primary btn-xl mb-3">
15 - <i class="fa fa-concierge-bell text-success"></i>
16 - Crear y Administrar Turnos
17 - </a>
18 - <a href="{{ route('portal.payments.index') }}" class="btn btn-outline-primary btn-xl mb-3">
19 - <i class="fa fa-wallet text-orange"></i>
20 - Pagar en Línea
21 - </a>
14 + <div class="d-flex flex-wrap justify-content-center w-75">
15 + <a href="{{ route('portal.queue.index') }}" class="btn btn-outline-primary btn-xl mb-3
dashboard-button mx-3 py-3">
16 + <i class="mb-2 fa-lg fa fa-concierge-bell text-success"></i>
17 + <span>Crear y Administrar Turnos</span>
18 + </a>
19 + <a href="{{ route('portal.payments.index') }}" class="btn btn-outline-primary btn-xl mb-3
dashboard-button mx-3 py-3">
20 + <i class="mb-2 fa-lg fa fa-wallet text-orange"></i>
21 + <span>Pagar en Línea</span>
22 + </a>
23 + </div>
22 24 </div>
23 25
24 26 <div class="text-center mt-6">
... ... @@ -32,5 +34,35 @@
32 34
33 35 {{-- @include('layouts.footers.auth') --}}
34 36 </div>
37 +
38 + <div class="modal fade" id="identificationModal" tabindex="-1" role="dialog" aria-
labelledby="identificationModalLabel" aria-hidden="true">
39 + <div class="modal-dialog" role="document">
40 + <div class="modal-content">
41 + <div class="modal-header">
42 + <h5 class="modal-title" id="identificationModalLabel">Información requerida</h5>
43 + </div>
44 + <div class="modal-body">
45 + <form action="{{route('portal.update-identification')}}" method="post">
46 + @csrf
47 + <div class="form-group">
48 + <label for="">Por favor, ingrese su número de identificación</label>
49 + <input type="text" name="identification" required class="form-control">
50 + </div>
51 + <input type="submit" class="d-none" id="submit">
52 + </form>
53 + </div>
54 + <div class="modal-footer">
55 + <button type="button" class="btn btn-primary"
onclick="$('#submit').click()">Guardar</button>
56 + </div>
57 + </div>
58 + </div>
59 + </div>
35 60 @endsection
61 + @if(\State::get('client.identification') == null || \State::get('client.identification') == '')
62 + @push('js')
63 + <script>
64 + $('#identificationModal').modal({backdrop: 'static', keyboard: false})
65 + </script>
66 + @endpush
67 + @endif
36 68
routes/web.php
... ... @@ -122,6 +122,7 @@ Route::group([
122 122 'namespace' => 'Portal',
123 123 ], function() {
124 124 Route::get('', 'PortalController@home')->name('home');
https://gitlab.com/guille.agudelo/transito-frontend/-/commit/3b96018751a50be7d123742e543e609180c4228a 9/10
1/8/2020 Se agrega variable que establezca si una sucursal tiene su propia cuenta de... (3b960187) · Commits · Guillermo Agudelo / transito-frontend · GitLab
https://gitlab.com/guille.agudelo/transito-frontend/-/commit/3b96018751a50be7d123742e543e609180c4228a 10/10