Fixes for upgrade
This commit is contained in:
@ -486,7 +486,10 @@ class Informes
|
|||||||
$info['Tipo'] = $venta->unidad()->abreviacion;
|
$info['Tipo'] = $venta->unidad()->abreviacion;
|
||||||
$info['m² Ponderados'] = $venta->unidad()->m2('vendible');
|
$info['m² Ponderados'] = $venta->unidad()->m2('vendible');
|
||||||
$info['Valor Promesa'] = $venta->valor_uf;
|
$info['Valor Promesa'] = $venta->valor_uf;
|
||||||
$info['Pie'] = $venta->pie()->valor;
|
$info['Pie'] = 0;
|
||||||
|
if ($venta->pie()) {
|
||||||
|
$info['Pie'] = $venta->pie()->valor;
|
||||||
|
}
|
||||||
$info['Pie Pagado'] = 0;
|
$info['Pie Pagado'] = 0;
|
||||||
$info['% Pie Pagado'] = 0;
|
$info['% Pie Pagado'] = 0;
|
||||||
if ($venta->pie()) {
|
if ($venta->pie()) {
|
||||||
@ -510,10 +513,10 @@ class Informes
|
|||||||
}
|
}
|
||||||
$info['Credito'] = 0;
|
$info['Credito'] = 0;
|
||||||
$info['Banco'] = '';
|
$info['Banco'] = '';
|
||||||
if ($venta->credito != 0) {
|
if ($venta->credito != 0 and $venta->credito()->pago()) {
|
||||||
$info['Credito'] = $venta->credito()->pago()->valor('ufs');
|
$info['Credito'] = $venta->credito()?->pago()->valor('ufs');
|
||||||
if ($venta->credito()->pago()->banco != 0) {
|
if ($venta->credito()?->pago()->banco != 0) {
|
||||||
$info['Banco'] = $venta->credito()->pago()->banco()->nombre;
|
$info['Banco'] = $venta->credito()?->pago()->banco()->nombre;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$info['Valor Ests & Bods'] = $venta->valorEstacionamientosYBodegas();
|
$info['Valor Ests & Bods'] = $venta->valorEstacionamientosYBodegas();
|
||||||
@ -525,6 +528,9 @@ class Informes
|
|||||||
$info['Precio'] = 0;
|
$info['Precio'] = 0;
|
||||||
try {
|
try {
|
||||||
$info['Precio'] = array_reduce($venta->propiedad()->departamentos(), function($sum, $item) use ($fecha) {
|
$info['Precio'] = array_reduce($venta->propiedad()->departamentos(), function($sum, $item) use ($fecha) {
|
||||||
|
if (!$item->precio($fecha)) {
|
||||||
|
return $sum;
|
||||||
|
}
|
||||||
return $sum + $item->precio($fecha)->valor;
|
return $sum + $item->precio($fecha)->valor;
|
||||||
});
|
});
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
@ -39,17 +39,16 @@ function uf($date, $async = false) {
|
|||||||
return (object) ['total' => 0];
|
return (object) ['total' => 0];
|
||||||
}
|
}
|
||||||
$url = 'http://' . config('locations.money') . '/api/uf/value/' . $date->format('Y-m-d');
|
$url = 'http://' . config('locations.money') . '/api/uf/value/' . $date->format('Y-m-d');
|
||||||
$client = new \Goutte\Client();
|
$client = new \GuzzleHttp\Client(['base_uri' => 'http://' . config('locations.money') . '/', 'headers' => ['Accept' => 'application/json']]);
|
||||||
$client->setHeader('Accept', 'application/json');
|
$response = $client->get('api/uf/value/' . $date->format('Y-m-d'));
|
||||||
$client->request('GET', $url);
|
|
||||||
|
|
||||||
$response = $client->getResponse();
|
//$response = $client->getResponse();
|
||||||
if (!$response) {
|
if (!$response) {
|
||||||
return (object) ['total' => 0];
|
return (object) ['total' => 0];
|
||||||
}
|
}
|
||||||
$status = $response->getStatusCode();
|
$status = $response->getStatusCode();
|
||||||
if ($status >= 200 and $status < 300) {
|
if ($status >= 200 and $status < 300) {
|
||||||
$data = json_decode($response->getContent());
|
$data = json_decode($response->getBody()->getContents());
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
return (object) ['total' => 0];
|
return (object) ['total' => 0];
|
||||||
|
@ -11,6 +11,6 @@ return [
|
|||||||
'controllers' => '{locations.app}/Controller',
|
'controllers' => '{locations.app}/Controller',
|
||||||
'money' => 'provm.cl/optimus/money',
|
'money' => 'provm.cl/optimus/money',
|
||||||
'api' => '192.168.1.100/intranet/api',
|
'api' => '192.168.1.100/intranet/api',
|
||||||
'api_url' => '/incoviba/api'
|
'api_url' => '/api'
|
||||||
];
|
];
|
||||||
?>
|
?>
|
||||||
|
@ -66,9 +66,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@if (isset($results) and is_array($results) and count($results) > 0)
|
||||||
@foreach ($results as $resultado)
|
@foreach ($results as $resultado)
|
||||||
@include('buscar.resultado')
|
@include('buscar.resultado', ['resultado' => $resultado])
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@endif
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user