Base
This commit is contained in:
30
resources/js/app.js
Normal file
30
resources/js/app.js
Normal file
@ -0,0 +1,30 @@
|
||||
require('./bootstrap');
|
||||
|
||||
var autocomplete = require('jquery-ui/ui/widgets/autocomplete');
|
||||
|
||||
$(document).ready(function() {
|
||||
$('form:first').find('*').filter(':input:visible:first').focus();
|
||||
|
||||
$('.dropdown-submenu>a').on("click", function(e) {
|
||||
$(this).next('ul').toggle();
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
|
||||
require('./jquery.filterTable');
|
||||
require('./binaryIndexOf');
|
||||
|
||||
require('jquery.rut');
|
||||
|
||||
String.prototype.ucwords = function() {
|
||||
str = this.toLowerCase();
|
||||
return str.replace(/(^([a-zA-Z\p{M}]))|([ -][a-zA-Z\p{M}])/g,
|
||||
function(s) {
|
||||
return s.toUpperCase();
|
||||
});
|
||||
};
|
||||
|
||||
require('./chart');
|
||||
|
||||
window.zxcvbn = require('zxcvbn');
|
28
resources/js/binaryIndexOf.js
Normal file
28
resources/js/binaryIndexOf.js
Normal file
@ -0,0 +1,28 @@
|
||||
function binaryIndexOf(searchElement) {
|
||||
'use strict';
|
||||
|
||||
var minIndex = 0;
|
||||
var maxIndex = this.length - 1;
|
||||
var currentIndex;
|
||||
var currentElement;
|
||||
var resultIndex;
|
||||
|
||||
while (minIndex <= maxIndex) {
|
||||
resultIndex = currentIndex = (minIndex + maxIndex) / 2 | 0;
|
||||
currentElement = this[currentIndex];
|
||||
|
||||
if (currentElement < searchElement) {
|
||||
minIndex = currentIndex + 1;
|
||||
}
|
||||
else if (currentElement > searchElement) {
|
||||
maxIndex = currentIndex - 1;
|
||||
}
|
||||
else {
|
||||
return currentIndex;
|
||||
}
|
||||
}
|
||||
|
||||
return ~maxIndex;
|
||||
}
|
||||
|
||||
Array.prototype.binaryIndexOf = binaryIndexOf;
|
11
resources/js/bootstrap.js
vendored
Normal file
11
resources/js/bootstrap.js
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
/**
|
||||
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
|
||||
* for JavaScript based Bootstrap features such as modals and tabs. This
|
||||
* code may be modified to fit the specific needs of your application.
|
||||
*/
|
||||
|
||||
window.$ = window.jQuery = require('jquery');
|
||||
|
||||
require('bootstrap');
|
||||
require('bootstrap-3-typeahead');
|
2
resources/js/chart.js
Normal file
2
resources/js/chart.js
Normal file
@ -0,0 +1,2 @@
|
||||
window.Chart = require('chart.js');
|
||||
require('chartjs-plugin-barchart-background');
|
68
resources/js/jquery.filterTable.js
Normal file
68
resources/js/jquery.filterTable.js
Normal file
@ -0,0 +1,68 @@
|
||||
(function($) {
|
||||
$.fn.filterTable = function(options)
|
||||
{
|
||||
var input = this;
|
||||
|
||||
var excludeFilter = function(row, col, headers, excludes) {
|
||||
var exclude = false;
|
||||
var cols = $(headers.get(row)).find('th');
|
||||
|
||||
if (excludes.indexOf($(cols.get(col)).html().toUpperCase()) > -1) {
|
||||
exclude = true;
|
||||
}
|
||||
|
||||
return exclude;
|
||||
}
|
||||
|
||||
this.keyup(function(e) {
|
||||
var settings = $.extend({
|
||||
"table": "filteredTable",
|
||||
"excludes": [],
|
||||
"height": 1
|
||||
}, options);
|
||||
var id_table = settings.table;
|
||||
var excludes = settings.excludes;
|
||||
var height = settings.height;
|
||||
|
||||
for (i = 0; i < excludes.length; i ++) {
|
||||
excludes[i] = excludes[i].toUpperCase();
|
||||
}
|
||||
|
||||
var filter = input.val().toUpperCase();
|
||||
var table = $('#' + id_table);
|
||||
var rows = table.find('tbody tr');
|
||||
var headers = table.find('thead tr');
|
||||
|
||||
if (filter == '') {
|
||||
rows.css('display', '');
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < rows.length; i += height) {
|
||||
var cols;
|
||||
var found = false;
|
||||
for (n = 0; n < height; n ++) {
|
||||
cols = $(rows.get(i + n)).find('td');
|
||||
$.each(cols, function(j, e) {
|
||||
if (excludeFilter(n, j, headers, excludes)) {
|
||||
return;
|
||||
}
|
||||
if ($(this).html().toUpperCase().indexOf(filter) > -1) {
|
||||
found = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (found) {
|
||||
for (n = 0; n < height; n ++) {
|
||||
$(rows.get(i + n)).css('display', '');
|
||||
}
|
||||
} else {
|
||||
for (n = 0; n < height; n ++) {
|
||||
$(rows.get(i + n)).css('display', 'none');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return this;
|
||||
}
|
||||
}(jQuery));
|
9
resources/less/_variables.less
Normal file
9
resources/less/_variables.less
Normal file
@ -0,0 +1,9 @@
|
||||
@icon-font-path: '~bootstrap/dist/fonts';
|
||||
|
||||
@palette1: #333;
|
||||
@palette2: #f78820;
|
||||
|
||||
@page_heading: #14153c;
|
||||
@grey: #a9a9a9;
|
||||
@dark-grey: #808080;
|
||||
@light-grey: #d3d3d3;
|
9
resources/less/app.less
Normal file
9
resources/less/app.less
Normal file
@ -0,0 +1,9 @@
|
||||
@import "_variables";
|
||||
|
||||
@import "bootstrap";
|
||||
|
||||
//@import "node_modules/font-awesome/less/font-awesome";
|
||||
|
||||
@import "custom";
|
||||
|
||||
@import (less) "node_modules/jquery-ui-bootstrap/jquery.ui.theme.css";
|
2
resources/less/bootstrap.less
vendored
Normal file
2
resources/less/bootstrap.less
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
@import "node_modules/bootstrap/less/bootstrap";
|
||||
//@import "node_modules/bootstrap-datepicker/less/datepicker3";
|
50
resources/less/custom.less
Normal file
50
resources/less/custom.less
Normal file
@ -0,0 +1,50 @@
|
||||
@import "submenu";
|
||||
@import "print";
|
||||
|
||||
.logo_cabezal {
|
||||
padding: 1%;
|
||||
img {
|
||||
height: @line-height-base * @font-size-base * 5;
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-submenu {
|
||||
position: relative;
|
||||
|
||||
.dropdown-menu {
|
||||
top: 0;
|
||||
left: 100%;
|
||||
margin-top: -1px;
|
||||
}
|
||||
}
|
||||
|
||||
.error {
|
||||
background-color: darken(@brand-danger, .9);
|
||||
}
|
||||
|
||||
.page-heading {
|
||||
padding: 3px 10px;
|
||||
margin: auto 0;
|
||||
background-color: @page_heading;
|
||||
color: white;
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
.section-heading {
|
||||
background-color: @dark-grey !important;
|
||||
color: white !important;
|
||||
|
||||
a {
|
||||
color: inherit !important;
|
||||
}
|
||||
}
|
||||
.subsection-heading {
|
||||
background-color: @light-grey !important;
|
||||
}
|
||||
|
||||
.agregar, .remover, .click {
|
||||
cursor: pointer;
|
||||
}
|
101
resources/less/print.less
Normal file
101
resources/less/print.less
Normal file
@ -0,0 +1,101 @@
|
||||
@media print {
|
||||
header, footer, .benchmark {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
#print {
|
||||
width: 100%;
|
||||
|
||||
div.title {
|
||||
font-size: 15pt;
|
||||
font-weight: bold;
|
||||
border-bottom: 3px solid black;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.data-box {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
td {
|
||||
border: thin solid black;
|
||||
padding-left: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
table.details {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
|
||||
thead {
|
||||
color: white;
|
||||
background-color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
tbody {
|
||||
tr {
|
||||
border: thin solid black;
|
||||
&:nth-child(odd) {
|
||||
background-color: lightgray;
|
||||
}
|
||||
&.total {
|
||||
font-weight: bold;
|
||||
td {
|
||||
border-top-style: double;
|
||||
border-top-width: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
td, th {
|
||||
border: thin solid black;
|
||||
padding-left: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
label {
|
||||
font-variant: small-caps;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
div.data {
|
||||
float: left;
|
||||
}
|
||||
div.data-value {
|
||||
float: right;
|
||||
}
|
||||
div.total {
|
||||
float: left;
|
||||
font-weight: bold;
|
||||
}
|
||||
div.total-value {
|
||||
float: right;
|
||||
font-weight: bold;
|
||||
}
|
||||
br.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
table.signature {
|
||||
width: 75%;
|
||||
tr {
|
||||
&.double {
|
||||
height: 12pt * 2;
|
||||
}
|
||||
&.triple {
|
||||
height: 12pt * 3;
|
||||
}
|
||||
&.quadruple {
|
||||
height: 12pt * 4;
|
||||
}
|
||||
td {
|
||||
padding-left: 2px;
|
||||
border: thin solid black;
|
||||
&:nth-child(2) {
|
||||
width: 70%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
42
resources/less/submenu.less
Normal file
42
resources/less/submenu.less
Normal file
@ -0,0 +1,42 @@
|
||||
.dropdown-submenu {
|
||||
position: relative;
|
||||
.dropdown-menu {
|
||||
top: 0;
|
||||
left: 100%;
|
||||
margin-top: -6px;
|
||||
margin-left: -1px;
|
||||
-webkit-border-radius: 0 6px 6px 6px;
|
||||
-moz-border-radius: 0 6px 6px;
|
||||
border-radius: 0 6px 6px 6px;
|
||||
}
|
||||
&:hover>.dropdown-menu {
|
||||
display: block;
|
||||
a:after {
|
||||
border-left-color: #fff;
|
||||
}
|
||||
}
|
||||
a:after {
|
||||
display: block;
|
||||
content: " ";
|
||||
float: right;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-color: transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 0 5px 5px;
|
||||
border-left-color: #ccc;
|
||||
margin-top: 5px;
|
||||
margin-right: -10px;
|
||||
}
|
||||
.pull-left {
|
||||
float: none;
|
||||
|
||||
.dropdown-menu {
|
||||
left: -100%;
|
||||
margin-left: 10px;
|
||||
-webkit-border-radius: 6px 0 6px 6px;
|
||||
-moz-border-radius: 6px 0 6px 6px;
|
||||
border-radius: 6px 0 6px 6px;
|
||||
}
|
||||
}
|
||||
}
|
43
resources/views/admin/base.blade.php
Normal file
43
resources/views/admin/base.blade.php
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>
|
||||
@if (isset($titulo))
|
||||
{{$titulo}} -
|
||||
@endif
|
||||
Incoviba S. A.</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/app.css" />
|
||||
<link rel="icon" type="image/png" href="images/Isotipo 32.png" />
|
||||
<script type="text/javascript" src="js/app.js"></script>
|
||||
|
||||
@stack('styles')
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="logo_cabezal">
|
||||
<a href="."><img src="images/logo_cabezal.png" /></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@include('admin.menu')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('layout.footer')
|
||||
@stack('scripts')
|
||||
</body>
|
||||
</html>
|
40
resources/views/admin/menu.blade.php
Normal file
40
resources/views/admin/menu.blade.php
Normal file
@ -0,0 +1,40 @@
|
||||
<nav class="navbar navbar-default">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href=".">Inicio</a></li>
|
||||
<li><a href="{{url('', ['p' => 'admin'])}}">Administración</a>
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
Modelos <span class="caret"></span>
|
||||
</a>
|
||||
@include('admin.menu.models')
|
||||
</li>
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
Roles <span class="caret"></span>
|
||||
</a>
|
||||
@include('admin.menu.roles')
|
||||
</li>
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
Usuarios <span class="caret"></span>
|
||||
</a>
|
||||
@include('admin.menu.users')
|
||||
</li>
|
||||
<li><a href="{{url('admin/registros')}}">Registros</a></li>
|
||||
<?php
|
||||
/*
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
Registros <span class="caret"></span>
|
||||
</a>
|
||||
@include('admin.menu.registros')
|
||||
</li>
|
||||
*/ ?>
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
{{\App\Contract\Auth::User()->name}} <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.login')
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
3
resources/views/admin/menu/models.blade.php
Normal file
3
resources/views/admin/menu/models.blade.php
Normal file
@ -0,0 +1,3 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{url('', ['p' => 'admin', 'a' => 'listModels'])}}">Listar Modelos</a></li>
|
||||
</ul>
|
3
resources/views/admin/menu/registros.blade.php
Normal file
3
resources/views/admin/menu/registros.blade.php
Normal file
@ -0,0 +1,3 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{nUrl('registros', 'list')}}">Listar Registros</a></li>
|
||||
</ul>
|
4
resources/views/admin/menu/roles.blade.php
Normal file
4
resources/views/admin/menu/roles.blade.php
Normal file
@ -0,0 +1,4 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{nUrl('admin', 'list_roles')}}">Listar Roles</a></li>
|
||||
<li><a href="{{nUrl('admin', 'add_role')}}">Agregar Rol</a></li>
|
||||
</ul>
|
4
resources/views/admin/menu/users.blade.php
Normal file
4
resources/views/admin/menu/users.blade.php
Normal file
@ -0,0 +1,4 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{url('', ['p' => 'admin', 'a' => 'list_users'])}}">Listar Usuarios</a></li>
|
||||
<li><a href="{{url('', ['p' => 'admin', 'a' => 'add_user'])}}">Agregar Usuario</a></li>
|
||||
</ul>
|
31
resources/views/admin/models.blade.php
Normal file
31
resources/views/admin/models.blade.php
Normal file
@ -0,0 +1,31 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">DB to Models</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{url('', ['p' => 'admin', 'a' => 'models'])}}" method="post" class="form-horizontal" id="databases">
|
||||
<div class="row form-group">
|
||||
<div class="col-md-3">DB</div>
|
||||
<div class="col-md-4">
|
||||
<select name="database" class="form-control">
|
||||
@foreach ($databases as $database)
|
||||
<option value="{{$database}}">{{$database}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col-md-offset-3 col-md-2"><input type="submit" value="Listar" class="form-control" /></div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="results"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript" src="js/admin.js"></script>
|
||||
@endpush
|
31
resources/views/admin/registros/controles_avance.blade.php
Normal file
31
resources/views/admin/registros/controles_avance.blade.php
Normal file
@ -0,0 +1,31 @@
|
||||
<div class="row">
|
||||
<div class="col-md-1">
|
||||
@if ($start > 0)
|
||||
<a href="{{url('admin/registros')}}">
|
||||
<span class="glyphicon glyphicon-fast-backward"></span>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-1">
|
||||
@if ($start > 0)
|
||||
<a href="{{url('admin/registros/') . ($start - $step + 1) . '/' . (($end > 0) ? $end - $step : $step * 2)}}">
|
||||
<span class="glyphicon glyphicon-chevron-left"></span>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-offset-3 col-md-2 text-center">{{$start + 1}} - {{$end}}</div>
|
||||
<div class="col-md-offset-3 col-md-1 text-right">
|
||||
@if ($end < $total)
|
||||
<a href="{{url('admin/registros/') . (($end > 0) ? $end + 1 : $step) . '/' . (($end > 0) ? $end + $step : $step * 2)}}">
|
||||
<span class="glyphicon glyphicon-chevron-right"></span>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-1 text-right">
|
||||
@if ($end < $total)
|
||||
<a href="{{url('admin/registros/') . (round($total / $step, 0) * $step + 1) . '/' . (round($total / $step, 0) *$step + $step)}}">
|
||||
<span class="glyphicon glyphicon-fast-forward"></span>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
41
resources/views/admin/registros/list.blade.php
Normal file
41
resources/views/admin/registros/list.blade.php
Normal file
@ -0,0 +1,41 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Registros</div>
|
||||
<div class="panel-body">
|
||||
@include('admin.registros.controles_avance')
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Usuario</th>
|
||||
<th>Roles</th>
|
||||
<th>Fecha - Hora</th>
|
||||
<th>Modelo</th>
|
||||
<th>Cambios</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($registros as $registro)
|
||||
<tr>
|
||||
<td>{{$registro->user()->name}}</td>
|
||||
<td>
|
||||
@foreach ($registro->user()->roles() as $rol)
|
||||
<span class="label label-default" style="padding: 3px; background-color: {{$colores[$rol->level]->toRGB()}};
|
||||
@if ($colores[$rol->level]->isDark())
|
||||
color: #fff;
|
||||
@endif
|
||||
">{{ucwords($rol->description)}}</span>
|
||||
@endforeach
|
||||
</td>
|
||||
<td><a href="{{url('admin/registro/' . $registro->id)}}">{{$registro->time()->format('d-m-Y - H:i:s')}} hrs.</a></td>
|
||||
<td>{{$registro->model()}}</td>
|
||||
<td>{{count($registro->actions())}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@include('admin.registros.controles_avance')
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
62
resources/views/admin/registros/show.blade.php
Normal file
62
resources/views/admin/registros/show.blade.php
Normal file
@ -0,0 +1,62 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Ver Registro</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-2"><strong>Usuario</strong></div>
|
||||
<div class="col-md-5">{{$registro->user()->name}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-2"><strong>Roles</strong></div>
|
||||
<div class="col-md-8">
|
||||
@foreach ($registro->user()->roles() as $rol)
|
||||
<span style="padding: 3px; background-color: {{$colores[$rol->level]->toRGB()}};
|
||||
@if ($colores[$rol->level]->isDark())
|
||||
color: #fff;
|
||||
@endif
|
||||
">{{ucwords($rol->description)}}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-2"><strong>Fecha - Hora</strong></div>
|
||||
<div class="col-md-8">{{$registro->time()->format('d-m-Y - H:i:s')}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-2"><strong>Modelo</strong></div>
|
||||
<div class="col-md-8">{{$registro->model()}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-2"><strong>Cambios</strong></div>
|
||||
<div class="col-md-10">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2">Columna</th>
|
||||
<th class="text-center" colspan="2">Valor</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Antiguo</th>
|
||||
<th>Nuevo</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($registro->actions() as $column => $action)
|
||||
<tr>
|
||||
<td>{{$column}}</td>
|
||||
<td>{{$action->old}}</td>
|
||||
<td>{{$action->new}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<a href="{{nUrl('registros', 'list')}}"><span class="glyphicon glyphicon-chevron-left"></span> Volver</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
17
resources/views/admin/roles/add.blade.php
Normal file
17
resources/views/admin/roles/add.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-12 h3">Agregar Rol</div>
|
||||
</div>
|
||||
<br />
|
||||
<form action="{{url('', ['p' => 'admin', 'a' => 'do_add_role'])}}" method="post" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Descripción</div>
|
||||
<div class="col-md-3"><input type="text" name="description" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button type="submit" class="form-control">Create</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
40
resources/views/admin/roles/add_permissions.blade.php
Normal file
40
resources/views/admin/roles/add_permissions.blade.php
Normal file
@ -0,0 +1,40 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-12 h3">Agregar Permisos - {{$role->description}}</div>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('admin', 'do_add_role_permissions', ['role' => $role->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Permitidos</div>
|
||||
<div class="col-md-3"><select name="allowed[]" class="form-control" multiple="multiple">
|
||||
@foreach ($actions as $action)
|
||||
<option value="{{$action->id}}"
|
||||
@if ($role->checkAccess($action->description))
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{$action->description}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
<?php
|
||||
/*
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Denegados</div>
|
||||
<div class="col-md-3"><select name="denied[]" class="form-control" multiple="multiple">
|
||||
@foreach ($actions as $action)
|
||||
<option value="{{$action->id}}"
|
||||
@if (!$role->checkAccess($action->description))
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{$action->description}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
*/ ?>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button class="form-control" type="submit">Agregar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
24
resources/views/admin/roles/add_users.blade.php
Normal file
24
resources/views/admin/roles/add_users.blade.php
Normal file
@ -0,0 +1,24 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-12 h3">Agregar Usuario - {{$role->description}}</div>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{url('', ['p' => 'admin', 'a' => 'do_add_user_role', 'role' => $role->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Ususarios</div>
|
||||
<div class="col-md-3"><select name="users[]" class="form-control" multiple="multiple">
|
||||
@foreach ($users as $user)
|
||||
@if ($role->hasUser($user->id))
|
||||
@continue
|
||||
@endif
|
||||
<option value="{{$user->id}}">{{$user->name}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button type="submit" class="form-control">Agregar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
32
resources/views/admin/roles/list.blade.php
Normal file
32
resources/views/admin/roles/list.blade.php
Normal file
@ -0,0 +1,32 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
<div class="page-heading row">
|
||||
<div class="col-md-6 h3">Roles</div>
|
||||
<div class="col-md-6 text-right h3"><a href="{{url('', ['p' => 'admin', 'a' => 'add_role'])}}"><span class="glyphicon glyphicon-plus"></span></a></div>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Descripción</th>
|
||||
<th>Nivel</th>
|
||||
<th>Usuarios</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($roles as $role)
|
||||
<tr>
|
||||
<td><a href="{{nUrl('admin', 'role', ['role' => $role->id])}}">{{$role->description}}</a></td>
|
||||
<td>{{$role->level}}</td>
|
||||
<td>
|
||||
@foreach ($role->users() as $user)
|
||||
{{$user->name}}
|
||||
@endforeach
|
||||
</td>
|
||||
<td><a href="{{url('', ['p' => 'admin', 'a' => 'delete_role'])}}"><span class="glyphicon glyphicon-minus"></span></a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endsection
|
63
resources/views/admin/roles/show.blade.php
Normal file
63
resources/views/admin/roles/show.blade.php
Normal file
@ -0,0 +1,63 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-12 h3">{{$role->description}}</div>
|
||||
</div>
|
||||
<div class="section-heading row">
|
||||
<div class="col-md-6 h4">Usuarios</div>
|
||||
<div class="col-md-6 h4 text-right"><a href="{{url('', ['p' => 'admin', 'a' => 'add_user_role', 'role' => $role->id])}}"><span class="glyphicon glyphicon-plus"></span></a></div>
|
||||
</div>
|
||||
<table class="table">
|
||||
@foreach ($role->users() as $user)
|
||||
<tr>
|
||||
<td><a href="{{nUrl('admin', 'user', ['user' => $user->id])}}">{{$user->name}}</a></td>
|
||||
<td><a href="{{url('', ['p' => 'admin', 'a' => 'remove_user_role', 'user' => $user->id, 'role' => $role->id])}}"><span class="glyphicon glyphicon-minus"></span></a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
<div class="row section-heading">
|
||||
<div class="col-md-6 h4">Permisos</div>
|
||||
<div class="col-md-6 h4 text-right"><a href="{{nUrl('admin', 'add_role_permissions', ['role' => $role->id])}}"><span class="glyphicon glyphicon-plus"></span></a></div>
|
||||
</div>
|
||||
@if ($role->permissions())
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Acción</th>
|
||||
<th>Estado</th>
|
||||
<th>Heredado</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($permissions as $permission)
|
||||
<tr>
|
||||
<td>{{$permission->description}}</td>
|
||||
<td style="color:
|
||||
@if ($permission->status)
|
||||
#00ff00
|
||||
@else
|
||||
#ff0000
|
||||
@endif
|
||||
;">
|
||||
@if ($permission->status) Permitido @else Denegado @endif
|
||||
</td>
|
||||
<td style="color:
|
||||
@if ($permission->inherited)
|
||||
#00ff00
|
||||
@else
|
||||
#ff0000
|
||||
@endif
|
||||
;">
|
||||
@if ($permission->inherited)
|
||||
Si
|
||||
@else
|
||||
No
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
@endsection
|
21
resources/views/admin/users/add.blade.php
Normal file
21
resources/views/admin/users/add.blade.php
Normal file
@ -0,0 +1,21 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-12 h3">Agregar Ususario</div>
|
||||
</div>
|
||||
<br />
|
||||
<form action="{{url('', ['p' => 'admin', 'a' => 'do_add_user'])}}" method="post" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Usuario</div>
|
||||
<div class="col-md-3"><input type="text" name="name" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Password</div>
|
||||
<div class="col-md-3"><input type="password" name="password" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button type="submit" class="form-control">Create</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
24
resources/views/admin/users/add_role.blade.php
Normal file
24
resources/views/admin/users/add_role.blade.php
Normal file
@ -0,0 +1,24 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-12 h3">Agregar Rol - {{$user->name}}</div>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{url('', ['p' => 'admin', 'a' => 'do_add_user_role', 'user' => $user->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Rol</div>
|
||||
<div class="col-md-3"><select name="role[]" class="form-control" multiple="multiple">
|
||||
@foreach ($roles as $role)
|
||||
@if ($user->hasRole($role->id))
|
||||
@continue
|
||||
@endif
|
||||
<option value="{{$role->id}}">{{$role->description}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button type="submit" class="form-control">Agregar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
29
resources/views/admin/users/list.blade.php
Normal file
29
resources/views/admin/users/list.blade.php
Normal file
@ -0,0 +1,29 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
<div class="page-heading row">
|
||||
<div class="col-md-6 h3">Usuarios</div>
|
||||
<div class="col-md-6 text-right h3"><a href="{{url('', ['p' => 'admin', 'a' => 'add_user'])}}"><span class="glyphicon glyphicon-plus"></span></a></div>
|
||||
</div>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nombre</th>
|
||||
<th>Roles</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($users as $user)
|
||||
<tr>
|
||||
<td><a href="{{url('', ['p' => 'admin', 'a' => 'user', 'user' => $user->id])}}">{{$user->name}}</a></td>
|
||||
<td>
|
||||
@foreach ($user->roles() as $role)
|
||||
{{$role->description}}
|
||||
@endforeach
|
||||
</td>
|
||||
<td><a href="{{url('', ['p' => 'admin', 'a' => 'delete_user', 'user' => $user->id])}}"><span class="glyphicon glyphicon-minus"></span></a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endsection
|
62
resources/views/admin/users/show.blade.php
Normal file
62
resources/views/admin/users/show.blade.php
Normal file
@ -0,0 +1,62 @@
|
||||
@extends('admin.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-12 h3">{{$user->name}}</div>
|
||||
</div>
|
||||
<a href="{{nUrl('admin', 'reset_user', ['user' => $user->id])}}">
|
||||
Resetear Clave
|
||||
</a>
|
||||
<div class="section-heading row">
|
||||
<div class="col-md-6 h4">Roles</div>
|
||||
<div class="col-md-6 h4 text-right"><a href="{{url('', ['p' => 'admin', 'a' => 'add_user_role', 'user' => $user->id])}}"><span class="glyphicon glyphicon-plus"></span></a></div>
|
||||
</div>
|
||||
<table class="table">
|
||||
@foreach ($user->roles() as $role)
|
||||
<tr>
|
||||
<td><a href="{{nUrl('admin', 'role', ['role' => $role->id])}}">{{$role->description}}</a></td>
|
||||
<td><a href="{{url('', ['p' => 'admin', 'a' => 'remove_user_role', 'user' => $user->id, 'role' => $role->id])}}"><span class="glyphicon glyphicon-minus"></span></a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
<div class="row section-heading">
|
||||
<div class="col-md-6 h4">Permisos</div>
|
||||
<div class="col-md-6 h4 text-right"><a href="{{nUrl('admin', 'add_user_permissions', ['user' => $user->id])}}"><span class="glyphicon glyphicon-plus"></span></a></div>
|
||||
</div>
|
||||
@if ($user->permissions())
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Páginas</th>
|
||||
<th>Rol</th>
|
||||
<th>Acceso</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($user->permissions() as $permission)
|
||||
<tr>
|
||||
<td>
|
||||
{{$permission->action()->description}}
|
||||
</td>
|
||||
<td>
|
||||
@if ($permission->type == 2)
|
||||
{{$permission->who()->description}}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($permission->all == 0)
|
||||
@if ($permission->access == 1)
|
||||
Permitido
|
||||
@else
|
||||
Denegado
|
||||
@endif
|
||||
@else
|
||||
Permitido
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endif
|
||||
@endsection
|
57
resources/views/auth/base.blade.php
Normal file
57
resources/views/auth/base.blade.php
Normal file
@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>
|
||||
@if (isset($titulo))
|
||||
{{$titulo}} -
|
||||
@endif
|
||||
Incoviba S. A.</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/app.css" />
|
||||
<link rel="icon" type="image/png" href="images/Isotipo 32.png" />
|
||||
<script type="text/javascript" src="js/app.js"></script>
|
||||
|
||||
@stack('styles')
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="logo_cabezal">
|
||||
<a href="."><img src="images/logo_cabezal.png" /></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<nav class="navbar navbar-default">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href=".">Inicio</a></li>
|
||||
@if (\App\Contract\Auth::isIn())
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
{{\App\Contract\Auth::User()->name}} <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.login')
|
||||
</li>
|
||||
@else
|
||||
<li><a href="{{url('', ['p' => 'auth', 'a' => 'login'])}}">Ingresar</a></li>
|
||||
@endif
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('layout.footer')
|
||||
@stack('scripts')
|
||||
</body>
|
||||
</html>
|
78
resources/views/auth/change_pass.blade.php
Normal file
78
resources/views/auth/change_pass.blade.php
Normal file
@ -0,0 +1,78 @@
|
||||
@extends('auth.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-12 h3">Cambio de Cláve</div>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{url('', ['p' => 'auth', 'a' => 'do_change_pass'])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Cláve anterior</div>
|
||||
<div class="col-md-3"><input type="password" name="old" class="form-control" /></div>
|
||||
<div class="col-md-3" id="msg1"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Cláve nueva</div>
|
||||
<div class="col-md-3"><input type="password" name="new" class="form-control" /></div>
|
||||
<div class="col-md-3" id="msg2"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Repetir cláve</div>
|
||||
<div class="col-md-3"><input type="password" name="new2" class="form-control" /></div>
|
||||
<div class="col-md-3" id="msg3"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button type="submit" class="form-control">Cambiar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var status = [0, 0, 0, 0];
|
||||
$("input[name='old']").blur(function(e) {
|
||||
$.post('{!!nUrl('auth', 'check_pass', ['ajax' => 'true'])!!}', {"password": $(this).val()}, function(data) {
|
||||
if (data == 'KO') {
|
||||
$('#msg1').html('<span class="label label-danger"><span class="glyphicon glyphicon-warning-sign"></span> Cláve anterior inválida.</span>');
|
||||
status[1] = 0;
|
||||
} else {
|
||||
$('#msg1').html('<span class="label label-success"><span class="glyphicon glyphicon-ok "></span></span>');
|
||||
status[1] = 1;
|
||||
}
|
||||
});
|
||||
})
|
||||
$("input[name='new']").blur(function(e) {
|
||||
var result = zxcvbn($(this).val(), user_inputs=[$("input[name='old']").val(), '{{\App\Contract\Auth::User()->name}}']);
|
||||
if (result.score < 3) {
|
||||
$('#msg2').html('<span class="label label-danger"><span class="glyphicon glyphicon-warning-sign"></span> Nivel ' + result.score + '</span>');
|
||||
status[2] = 0;
|
||||
} else {
|
||||
if (result.score == 3) {
|
||||
$('#msg2').html('<span class="label label-warning"><span class="glyphicon glyphicon-ok"></span> Nivel ' + result.score + '</span>');
|
||||
} else {
|
||||
$('#msg2').html('<span class="label label-success"><span class="glyphicon glyphicon-ok"></span> Nivel ' + result.score + '</span>');
|
||||
}
|
||||
status[2] = 1;
|
||||
}
|
||||
});
|
||||
$("input[name='new2']").blur(function(e) {
|
||||
var n = $("input[name='new']").val();
|
||||
if ($(this).val() != n) {
|
||||
$('#msg3').html('<span class="label label-danger"><span class="glyphicon glyphicon-warning-sign"></span> Las cláves no coinciden.</span>');
|
||||
status[3] = 0;
|
||||
} else {
|
||||
$('#msg3').html('<span class="label label-success"><span class="glyphicon glyphicon-ok"></span></span>');
|
||||
status[3] = 1;
|
||||
}
|
||||
});
|
||||
$("form").submit(function(e) {
|
||||
status[0] = status[1] & status[2] & status[3];
|
||||
if (!status[0]) {
|
||||
e.preventDefault();
|
||||
}
|
||||
return status[0];
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
17
resources/views/auth/login.blade.php
Normal file
17
resources/views/auth/login.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
@extends('auth.base')
|
||||
|
||||
@section('content')
|
||||
<form class="form-horizontal" action="{{url('', ['p' => 'auth', 'a' => 'do_login'])}}" method="post">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Usuario</div>
|
||||
<div class="col-md-3"><input type="text" name="name" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Cláve</div>
|
||||
<div class="col-md-3"><input type="password" name="password" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><input type="submit" value="Ingresar" class="form-control" /></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
7
resources/views/benchmark.blade.php
Normal file
7
resources/views/benchmark.blade.php
Normal file
@ -0,0 +1,7 @@
|
||||
<br />
|
||||
<div class="benchmark container">
|
||||
<div class="row alert alert-info">
|
||||
<div class="col-md-2">Tiempo demorado</div>
|
||||
<div class="col-md-5">{{$benchmark->time}} s</div>
|
||||
</div>
|
||||
</div>
|
77
resources/views/buscar/buscar.blade.php
Normal file
77
resources/views/buscar/buscar.blade.php
Normal file
@ -0,0 +1,77 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Buscar</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{url('', ['p' => 'buscar'])}}" method="get" class="form form-horizontal">
|
||||
<input type="hidden" name="p" value="buscar" />
|
||||
<div class="form-group">
|
||||
<div class="col-md-6"><input type="text" name="q" class="form-control"
|
||||
@if (get('q'))
|
||||
value="{!!urldecode(get('q'))!!}"
|
||||
@elseif (get('query'))
|
||||
value="{!!urldecode(get('query'))!!}"
|
||||
@endif
|
||||
/></div>
|
||||
<div class="col-md-2"><input type="submit" value="Buscar" class="form-control" /></div>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-12 text-center">
|
||||
<input type="radio" name="tipo" value="{{urlencode($tipos[0])}}"
|
||||
@if (get('tipo') == null or get('tipo') == $tipos[0])
|
||||
checked="checked"
|
||||
@endif
|
||||
/>
|
||||
{{ucwords($tipos[0])}}
|
||||
</div>
|
||||
@foreach ($tipos as $i => $tipo)
|
||||
@if ($tipo == 'cualquiera')
|
||||
@continue
|
||||
@endif
|
||||
<div class="col-md-6">
|
||||
<input type="radio" name="tipo" value="{{urlencode($tipo)}}"
|
||||
@if (get('tipo') != null)
|
||||
@if ($tipo == get('tipo'))
|
||||
checked="checked"
|
||||
@endif
|
||||
@else
|
||||
@if ($tipo == 'cualquiera')
|
||||
checked="checked"
|
||||
@endif
|
||||
@endif
|
||||
/>
|
||||
{{ucwords($tipo)}}
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@if ($results != null)
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Resultados</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Proyecto</th>
|
||||
<th>Departamento</th>
|
||||
<th>Propietario</th>
|
||||
<th>Tipo</th>
|
||||
<th>m²</th>
|
||||
<th>Valor [UF]</th>
|
||||
<th>Fecha Venta</th>
|
||||
<th>Fecha Entrega</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($results as $resultado)
|
||||
@include('buscar.resultado')
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
46
resources/views/buscar/resultado.blade.php
Normal file
46
resources/views/buscar/resultado.blade.php
Normal file
@ -0,0 +1,46 @@
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{url('', ['p' => 'buscar', 'q' => urlencode('"' . $resultado->proyecto()->descripcion . '"'), 't' => 'proyecto'])}}">
|
||||
{{$resultado->proyecto()->descripcion}} <span class="small glyphicon glyphicon-search"></span>
|
||||
</a>
|
||||
</td>
|
||||
@if (method_exists($resultado, 'unidad'))
|
||||
<td>
|
||||
<a href="{{url('', ['p' => 'ventas', 'a' => 'show', 'venta' => $resultado->id])}}">
|
||||
{{$resultado->unidad()->descripcion}}
|
||||
@if ($resultado->estado == 0)
|
||||
(r)
|
||||
@elseif ($resultado->estado == -1)
|
||||
(c)
|
||||
@endif
|
||||
<span class="small glyphicon glyphicon-chevron-right"></span>
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{url('', ['p' => 'buscar', 'q' => urlencode('"' . $resultado->propietario()->nombreCompleto() . '"'), 't' => 'propietario'])}}">
|
||||
{{$resultado->propietario()->nombreCompleto()}} <span class="small glyphicon glyphicon-search"></span>
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ucwords($resultado->unidad()->tipo()->descripcion)}}</td>
|
||||
<td>{{\App\Helper\Format::m2($resultado->unidad()->m2())}}</td>
|
||||
<td>{{\App\Helper\Format::ufs($resultado->valor_uf)}}</td>
|
||||
<td>{{\App\Helper\Format::shortDate($resultado->fecha)}}</td>
|
||||
<td>
|
||||
@if ($resultado->entrega != 0)
|
||||
{{\App\Helper\Format::shortDate($resultado->entrega()->fecha)}}
|
||||
@endif
|
||||
</td>
|
||||
@else
|
||||
<td>
|
||||
{{$resultado->descripcion}} <span class="glyphicon glyphicon-ban-circle"></span>
|
||||
</td><td>
|
||||
<td>{{ucwords($resultado->tipo()->descripcion)}}</td>
|
||||
<td>{{\App\Helper\Format::m2($resultado->m2())}}</td>
|
||||
@if ($resultado->valor)
|
||||
<td>{{format('ufs', $resultado->valor)}}</td>
|
||||
@else
|
||||
<td></td>
|
||||
@endif
|
||||
<td></td>
|
||||
@endif
|
||||
</tr>
|
17
resources/views/calendario.blade.php
Normal file
17
resources/views/calendario.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
<div class="ui divided list" style="max-width: 300px;">
|
||||
@foreach ($dias as $dia => $proyectos)
|
||||
<div class="item">
|
||||
<div class="date"><strong>{{format('localDate', $dia, 'ddd DD [de] MMMM [de] YYYY', true)}}</strong></div>
|
||||
<div class="ui feed">
|
||||
@foreach ($proyectos as $proyecto => $cantidad)
|
||||
<div class="event">
|
||||
<div class="content">
|
||||
<div class="summary">{{$proyecto}}</div>
|
||||
</div>
|
||||
<div class="meta">{{$cantidad}}</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
31
resources/views/cierres.blade.php
Normal file
31
resources/views/cierres.blade.php
Normal file
@ -0,0 +1,31 @@
|
||||
<h3 class="ui header">Cierres Vigentes</h3>
|
||||
<div class="ui divided list" style="max-width: 300px;">
|
||||
@foreach ($cierres as $proyecto => $cierre)
|
||||
<div class="item">
|
||||
<div class="date"><strong>{{$proyecto}}</strong> [{{$cierre->total}}]</div>
|
||||
<div class="ui feed">
|
||||
<div class="event">
|
||||
<div class="content">
|
||||
<div class="summary">Promesados</div>
|
||||
</div>
|
||||
<div class="meta">{{count($cierre->vigentes)}}</div>
|
||||
</div>
|
||||
<div class="event">
|
||||
<div class="content">
|
||||
<div class="summary">Pendientes</div>
|
||||
@if (count($cierre->pendientes) > 0)
|
||||
<div class="date">Desde {{$cierre->pendientes[0]->periodo()}} días atrás</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="meta">{{count($cierre->pendientes)}}</div>
|
||||
</div>
|
||||
<div class="event">
|
||||
<div class="content">
|
||||
<div class="summary">Rechazados</div>
|
||||
</div>
|
||||
<div class="meta">{{count($cierre->rechazados)}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
5
resources/views/construccion.blade.php
Normal file
5
resources/views/construccion.blade.php
Normal file
@ -0,0 +1,5 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
Sección en construcción.
|
||||
@endsection
|
38
resources/views/form/fecha.blade.php
Normal file
38
resources/views/form/fecha.blade.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php $t = \Carbon\Carbon::today(config('app.timezone')) ?>
|
||||
<div class="col-md-1"><select name="day{{(isset($id)) ? $id : ''}}" class="form-control">
|
||||
@for ($i = 0; $i < 31; $i ++)
|
||||
<option value="{{$i + 1}}"
|
||||
@if (isset($f))
|
||||
@if ($f->day == $i + 1)
|
||||
selected="selected"
|
||||
@endif
|
||||
@elseif ($t->day == $i + 1)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
|
||||
@endfor
|
||||
</select></div>
|
||||
<div class="col-md-1"><select name="month{{(isset($id)) ? $id : ''}}" class="form-control">
|
||||
@for ($i = 0; $i < 12; $i ++)
|
||||
<option value="{{$i + 1}}"
|
||||
@if (isset($f))
|
||||
@if ($f->month == $i + 1)
|
||||
selected="selected"
|
||||
@endif
|
||||
@elseif ($t->month == $i + 1)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
|
||||
@endfor
|
||||
</select></div>
|
||||
<div class="col-md-2"><select name="year{{(isset($id)) ? $id : ''}}" class="form-control">
|
||||
@for ($i = $t->year; $i > $t->year - 5; $i --)
|
||||
<option value="{{$i}}"
|
||||
@if (isset($f))
|
||||
@if ($f->year == $i)
|
||||
selected="selected"
|
||||
@endif
|
||||
@endif
|
||||
>{{$i}}</option>
|
||||
@endfor
|
||||
</select></div>
|
57
resources/views/guest.blade.php
Normal file
57
resources/views/guest.blade.php
Normal file
@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>
|
||||
@if (isset($titulo))
|
||||
{{$titulo}} -
|
||||
@endif
|
||||
Incoviba S. A.</title>
|
||||
<link rel="stylesheet" type="text/css" href="css/app.css" />
|
||||
<link rel="icon" type="image/png" href="images/Isotipo 32.png" />
|
||||
<script type="text/javascript" src="js/app.js"></script>
|
||||
|
||||
@stack('styles')
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="logo_cabezal">
|
||||
<a href="."><img src="images/logo_cabezal.png" /></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<nav class="navbar navbar-default">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href=".">Inicio</a></li>
|
||||
@if (\App\Contract\Auth::isIn())
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
{{Auth::User()}} <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.login')
|
||||
</li>
|
||||
@else
|
||||
<li><a href="{{url('', ['p' => 'auth', 'a' => 'login'])}}">Ingresar</a></li>
|
||||
@endif
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
Hola invitad@, favor ingresar.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('layout.footer')
|
||||
@stack('scripts')
|
||||
</body>
|
||||
</html>
|
28
resources/views/home.blade.php
Normal file
28
resources/views/home.blade.php
Normal file
@ -0,0 +1,28 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
@if ($hoy > 0)
|
||||
<div clasS="row">
|
||||
<div class="col-md-12">Hay {{$hoy}} deposito{{($hoy > 1) ? 's' : ''}} para hoy.</div>
|
||||
</div>
|
||||
@endif
|
||||
@if ($pendientes > 0)
|
||||
<div class="row">
|
||||
<div class="col-md-12"><a href="{{url('', ['p' => 'cuotas', 'a' => 'pendientes'])}}">Existe{{($pendientes > 1) ? 'n' : ''}} {{$pendientes}} cuota{{($pendientes > 1) ? 's' : ''}} pendiente{{($pendientes > 1) ? 's' : ''}}. <span class="glyphicon glyphicon-arrow-right"></span></a></div>
|
||||
</div>
|
||||
@endif
|
||||
<table class="ui table">
|
||||
<tr>
|
||||
@if (count($dias) > 0)
|
||||
<td>
|
||||
@include('calendario')
|
||||
</td>
|
||||
@endif
|
||||
@if (count($cierres) > 0)
|
||||
<td>
|
||||
@include('cierres')
|
||||
</td>
|
||||
@endif
|
||||
</tr>
|
||||
</table>
|
||||
@endsection
|
49
resources/views/informes/comisiones.blade.php
Normal file
49
resources/views/informes/comisiones.blade.php
Normal file
@ -0,0 +1,49 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="page-heading">
|
||||
<h2>Comisiones - {{$proyecto->descripcion}}</h2>
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Departamento</th>
|
||||
<th>Propietario</th>
|
||||
<th class="text-center">Estacionamientos</th>
|
||||
<th class="text-center">Bodegas</th>
|
||||
<th colspan="2" class="text-center">Precio</th>
|
||||
<th colspan="2" class="text-center">Comisión</th>
|
||||
<th>Operador</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4"></th>
|
||||
<th class="text-right">Promesa</th>
|
||||
<th class="text-right">Neto</th>
|
||||
<th class="text-center">%</th>
|
||||
<th class="text-right">UF</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($ventas as $venta)
|
||||
<tr>
|
||||
<td><a href="{{nUrl('ventas', 'show', ['venta' => $venta->id])}}">{{$venta->unidad()->descripcion}}</a></td>
|
||||
<td>{{$venta->propietario()->nombreCompleto()}}</td>
|
||||
<td class="text-center">{{implode(' - ', $venta->propiedad()->estacionamientos('array'))}}</td>
|
||||
<td class="text-center">{{implode(' - ', $venta->propiedad()->bodegas('array'))}}</td>
|
||||
<td class="text-right">{{format('ufs', $venta->valor_uf, null, true)}}</td>
|
||||
<td class="text-right">{{format('ufs', $venta->valorCorredora(), null, true)}}</td>
|
||||
<td class="text-center">1,5 %</td>
|
||||
<td class="text-right">{{format('ufs', $venta->valorCorredora() * 1.5 / 100, null, true)}}</td>
|
||||
<td>{{($venta->agente != 0 and $venta->agente()->agente != 1) ? $venta->agente()->agente()->descripcion : ''}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<td colspan="4"><b>Total</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->precio, null, true)}}</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->neto, null, true)}}</b></td>
|
||||
<td class="text-center"><b>1,5 %</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->comision, null, true)}}</b></td>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- <a href="{{nUrl('informes', 'comisiones_xlsx', ['ventas' => implode(',', $ids)])}}">Excel</a> -->
|
||||
@endsection
|
68
resources/views/informes/contabilidad.blade.php
Normal file
68
resources/views/informes/contabilidad.blade.php
Normal file
@ -0,0 +1,68 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<h2>Contabilidad</h2>
|
||||
<form action="#" class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<div class="col-md-1">Mes</div>
|
||||
<div class="col-md-3"><select name="mes" class="form-control">
|
||||
<option value="">Todo</option>
|
||||
<?php $f = Carbon\Carbon::today(); ?>
|
||||
@for ($y = date('Y'); $y >= date('Y') - 5; $y --)
|
||||
@for ($m = 12; $m > 0; $m --)
|
||||
@if ($y == date('Y') and $m >= date('m'))
|
||||
@continue
|
||||
@endif
|
||||
<option value="{{$y}}-{{$m}}" @if ($m == $f->month-1 and $y == $f->year) selected="selected" @endif>{{ucwords(strftime('%B - %Y', mktime(0, 0, 0, $m, 1, $y)))}}</option>
|
||||
@endfor
|
||||
@endfor
|
||||
</select></div>
|
||||
</div>
|
||||
</form>
|
||||
<div id="proyectos">
|
||||
@include('informes.proyectos', ['a' => 'contabilidad'])
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
function changeUrl(url, field, change) {
|
||||
if (url.indexOf(field) > -1) {
|
||||
var nurl = [];
|
||||
var info = url.split('&');
|
||||
$.each(info, function(k, v) {
|
||||
if (v.indexOf(field) == -1) {
|
||||
nurl.push(v);
|
||||
} else {
|
||||
if (change != '') {
|
||||
nurl.push(field + '=' + change);
|
||||
}
|
||||
}
|
||||
});
|
||||
nurl = nurl.join('&');
|
||||
return nurl;
|
||||
} else {
|
||||
if (change != '') {
|
||||
nurl = url + '&' + field + '=' + change;
|
||||
return nurl;
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
function updateUrls(select, link_id) {
|
||||
var f = $("select[name='" + select + "']").val();
|
||||
var links = $('#' + link_id + ' a');
|
||||
links.each(function(k, v) {
|
||||
url = $(v).attr('href');
|
||||
nurl = changeUrl(url, 'fecha', f);
|
||||
$(v).attr('href', nurl);
|
||||
});
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$("select[name='mes']").change(function(e) {
|
||||
updateUrls('mes', 'proyectos');
|
||||
});
|
||||
updateUrls('mes', 'proyectos');
|
||||
});
|
||||
</script>
|
||||
@endpush
|
6
resources/views/informes/escrituras.blade.php
Normal file
6
resources/views/informes/escrituras.blade.php
Normal file
@ -0,0 +1,6 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<h2>Escrituras</h2>
|
||||
@include('informes.proyectos', ['a' => 'escrituras'])
|
||||
@endsection
|
6
resources/views/informes/gantt_entregas.blade.php
Normal file
6
resources/views/informes/gantt_entregas.blade.php
Normal file
@ -0,0 +1,6 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<h2>Gantt de Entregas</h2>
|
||||
@include('informes.proyectos', ['a' => 'gantt_entregas'])
|
||||
@endsection
|
25
resources/views/informes/para_comision.blade.php
Normal file
25
resources/views/informes/para_comision.blade.php
Normal file
@ -0,0 +1,25 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="page-heading">
|
||||
<h2>Comisiones</h2>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('informes', 'comisiones')}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Proyecto</div>
|
||||
<div class="col-md-3"><select class="form-control" name="proyecto">
|
||||
@foreach ($proyectos as $proyecto)
|
||||
<option value="{{$proyecto->id}}">{{$proyecto->descripcion}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Unidades</div>
|
||||
<div class="col-md-5"><textarea name="unidades" class="form-control" rows="5"></textarea></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button type="submit" class="form-control">Buscar</button>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
12
resources/views/informes/proyectos.blade.php
Normal file
12
resources/views/informes/proyectos.blade.php
Normal file
@ -0,0 +1,12 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">Proyectos</div>
|
||||
<ul class="list-group">
|
||||
@foreach ($proyectos as $proyecto)
|
||||
<li class="list-group-item">
|
||||
<a href="{{url('', ['p' => 'informes', 'a' => $a, 'proyecto' => $proyecto->id])}}">
|
||||
{{$proyecto->descripcion}} - {{$proyecto->inmobiliaria()->abreviacion}}
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
6
resources/views/informes/resciliaciones.blade.php
Normal file
6
resources/views/informes/resciliaciones.blade.php
Normal file
@ -0,0 +1,6 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<h2>Resciliaciones</h2>
|
||||
@include('informes.proyectos', ['a' => 'resciliaciones'])
|
||||
@endsection
|
8
resources/views/informes/resumen_contabilidad.blade.php
Normal file
8
resources/views/informes/resumen_contabilidad.blade.php
Normal file
@ -0,0 +1,8 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<h2>Resumen para Contabilidad</h2>
|
||||
<div id="proyectos">
|
||||
@include('informes.proyectos', ['a' => 'resumen_contabilidad'])
|
||||
</div>
|
||||
@endsection
|
6
resources/views/informes/ventas.blade.php
Normal file
6
resources/views/informes/ventas.blade.php
Normal file
@ -0,0 +1,6 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<h2>Ventas</h2>
|
||||
@include('informes.proyectos', ['a' => 'ventas'])
|
||||
@endsection
|
50
resources/views/inmobiliarias/add.blade.php
Normal file
50
resources/views/inmobiliarias/add.blade.php
Normal file
@ -0,0 +1,50 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Agregar Inmobiliaria</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form method="post" class="form-horizontal" action="{{url('', ['p' => 'inmobiliarias', 'a' => 'agregar'])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">RUT</div>
|
||||
<div class="col-md-3"><input type="text" name="rut" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Razón Social</div>
|
||||
<div class="col-md-5"><input type="text" name="razon" class="form-control" /></div>
|
||||
<div class="col-md-2">
|
||||
<select name="sociedad" class="form-control">
|
||||
@foreach ($sociedades as $sociedad)
|
||||
<option value="{{$sociedad->id}}">{{$sociedad->abreviacion}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Abreviación</div>
|
||||
<div class="col-md-4"><input type="text" name="abrev" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><input type="submit" value="Agregar" class="form-control" /></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("input[name='rut']").rut({"formatOn": 'keyup', "validateOn": 'blur'}).on('rutInvalido', function(e) {
|
||||
$(this).parent().next().remove();
|
||||
$(this).parent().after($('<div></div>').attr('class', 'col-md-2 alert-danger').html('Rut inválido'));
|
||||
}).on('rutValido', function(e, rut, dv) {
|
||||
$(this).parent().next().remove();
|
||||
|
||||
$.post('{!!url('', ['p' => 'ajax', 'a' => 'inmobiliarias', 'ajax' => true])!!}', {'rut': rut}, function(data) {
|
||||
$("input[name='razon']").val(data.razon);
|
||||
$("input[name='abrev']").val(data.abreviacion);
|
||||
}, 'json');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
54
resources/views/inmobiliarias/edit.blade.php
Normal file
54
resources/views/inmobiliarias/edit.blade.php
Normal file
@ -0,0 +1,54 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="page-heading">
|
||||
<h3>Editar <a href="{{nUrl('inmobiliarias', 'show', ['rut' => $inmobiliaria->rut])}}">{{$inmobiliaria->abreviacion}}</a></h3>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('inmobiliarias', 'do_edit', ['rut' => $inmobiliaria->rut])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">RUT</div>
|
||||
<div class="col-md-3"><input type="text" name="rut" class="form-control" value="{{$inmobiliaria->rut}}" /></div>
|
||||
<div class="col-md-1"><input type="text" name="dv" class="form-control" value="{{$inmobiliaria->dv}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Abreviación</div>
|
||||
<div class="col-md-3"><input type="text" name="abreviacion" class="form-control" value="{{$inmobiliaria->abreviacion}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Razón Social</div>
|
||||
<div class="col-md-4"><input type="text" name="razon" value="{{$inmobiliaria->razon}}" class="form-control" /></div>
|
||||
<div class="col-md-2">
|
||||
<select name="sociedad" class="form-control">
|
||||
@foreach ($sociedades as $sociedad)
|
||||
<option value="{{$sociedad->id}}"
|
||||
@if ($sociedad->id == $inmobiliaria->sociedad)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{$sociedad->abreviacion}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Banco</div>
|
||||
<div class="col-md-3"><select name="banco" class="form-control">
|
||||
<option value="0">---</option>
|
||||
@foreach ($bancos as $banco)
|
||||
<option value="{{$banco->id}}"
|
||||
@if ($banco->id == $inmobiliaria->id)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{$banco->nombre}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Cuenta</div>
|
||||
<div class="col-md-3"><input type="text" name="cuenta" class="form-control" value="{{$inmobiliaria->cuenta}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button type="submit" class="form-control">Edit</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
31
resources/views/inmobiliarias/list.blade.php
Normal file
31
resources/views/inmobiliarias/list.blade.php
Normal file
@ -0,0 +1,31 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-10 h3">Inmobiliarias</div>
|
||||
<div class="col-md-2 text-right h4">
|
||||
<a href="{{url('', ['p' => 'inmobiliarias', 'a' => 'add'])}}">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui segment">
|
||||
<div class="ui cards">
|
||||
@foreach ($inmobiliarias as $inmobiliaria)
|
||||
<div class="card">
|
||||
<div class="content">
|
||||
<div class="header">
|
||||
<a href="{{nUrl('inmobiliarias', 'show', ['rut' => $inmobiliaria->rut])}}">{{$inmobiliaria->nombre()}}</a>
|
||||
</div>
|
||||
<div class="meta">
|
||||
{{$inmobiliaria->rut()}}
|
||||
</div>
|
||||
<div class="description">
|
||||
{{$inmobiliaria->razon(true)}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
47
resources/views/inmobiliarias/show.blade.php
Normal file
47
resources/views/inmobiliarias/show.blade.php
Normal file
@ -0,0 +1,47 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-10">
|
||||
<h3>Inmobiliaria {{$inmobiliaria->nombre()}}</h3>
|
||||
</div>
|
||||
<div class="col-md-2 text-right h3">
|
||||
<a href="{{url('', ['p' => 'inmobiliarias', 'a' => 'edit', 'rut' => $inmobiliaria->rut])}}">
|
||||
<span class="glyphicon glyphicon-edit"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-2">RUT</div>
|
||||
<div class="col-md-4">{{format('rut', $inmobiliaria->rut)}}-{{$inmobiliaria->dv}}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-2">Razón Social</div>
|
||||
<div class="col-md-10">{{$inmobiliaria->razon(true)}}</div>
|
||||
</div>
|
||||
@if ($inmobiliaria->banco != 0)
|
||||
<div class="row">
|
||||
<div class="col-md-2">Cuenta</div>
|
||||
<div class="col-md-2">{{$inmobiliaria->banco()->nombre}}</div>
|
||||
<div class="col-md-3">{{$inmobiliaria->cuenta}}</div>
|
||||
</div>
|
||||
@endif
|
||||
<br />
|
||||
<div class="row">
|
||||
<div class="col-md-2">Proyectos</div>
|
||||
<div class="col-md-10 text-right"><a href="{{url('', ['p' => 'proyectos', 'a' => 'add', 'inmobiliaria' => $inmobiliaria->rut])}}"><span class="glyphicon glyphicon-plus"></span></a></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<table class="table table-striped">
|
||||
@foreach ($inmobiliaria->proyectos() as $proyecto)
|
||||
<tr>
|
||||
<td><a href="{{url('', ['p' => 'proyectos', 'a' => 'show', 'proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a></td>
|
||||
<td>{{$proyecto->estado()->tipo()->etapa()->descripcion}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
47
resources/views/install/admin.blade.php
Normal file
47
resources/views/install/admin.blade.php
Normal file
@ -0,0 +1,47 @@
|
||||
@extends('install.base')
|
||||
|
||||
@section('content')
|
||||
<h3>Create Admin</h3>
|
||||
<form class="form-horizontal" method="post" action="create_admin.php">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Username</div>
|
||||
<div class="col-md-3"><input type="text" name="name" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Password</div>
|
||||
<div class="col-md-3"><input type="password" name="password" class="form-control" /></div>
|
||||
<div class="col-md-3" id="msg2"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-2"><button type="submit" class="form-control">Create</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
status = 0;
|
||||
$("input[name='password']").blur(function(e) {
|
||||
var result = zxcvbn($(this).val(), user_inputs=[$("input[name='name']").val()]);
|
||||
if (result.score < 3) {
|
||||
$('#msg2').html('<span class="label label-danger"><span class="glyphicon glyphicon-warning-sign"></span> Nivel ' + result.score + '</span>');
|
||||
status = 0;
|
||||
} else {
|
||||
if (result.score == 3) {
|
||||
$('#msg2').html('<span class="label label-warning"><span class="glyphicon glyphicon-ok"></span> Nivel ' + result.score + '</span>');
|
||||
} else {
|
||||
$('#msg2').html('<span class="label label-success"><span class="glyphicon glyphicon-ok"></span> Nivel ' + result.score + '</span>');
|
||||
}
|
||||
status = 1;
|
||||
}
|
||||
});
|
||||
$("form").submit(function(e) {
|
||||
if (!status) {
|
||||
e.preventDefault();
|
||||
}
|
||||
return status;
|
||||
});
|
||||
};
|
||||
</script>
|
||||
@endpush
|
38
resources/views/install/base.blade.php
Normal file
38
resources/views/install/base.blade.php
Normal file
@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>
|
||||
@if (isset($titulo))
|
||||
{{$titulo}} -
|
||||
@endif
|
||||
Incoviba S. A.</title>
|
||||
<link rel="stylesheet" type="text/css" href="../css/app.css" />
|
||||
<link rel="icon" type="image/png" href="../images/Isotipo 32.png" />
|
||||
<script type="text/javascript" src="../js/app.js"></script>
|
||||
|
||||
@stack('styles')
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="logo_cabezal">
|
||||
<a href="."><img src="../images/logo_cabezal.png" /></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('layout.footer')
|
||||
@stack('scripts')
|
||||
</body>
|
||||
</html>
|
5
resources/views/install/end.blade.php
Normal file
5
resources/views/install/end.blade.php
Normal file
@ -0,0 +1,5 @@
|
||||
@extends('install.base')
|
||||
|
||||
@section('content')
|
||||
Installation ended. Go to <a href="../">Inicio</a>. Remember to remove install folder.
|
||||
@endsection
|
6
resources/views/install/start.blade.php
Normal file
6
resources/views/install/start.blade.php
Normal file
@ -0,0 +1,6 @@
|
||||
@extends('install.base')
|
||||
|
||||
@section('content')
|
||||
Start Installation
|
||||
<a href="next_step.php">Create Tables</a>
|
||||
@endsection
|
31
resources/views/layout/base.blade.php
Normal file
31
resources/views/layout/base.blade.php
Normal file
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>
|
||||
@if (isset($titulo))
|
||||
{{$titulo}} -
|
||||
@endif
|
||||
Incoviba S. A.</title>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.7.8/semantic.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/app.css" />
|
||||
<link rel="stylesheet" type="text/css" href="css/custom.css" />
|
||||
<link rel="icon" type="image/png" href="images/Isotipo 32.png" />
|
||||
<script type="text/javascript" src="js/app.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.7.8/semantic.min.js"></script>
|
||||
|
||||
@stack('styles')
|
||||
</head>
|
||||
<body>
|
||||
@include('layout.header')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('layout.footer')
|
||||
@stack('scripts')
|
||||
</body>
|
||||
</html>
|
0
resources/views/layout/footer.blade.php
Normal file
0
resources/views/layout/footer.blade.php
Normal file
16
resources/views/layout/header.blade.php
Normal file
16
resources/views/layout/header.blade.php
Normal file
@ -0,0 +1,16 @@
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="logo_cabezal">
|
||||
<a href="."><img src="images/logo_cabezal.png" /></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@include('layout.menu')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
1
resources/views/layout/icons/abonar.blade.php
Normal file
1
resources/views/layout/icons/abonar.blade.php
Normal file
@ -0,0 +1 @@
|
||||
<span class="glyphicon glyphicon-piggy-bank small" title="Abonar"></span>
|
5
resources/views/layout/icons/add.blade.php
Normal file
5
resources/views/layout/icons/add.blade.php
Normal file
@ -0,0 +1,5 @@
|
||||
<span class="glyphicon glyphicon-plus
|
||||
@if (isset($small) and $small)
|
||||
small
|
||||
@endif
|
||||
" title="Agregar"></span>
|
5
resources/views/layout/icons/edit.blade.php
Normal file
5
resources/views/layout/icons/edit.blade.php
Normal file
@ -0,0 +1,5 @@
|
||||
<span class="glyphicon glyphicon-edit
|
||||
@if (isset($small) and $small)
|
||||
small
|
||||
@endif
|
||||
" title="Editar"></span>
|
1
resources/views/layout/icons/pagar.blade.php
Normal file
1
resources/views/layout/icons/pagar.blade.php
Normal file
@ -0,0 +1 @@
|
||||
<span class="glyphicon glyphicon-usd small" title="Pagar"></span>
|
5
resources/views/layout/icons/remove.blade.php
Normal file
5
resources/views/layout/icons/remove.blade.php
Normal file
@ -0,0 +1,5 @@
|
||||
<span class="glyphicon glyphicon-remove
|
||||
@if (isset($small) and $small)
|
||||
small
|
||||
@endif
|
||||
" title="Eliminar"></span>
|
9
resources/views/layout/icons/show.blade.php
Normal file
9
resources/views/layout/icons/show.blade.php
Normal file
@ -0,0 +1,9 @@
|
||||
<span class="glyphicon glyphicon-{{$icon}}
|
||||
@if (isset($small) and $small)
|
||||
small
|
||||
@endif
|
||||
"
|
||||
@if (isset($title))
|
||||
title="{{$title}}"
|
||||
@endif
|
||||
></span>
|
62
resources/views/layout/menu.blade.php
Normal file
62
resources/views/layout/menu.blade.php
Normal file
@ -0,0 +1,62 @@
|
||||
<nav class="navbar navbar-default">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href=".">Inicio</a></li>
|
||||
@if (\App\Contract\Auth::isIn())
|
||||
@if (\App\Contract\Auth::checkAccess('ventas'))
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
Ventas <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.ventas')
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (\App\Contract\Auth::checkAccess('proyectos'))
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
Proyectos <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.proyectos')
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (\App\Contract\Auth::checkAccess('inmobiliarias'))
|
||||
<li><a href="{{url('', ['p' => 'inmobiliarias', 'a' => 'list'])}}">Inmobiliarias</a></li>
|
||||
@endif
|
||||
|
||||
@if (\App\Contract\Auth::checkAccess('viewInformesContabilidad'))
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
Contabilidad <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.informes')
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (\App\Contract\Auth::checkAccess('viewHerramientas'))
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
Herramientas <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.herramientas')
|
||||
</li>
|
||||
@endif
|
||||
@else
|
||||
<li><a href="{{url('', ['p' => 'auth', 'a' => 'login'])}}">Ingresar</a></li>
|
||||
@endif
|
||||
</ul>
|
||||
@if (\App\Contract\Auth::isIn())
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
{{\App\Contract\Auth::User()->name}} <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.login')
|
||||
</li>
|
||||
@if (\App\Contract\Auth::checkAccess('buscar'))
|
||||
<li style="font-size: large; border-left: 1px solid #e7e7e7;"><a href="{{url('', ['p' => 'buscar'])}}"><span class="glyphicon glyphicon-search"></span></a></li>
|
||||
<li style="margin-right: 15px;"> </li>
|
||||
@endif
|
||||
</ul>
|
||||
@endif
|
||||
</nav>
|
62
resources/views/layout/menu.blade.php.save
Normal file
62
resources/views/layout/menu.blade.php.save
Normal file
@ -0,0 +1,62 @@
|
||||
<nav class="navbar navbar-default">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href=".">Inicio</a></li>
|
||||
@if (\App\Contract\Auth::isIn())
|
||||
@if (\App\Contract\Auth::checkAccess('ventas'))
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
Ventas <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.ventas')
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (\App\Contract\Auth::checkAccess('proyectos'))
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
Proyectos <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.proyectos')
|
||||
|
||||
@endif
|
||||
|
||||
@if (\App\Contract\Auth::checkAccess('inmobiliarias'))
|
||||
<li><a href="{{url('', ['p' => 'inmobiliarias', 'a' => 'list'])}}">Inmobiliarias</a></li>
|
||||
@endif
|
||||
|
||||
@if (\App\Contract\Auth::checkAccess('viewInformesContabilidad'))
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
Contabilidad <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.informes')
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (\App\Contract\Auth::checkAccess('viewHerramientas'))
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
Herramientas <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.herramientas')
|
||||
</li>
|
||||
@endif
|
||||
@else
|
||||
<li><a href="{{url('', ['p' => 'auth', 'a' => 'login'])}}">Ingresar</a></li>
|
||||
@endif
|
||||
</ul>
|
||||
@if (\App\Contract\Auth::isIn())
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li role="presentation" class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
{{\App\Contract\Auth::User()->name}} <span class="caret"></span>
|
||||
</a>
|
||||
@include('layout.menu.login')
|
||||
</li>
|
||||
@if (\App\Contract\Auth::checkAccess('buscar'))
|
||||
<li style="font-size: large; border-left: 1px solid #e7e7e7;"><a href="{{url('', ['p' => 'buscar'])}}"><span class="glyphicon glyphicon-search"></span></a></li>
|
||||
<li style="margin-right: 15px;"> </li>
|
||||
@endif
|
||||
</ul>
|
||||
@endif
|
||||
</nav>
|
3
resources/views/layout/menu/herramientas.blade.php
Normal file
3
resources/views/layout/menu/herramientas.blade.php
Normal file
@ -0,0 +1,3 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="http://{{config('locations.money')}}">Valores Monetarios</a></li>
|
||||
</ul>
|
4
resources/views/layout/menu/informes.blade.php
Normal file
4
resources/views/layout/menu/informes.blade.php
Normal file
@ -0,0 +1,4 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{url('', ['p' => 'informes', 'a' => 'contabilidad'])}}">Pagos Mes</a></li>
|
||||
<li><a href="{{url('', ['p' => 'informes', 'a' => 'resumen_contabilidad'])}}">Resumen</a></li>
|
||||
</ul>
|
3
resources/views/layout/menu/inmobiliarias.blade.php
Normal file
3
resources/views/layout/menu/inmobiliarias.blade.php
Normal file
@ -0,0 +1,3 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{url('', ['p' => 'inmobiliarias', 'a' => 'list'])}}">Listado</a></li>
|
||||
</ul>
|
8
resources/views/layout/menu/login.blade.php
Normal file
8
resources/views/layout/menu/login.blade.php
Normal file
@ -0,0 +1,8 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{url('', ['p' => 'auth', 'a' => 'change_pass'])}}">Cambiar Cláve</a></li>
|
||||
@if (\App\Contract\Auth::checkAccess('admin'))
|
||||
<li><a href="{{url('', ['p' => 'admin'])}}">Administración</a></li>
|
||||
@endif
|
||||
|
||||
<li><a href="{{url('', ['p' => 'auth', 'a' => 'logout'])}}">Salir</a></li>
|
||||
</ul>
|
4
resources/views/layout/menu/proyectos.blade.php
Normal file
4
resources/views/layout/menu/proyectos.blade.php
Normal file
@ -0,0 +1,4 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{url('', ['p' => 'proyectos', 'a' => 'list'])}}">Listado</a></li>
|
||||
<li><a href="{{url('', ['p' => 'proyectos', 'a' => 'unidades'])}}">Unidades</a></li>
|
||||
</ul>
|
24
resources/views/layout/menu/ventas.blade.php
Normal file
24
resources/views/layout/menu/ventas.blade.php
Normal file
@ -0,0 +1,24 @@
|
||||
<ul class="dropdown-menu">
|
||||
<li class="dropdown-submenu"><a>Listado</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{nUrl('precios', 'listProyectos')}}">Precios</a></li>
|
||||
<li><a href="{{url('', ['p' => 'cierres', 'a' => 'list'])}}">Cierres</a></li>
|
||||
<li><a href="{{url('', ['p' => 'ventas', 'a' => 'list'])}}">Ventas</a></li>
|
||||
<li><a href="{{url('', ['p' => 'cuotas', 'a' => 'pendientes'])}}">Cuotas Pendientes</a></li>
|
||||
<li><a href="{{url('', ['p' => 'cuotas', 'a' => 'para_abonar'])}}">Abonar Cuotas</a></li>
|
||||
<li><a href="{{url('', ['p' => 'pagos', 'a' => 'pendientes'])}}">Pagos Pendientes</a></li>
|
||||
<li><a href="{{url('', ['p' => 'ventas', 'a' => 'consolidacion'])}}">Consolidado Ventas</a>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown-submenu"><a>Informes</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{url('', ['p' => 'informes', 'a' => 'ventas'])}}">Ventas</a></li>
|
||||
<li><a href="{{url('', ['p' => 'informes', 'a' => 'escrituras'])}}">Escrituras</a></li>
|
||||
<li><a href="{{url('', ['p' => 'informes', 'a' => 'gantt_entregas'])}}">Gantt de Entregas</a></li>
|
||||
<li><a href="{{nUrl('informes', 'resciliaciones')}}">Resciliaciones</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="{{nUrl('precios', 'import')}}">Importar Precios</a></li>
|
||||
<li><a href="{{nUrl('cierres', 'evalue')}}">Evaluar Cierre</a></li>
|
||||
<li><a href="{{url('', ['p' => 'ventas', 'a' => 'new'])}}">Nueva Venta <span class="glyphicon glyphicon-plus"></span></a></li>
|
||||
</ul>
|
21
resources/views/other/capacidades.blade.php
Normal file
21
resources/views/other/capacidades.blade.php
Normal file
@ -0,0 +1,21 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Capacidades</h3>
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<?php $class = '' ?>
|
||||
@foreach ($capacidades as $method)
|
||||
@if ($class != $method->class)
|
||||
<?php $class = $method->class ?>
|
||||
<tr class="section-heading">
|
||||
<td>{{\Stringy\Stringy::create($method->class)->replace('App\\Controller\\', '')}}</td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td>{{\Stringy\Stringy::create($method->class)->replace('App\\Controller\\', '')}}::{{$method->name}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
@endsection
|
26
resources/views/other/entregar_multiple.blade.php
Normal file
26
resources/views/other/entregar_multiple.blade.php
Normal file
@ -0,0 +1,26 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<form action="{{url('', ['p' => 'other', 'a' => 'entregar_multiple'])}}" method="post" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Archivo</div>
|
||||
<div class="col-md-6"><input type="file" name="entregas" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-9 small">archivo CSV con separador ';'. 2 columnas: Departamento; Fecha</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Proyecto</div>
|
||||
<div class="col-md-6">
|
||||
<select name="proyecto">
|
||||
@foreach ($proyectos as $proyecto)
|
||||
<option value="{{$proyecto->id}}">{{htmlentities($proyecto->descripcion)}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-3 col-md-2"><input type="submit" value="Entregar" /></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
136
resources/views/print/devolucion.blade.php
Normal file
136
resources/views/print/devolucion.blade.php
Normal file
@ -0,0 +1,136 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div id="print">
|
||||
<div class="title">Devolución Por Pago Excesivo</div>
|
||||
<br /><br />
|
||||
<table class="data-box">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Fecha</td>
|
||||
<?php setlocale(LC_TIME, 'es'); $f = \Carbon\Carbon::today(config('app.timezone'))?>
|
||||
<td>{{$f->formatLocalized('%A, %d de %B de %Y')}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inmobiliaria</td>
|
||||
<td>{{$venta->proyecto()->inmobiliaria()->razon}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Proyecto</td>
|
||||
<td>{{$venta->proyecto()->descripcion}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Propiedad</td>
|
||||
<td>{{$venta->unidad()->descripcion}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Propietario</td>
|
||||
<td>{{$venta->propietario()->nombreCompleto()}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br />
|
||||
<label for="pago">Detalle de Pago</label>
|
||||
<table class="details" id="pago">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Pago</th>
|
||||
<th>Detalle</th>
|
||||
<th>Valor Pagado</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $sum = 0 ?>
|
||||
@if ($venta->pie)
|
||||
<?php $sum += $venta->pie()->valorAbonado('ufs') ?>
|
||||
<tr>
|
||||
<td>Pie</td>
|
||||
<td>@if ($venta->pie()->cuotas > 1) {{count($venta->pie()->abonadas())}} cuotas @else contado @endif</td>
|
||||
<td>{{format('ufs', $venta->pie()->valorAbonado('ufs'), null, true)}}</td>
|
||||
</tr>
|
||||
@if ($venta->pie()->reajuste and $venta->pie()->reajuste()->estado()->estado == 2)
|
||||
<?php $venta->pie()->reajuste()->valor('ufs') ?>
|
||||
<tr>
|
||||
<td>Reajuste de Pie</td>
|
||||
<td></td>
|
||||
<td>{{format('ufs', $venta->pie()->reajuste()->valor('ufs'), null, true)}}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endif
|
||||
@if ($venta->escritura and $venta->escritura()->estado()->estado == 2)
|
||||
<?php $venta->pie()->escritura()->valor('ufs') ?>
|
||||
<tr>
|
||||
<td>Abono en Escritura</td>
|
||||
<td></td>
|
||||
<td>{{format('ufs', $venta->escritura()->valor('ufs'), null, true)}}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if ($venta->subsidio)
|
||||
<?php $sum += $venta->subsidio()->total('ufs') ?>
|
||||
<tr>
|
||||
<td>Subsidio</td>
|
||||
<td>Ahorro: {{format('ufs', $venta->subsidio()->pago()->valor('ufs'), null, true)}}</td>
|
||||
<td>{{format('ufs', $venta->subsidio()->total('ufs'), null, true)}}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if ($venta->bono_pie)
|
||||
<?php $sum += $venta->bonoPie()->pago()->valor('ufs') ?>
|
||||
<tr>
|
||||
<td>Bono Pie</td>
|
||||
<td></td>
|
||||
<td>{{format('ufs', $venta->bonoPie()->pago()->valor('ufs'))}}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if ($venta->credito)
|
||||
<?php $sum += $venta->credito()->pago()->valor('ufs') ?>
|
||||
<tr>
|
||||
<td>Crédito</td>
|
||||
<td>Banco: {{$venta->credito()->pago()->banco()->nombre}}</td>
|
||||
<td>{{format('ufs', $venta->credito()->pago()->valor('ufs'), null, true)}}</td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr class="total">
|
||||
<td colspan="2">TOTAL</td>
|
||||
<td>{{format('ufs', $sum, null, true)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br />
|
||||
<div class="data">Valor Venta</div>
|
||||
<div class="data-value">{{format('ufs', $venta->valor('ufs'), null, true)}}</div>
|
||||
<br class="clear" />
|
||||
<div class="data">Devolución</div>
|
||||
<div class="data-value">{{format('ufs', $venta->saldo('ufs'), null, true)}}</div>
|
||||
<br class="clear" />
|
||||
<br />
|
||||
<div class="data">Valor de UF a la fecha</div>
|
||||
<div class="data-value">$ {{format('ufs', $uf = uf($f)->uf->value)}}</div>
|
||||
<br class="clear" />
|
||||
<br />
|
||||
<div class="total">Total a Devolver</div>
|
||||
<div class="total-value">{{format('pesos', $uf * $venta->saldo('ufs'), null, true)}}</div>
|
||||
<br class="clear" />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<label for="firma">Recibido Conforme</label>
|
||||
<table class="signature" id="firma">
|
||||
<tr>
|
||||
<td>Nombre</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>RUT</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fecha</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="triple">
|
||||
<td>Firma</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
80
resources/views/proyectos/add.blade.php
Normal file
80
resources/views/proyectos/add.blade.php
Normal file
@ -0,0 +1,80 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Agregar Proyecto</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form method="post" class="form-horizontal" action="{{url('', ['p' => 'proyectos', 'a' => 'agregar'])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Nombre</div>
|
||||
<div class="col-md-5"><input type="text" name="descripcion" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Inmobiliaria</div>
|
||||
<div class="col-md-4"><select name="inmobiliaria" class="form-control">
|
||||
@foreach ($inmobiliarias as $inmobiliaria)
|
||||
<option value="{{$inmobiliaria->rut}}"
|
||||
@if ($inmobiliaria->rut == $rut)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{$inmobiliaria->abreviacion}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Dirección</div>
|
||||
<div class="col-md-4"><input type="text" name="calle" class="form-control" /></div>
|
||||
<div class="col-md-1"><input type="text" name="numero" class="form-control" /></div>
|
||||
<div class="col-md-3"><input type="text" name="extra" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-4"><select name="region" class="form-control">
|
||||
@foreach ($regiones as $region)
|
||||
<option value="{{$region->id}}"
|
||||
@if ($region->numeral == 'RM')
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{$region->descripcion}}</option>
|
||||
@endforeach
|
||||
</select></div>
|
||||
<div class="col-md-4"><select name="comuna" class="form-control"></select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Fecha de Inicio</div>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-3"><input type="submit" value="Agregar" class="form-control" /></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("select[name='region']").change(function(e) {
|
||||
changeRegion($(this).val());
|
||||
});
|
||||
changeRegion($("select[name='region']").val());
|
||||
|
||||
$.post('{!!nUrl('ajax', 'calles', ['ajax' => true])!!}', function(data) {
|
||||
$("input[name='calle']").typeahead({"source": data});
|
||||
}, 'json');
|
||||
$("input[name='extra']").typeahead({"source": ['Casa', 'Departamento', 'Oficina', 'Villa']});
|
||||
});
|
||||
function changeRegion(region) {
|
||||
var jq_comunas = $("select[name='comuna']");
|
||||
var region = $("select[name='region']").val();
|
||||
jq_comunas.html('');
|
||||
return $.post('{!!url('', ['p' => 'ajax', 'a' => 'comunas', 'ajax' => true])!!}', {"region": region}, function(data) {
|
||||
info = $.parseJSON(data);
|
||||
$.each(info, function(i, e) {
|
||||
jq_comunas.append(
|
||||
$('<option></option>').attr('value', e.id).html(e.descripcion)
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
98
resources/views/proyectos/advance.blade.php
Normal file
98
resources/views/proyectos/advance.blade.php
Normal file
@ -0,0 +1,98 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Avanzar Proyecto</h3>
|
||||
</div>
|
||||
<br />
|
||||
@if ($proyecto->estado()->tipo()->etapa()->descripcion == 'Construcción' and (float) $proyecto->avances()[count($proyecto->avances())-1]->avance < 1)
|
||||
<form method="post" class="form-horizontal" action="{{nUrl('proyectos', 'avance', ['proyecto' => $proyecto->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-12"><h4>{{$proyecto->descripcion}}</h4></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-5">{{$proyecto->estado()->tipo()->descripcion}}</div>
|
||||
<div class="col-md-2">{{format('shortDate', $proyecto->estado()->fecha)}}</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha</div>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">% Avance</div>
|
||||
<div class="col-md-1"><input type="text" name="avance" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Estado de Pago</div>
|
||||
<div class="col-md-1"><input type="text" name="numero" class="form-control" placeholder="{{count($proyecto->avances()) + 1}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Valor Estado de Pago [UF]</div>
|
||||
<div class="col-md-3"><input type="text" name="estado_pago" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-3 col-md-2"><button class="form-control">Avanzar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@else
|
||||
<form method="post" class="form-horizontal" action="{{url('', ['p' => 'proyectos', 'a' => 'avanzar', 'proyecto' => $proyecto->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-12"><h4>{{$proyecto->descripcion}}</h4></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-5">{{$proyecto->estado()->tipo()->descripcion}}</div>
|
||||
<div class="col-md-2">{{format('shortDate', $proyecto->estado()->fecha)}}</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Nuevo Estado</div>
|
||||
<div class="col-md-4"><select name="estado" class="form-control">
|
||||
<?php $etapa = ''; $group = false ?>
|
||||
@foreach ($estados as $estado)
|
||||
@if ($etapa != $estado->etapa()->descripcion)
|
||||
<?php $etapa = $estado->etapa()->descripcion?>
|
||||
@if ($group)
|
||||
</optgroup>
|
||||
@endif
|
||||
<optgroup label="{{$etapa}}">
|
||||
<?php $group = true ?>
|
||||
@endif
|
||||
<option value="{{$estado->id}}">{{$estado->descripcion}}</option>
|
||||
@endforeach
|
||||
@if ($group)
|
||||
</optgroup>
|
||||
@endif
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha</div>
|
||||
<div class="col-md-1"><select name="day" class="form-control">
|
||||
<?php $t = \Carbon\Carbon::today(config('app.timezone')) ?>
|
||||
@for ($i = 0; $i < 31; $i ++)
|
||||
<option value="{{$i + 1}}"
|
||||
@if ($i + 1 == $t->day)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
|
||||
@endfor
|
||||
</select></div>
|
||||
<div class="col-md-1"><select name="month" class="form-control">
|
||||
@for ($i = 0; $i < 12; $i ++)
|
||||
<option value="{{$i + 1}}"
|
||||
@if ($i + 1 == $t->month)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{str_pad($i + 1, 2, '0', STR_PAD_LEFT)}}</option>
|
||||
@endfor
|
||||
</select></div>
|
||||
<div class="col-md-2"><select name="year" class="form-control">
|
||||
@for ($i = $t->year; $i > $t->year - 5; $i --)
|
||||
<option value="{{$i}}">{{$i}}</option>
|
||||
@endfor
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-3 col-md-3"><input type="submit" value="Avanzar" class="form-control" /></div>
|
||||
</div>
|
||||
</form>
|
||||
@endif
|
||||
@endsection
|
15
resources/views/proyectos/avance.blade.php
Normal file
15
resources/views/proyectos/avance.blade.php
Normal file
@ -0,0 +1,15 @@
|
||||
<div class="progress">
|
||||
<?php
|
||||
$total = 1;
|
||||
if ($proyecto->estado()->tipo()->orden < max($estados) - 1 and count($proyecto->estados()) > 1) {
|
||||
$tf = \Carbon\Carbon::parse($proyecto->estado()->fecha, config('app.timezone'));
|
||||
$t0 = \Carbon\Carbon::parse($proyecto->estados()[0]->fecha, config('app.timezone'));
|
||||
$df = $tf->diffInSeconds($t0);
|
||||
$hoy = \Carbon\Carbon::now(config('app.timezone'));
|
||||
$dh = $hoy->diffInSeconds($t0);
|
||||
$total = $df / $dh;
|
||||
}
|
||||
$valor = round(($proyecto->estado()->tipo()->orden + 1) / max($estados) * 100 * $total);
|
||||
?>
|
||||
<div class="progress-bar" style="width: {{$valor}}%">{{$valor}}%</div>
|
||||
</div>
|
39
resources/views/proyectos/avances/edit.blade.php
Normal file
39
resources/views/proyectos/avances/edit.blade.php
Normal file
@ -0,0 +1,39 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Edit Avance - {{$avance->proyecto()->descripcion}}</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form method="post" class="form-horizontal" action="{{nUrl('proyectos', 'edit_avance', ['avance' => $avance->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Estado de Pago</div>
|
||||
<div class="col-md-1">{{$avance->numero}}</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha</div>
|
||||
<?php $f = $avance->fecha() ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">% Avance</div>
|
||||
<div class="col-md-1"><input type="text" name="avance" class="form-control" value="{{$avance->avance * 100}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Valor Estado de Pago [UF]</div>
|
||||
<div class="col-md-3"><input type="text" name="estado_pago" class="form-control" value="{{$avance->estado_pago}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Pagado [$]</div>
|
||||
<div class="col-md-3"><input type="text" name="pagado" class="form-control" value="{{$avance->pagado}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-1 col-md-2">Fecha</div>
|
||||
<?php $f = $avance->fechaPago(); $id = '_pago' ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-3 col-md-2"><button class="form-control">Editar</button></div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
27
resources/views/proyectos/avances_row.blade.php
Normal file
27
resources/views/proyectos/avances_row.blade.php
Normal file
@ -0,0 +1,27 @@
|
||||
<tr>
|
||||
<td>EP {{$avance->numero}}</td>
|
||||
<td>{{$avance->pagare()->id}}</td>
|
||||
<td style="min-width: 150px;">
|
||||
<div class="progress">
|
||||
<div class="progress-bar" style="width: {{round($avance->avance * 100, 2)}}%">
|
||||
<span class="sr-only">{{format('percent', round($avance->avance * 100, 2))}}%</span>
|
||||
@if ($avance->avance > 0.3)
|
||||
{{format('percent', round($avance->avance * 100, 2))}}%
|
||||
@endif
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-warning" style="width: {{round(100 - $avance->avance * 100, 2)}}%">
|
||||
<span class="sr-only">{{format('percent', round(100 - $avance->avance * 100, 2))}}%</span>
|
||||
@if ($avance->avance <= 0.3)
|
||||
{{format('percent', round($avance->avance * 100, 2))}}%
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{format('shortDate', $avance->fecha)}}</td>
|
||||
<td>{{format('ufs', $avance->estado_pago)}}</td>
|
||||
<td>{{format('shortDate', $avance->pagare()->fecha)}}</td>
|
||||
<td>{{format('ufs', $avance->pagare()->valor())}}</td>
|
||||
<th>{{format('ufs', $total_avance)}}</th>
|
||||
<th>{{format('ufs', $total_deuda)}}</th>
|
||||
<th>{{format('ufs', $total_dif)}}</th>
|
||||
</tr>
|
336
resources/views/proyectos/construccion.blade.php
Normal file
336
resources/views/proyectos/construccion.blade.php
Normal file
@ -0,0 +1,336 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3>Construcción Proyecto <a href="{{nUrl('proyectos', 'show', ['proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="row">
|
||||
<div class="col-md-2"><b>Estado de Pago</b></div>
|
||||
<div class="col-md-10"><b>Avance</b></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
@foreach ($proyecto->avances() as $avance)
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
@if ($avance->numero == 0)
|
||||
Anticipo
|
||||
@else
|
||||
{{$avance->numero}}
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
<div class="progress" style="margin: 2px 0;">
|
||||
<div class="progress-bar" style="width: {{round($avance->avance * 100, 2)}}%">
|
||||
<span class="sr-only">{{format('percent', round($avance->avance * 100, 2))}}%</span>
|
||||
@if ($avance->avance > 0.3)
|
||||
{{format('percent', round($avance->avance * 100, 2))}}%
|
||||
@endif
|
||||
</div>
|
||||
<div class="progress-bar progress-bar-warning" style="width: {{round(100 - $avance->avance * 100, 2)}}%">
|
||||
<span class="sr-only">{{format('percent', round(100 - $avance->avance * 100, 2))}}%</span>
|
||||
@if ($avance->avance <= 0.3)
|
||||
{{format('percent', round($avance->avance * 100, 2))}}%
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2">
|
||||
Estado de Pago
|
||||
<a href="{{nUrl('proyectos', 'advance', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
</th>
|
||||
<th colspan="4" class="text-center">Pagado</th>
|
||||
<th rowspan="2">
|
||||
Pagaré
|
||||
<a href="{{nUrl('pagares', 'add', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon small glyphicon-plus"></span>
|
||||
</a>
|
||||
</th>
|
||||
<th colspan="4" class="text-center">Deuda</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Fecha</th>
|
||||
<th>Valor</th>
|
||||
<th>Real</th>
|
||||
<th>Diferencia</th>
|
||||
<th>Fecha</th>
|
||||
<th>Valor</th>
|
||||
<th>Abonado</th>
|
||||
<th>Diferencia</th>
|
||||
<th>Intereses</th>
|
||||
<th class="small">% Intereses</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $totales = (object) [
|
||||
'avance' => (object) [
|
||||
'pagado' => 0,
|
||||
'real' => 0,
|
||||
'dif' => 0
|
||||
],
|
||||
'deuda' => (object) [
|
||||
'pagare' => 0,
|
||||
'abonado' => 0,
|
||||
'dif' => 0,
|
||||
'intereses' => 0
|
||||
],
|
||||
'dif' => 0,
|
||||
'dif_real' => 0
|
||||
] ?>
|
||||
@foreach ($proyecto->avances() as $i => $avance)
|
||||
<?php
|
||||
$totales->avance->pagado += $avance->estado_pago;
|
||||
$totales->avance->real += $avance->pagado();
|
||||
if ($avance->pagado() > 0) {
|
||||
$totales->avance->dif += $avance->pagado() - $avance->estado_pago;
|
||||
}
|
||||
if ($avance->pagares()) {
|
||||
$arr = $avance->pagares();
|
||||
$totales->deuda->pagare += array_reduce($arr, function($sum, $item) {
|
||||
return $sum + $item->valor();
|
||||
});
|
||||
$totales->deuda->abonado += array_reduce($arr, function($sum, $item) {
|
||||
return $sum + $item->abonado();
|
||||
});
|
||||
$totales->deuda->dif += array_reduce($arr, function($sum, $item) {
|
||||
return $sum + $item->abonado() - $item->valor();
|
||||
});
|
||||
$totales->deuda->intereses += array_reduce($arr, function($sum, $item) {
|
||||
return $sum + $item->intereses();
|
||||
});
|
||||
$totales->dif += array_reduce($arr, function($sum, $item) {
|
||||
return $sum + $item->valor();
|
||||
}) - $avance->estado_pago;
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{nUrl('proyectos', 'editar_avance', ['avance' => $avance->id])}}">
|
||||
@if ($avance->numero == 0)
|
||||
Anticipo
|
||||
@else
|
||||
{{$avance->numero}}</a>
|
||||
@endif
|
||||
</a>
|
||||
</td>
|
||||
<td>{{format('shortDate', $avance->fecha)}}</td>
|
||||
<td class="text-right">{{format('ufs', $avance->estado_pago)}}</td>
|
||||
<td class="text-right">
|
||||
@if ($avance->pagado() > 0)
|
||||
{{format('ufs', $avance->pagado())}}
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if ($avance->pagado() > 0)
|
||||
{{format('ufs', $avance->estado_pago - $avance->pagado())}}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($avance->pagares())
|
||||
@foreach ($avance->pagares() as $pagare)
|
||||
<a href="{{nUrl('pagares', 'show', ['pagare' => $pagare->id])}}">
|
||||
{{$pagare->id}} ({{$pagare->moneda()->descripcion}})
|
||||
</a><br />
|
||||
@endforeach
|
||||
@else
|
||||
--
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($avance->pagares())
|
||||
@foreach ($avance->pagares() as $pagare)
|
||||
{{format('shortDate', $pagare->fecha)}} ({{$pagare->duracion}})<br />
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if ($avance->pagares())
|
||||
@foreach ($avance->pagares() as $pagare)
|
||||
{{format('ufs', $pagare->valor())}}<br />
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if ($avance->pagares())
|
||||
@foreach ($avance->pagares() as $pagare)
|
||||
{{format('ufs', $pagare->abonado())}}<br />
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if ($avance->pagare())
|
||||
{{format('ufs', $pagare->abonado() - $pagare->valor())}}
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@if ($avance->pagares())
|
||||
@foreach ($avance->pagares() as $pagare)
|
||||
{{format('ufs', - $pagare->intereses())}}<br />
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right small">
|
||||
@if ($avance->pagares())
|
||||
@foreach ($avance->pagares() as $pagare)
|
||||
{{format('percent', round($pagare->intereses() / $pagare->valor() * 100, 2), null, true)}}<br />
|
||||
@endforeach
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<td><b>Total</b></td>
|
||||
<td></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->avance->pagado)}}</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->avance->real)}}</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', - $totales->avance->dif)}}</b></td>
|
||||
<td colspan="2"></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->deuda->pagare)}}</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->deuda->abonado)}}</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', $totales->deuda->dif)}}</b></td>
|
||||
<td class="text-right"><b>{{format('ufs', - $totales->deuda->intereses)}}</b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<b>Diferencias en Caja</b>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<canvas id="estados_pago"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
var estados_pago = []
|
||||
var pagado = []
|
||||
var abonado = []
|
||||
var diferencia = []
|
||||
var intereses = []
|
||||
var colores_dif = []
|
||||
function setUp() {
|
||||
@foreach ($proyecto->avances() as $avance)
|
||||
estados_pago.push({{$avance->numero}})
|
||||
pagado.push(({{$avance->pagado()}}).toFixed(2))
|
||||
valor = 0
|
||||
if (diferencia.length > 0) {
|
||||
valor = parseFloat(diferencia[diferencia.length - 1])
|
||||
}
|
||||
valor2 = 0
|
||||
if (intereses.length > 0) {
|
||||
valor2 = parseFloat(intereses[intereses.length - 1])
|
||||
}
|
||||
@if ($avance->pagares())
|
||||
<?php $arr = $avance->pagares() ?>
|
||||
abonado.push({{array_reduce($arr, function($sum, $item) {return $sum + $item->abonado();})}}.toFixed(2))
|
||||
diferencia.push((valor + {{array_reduce($arr, function($sum, $item) {return $sum + $item->abonado();}) - $avance->pagado()}}).toFixed(2))
|
||||
intereses.push((valor2 + {{array_reduce($arr, function($sum, $item) {return $sum + $item->intereses();})}}).toFixed(2))
|
||||
@else
|
||||
abonado.push(0)
|
||||
diferencia.push((valor + {{-$avance->pagado()}}).toFixed(2))
|
||||
intereses.push(valor2.toFixed(2))
|
||||
@endif
|
||||
if (diferencia[diferencia.length - 1] < 0) {
|
||||
colores_dif.push('rgba(255, 0, 0, 1)')
|
||||
} else {
|
||||
colores_dif.push('rgba(0, 255, 0, 1)')
|
||||
}
|
||||
@endforeach
|
||||
console.debug(intereses)
|
||||
}
|
||||
function formatNumber(number, decimals = 2, dec_sep = ',', thou_sep = '.') {
|
||||
var arr = ('' + number).split('.')
|
||||
var num = arr[0]
|
||||
var dec = arr.length > 1 ? dec_sep + arr[1] : ''
|
||||
var rgx = /(\d+)(\d{3})/
|
||||
while (rgx.test(num)) {
|
||||
num = num.replace(rgx, '$1' + thou_sep + '$2')
|
||||
}
|
||||
return num + dec
|
||||
}
|
||||
function build() {
|
||||
var ctx = $('#estados_pago').get(0).getContext('2d')
|
||||
var chart = new Chart(ctx, {
|
||||
type: 'bar',
|
||||
data: {
|
||||
labels: estados_pago,
|
||||
datasets: [
|
||||
{
|
||||
label: 'Abonado por Banco',
|
||||
data: abonado,
|
||||
backgroundColor: 'rgba(0, 255, 255, 1)'
|
||||
},
|
||||
{
|
||||
label: 'Pagado a Constructora',
|
||||
data: pagado,
|
||||
backgroundColor: 'rgba(0, 0, 255, 1)'
|
||||
},
|
||||
{
|
||||
label: 'Diferencia',
|
||||
data: diferencia,
|
||||
backgroundColor: colores_dif
|
||||
},
|
||||
{
|
||||
label: 'Intereses',
|
||||
data: intereses,
|
||||
backgroundColor: 'rgba(255, 255, 0, 1)'
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
yAxes: [{
|
||||
afterTickToLabelConversion: (axis) => {
|
||||
$.each(axis.ticks, (i, el) => {
|
||||
axis.ticks[i] = formatNumber(parseInt(el))
|
||||
})
|
||||
return axis
|
||||
}
|
||||
}]
|
||||
},
|
||||
tooltips: {
|
||||
callbacks: {
|
||||
title: (tooltipItem, data) => {
|
||||
var ep = data.labels[tooltipItem[0].index]
|
||||
var label = 'Anticipo'
|
||||
if (ep > 0) {
|
||||
label = 'EP ' + ep
|
||||
}
|
||||
return label
|
||||
},
|
||||
label: (tooltipItem, data) => {
|
||||
var label = data.datasets[tooltipItem.datasetIndex].label || ''
|
||||
if (label) {
|
||||
label += ': '
|
||||
}
|
||||
label += formatNumber(tooltipItem.yLabel)
|
||||
return label
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
$(document).ready(function() {
|
||||
setUp()
|
||||
build()
|
||||
})
|
||||
</script>
|
||||
@endpush
|
36
resources/views/proyectos/disponibles.blade.php
Normal file
36
resources/views/proyectos/disponibles.blade.php
Normal file
@ -0,0 +1,36 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col h3">Unidades Disponibles - <a href="{{url('', ['p' => 'proyectos', 'a' => 'show', 'proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a> [{{count($proyecto->unidadesDisponibles())}}]</div>
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tipo</th>
|
||||
<th>Unidad</th>
|
||||
<th>Piso</th>
|
||||
<th>m² Vendibles</th>
|
||||
<th>Valor Referencial</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($proyecto->unidadesDisponibles() as $unidad)
|
||||
<tr>
|
||||
<td>{{ucwords($unidad->tipo()->descripcion)}}</td>
|
||||
<td>{{$unidad->descripcion}}</td>
|
||||
<td>{{$unidad->piso}}</td>
|
||||
<td>
|
||||
@if ($unidad->tipo == 1)
|
||||
{{$unidad->m2('vendible')}}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{format('ufs', (($unidad->precio()) ? $unidad->precio()->valor : $unidad->valor) ?: 0, null, true)}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
42
resources/views/proyectos/estimado.blade.php
Normal file
42
resources/views/proyectos/estimado.blade.php
Normal file
@ -0,0 +1,42 @@
|
||||
@if (count($proyecto->ventas()) > 0 and $proyecto->valores()->estimados->departamentos->cantidad > 0)
|
||||
<tr>
|
||||
<td>Estimado Total</td>
|
||||
<td colspan="2">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
UF Total<br />
|
||||
Bruto - Neto
|
||||
</th>
|
||||
<th>UF/m² Neto</th>
|
||||
<th>UF Promedio</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{format('ufs', $proyecto->valores()->vendidos->ingreso->bruto + $proyecto->valores()->estimados->ingreso->bruto, null, true)}} - {{format('ufs', $proyecto->valores()->vendidos->ingreso->neto + $proyecto->valores()->estimados->ingreso->neto, null, true)}}</td>
|
||||
<td>{{format('ufs', ($proyecto->valores()->vendidos->ingreso->neto + $proyecto->valores()->estimados->ingreso->neto) / $proyecto->superficie('vendible'), null, true)}}</td>
|
||||
<td>{{format('ufs', ($proyecto->valores()->vendidos->ingreso->neto + $proyecto->valores()->estimados->ingreso->neto) / count($proyecto->unidades(1)), null, true)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Estacionamientos y Bodegas</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="3">{{format('ufs', $proyecto->valores()->vendidos->otros->valor + $proyecto->valores()->estimados->otros->valor, null, true)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Total</th>
|
||||
<th colspan="2">{{format('ufs', $proyecto->valores()->vendidos->ingreso->neto + $proyecto->valores()->estimados->ingreso->neto + $proyecto->valores()->vendidos->otros->valor + $proyecto->valores()->estimados->otros->valor, null, true)}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
74
resources/views/proyectos/historia.blade.php
Normal file
74
resources/views/proyectos/historia.blade.php
Normal file
@ -0,0 +1,74 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="row">
|
||||
<div class="col-md-6">
|
||||
Historial Proyecto <a href="{{nUrl('proyectos', 'show', ['proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a>
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<a href="{{nUrl('proyectos', 'advance', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon glyphicon-chevron-right"></span>
|
||||
</a>
|
||||
</div>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body"><?php $t = \Carbon\Carbon::today(config('app.timezone')) ?>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Etapa</th>
|
||||
<th>Estado</th>
|
||||
<th>Fecha</th>
|
||||
<th>Duración</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$estados = [];
|
||||
foreach ($proyecto->estados() as $estado) {
|
||||
$estados[$estado->fecha] []= $estado;
|
||||
}
|
||||
ksort($estados);
|
||||
$ff = null;
|
||||
?>
|
||||
@foreach ($estados as $fecha => $es)
|
||||
<?php
|
||||
$f = \Carbon\Carbon::parse($fecha, config('app.timezone'));
|
||||
usort($es, function($a, $b) {
|
||||
return $a->tipo()->orden - $b->tipo()->orden;
|
||||
});
|
||||
$estado = $es[count($es) - 1];
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
@if ($estado->tipo()->etapa()->descripcion == 'Construcción')
|
||||
<a href="{{nUrl('proyectos', 'construccion', ['proyecto' => $proyecto->id])}}">
|
||||
@endif
|
||||
{{$estado->tipo()->etapa()->descripcion}}
|
||||
@if ($estado->tipo()->etapa()->descripcion == 'Construcción')
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{$estado->tipo()->descripcion}}</td>
|
||||
<td>
|
||||
@if ($f->timestamp > 0)
|
||||
{{$f->format('d M Y')}}
|
||||
@else
|
||||
--
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($ff !== null)
|
||||
{{$f->longAbsoluteDiffForHumans($ff)}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<?php $ff = $f; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
82
resources/views/proyectos/historia.blade.php.old
Normal file
82
resources/views/proyectos/historia.blade.php.old
Normal file
@ -0,0 +1,82 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="row">
|
||||
<div class="col-md-6">
|
||||
Historial Proyecto <a href="{{nUrl('proyectos', 'show', ['proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a>
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<a href="{{nUrl('proyectos', 'advance', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon glyphicon-chevron-right"></span>
|
||||
</a>
|
||||
</div>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body"><?php $t = \Carbon\Carbon::today(config('app.timezone')) ?>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Fecha</th>
|
||||
<th></th>
|
||||
<th>Duración</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$estados = [];
|
||||
foreach ($proyecto->estados() as $estado) {
|
||||
$estados[$estado->fecha] []= $estado;
|
||||
}
|
||||
ksort($estados);
|
||||
$ff = \Carbon\Carbon::parse('0', config('app.timezone'));
|
||||
?>
|
||||
@foreach ($estados as $fecha => $es)
|
||||
<?php
|
||||
$f = \Carbon\Carbon::parse($fecha, config('app.timezone'));
|
||||
usort($es, function($a, $b) {
|
||||
return $a->tipo()->orden - $b->tipo()->orden;
|
||||
});
|
||||
?>
|
||||
<tr>
|
||||
<td>{{$f->format('d M Y')}}</td>
|
||||
<td>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Etapa</th>
|
||||
<th>Estado</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($es as $estado)
|
||||
<tr>
|
||||
<td>
|
||||
@if ($estado->tipo()->etapa()->descripcion == 'Construcción')
|
||||
<a href="{{nUrl('proyectos', 'construccion', ['proyecto' => $proyecto->id])}}">
|
||||
@endif
|
||||
{{$estado->tipo()->etapa()->descripcion}}
|
||||
@if ($estado->tipo()->etapa()->descripcion == 'Construcción')
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{$estado->tipo()->descripcion}}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
@if ($f->diffInYears($ff) < 100)
|
||||
{{$f->longAbsoluteDiffForHumans($ff)}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<?php $ff = $f; ?>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
42
resources/views/proyectos/list.blade.php
Normal file
42
resources/views/proyectos/list.blade.php
Normal file
@ -0,0 +1,42 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="h3">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
Proyectos
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<a href="{{nUrl('proyectos', 'add')}}">
|
||||
<span class="glyphicon small glyphicon-plus"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Proyecto</th>
|
||||
<th>Inmobiliaria</th>
|
||||
<th>Etapa</th>
|
||||
<th>Estado</th>
|
||||
<th>Tiempo Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($proyectos as $proyecto)
|
||||
<tr>
|
||||
<td><a href="{{url('', ['p' => 'proyectos', 'a' => 'show', 'proyecto' => $proyecto->id])}}">{{$proyecto->descripcion}}</a></td>
|
||||
<td><a href="{{url('', ['p' => 'proyectos', 'a' => 'list', 'inmobiliaria' => $proyecto->inmobiliaria()->id])}}">{{$proyecto->inmobiliaria()->abreviacion}}</a></td>
|
||||
<td>{{$proyecto->estado()->tipo()->etapa()->descripcion}}</td>
|
||||
<td>{{$proyecto->estado()->tipo()->descripcion}} ({{\Carbon\Carbon::parse($proyecto->estado()->fecha, config('app.timezone'))->diffForHumans()}})</td>
|
||||
<td>
|
||||
{{\Carbon\Carbon::parse($proyecto->estados()[0]->fecha, config('app.timezone'))->diffForHumans()}}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@endsection
|
29
resources/views/proyectos/operadores/add.blade.php
Normal file
29
resources/views/proyectos/operadores/add.blade.php
Normal file
@ -0,0 +1,29 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Agregar Operadores - {{$proyecto->descripcion}}</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form method="post" class="form-horizontal" action="{{nUrl('operadores', 'add', ['proyecto' => $proyecto->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">Operadores</div>
|
||||
<div class="col-md-3">
|
||||
<select name="operadores[]" multiple="multiple">
|
||||
@foreach ($operadores as $operador)
|
||||
<option value="{{$operador->id}}"
|
||||
@if (array_search($operador, $vigentes) !== false)
|
||||
selected="selected"
|
||||
@endif
|
||||
>{{$operador->abreviacion}}
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-3">
|
||||
<button class="form-control" type="submit">Agregar</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
62
resources/views/proyectos/pagares/add.blade.php
Normal file
62
resources/views/proyectos/pagares/add.blade.php
Normal file
@ -0,0 +1,62 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Agregar Pagaré
|
||||
<a href="{{nUrl('proyectos', 'construccion', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon small glyphicon-chevron-up"></span>
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('pagares', 'do_add', ['proyecto' => $proyecto->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Estado Pago</div>
|
||||
<div class="col-md-1"><input type="text" name="estado_pago" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Número</div>
|
||||
<div class="col-md-3"><input type="text" name="numero" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Moneda</div>
|
||||
<div class="col-md-2">
|
||||
<select name="moneda" class="form-control">
|
||||
<option value="UF">UF</option>
|
||||
<option value="Pesos">Pesos</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Capital</div>
|
||||
<div class="col-md-3"><input type="text" name="capital" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Tasa [%]</div>
|
||||
<div class="col-md-1"><input type="text" name="tasa" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha Otorgado</div>
|
||||
<?php $id = '_banco' ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Duración</div>
|
||||
<div class="col-md-1"><input type="text" name="duracion" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha Abonado</div>
|
||||
<?php unset($id) ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Monto Abonado [$]</div>
|
||||
<div class="col-md-3"><input type="text" name="abonado" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-1 col-md-2">
|
||||
<button class="form-control">Agregar</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
44
resources/views/proyectos/pagares/add_renovacion.blade.php
Normal file
44
resources/views/proyectos/pagares/add_renovacion.blade.php
Normal file
@ -0,0 +1,44 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Agregar Renovación Pagaré <a href="{{nUrl('pagares', 'show', ['pagare' => $pagare->id])}}">{{$pagare->id}}</a>
|
||||
</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('pagares', 'do_add_renovacion', ['pagare' => $pagare->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha</div>
|
||||
<?php $id = '_banco' ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Duración [días]</div>
|
||||
<div class="col-md-1"><input type="text" name="duracion" class="form-control" /></div>
|
||||
<div class="col-md-3 small">* Pagaré {{$pagare->duracion}}</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Monto Insoluto [{{$pagare->moneda()->descripcion}}]</div>
|
||||
<div class="col-md-3"><input type="text" name="insoluto" class="form-control" value="{{$pagare->capital}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Tasa [%]</div>
|
||||
<div class="col-md-1"><input type="text" name="tasa" class="form-control" /></div>
|
||||
<div class="col-md-2 small">* Pagaré {{format('percent', $pagare->tasa, null, true)}} </div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Intereses [$]</div>
|
||||
<div class="col-md-3"><input type="text" name="intereses" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha Abono</div>
|
||||
<?php unset($id) ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-1 col-md-2">
|
||||
<button class="form-control">Agregar</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
66
resources/views/proyectos/pagares/edit.blade.php
Normal file
66
resources/views/proyectos/pagares/edit.blade.php
Normal file
@ -0,0 +1,66 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Pagaré <a href="{{nUrl('pageres', 'show', ['pagare' => $pagare->id])}}">{{$pagare->id}}</a></h3>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('pagares', 'do_edit', ['pagare' => $pagare->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Estado Pago</div>
|
||||
<div class="col-md-1"><input type="text" name="estado_pago" value="{{$pagare->estado_pago}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Número</div>
|
||||
<div class="col-md-3"><input type="text" name="numero" value="{{$pagare->id}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Moneda</div>
|
||||
<div class="col-md-2">
|
||||
<select name="moneda" class="form-control">
|
||||
<option value="UF"
|
||||
@if (strtolower($pagare->moneda()->descripcion) == 'uf')
|
||||
selected="selected"
|
||||
@endif
|
||||
>UF</option>
|
||||
<option value="Pesos"
|
||||
@if (strtolower($pagare->moneda()->descripcion) == 'pesos')
|
||||
selected="selected"
|
||||
@endif
|
||||
>Pesos</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Capital</div>
|
||||
<div class="col-md-3"><input type="text" name="capital" value="{{$pagare->capital}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Tasa [%]</div>
|
||||
<div class="col-md-1"><input type="text" name="tasa" value="{{$pagare->tasa}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha Otorgado</div>
|
||||
<?php $f = $pagare->fechaBanco(); $id = '_banco' ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Duración</div>
|
||||
<div class="col-md-1"><input type="text" name="duracion" class="form-control" value="{{$pagare->duracion}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha Abonado</div>
|
||||
<?php $f = $pagare->fecha(); unset($id) ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Monto Abonado [$]</div>
|
||||
<div class="col-md-3"><input type="text" name="abonado" class="form-control" value="{{$pagare->abonado}}" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-1 col-md-2">
|
||||
<button class="form-control">Editar</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
45
resources/views/proyectos/pagares/edit_renovacion.blade.php
Normal file
45
resources/views/proyectos/pagares/edit_renovacion.blade.php
Normal file
@ -0,0 +1,45 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<h3>Renovación
|
||||
{{array_search($renovacion, $renovacion->pagare()->renovaciones()) + 1}}
|
||||
Pagaré <a href="{{nUrl('pagares', 'show', ['pagare' => $renovacion->pagare])}}">{{$renovacion->pagare}}</a>
|
||||
</h3>
|
||||
</div>
|
||||
<br />
|
||||
<form class="form-horizontal" method="post" action="{{nUrl('pagares', 'do_edit_renovacion', ['renovacion' => $renovacion->id])}}">
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha</div>
|
||||
<?php $f = $renovacion->fechaBanco(); $id = '_banco' ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Duración [días]</div>
|
||||
<div class="col-md-1"><input type="text" name="duracion" value="{{$renovacion->duracion}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Monto Insoluto [{{$renovacion->pagare()->moneda()->descripcion}}]</div>
|
||||
<div class="col-md-3"><input type="text" name="insoluto" value="{{$renovacion->insoluto}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Tasa [%]</div>
|
||||
<div class="col-md-1"><input type="text" name="tasa" value="{{$renovacion->tasa}}" class="form-control" /></div>
|
||||
<div class="col-md-2 small">* Pagaré {{format('percent', $renovacion->pagare()->tasa, null, true)}} </div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Intereses [$]</div>
|
||||
<div class="col-md-3"><input type="text" name="intereses" value="{{$renovacion->intereses}}" class="form-control" /></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3">Fecha Abono</div>
|
||||
<?php $f = $renovacion->fecha(); unset($id) ?>
|
||||
@include('form.fecha')
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-1 col-md-2">
|
||||
<button class="form-control">Editar</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
100
resources/views/proyectos/pagares/show.blade.php
Normal file
100
resources/views/proyectos/pagares/show.blade.php
Normal file
@ -0,0 +1,100 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-6 h3">
|
||||
Pagaré {{$pagare->id}}
|
||||
<a href="{{nUrl('proyectos', 'construccion', ['proyecto' => $pagare->proyecto()->id])}}">
|
||||
<span class="glyphicon small glyphicon-chevron-up"></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-6 h3 text-right">
|
||||
<a href="{{nUrl('pagares', 'edit', ['pagare' => $pagare->id])}}">
|
||||
<span class="glyphicon glyphicon-edit"></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<thead></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Estado Pago</td>
|
||||
<td>
|
||||
{{$pagare->estado_pago}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Moneda</td>
|
||||
<td>{{$pagare->moneda()->descripcion}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Capital</td>
|
||||
<td>{{format('ufs', $pagare->valor(), null, true)}}</td>
|
||||
<td>{{format('pesos', $pagare->valor('pesos'), null, true)}}</td>
|
||||
<td>{{format('shortDate', $pagare->fecha_banco)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Abonado</td>
|
||||
<td>{{format('ufs', $pagare->abonado(), null, true)}}</td>
|
||||
<td>{{format('pesos', $pagare->abonado('pesos'), null, true)}}</td>
|
||||
<td>
|
||||
@if ($pagare->fecha != '0000-00-00')
|
||||
{{format('shortDate', $pagare->fecha)}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tasa Anualizada</td>
|
||||
<td colspan="3">{{format('percent', $pagare->tasa, null, true)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Duración</td>
|
||||
<td>{{$pagare->duracion}}</td>
|
||||
<td colspan="2">{{format('shortDate', $pagare->vencimiento()->format('Y-m-d'))}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@if ($pagare->renovaciones())
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Renovaciones</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Fecha Renovación</th>
|
||||
<th>Intereses Pagados</th>
|
||||
<th>
|
||||
<a href="{{nUrl('pagares', 'add_renovacion', ['pagare' => $pagare->id])}}">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $total = 0 ?>
|
||||
@foreach ($pagare->renovaciones() as $renovacion)
|
||||
<?php $total += $renovacion->intereses() ?>
|
||||
<tr>
|
||||
<td>
|
||||
{{format('shortDate', $renovacion->fecha)}}
|
||||
({{$renovacion->duracion}})
|
||||
{{format('shortDate', $renovacion->vencimiento()->format('Y-m-d'))}}
|
||||
</td>
|
||||
<td>{{format('ufs', $renovacion->intereses(), null, true)}}</td>
|
||||
<td>
|
||||
<a href="{{nUrl('pagares', 'edit_renovacion', ['renovacion' => $renovacion->id])}}">
|
||||
<span class="glyphicon glyphicon-edit"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<td><b>Total</b></td>
|
||||
<td colspan="2"><b>{{format('ufs', $total, null, true)}}</b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<a href="{{nUrl('pagares', 'add_renovacion', ['pagare' => $pagare->id])}}">Agregar Renovación</a>
|
||||
@endif
|
||||
@endsection
|
66
resources/views/proyectos/por_vender.blade.php
Normal file
66
resources/views/proyectos/por_vender.blade.php
Normal file
@ -0,0 +1,66 @@
|
||||
@if (count($proyecto->unidades()) > 0 and $proyecto->valores()->estimados->departamentos->cantidad > 0)
|
||||
<tr>
|
||||
<td><a href="{{url('', ['p' => 'proyectos', 'a' => 'disponibles', 'proyecto' => $proyecto->id])}}">Por vender</a></td>
|
||||
<td colspan="2">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>% Por Vender</th>
|
||||
<th>m² promedio</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{$proyecto->valores()->estimados->departamentos->cantidad}}</td>
|
||||
<td>{{\App\Helper\Format::number($proyecto->valores()->estimados->departamentos->cantidad / count($proyecto->unidades(1)) * 100, 2)}} %</td>
|
||||
<td>{!!format('m2', $proyecto->valores()->estimados->departamentos->mts->vendibles->promedio, null, true)!!}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>UF Estimado<br />
|
||||
Bruto - Neto
|
||||
</th>
|
||||
<th>UF/m² Neto</th>
|
||||
<th>UF promedio</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->ingreso->bruto, null, true)}} - {{format('ufs', $proyecto->valores()->estimados->ingreso->neto, null, true)}}</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->departamentos->uf_m2->promedio, null, true)}}</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->departamentos->precio->promedio, null, true)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Estacionamientos</th>
|
||||
<th>Bodegas</th>
|
||||
<th>Valor Estimado</th>
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{count($proyecto->unidadesDisponibles(2))}}</td>
|
||||
<td>{{count($proyecto->unidadesDisponibles(3))}}</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->otros->valor, null, true)}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Operador</th>
|
||||
<th>Bono Pie</th>
|
||||
<th>Premios</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->comision, null, true)}}</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->bono->valor, null, true)}}</td>
|
||||
<td>{{format('ufs', $proyecto->valores()->estimados->premios(), null, true)}}</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
72
resources/views/proyectos/reservas/base.blade.php
Normal file
72
resources/views/proyectos/reservas/base.blade.php
Normal file
@ -0,0 +1,72 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<h1 class="page-heading">
|
||||
<a href="{{nUrl('proyectos', 'show', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon small glyphicon-chevron-up"></span></a>
|
||||
Ventas y Reservas - {{$proyecto->descripcion}}
|
||||
</h1>
|
||||
<table class="ui celled table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Piso</th>
|
||||
@for ($i = 1; $i <= $max_unidades; $i ++)
|
||||
<th>{{$i}}</th>
|
||||
@endfor
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($pisos as $piso)
|
||||
<tr>
|
||||
<td>{{$piso->descripcion}}</td>
|
||||
@for ($i = 1; $i <= $max_unidades; $i ++)
|
||||
@if (!isset($piso->unidades[$i]))
|
||||
<td style="min-width: 12ex;"></td>
|
||||
@continue
|
||||
@endif
|
||||
<?php $unidad = $piso->unidades[$i] ?>
|
||||
<td style="min-width: 12ex;">
|
||||
<strong>{{$unidad->descripcion}}</strong>
|
||||
<br />
|
||||
{{$unidad->tipologia()->tipologia()->descripcion}}
|
||||
<br />
|
||||
{{format('ufs', $unidad->precio()->valor, null, true)}}
|
||||
<br />
|
||||
@if ($unidad->isVendida())
|
||||
<span style="color: white; background-color: darkgreen; width: 100%; padding: 2px;">{{format('shortDate', $unidad->venta()->fecha)}}</span>
|
||||
@endif
|
||||
<br />
|
||||
@if ($unidad->isReservada())
|
||||
<span style="color: white; background-color: olive; padding: 2px;">{{format('shortDate', $unidad->cierre()->fecha)}}</span>
|
||||
@endif
|
||||
</td>
|
||||
@endfor
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<td>
|
||||
<div style="color: white; background-color: darkgreen; min-width: 5ex; text-align: center">
|
||||
<strong>
|
||||
{{array_reduce($totales, function($sum, $item) {
|
||||
return $sum + $item->ventas;
|
||||
})}}
|
||||
</strong>
|
||||
</div>
|
||||
<div style="color: white; background-color: olive; min-width: 5ex; text-align: center;">
|
||||
<strong>
|
||||
{{array_reduce($totales, function($sum, $item) {
|
||||
return $sum + $item->reservas;
|
||||
})}}
|
||||
</strong>
|
||||
</div>
|
||||
</td>
|
||||
@for ($i = 1; $i <= $max_unidades; $i ++)
|
||||
<td>
|
||||
<div style="color: white; background-color: darkgreen; min-width: 12ex; text-align: center;"><strong>{{$totales[$i]->ventas}}</strong></div>
|
||||
<div style="color: white; background-color: olive; min-width: 12ex; text-align: center;"><strong>{{$totales[$i]->reservas}}</strong></div>
|
||||
</td>
|
||||
@endfor
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@endsection
|
230
resources/views/proyectos/show.blade.php
Normal file
230
resources/views/proyectos/show.blade.php
Normal file
@ -0,0 +1,230 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('content')
|
||||
<div class="row page-heading">
|
||||
<div class="col-md-6 h3">Proyecto - {{$proyecto->descripcion}}</div>
|
||||
<div class="col-md-6 h3 text-right"><a href="{{url('', ['p' => 'proyectos', 'a' => 'edit', 'proyecto' => $proyecto->id])}}"><span class="glyphicon glyphicon-edit"></span></a></div>
|
||||
</div>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td>Dirección</td>
|
||||
<td>{{$proyecto->direccion()->completa(true)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inmobiliaria</td>
|
||||
<td colspan="2"><a href="{{url('', ['p' => 'inmobiliarias', 'a' => 'show', 'rut' => $proyecto->inmobiliaria()->rut])}}">{{$proyecto->inmobiliaria()->abreviacion}}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inicio</td>
|
||||
<td>{{$proyecto->estados()[0]->tipo()->descripcion}} [{{$proyecto->estados()[0]->tipo()->etapa()->descripcion}}]] ({{format('shortDate', $proyecto->estados()[0]->fecha)}})
|
||||
(<?php
|
||||
$today = \Carbon\Carbon::today(config('app.timezone'));
|
||||
$f = \Carbon\Carbon::parse($proyecto->estados()[0]->fecha, config('app.timezone'));
|
||||
?>{{$f->diffForHumans($today)}})
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Estado <a href="{{nUrl('proyectos', 'historial', ['proyecto' => $proyecto->id])}}"><span class="glyphicon glyphicon-list-alt"></span></a></td>
|
||||
<td>{{$proyecto->estado()->tipo()->descripcion}}
|
||||
@if ($proyecto->estado()->tipo()->etapa()->descripcion == 'Construcción')
|
||||
<a href="{{nUrl('proyectos', 'construccion', ['proyecto' => $proyecto->id])}}">
|
||||
@endif
|
||||
[{{$proyecto->estado()->tipo()->etapa()->descripcion}}]
|
||||
@if ($proyecto->estado()->tipo()->etapa()->descripcion == 'Construcción')
|
||||
</a>
|
||||
@endif
|
||||
({{format('shortDate', $proyecto->estado()->fecha)}}) (<?php
|
||||
$f = \Carbon\Carbon::parse($proyecto->estado()->fecha, config('app.timezone'));
|
||||
?>{{$f->diffForHumans($today)}})</td>
|
||||
<td><a href="{{url('', ['p' => 'proyectos', 'a' => 'advance', 'proyecto' => $proyecto->id])}}"><span class="glyphicon glyphicon-chevron-right"></span></a>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>@include('proyectos.avance')
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Operadores</td>
|
||||
<td>
|
||||
@if ($proyecto->operadoresVigentes())
|
||||
{{array_reduce($proyecto->operadoresVigentes(), function($list, $item) {
|
||||
return trim($list . ', ' . $item->agente()->agente()->abreviacion, ', ');
|
||||
})}}
|
||||
@endif
|
||||
<a href="{{nUrl('operadores', 'agregar', ['proyecto' => $proyecto->id])}}">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@include('proyectos.superficies')
|
||||
@if (count($proyecto->proyectoTipoUnidades()) > 0)
|
||||
<tr>
|
||||
<td>Departamentos</td>
|
||||
<td colspan="2"><a href="{{nUrl('proyectos', 'list_unidades', ['proyecto' => $proyecto->id])}}">{{count($proyecto->unidades(1))}}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Pisos</td>
|
||||
<td colspan="2">{{$proyecto->pisos()}}</td>
|
||||
</tr>
|
||||
@else
|
||||
<tr>
|
||||
<td></td>
|
||||
<td colspan="2"><a href="{{url('', ['p' => 'proyectos', 'a' => 'add_tipo_unidad', 'proyecto' => $proyecto->id])}}">Agregar tipo de unidad <span class="glyphicon glyphicon-plus"></span></a></td>
|
||||
</tr>
|
||||
@endif
|
||||
@include('proyectos.ventas')
|
||||
@include('proyectos.por_vender')
|
||||
@include('proyectos.estimado')
|
||||
<tr>
|
||||
<td colspan="2" style="text-align: center;">
|
||||
<canvas id="ventas_un" width="400" height="300" style="display: inline;"></canvas>
|
||||
<canvas id="ventas_uf" width="400" height="300" style="display: inline;"></canvas>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="text-center">
|
||||
<table class="table">
|
||||
<tr id="graficos_unidades"></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="text-align: center;">
|
||||
<canvas id="ventas_pt" width="1000" height="400" style="display: inline;"></canvas>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@if (count($proyecto->unidades()) > 0)
|
||||
<script>
|
||||
function buildPie(chart_id, data, options) {
|
||||
var ctx = document.getElementById(chart_id).getContext('2d')
|
||||
var vData = {
|
||||
datasets: [{
|
||||
data: data.values,
|
||||
backgroundColor: data.colors
|
||||
}],
|
||||
labels: data.labels
|
||||
}
|
||||
var vOptions = {
|
||||
responsive: false,
|
||||
title: {
|
||||
display: true,
|
||||
text: options.title
|
||||
},
|
||||
legend: {
|
||||
position: 'right'
|
||||
},
|
||||
tooltips: {
|
||||
callbacks: {
|
||||
label: changeLabel
|
||||
}
|
||||
}
|
||||
}
|
||||
return chart = new Chart(ctx, {
|
||||
type: 'pie',
|
||||
data: vData,
|
||||
options: vOptions
|
||||
})
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
@if ($proyecto->ventas())
|
||||
buildPie('ventas_un', {
|
||||
values: [
|
||||
{{count($proyecto->ventas())}},
|
||||
{{$proyecto->valores()->estimados->departamentos->cantidad}}
|
||||
],
|
||||
colors: [
|
||||
'rgba(0, 200, 0, .7)',
|
||||
'rgba(200, 0, 0, .7)'
|
||||
],
|
||||
labels: [
|
||||
'Vendida',
|
||||
'Por Vender'
|
||||
]
|
||||
}, {
|
||||
title: 'Unidades Vendidas'
|
||||
})
|
||||
buildPie('ventas_uf', {
|
||||
values: [
|
||||
{{round($proyecto->valores()->vendidos->ingreso->bruto, 0)}},
|
||||
{{round($proyecto->valores()->estimados->ingreso->bruto, 0)}}
|
||||
],
|
||||
colors: [
|
||||
'rgba(0, 200, 0, .7)',
|
||||
'rgba(200, 0, 0, .7)'
|
||||
],
|
||||
labels: [
|
||||
'Vendida',
|
||||
'Estimada'
|
||||
]
|
||||
}, {
|
||||
title: 'UF Neto Vendida'
|
||||
})
|
||||
|
||||
var width = {{floor(1000 / count($ventas_pt->data))}}
|
||||
<?php $c = 0 ?>
|
||||
@foreach ($ventas_pt->data as $tipo => $data)
|
||||
chart = $('<td></td>').append(
|
||||
$('<canvas></canvas>').attr('id', 'chart_{{$tipo}}').attr('width', width).attr('height', 300)
|
||||
)
|
||||
$('#graficos_unidades').append(chart)
|
||||
buildPie('chart_{{$tipo}}', {
|
||||
values: [
|
||||
{{$ventas_pt->totales[$tipo] * $data[count($data) - 1] / 100}},
|
||||
{{$ventas_pt->totales[$tipo] * (1 - $data[count($data) - 1] / 100)}}
|
||||
],
|
||||
colors: ['rgba(0, 255, 0, .7)', 'rgba(255, 0, 0, .7)'],
|
||||
labels: ['Vendido', 'Total']
|
||||
}, {
|
||||
title: '{{$tipo}}'
|
||||
})
|
||||
@endforeach
|
||||
|
||||
ctx = document.getElementById('ventas_pt').getContext('2d');
|
||||
vData = {
|
||||
labels: ["{!!implode('", "', $ventas_pt->fields)!!}"],
|
||||
datasets: [
|
||||
<?php $c = 0 ?>
|
||||
@foreach ($ventas_pt->data as $tipo => $data)
|
||||
{
|
||||
data: [{{implode(', ', $data)}}],
|
||||
borderColor: '{{$colors[$c]}}',
|
||||
backgroundColor: '{{$colors[$c ++]}}',
|
||||
fill: false,
|
||||
label: "{{$tipo}}"
|
||||
},
|
||||
@endforeach
|
||||
]
|
||||
}
|
||||
vOptions = {
|
||||
responsive: false,
|
||||
title: {
|
||||
display: true,
|
||||
text: "% Unidades Vendidas por Tipo"
|
||||
},
|
||||
legend: {
|
||||
position: 'bottom'
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
min: 0,
|
||||
max: 100
|
||||
}
|
||||
}]
|
||||
}
|
||||
};
|
||||
ventas = new Chart(ctx, {
|
||||
type: "line",
|
||||
data: vData,
|
||||
options: vOptions
|
||||
})
|
||||
@endif
|
||||
})
|
||||
</script>
|
||||
@endif
|
||||
@endpush
|
97
resources/views/proyectos/superficies.blade.php
Normal file
97
resources/views/proyectos/superficies.blade.php
Normal file
@ -0,0 +1,97 @@
|
||||
@if ($proyecto->superficie('total') != null)
|
||||
<tr>
|
||||
<td>Superficies</td>
|
||||
<td colspan="2">
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td>Total</td>
|
||||
<td>{!!format('m2', $proyecto->superficie('total'), null, true)!!}</td>
|
||||
<td rowspan="6">
|
||||
<canvas id="superficies" width="300" height="200"></canvas>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Sobre Nivel</td>
|
||||
<td>{!!format('m2', $proyecto->superficie('snt'), null, true)!!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bajo Nivel</td>
|
||||
<td>{!!format('m2', $proyecto->superficie('bnt'), null, true)!!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Vendible</td>
|
||||
<td>{!!format('m2', $proyecto->superficie('vendible'), null, true)!!}</td>
|
||||
</tr>
|
||||
@if (count($proyecto->ventas()) > 0)
|
||||
<tr>
|
||||
<td>Vendido</td>
|
||||
<td>{!!format('m2', $proyecto->superficie('vendida'), null, true)!!}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Por Vender</td>
|
||||
<td>{!!format('m2', $proyecto->superficie('por vender'), null, true)!!}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@push('scripts')
|
||||
@if ($proyecto->superficie('total') != null)
|
||||
<script>
|
||||
Number.prototype.formatMoney = function(c, d, t) {
|
||||
var n = this,
|
||||
c = isNaN(c = Math.abs(c)) ? 2 : c,
|
||||
d = d == undefined ? "." : d,
|
||||
t = t == undefined ? "," : t,
|
||||
s = n < 0 ? "-" : "",
|
||||
i = String(parseInt(n = Math.abs(Number(n) || 0).toFixed(c))),
|
||||
j = ((j = i.length) > 3) ? j % 3 : 0;
|
||||
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
|
||||
};
|
||||
function changeLabel(tooltipItem, data) {
|
||||
var label = data.labels[tooltipItem.index] || '';
|
||||
var value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
|
||||
var total = data.datasets[tooltipItem.datasetIndex].data.reduce((a, b) => a + b, 0);
|
||||
if (label) {
|
||||
label += ': ';
|
||||
}
|
||||
label += value.formatMoney(0, ',', '.') + ' (' + Math.round(value / total * 100, 1) + '%)';
|
||||
return label;
|
||||
}
|
||||
var ctx = document.getElementById('superficies').getContext('2d');
|
||||
var sData = {
|
||||
"datasets": [{
|
||||
"data": [
|
||||
{{(($proyecto->superficie('vendible') > 0) ? round($proyecto->superficie('vendida') / $proyecto->superficie('vendible') * 100, 2) : 0)}},
|
||||
{{(($proyecto->superficie('vendible') > 0) ? round($proyecto->superficie('por vender') / $proyecto->superficie('vendible') * 100, 2) : 0)}}
|
||||
],
|
||||
"backgroundColor": ['rgba(0, 200, 0, .7)', 'rgba(200, 0, 0, .7)']
|
||||
}],
|
||||
"labels": ["Vendida", "Por Vender"]
|
||||
};
|
||||
var sOptions = {
|
||||
"responsive": false,
|
||||
"title": {
|
||||
"display": true,
|
||||
"text": "Superfice Vendible"
|
||||
},
|
||||
"legend": {
|
||||
"position": 'right'
|
||||
},
|
||||
"tooltips": {
|
||||
"callbacks": {
|
||||
"label": changeLabel
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var superficies = new Chart(ctx, {
|
||||
"type": "pie",
|
||||
"data": sData,
|
||||
"options": sOptions
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
@endpush
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user