Skip to content

Commit

Permalink
Reorganizados los campos en el modal detalles en compras y ventas.
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoRazorX committed Apr 30, 2022
1 parent 0128d8a commit 0cf4782
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 50 deletions.
8 changes: 4 additions & 4 deletions Core/Base/AjaxForms/CommonSalesPurchases.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ trait CommonSalesPurchases
protected static function cifnif(Translator $i18n, BusinessDocument $model): string
{
$attributes = $model->editable ? 'name="cifnif" maxlength="30" autocomplete="off"' : 'disabled=""';
return '<div class="col-sm">'
return '<div class="col-sm-12">'
. '<div class="form-group">' . $i18n->trans('cifnif')
. '<input type="text" ' . $attributes . ' value="' . $model->cifnif . '" class="form-control"/>'
. '</div>'
Expand Down Expand Up @@ -102,7 +102,7 @@ protected static function coddivisa(Translator $i18n, BusinessDocument $model):
}

$attributes = $model->editable ? 'name="coddivisa" required=""' : 'disabled=""';
return empty($model->subjectColumnValue()) ? '' : '<div class="col-sm">'
return empty($model->subjectColumnValue()) ? '' : '<div class="col-sm-6">'
. '<div class="form-group">'
. '<a href="' . Divisas::get($model->coddivisa)->url() . '">' . $i18n->trans('currency') . '</a>'
. '<select ' . $attributes . ' class="form-control">'
Expand Down Expand Up @@ -258,7 +258,7 @@ protected static function femail(Translator $i18n, BusinessDocument $model): str
protected static function hora(Translator $i18n, BusinessDocument $model): string
{
$attributes = $model->editable ? 'name="hora" required=""' : 'disabled=""';
return empty($model->subjectColumnValue()) ? '' : '<div class="col-sm">'
return empty($model->subjectColumnValue()) ? '' : '<div class="col-sm-6">'
. '<div class="form-group">' . $i18n->trans('hour')
. '<input type="time" ' . $attributes . ' value="' . date('H:i:s', strtotime($model->hora)) . '" class="form-control"/>'
. '</div>'
Expand Down Expand Up @@ -494,7 +494,7 @@ protected static function sortableBtn(Translator $i18n, BusinessDocument $model)
protected static function tasaconv(Translator $i18n, BusinessDocument $model): string
{
$attributes = $model->editable ? 'name="tasaconv" step="any" autocomplete="off"' : 'disabled=""';
return '<div class="col-sm">'
return '<div class="col-sm-6">'
. '<div class="form-group">' . $i18n->trans('conversion-rate')
. '<input type="number" ' . $attributes . ' value="' . $model->tasaconv . '" class="form-control"/>'
. '</div>'
Expand Down
20 changes: 4 additions & 16 deletions Core/Base/AjaxForms/PurchasesHeaderHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,33 +179,21 @@ private static function detailModal(Translator $i18n, PurchaseDocument $model):
. '<div class="modal-dialog modal-dialog-centered">'
. '<div class="modal-content">'
. '<div class="modal-header">'
. '<h5 class="modal-title">'
. $i18n->trans($model->modelClassName() . '-min') . ' ' . $model->codigo
. '</h5>'
. '<h5 class="modal-title">' . $i18n->trans('detail') . '</h5>'
. '<button type="button" class="close" data-dismiss="modal" aria-label="Close">'
. '<span aria-hidden="true">&times;</span>'
. '</button>'
. '</div>'
. '<div class="modal-body">'
. '<div class="form-row">'
. self::renderField($i18n, $model, '_fecha')
. self::renderField($i18n, $model, 'hora')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, 'nombreproveedor')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, 'cifnif')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, 'coddivisa')
. self::renderField($i18n, $model, 'tasaconv')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, '_fecha')
. self::renderField($i18n, $model, 'hora')
. self::renderField($i18n, $model, 'femail')
. self::renderField($i18n, $model, 'user')
. '</div>'
. '<div class="form-row">'
. self::renderNewFields($i18n, $model)
. '</div>'
. '</div>'
Expand All @@ -225,7 +213,7 @@ private static function detailModal(Translator $i18n, PurchaseDocument $model):
private static function nombreproveedor(Translator $i18n, PurchaseDocument $model): string
{
$attributes = $model->editable ? 'name="nombre" required=""' : 'disabled=""';
return '<div class="col-sm">'
return '<div class="col-sm-12">'
. '<div class="form-group">' . $i18n->trans('business-name')
. '<input type="text" ' . $attributes . ' value="' . $model->nombre . '" class="form-control" maxlength="100" autocomplete="off" />'
. '</div>'
Expand Down
40 changes: 10 additions & 30 deletions Core/Base/AjaxForms/SalesHeaderHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private static function codcliente(Translator $i18n, SalesDocument $model): stri
private static function codigoenv(Translator $i18n, SalesDocument $model): string
{
$attributes = $model->editable ? 'name="codigoenv" maxlength="200" autocomplete="off"' : 'disabled=""';
return '<div class="col-sm">'
return '<div class="col-sm-6">'
. '<div class="form-group">' . $i18n->trans('tracking-code')
. '<input type="text" ' . $attributes . ' value="' . $model->codigoenv . '" class="form-control"/>'
. '</div>'
Expand All @@ -235,7 +235,7 @@ private static function codtrans(Translator $i18n, SalesDocument $model): string
}

$attributes = $model->editable ? 'name="codtrans"' : 'disabled=""';
return empty($model->idcontactoenv) || count($options) === 1 ? '' : '<div class="col-sm">'
return '<div class="col-sm-6">'
. '<div class="form-group">'
. '<a href="' . $agenciaTransporte->url() . '">' . $i18n->trans('carrier') . '</a>'
. '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>'
Expand Down Expand Up @@ -266,46 +266,26 @@ private static function detailModal(Translator $i18n, SalesDocument $model): str
. '<div class="modal-dialog modal-dialog-centered">'
. '<div class="modal-content">'
. '<div class="modal-header">'
. '<h5 class="modal-title">'
. $i18n->trans($model->modelClassName() . '-min') . ' ' . $model->codigo
. '</h5>'
. '<h5 class="modal-title">' . $i18n->trans('detail') . '</h5>'
. '<button type="button" class="close" data-dismiss="modal" aria-label="Close">'
. '<span aria-hidden="true">&times;</span>'
. '</button>'
. '</div>'
. '<div class="modal-body">'
. '<div class="form-row">'
. self::renderField($i18n, $model, '_fecha')
. self::renderField($i18n, $model, 'hora')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, 'idcontactofact')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, 'nombrecliente')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, 'cifnif')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, 'idcontactofact')
. self::renderField($i18n, $model, 'idcontactoenv')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, 'codtrans')
. self::renderField($i18n, $model, 'codigoenv')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, 'codagente')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, 'coddivisa')
. self::renderField($i18n, $model, 'tasaconv')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, '_fecha')
. self::renderField($i18n, $model, 'hora')
. self::renderField($i18n, $model, 'femail')
. self::renderField($i18n, $model, 'user')
. '</div>'
. '<div class="form-row">'
. self::renderField($i18n, $model, 'codagente')
. self::renderNewFields($i18n, $model)
. '</div>'
. '</div>'
Expand Down Expand Up @@ -369,7 +349,7 @@ private static function idcontactoenv(Translator $i18n, SalesDocument $model): s

