FIX: campos que cambiaron

This commit is contained in:
2020-06-04 11:19:30 -04:00
parent c1d4046c93
commit 6cbc4b4763
3 changed files with 14 additions and 5 deletions

View File

@ -187,8 +187,10 @@
$(this).find('input').val(('0' + (a.getMonth() + 1)).slice(-2) + '/' + a.getFullYear()) $(this).find('input').val(('0' + (a.getMonth() + 1)).slice(-2) + '/' + a.getFullYear())
} }
}) })
var entrega = new Date('{{str_pad(implode('-', array_reverse(explode('/', $producto->entrega))), 7, '20', STR_PAD_LEFT)}}-01T01:00') @if (isset($producto->entrega))
$('.calendar').calendar('set date', entrega) var entrega = new Date('{{str_pad(implode('-', array_reverse(explode('/', $producto->entrega))), 7, '20', STR_PAD_LEFT)}}-01T01:00')
$('.calendar').calendar('set date', entrega)
@endif
}, },
changeSegmento: () => { changeSegmento: () => {
var segmento = $('#segmento').dropdown('get value') var segmento = $('#segmento').dropdown('get value')

View File

@ -29,7 +29,8 @@ class Bodega extends Producto {
], ],
[ [
'label' => 'UF/m²', 'label' => 'UF/m²',
'name' => 'uf_m2' 'name' => 'uf_m2',
'suffix' => ' UF/m²'
] ]
]; ];
array_walk($properties, function(&$item) { array_walk($properties, function(&$item) {

View File

@ -5,6 +5,7 @@ use ProVM\KI\Producto;
class Oficina extends Producto { class Oficina extends Producto {
protected $properties = [ protected $properties = [
'sector',
'm2', 'm2',
'baños', 'baños',
'privados', 'privados',
@ -12,7 +13,7 @@ class Oficina extends Producto {
]; ];
public function uf_m2() { public function uf_m2() {
return $this->arriendo / ($this->m2 ?? 1); return $this->valor / ($this->m2 ?? 1);
} }
public function privados() { public function privados() {
if ($this->privados == 0) { if ($this->privados == 0) {
@ -57,7 +58,12 @@ class Oficina extends Producto {
]; ];
$data []= (object) [ $data []= (object) [
'label' => 'UF/m²', 'label' => 'UF/m²',
'name' => 'uf_m2' 'name' => 'uf_m2',
'suffix' => ' UF/m²'
];
$data []= (object) [
'label' => 'Sector',
'name' => 'sector'
]; ];
array_walk($data, function(&$item) { array_walk($data, function(&$item) {
$item->prefix = $item->prefix ?? ''; $item->prefix = $item->prefix ?? '';