$attributes = $model->editable ? 'name="idcontactoenv"' : 'disabled=""';
$options = self::getAddressOptions($i18n, $model->idcontactoenv, true);
return '<div class="col-sm">'
return '<div class="col-sm-12">'
. '<div class="form-group">'
. '<a href="' . self::$cliente->url() . '&activetab=EditDireccionContacto" target="_blank">'
. $i18n->trans('shipping-address') . '</a>'
Expand All @@ -386,7 +366,7 @@ private static function idcontactofact(Translator $i18n, SalesDocument $model):

$attributes = $model->editable ? 'name="idcontactofact" onchange="return salesFormActionWait(\'recalculate-line\', \'0\', event);"' : 'disabled=""';
$options = self::getAddressOptions($i18n, $model->idcontactofact, false);
return '<div class="col-sm">'
return '<div class="col-sm-12">'
. '<div class="form-group">'
. '<a href="' . self::$cliente->url() . '&activetab=EditDireccionContacto" target="_blank">' . $i18n->trans('billing-address') . '</a>'
. '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>'
Expand All @@ -397,7 +377,7 @@ private static function idcontactofact(Translator $i18n, SalesDocument $model):
private static function nombrecliente(Translator $i18n, SalesDocument $model): string
{
$attributes = $model->editable ? 'name="nombrecliente" required="" maxlength="100" autocomplete="off"' : 'disabled=""';
return '<div class="col-sm">'
return '<div class="col-sm-12">'
. '<div class="form-group">'
. $i18n->trans('business-name')
. '<input type="text" ' . $attributes . ' value="' . $model->nombrecliente . '" class="form-control"/>'
Expand Down

0 comments on commit 0cf4782

Please sign in to comment.