mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Finalizadas las tareas de modificacion
This commit is contained in:
@ -84,7 +84,9 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
// JJO
|
// JJO
|
||||||
$sanitizedData['user_created_id'] = $session->id_user;
|
$sanitizedData['user_created_id'] = $session->id_user;
|
||||||
|
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
|
||||||
|
$sanitizedData['mostrar_en_presupuesto'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
@ -164,6 +166,9 @@ class Tarifaacabado extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
// JJO
|
// JJO
|
||||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||||
|
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
|
||||||
|
$sanitizedData['mostrar_en_presupuesto'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
|
|||||||
@ -47,6 +47,11 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController
|
|||||||
$this->viewData['pageTitle'] = lang('TarifaAcabadoLineas.moduleTitle');
|
$this->viewData['pageTitle'] = lang('TarifaAcabadoLineas.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = true;
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
|
|
||||||
|
// Se indica que este controlador trabaja con soft_delete
|
||||||
|
$this->soft_delete = true;
|
||||||
|
// Se indica el flag para los ficheros borrados
|
||||||
|
$this->delete_flag = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -248,19 +253,19 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController
|
|||||||
// Build our Editor instance and process the data coming from _POST
|
// Build our Editor instance and process the data coming from _POST
|
||||||
$response = Editor::inst($db, 'tarifa_acabado_lineas')
|
$response = Editor::inst($db, 'tarifa_acabado_lineas')
|
||||||
->fields(
|
->fields(
|
||||||
Field::inst('paginas_min')
|
Field::inst('tirada_min')
|
||||||
->validator('Validate::numeric', array(
|
->validator('Validate::numeric', array(
|
||||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_min.decimal'))
|
'message' => lang('TarifaAcabadoLineas.validation.tirada_min.decimal'))
|
||||||
)
|
)
|
||||||
->validator('Validate::notEmpty', array(
|
->validator('Validate::notEmpty', array(
|
||||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_min.required'))
|
'message' => lang('TarifaAcabadoLineas.validation.tirada_min.required'))
|
||||||
),
|
),
|
||||||
Field::inst('paginas_max')
|
Field::inst('tirada_max')
|
||||||
->validator('Validate::numeric', array(
|
->validator('Validate::numeric', array(
|
||||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_max.decimal'))
|
'message' => lang('TarifaAcabadoLineas.validation.tirada_max.decimal'))
|
||||||
)
|
)
|
||||||
->validator('Validate::notEmpty', array(
|
->validator('Validate::notEmpty', array(
|
||||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_max.required'))
|
'message' => lang('TarifaAcabadoLineas.validation.tirada_max.required'))
|
||||||
),
|
),
|
||||||
Field::inst('precio_min')
|
Field::inst('precio_min')
|
||||||
->validator('Validate::numeric', array(
|
->validator('Validate::numeric', array(
|
||||||
@ -298,8 +303,8 @@ class Tarifaacabadolineas extends \App\Controllers\GoBaseResourceController
|
|||||||
// Si no se quiere borrar...
|
// Si no se quiere borrar...
|
||||||
if ($data['data'][$pkey]['is_deleted'] != 1) {
|
if ($data['data'][$pkey]['is_deleted'] != 1) {
|
||||||
|
|
||||||
$process_data['paginas_min'] = $data['data'][$pkey]['paginas_min'];
|
$process_data['tirada_min'] = $data['data'][$pkey]['tirada_min'];
|
||||||
$process_data['paginas_max'] = $data['data'][$pkey]['paginas_max'];
|
$process_data['tirada_max'] = $data['data'][$pkey]['tirada_max'];
|
||||||
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['tarifa_acabado_id']);
|
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['tarifa_acabado_id']);
|
||||||
// No se pueden duplicar valores al crear o al editar
|
// No se pueden duplicar valores al crear o al editar
|
||||||
if (!empty($response)) {
|
if (!empty($response)) {
|
||||||
|
|||||||
@ -44,6 +44,11 @@ class Tarifaencuadernacionlineas extends \App\Controllers\GoBaseResourceControll
|
|||||||
$this->viewData['pageTitle'] = lang('TarifaEncuadernacionLineas.moduleTitle');
|
$this->viewData['pageTitle'] = lang('TarifaEncuadernacionLineas.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = true;
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
|
|
||||||
|
// Se indica que este controlador trabaja con soft_delete
|
||||||
|
$this->soft_delete = true;
|
||||||
|
// Se indica el flag para los ficheros borrados
|
||||||
|
$this->delete_flag = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ use App\Models\Collection;
|
|||||||
use App\Entities\Tarifas\TarifaEncuadernacionTirada;
|
use App\Entities\Tarifas\TarifaEncuadernacionTirada;
|
||||||
|
|
||||||
use App\Models\Tarifas\TarifaEncuadernacionTiradaModel;
|
use App\Models\Tarifas\TarifaEncuadernacionTiradaModel;
|
||||||
|
use App\Models\Tarifas\TarifaEncuadernacionLineaModel;
|
||||||
use App\Models\Compras\ProveedorModel;
|
use App\Models\Compras\ProveedorModel;
|
||||||
use App\Models\Compras\ProveedorTipoModel;
|
use App\Models\Compras\ProveedorTipoModel;
|
||||||
|
|
||||||
@ -47,6 +48,45 @@ class Tarifaencuadernaciontiradas extends \App\Controllers\GoBaseResourceControl
|
|||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function delete($id = null)
|
||||||
|
{
|
||||||
|
if (!empty(static::$pluralObjectNameCc) && !empty(static::$singularObjectNameCc)) {
|
||||||
|
$objName = mb_strtolower(lang(ucfirst(static::$pluralObjectNameCc).'.'.static::$singularObjectNameCc));
|
||||||
|
} else {
|
||||||
|
$objName = lang('Basic.global.record');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$this->soft_delete){
|
||||||
|
|
||||||
|
if (!$this->model->delete($id)) {
|
||||||
|
return $this->failNotFound(lang('Basic.global.deleteError', [$objName]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
||||||
|
|
||||||
|
$lineaModel = new TarifaEncuadernacionLineaModel();
|
||||||
|
$lineaResult = $lineaModel->removeAllEncuadernacionLineas($id, $datetime, $this->delete_flag);
|
||||||
|
|
||||||
|
$rawResult = $this->model->where('id',$id)
|
||||||
|
->set(['deleted_at' => $datetime->format('Y-m-d H:i:s'),
|
||||||
|
'is_deleted' => $this->delete_flag])
|
||||||
|
->update();
|
||||||
|
|
||||||
|
if (!$rawResult && !$lineaResult) {
|
||||||
|
return $this->failNotFound(lang('Basic.global.deleteError', [$objName]));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// $message = lang('Basic.global.deleteSuccess', [$objName]); IMN commented
|
||||||
|
$message = lang('Basic.global.deleteSuccess', [lang('Basic.global.record')]);
|
||||||
|
$response = $this->respondDeleted(['id' => $id, 'msg' => $message]);
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function datatable_editor()
|
public function datatable_editor()
|
||||||
{
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
|
|||||||
@ -43,6 +43,12 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController
|
|||||||
{
|
{
|
||||||
$this->viewData['pageTitle'] = lang('TarifaManipuladoLineas.moduleTitle');
|
$this->viewData['pageTitle'] = lang('TarifaManipuladoLineas.moduleTitle');
|
||||||
$this->viewData['usingSweetAlert'] = true;
|
$this->viewData['usingSweetAlert'] = true;
|
||||||
|
|
||||||
|
// Se indica que este controlador trabaja con soft_delete
|
||||||
|
$this->soft_delete = true;
|
||||||
|
// Se indica el flag para los ficheros borrados
|
||||||
|
$this->delete_flag = 1;
|
||||||
|
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,19 +216,19 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController
|
|||||||
// Build our Editor instance and process the data coming from _POST
|
// Build our Editor instance and process the data coming from _POST
|
||||||
$response = Editor::inst($db, 'tarifa_manipulado_lineas')
|
$response = Editor::inst($db, 'tarifa_manipulado_lineas')
|
||||||
->fields(
|
->fields(
|
||||||
Field::inst('paginas_min')
|
Field::inst('tirada_min')
|
||||||
->validator('Validate::numeric', array(
|
->validator('Validate::numeric', array(
|
||||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_min.decimal'))
|
'message' => lang('TarifaAcabadoLineas.validation.tirada_min.decimal'))
|
||||||
)
|
)
|
||||||
->validator('Validate::notEmpty', array(
|
->validator('Validate::notEmpty', array(
|
||||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_min.required'))
|
'message' => lang('TarifaAcabadoLineas.validation.tirada_min.required'))
|
||||||
),
|
),
|
||||||
Field::inst('paginas_max')
|
Field::inst('tirada_max')
|
||||||
->validator('Validate::numeric', array(
|
->validator('Validate::numeric', array(
|
||||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_max.decimal'))
|
'message' => lang('TarifaAcabadoLineas.validation.tirada_max.decimal'))
|
||||||
)
|
)
|
||||||
->validator('Validate::notEmpty', array(
|
->validator('Validate::notEmpty', array(
|
||||||
'message' => lang('TarifaAcabadoLineas.validation.paginas_max.required'))
|
'message' => lang('TarifaAcabadoLineas.validation.tirada_max.required'))
|
||||||
),
|
),
|
||||||
Field::inst('precio_min')
|
Field::inst('precio_min')
|
||||||
->validator('Validate::numeric', array(
|
->validator('Validate::numeric', array(
|
||||||
@ -259,8 +265,8 @@ class Tarifamanipuladolineas extends \App\Controllers\GoBaseResourceController
|
|||||||
foreach ($data['data'] as $pkey => $values) {
|
foreach ($data['data'] as $pkey => $values) {
|
||||||
// Si no se quiere borrar...
|
// Si no se quiere borrar...
|
||||||
if ($data['data'][$pkey]['is_deleted'] != 1) {
|
if ($data['data'][$pkey]['is_deleted'] != 1) {
|
||||||
$process_data['paginas_min'] = $data['data'][$pkey]['paginas_min'];
|
$process_data['tirada_min'] = $data['data'][$pkey]['tirada_min'];
|
||||||
$process_data['paginas_max'] = $data['data'][$pkey]['paginas_max'];
|
$process_data['tirada_max'] = $data['data'][$pkey]['tirada_max'];
|
||||||
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['tarifa_manipulado_id']);
|
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['tarifa_manipulado_id']);
|
||||||
// No se pueden duplicar valores al crear o al editar
|
// No se pueden duplicar valores al crear o al editar
|
||||||
if (!empty($response)) {
|
if (!empty($response)) {
|
||||||
|
|||||||
@ -89,6 +89,9 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController
|
|||||||
if (isset($this->model->user_updated_id)) {
|
if (isset($this->model->user_updated_id)) {
|
||||||
$sanitizedData['user_created_id'] = $session->id_user;
|
$sanitizedData['user_created_id'] = $session->id_user;
|
||||||
}
|
}
|
||||||
|
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
|
||||||
|
$sanitizedData['mostrar_en_presupuesto'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
@ -170,6 +173,9 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController
|
|||||||
if (isset($this->model->user_updated_id)) {
|
if (isset($this->model->user_updated_id)) {
|
||||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||||
}
|
}
|
||||||
|
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
|
||||||
|
$sanitizedData['mostrar_en_presupuesto'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
|
|||||||
@ -86,6 +86,9 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController
|
|||||||
if (isset($this->model->user_updated_id)) {
|
if (isset($this->model->user_updated_id)) {
|
||||||
$sanitizedData['user_created_id'] = $session->id_user;
|
$sanitizedData['user_created_id'] = $session->id_user;
|
||||||
}
|
}
|
||||||
|
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
|
||||||
|
$sanitizedData['mostrar_en_presupuesto'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
@ -167,6 +170,9 @@ class Tarifasmanipulado extends \App\Controllers\GoBaseResourceController
|
|||||||
if (isset($this->model->user_updated_id)) {
|
if (isset($this->model->user_updated_id)) {
|
||||||
$sanitizedData['user_updated_id'] = $session->id_user;
|
$sanitizedData['user_updated_id'] = $session->id_user;
|
||||||
}
|
}
|
||||||
|
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
|
||||||
|
$sanitizedData['mostrar_en_presupuesto'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
|
|||||||
@ -11,6 +11,7 @@ class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"nombre" => null,
|
"nombre" => null,
|
||||||
"precio_min" => 0,
|
"precio_min" => 0,
|
||||||
"importe_fijo" => 0,
|
"importe_fijo" => 0,
|
||||||
|
"mostrar_en_presupuesto" => 1,
|
||||||
"user_created_id" => 0,
|
"user_created_id" => 0,
|
||||||
"user_updated_id" => 0,
|
"user_updated_id" => 0,
|
||||||
"is_deleted" => 0,
|
"is_deleted" => 0,
|
||||||
@ -21,6 +22,7 @@ class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity
|
|||||||
protected $casts = [
|
protected $casts = [
|
||||||
"precio_min" => "float",
|
"precio_min" => "float",
|
||||||
"importe_fijo" => "float",
|
"importe_fijo" => "float",
|
||||||
|
"mostrar_en_presupuesto" => "int",
|
||||||
"user_created_id" => "int",
|
"user_created_id" => "int",
|
||||||
"user_updated_id" => "int",
|
"user_updated_id" => "int",
|
||||||
"is_deleted" => "int",
|
"is_deleted" => "int",
|
||||||
|
|||||||
@ -11,6 +11,7 @@ class TarifaManipuladoEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"nombre" => null,
|
"nombre" => null,
|
||||||
"precio_min" => 0,
|
"precio_min" => 0,
|
||||||
"importe_fijo" => 0,
|
"importe_fijo" => 0,
|
||||||
|
"mostrar_en_presupuesto" => 1,
|
||||||
"user_created_id" => 0,
|
"user_created_id" => 0,
|
||||||
"user_updated_id" => 0,
|
"user_updated_id" => 0,
|
||||||
"is_deleted" => 0,
|
"is_deleted" => 0,
|
||||||
@ -21,6 +22,7 @@ class TarifaManipuladoEntity extends \CodeIgniter\Entity\Entity
|
|||||||
protected $casts = [
|
protected $casts = [
|
||||||
"precio_min" => "float",
|
"precio_min" => "float",
|
||||||
"importe_fijo" => "float",
|
"importe_fijo" => "float",
|
||||||
|
"mostrar_en_presupuesto" => "int",
|
||||||
"user_created_id" => "int",
|
"user_created_id" => "int",
|
||||||
"user_updated_id" => "int",
|
"user_updated_id" => "int",
|
||||||
"is_deleted" => "int",
|
"is_deleted" => "int",
|
||||||
|
|||||||
@ -10,6 +10,7 @@ class TarifaacabadoEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"nombre" => null,
|
"nombre" => null,
|
||||||
"precio_min" => 0,
|
"precio_min" => 0,
|
||||||
"importe_fijo" => 0,
|
"importe_fijo" => 0,
|
||||||
|
"mostrar_en_presupuesto" => 1,
|
||||||
"user_created_id" => 0,
|
"user_created_id" => 0,
|
||||||
"user_updated_id" => 0,
|
"user_updated_id" => 0,
|
||||||
"is_deleted" => 0,
|
"is_deleted" => 0,
|
||||||
@ -20,6 +21,7 @@ class TarifaacabadoEntity extends \CodeIgniter\Entity\Entity
|
|||||||
protected $casts = [
|
protected $casts = [
|
||||||
"precio_min" => "float",
|
"precio_min" => "float",
|
||||||
"importe_fijo" => "float",
|
"importe_fijo" => "float",
|
||||||
|
"mostrar_en_presupuesto" => "int",
|
||||||
"user_created_id" => "int",
|
"user_created_id" => "int",
|
||||||
"user_updated_id" => "int",
|
"user_updated_id" => "int",
|
||||||
"is_deleted" => "int",
|
"is_deleted" => "int",
|
||||||
|
|||||||
@ -11,6 +11,7 @@ return [
|
|||||||
'precioUnidad' => 'Price Unit',
|
'precioUnidad' => 'Price Unit',
|
||||||
'paginasMax' => 'Max Pages',
|
'paginasMax' => 'Max Pages',
|
||||||
'paginasMin' => 'Min Pages',
|
'paginasMin' => 'Min Pages',
|
||||||
|
'moduleExplanation' => 'The number of pages indicated in this section refers per copy, not to the total of the order.',
|
||||||
'margen' => 'Margin',
|
'margen' => 'Margin',
|
||||||
'validation' => [
|
'validation' => [
|
||||||
'error_seleccion_tiradas' => 'A line from the Printings table must be selected before creating a new record.',
|
'error_seleccion_tiradas' => 'A line from the Printings table must be selected before creating a new record.',
|
||||||
|
|||||||
@ -15,6 +15,7 @@ return [
|
|||||||
'precioMin' => 'Min Price',
|
'precioMin' => 'Min Price',
|
||||||
'importeFijo' => 'Fixed amount',
|
'importeFijo' => 'Fixed amount',
|
||||||
'margen' => 'Margin',
|
'margen' => 'Margin',
|
||||||
|
'mostrar_en_presupuesto' => 'Show in budget',
|
||||||
'tarifaacabado' => 'Finishing Rates',
|
'tarifaacabado' => 'Finishing Rates',
|
||||||
'tarifaacabadoList' => 'Finishing Rates List',
|
'tarifaacabadoList' => 'Finishing Rates List',
|
||||||
'tarifasacabado' => 'Finishing Rates',
|
'tarifasacabado' => 'Finishing Rates',
|
||||||
|
|||||||
@ -21,6 +21,7 @@ return [
|
|||||||
'tarifasencuadernacion' => 'Binding rates',
|
'tarifasencuadernacion' => 'Binding rates',
|
||||||
'tiradaMax' => 'Print Max',
|
'tiradaMax' => 'Print Max',
|
||||||
'tiradaMin' => 'Print Min',
|
'tiradaMin' => 'Print Min',
|
||||||
|
'mostrar_en_presupuesto' => 'Show in budget',
|
||||||
'updatedAt' => 'Updated At',
|
'updatedAt' => 'Updated At',
|
||||||
'userCreatedId' => 'User Created ID',
|
'userCreatedId' => 'User Created ID',
|
||||||
'userUpdateId' => 'User Update ID',
|
'userUpdateId' => 'User Update ID',
|
||||||
|
|||||||
@ -15,6 +15,7 @@ return [
|
|||||||
'precioMin' => 'Price Min',
|
'precioMin' => 'Price Min',
|
||||||
'precioMin' => 'Min Price',
|
'precioMin' => 'Min Price',
|
||||||
'importeFijo' => 'Fixed amount',
|
'importeFijo' => 'Fixed amount',
|
||||||
|
'mostrar_en_presupuesto' => 'Show in budget',
|
||||||
'margen' => 'Margin',
|
'margen' => 'Margin',
|
||||||
'tarifamanipulado' => 'Handling rate',
|
'tarifamanipulado' => 'Handling rate',
|
||||||
'tarifamanipuladoList' => 'Handling rates List',
|
'tarifamanipuladoList' => 'Handling rates List',
|
||||||
|
|||||||
@ -11,6 +11,7 @@ return [
|
|||||||
'precioUnidad' => 'Precio Unidad',
|
'precioUnidad' => 'Precio Unidad',
|
||||||
'paginasMax' => 'Páginas Max',
|
'paginasMax' => 'Páginas Max',
|
||||||
'paginasMin' => 'Páginas Min',
|
'paginasMin' => 'Páginas Min',
|
||||||
|
'moduleExplanation' => 'El número de páginas reflejado en este apartado se refiere por ejemplar, no al total del pedido',
|
||||||
'margen' => 'Margen',
|
'margen' => 'Margen',
|
||||||
'validation' => [
|
'validation' => [
|
||||||
'error_seleccion_tiradas' => 'Debe seleccionar una línea de la tabla tiradas antes de crear un registro nuevo.',
|
'error_seleccion_tiradas' => 'Debe seleccionar una línea de la tabla tiradas antes de crear un registro nuevo.',
|
||||||
|
|||||||
@ -11,6 +11,7 @@ return [
|
|||||||
'nombre' => 'Nombre',
|
'nombre' => 'Nombre',
|
||||||
'precioMin' => 'Precio Mínimo',
|
'precioMin' => 'Precio Mínimo',
|
||||||
'importeFijo' => 'Importe Fijo',
|
'importeFijo' => 'Importe Fijo',
|
||||||
|
'mostrar_en_presupuesto' => 'Mostrar en presupuesto',
|
||||||
'tarifaacabado' => 'Tarifas Acabado',
|
'tarifaacabado' => 'Tarifas Acabado',
|
||||||
'tarifaacabadoList' => 'Lista Tarifas Acabado',
|
'tarifaacabadoList' => 'Lista Tarifas Acabado',
|
||||||
'tarifasacabado' => 'Tarifas Acabado',
|
'tarifasacabado' => 'Tarifas Acabado',
|
||||||
|
|||||||
@ -18,6 +18,7 @@ return [
|
|||||||
'tarifasencuadernacion' => 'Tarifas Encuadernación',
|
'tarifasencuadernacion' => 'Tarifas Encuadernación',
|
||||||
'tiradaMax' => 'Tirada Max',
|
'tiradaMax' => 'Tirada Max',
|
||||||
'tiradaMin' => 'Tirada Min',
|
'tiradaMin' => 'Tirada Min',
|
||||||
|
'mostrar_en_presupuesto' => 'Mostrar en presupuesto',
|
||||||
'updatedAt' => 'Actualizado en',
|
'updatedAt' => 'Actualizado en',
|
||||||
'userCreatedId' => 'ID Usuario \"Creado en\"',
|
'userCreatedId' => 'ID Usuario \"Creado en\"',
|
||||||
'userUpdateId' => 'ID Usuario \"Actualizado en\"',
|
'userUpdateId' => 'ID Usuario \"Actualizado en\"',
|
||||||
|
|||||||
@ -13,6 +13,7 @@ return [
|
|||||||
'precioMax' => 'Precio Max',
|
'precioMax' => 'Precio Max',
|
||||||
'precioMin' => 'Precio Min',
|
'precioMin' => 'Precio Min',
|
||||||
'importeFijo' => 'Importe Fijo',
|
'importeFijo' => 'Importe Fijo',
|
||||||
|
'mostrar_en_presupuesto' => 'Mostrar en presupuesto',
|
||||||
'tarifamanipulado' => 'Tarifa Manipulado',
|
'tarifamanipulado' => 'Tarifa Manipulado',
|
||||||
'tarifamanipuladoList' => 'Lista Tarifas Manipulado',
|
'tarifamanipuladoList' => 'Lista Tarifas Manipulado',
|
||||||
'tarifasmanipulado' => 'Tarifas Manipulado',
|
'tarifasmanipulado' => 'Tarifas Manipulado',
|
||||||
|
|||||||
@ -156,4 +156,16 @@ class TarifaEncuadernacionLineaModel extends \App\Models\GoBaseModel
|
|||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function removeAllEncuadernacionLineas($tiradaId = -1, $datetime = null, $delete_flag=1){
|
||||||
|
|
||||||
|
$builder = $this->db
|
||||||
|
->table($this->table)
|
||||||
|
->set(['deleted_at' => $datetime->format('Y-m-d H:i:s'),
|
||||||
|
'is_deleted' => $delete_flag])
|
||||||
|
->where('tirada_encuadernacion_id',$tiradaId)
|
||||||
|
->update();
|
||||||
|
|
||||||
|
return $builder;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,12 +14,17 @@ class TarifaEncuadernacionModel extends \App\Models\GoBaseModel
|
|||||||
|
|
||||||
const SORTABLE = [
|
const SORTABLE = [
|
||||||
0 => "t1.nombre",
|
0 => "t1.nombre",
|
||||||
|
1 => "t1.precio_min",
|
||||||
|
2 => "t1.importe_fijo",
|
||||||
|
3 => "t1.mostrar_en_presupuesto",
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
"nombre",
|
"nombre",
|
||||||
"precio_min",
|
"precio_min",
|
||||||
"importe_fijo",
|
"importe_fijo",
|
||||||
|
"mostrar_en_presupuesto",
|
||||||
"deleted_at",
|
"deleted_at",
|
||||||
"is_deleted",
|
"is_deleted",
|
||||||
"user_created_id",
|
"user_created_id",
|
||||||
@ -76,7 +81,8 @@ class TarifaEncuadernacionModel extends \App\Models\GoBaseModel
|
|||||||
*/
|
*/
|
||||||
public function getResource(string $search = "")
|
public function getResource(string $search = "")
|
||||||
{
|
{
|
||||||
$builder = $this->db->table($this->table . " t1")->select("t1.id AS id, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo");
|
$builder = $this->db->table($this->table . " t1")->select("t1.id AS id, t1.nombre AS nombre,
|
||||||
|
t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo, t1.mostrar_en_presupuesto AS mostrar_en_presupuesto");
|
||||||
|
|
||||||
//JJO
|
//JJO
|
||||||
$builder->where("t1.is_deleted", 0);
|
$builder->where("t1.is_deleted", 0);
|
||||||
|
|||||||
@ -14,12 +14,16 @@ class TarifaManipuladoModel extends \App\Models\GoBaseModel
|
|||||||
|
|
||||||
const SORTABLE = [
|
const SORTABLE = [
|
||||||
0 => "t1.nombre",
|
0 => "t1.nombre",
|
||||||
|
1 => "precio_min",
|
||||||
|
2 => "importe_fijo",
|
||||||
|
3 => "t1.mostrar_en_presupuesto",
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
"nombre",
|
"nombre",
|
||||||
"precio_min",
|
"precio_min",
|
||||||
"importe_fijo",
|
"importe_fijo",
|
||||||
|
"mostrar_en_presupuesto",
|
||||||
"deleted_at",
|
"deleted_at",
|
||||||
"is_deleted",
|
"is_deleted",
|
||||||
"user_created_id",
|
"user_created_id",
|
||||||
@ -76,7 +80,8 @@ class TarifaManipuladoModel extends \App\Models\GoBaseModel
|
|||||||
*/
|
*/
|
||||||
public function getResource(string $search = "")
|
public function getResource(string $search = "")
|
||||||
{
|
{
|
||||||
$builder = $this->db->table($this->table . " t1")->select("t1.id AS id, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo");
|
$builder = $this->db->table($this->table . " t1")->select("t1.id AS id, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo
|
||||||
|
,t1.mostrar_en_presupuesto AS mostrar_en_presupuesto");
|
||||||
|
|
||||||
//JJO
|
//JJO
|
||||||
$builder->where("t1.is_deleted", 0);
|
$builder->where("t1.is_deleted", 0);
|
||||||
|
|||||||
@ -16,12 +16,14 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
|
|||||||
0 => "t1.nombre",
|
0 => "t1.nombre",
|
||||||
1 => "precio_min",
|
1 => "precio_min",
|
||||||
2 => "importe_fijo",
|
2 => "importe_fijo",
|
||||||
|
3 => "t1.mostrar_en_presupuesto",
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
"nombre",
|
"nombre",
|
||||||
"precio_min",
|
"precio_min",
|
||||||
"importe_fijo",
|
"importe_fijo",
|
||||||
|
"mostrar_en_presupuesto",
|
||||||
"deleted_at",
|
"deleted_at",
|
||||||
"is_deleted",
|
"is_deleted",
|
||||||
"user_created_id",
|
"user_created_id",
|
||||||
@ -79,7 +81,7 @@ class TarifaacabadoModel extends \App\Models\GoBaseModel
|
|||||||
public function getResource(string $search = "")
|
public function getResource(string $search = "")
|
||||||
{
|
{
|
||||||
$builder = $this->db->table($this->table . " t1")->select(
|
$builder = $this->db->table($this->table . " t1")->select(
|
||||||
"t1.id AS id, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo"
|
"t1.id AS id, t1.nombre AS nombre, t1.precio_min AS precio_min, t1.importe_fijo AS importe_fijo, t1.mostrar_en_presupuesto AS mostrar_en_presupuesto"
|
||||||
);
|
);
|
||||||
|
|
||||||
//JJO
|
//JJO
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class TarifapreimpresionModel extends \App\Models\GoBaseModel
|
|||||||
"label" => "Tarifapreimpresion.nombre",
|
"label" => "Tarifapreimpresion.nombre",
|
||||||
"rules" => "trim|required|max_length[255]",
|
"rules" => "trim|required|max_length[255]",
|
||||||
],
|
],
|
||||||
"precio" => [
|
"precio_pagina" => [
|
||||||
"label" => "Tarifapreimpresion.precio",
|
"label" => "Tarifapreimpresion.precio",
|
||||||
"rules" => "required|decimal",
|
"rules" => "required|decimal",
|
||||||
],
|
],
|
||||||
@ -61,7 +61,7 @@ class TarifapreimpresionModel extends \App\Models\GoBaseModel
|
|||||||
"max_length" => "Tarifapreimpresion.validation.nombre.max_length",
|
"max_length" => "Tarifapreimpresion.validation.nombre.max_length",
|
||||||
"required" => "Tarifapreimpresion.validation.nombre.required",
|
"required" => "Tarifapreimpresion.validation.nombre.required",
|
||||||
],
|
],
|
||||||
"precio" => [
|
"precio_pagina" => [
|
||||||
"decimal" => "Tarifapreimpresion.validation.precio.decimal",
|
"decimal" => "Tarifapreimpresion.validation.precio.decimal",
|
||||||
"required" => "Tarifapreimpresion.validation.precio.required",
|
"required" => "Tarifapreimpresion.validation.precio.required",
|
||||||
],
|
],
|
||||||
|
|||||||
@ -24,6 +24,16 @@
|
|||||||
value="<?= old('importe_fijo', $tarifaacabadoEntity->importe_fijo) ?>">
|
value="<?= old('importe_fijo', $tarifaacabadoEntity->importe_fijo) ?>">
|
||||||
</div><!--//.mb-3 -->
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<div class="form-check">
|
||||||
|
|
||||||
|
<label for="mostrar_en_presupuesto" class="form-check-label">
|
||||||
|
<input type="checkbox" id="mostrar_en_presupuesto" name="mostrar_en_presupuesto" value="1" class="form-check-input" <?= $tarifaacabadoEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
|
||||||
|
<?= lang('Tarifaacabado.mostrar_en_presupuesto') ?>
|
||||||
|
</label>
|
||||||
|
</div><!--//.form-check -->
|
||||||
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
</div><!--//.col -->
|
</div><!--//.col -->
|
||||||
|
|
||||||
</div><!-- //.row -->
|
</div><!-- //.row -->
|
||||||
@ -1,6 +1,7 @@
|
|||||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
||||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||||
|
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
||||||
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
<?=$this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||||
|
|
||||||
<?= $this->section("content") ?>
|
<?= $this->section("content") ?>
|
||||||
@ -49,7 +50,7 @@
|
|||||||
<th><?= lang('TarifaAcabadoLineas.tiradaMax') ?></th>
|
<th><?= lang('TarifaAcabadoLineas.tiradaMax') ?></th>
|
||||||
<th><?= lang('TarifaAcabadoLineas.precioMin') ?></th>
|
<th><?= lang('TarifaAcabadoLineas.precioMin') ?></th>
|
||||||
<th><?= lang('TarifaAcabadoLineas.margen') ?></th>
|
<th><?= lang('TarifaAcabadoLineas.margen') ?></th>
|
||||||
<th></th>
|
<th style="min-width:100px"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -79,10 +80,10 @@
|
|||||||
|
|
||||||
const actionBtns = function(data) {
|
const actionBtns = function(data) {
|
||||||
return `
|
return `
|
||||||
<span class="edit"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></span>
|
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
|
||||||
<span class="cancel"></span>
|
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||||
<span class="remove"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i></span>
|
<span class="cancel"></span>
|
||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -96,11 +97,11 @@
|
|||||||
table : "#tableOfTarifaacabadolineas",
|
table : "#tableOfTarifaacabadolineas",
|
||||||
idSrc: 'id',
|
idSrc: 'id',
|
||||||
fields: [ {
|
fields: [ {
|
||||||
name: "paginas_min"
|
name: "tirada_min"
|
||||||
}, {
|
}, {
|
||||||
name: "precio_max"
|
name: "precio_max"
|
||||||
}, {
|
}, {
|
||||||
name: "paginas_max"
|
name: "tirada_max"
|
||||||
}, {
|
}, {
|
||||||
name: "precio_min"
|
name: "precio_min"
|
||||||
},{
|
},{
|
||||||
@ -165,9 +166,9 @@
|
|||||||
async: true,
|
async: true,
|
||||||
}),
|
}),
|
||||||
columns: [
|
columns: [
|
||||||
{ 'data': 'paginas_min' },
|
{ 'data': 'tirada_min' },
|
||||||
{ 'data': 'precio_max' },
|
{ 'data': 'precio_max' },
|
||||||
{ 'data': 'paginas_max' },
|
{ 'data': 'tirada_max' },
|
||||||
{ 'data': 'precio_min' },
|
{ 'data': 'precio_min' },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen' },
|
||||||
{
|
{
|
||||||
@ -193,7 +194,7 @@
|
|||||||
editor: editor,
|
editor: editor,
|
||||||
formOptions: {
|
formOptions: {
|
||||||
submitTrigger: -1,
|
submitTrigger: -1,
|
||||||
submitHtml: '<i class="ti ti-device-floppy"/>'
|
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
||||||
}
|
}
|
||||||
} ]
|
} ]
|
||||||
} );
|
} );
|
||||||
@ -205,9 +206,9 @@
|
|||||||
editor.inline(
|
editor.inline(
|
||||||
theTable.cells(this.parentNode.parentNode, '*').nodes(),
|
theTable.cells(this.parentNode.parentNode, '*').nodes(),
|
||||||
{
|
{
|
||||||
cancelHtml: '<i class="ti ti-x"></i>',
|
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
|
||||||
cancelTrigger: 'span.cancel',
|
cancelTrigger: 'span.cancel',
|
||||||
submitHtml: '<i class="ti ti-device-floppy"></i>',
|
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
|
||||||
submitTrigger: 'span.edit',
|
submitTrigger: 'span.edit',
|
||||||
submit: 'allIfChanged'
|
submit: 'allIfChanged'
|
||||||
}
|
}
|
||||||
@ -216,32 +217,29 @@
|
|||||||
|
|
||||||
|
|
||||||
// Delete row
|
// Delete row
|
||||||
$('#tableOfTarifaacabadolineas').on( 'click', 'tbody span.remove', function (e) {
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
|
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||||
Swal.fire({
|
|
||||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Basic.global.sweet.line'))]) ?>',
|
|
||||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
|
||||||
icon: 'warning',
|
|
||||||
showCancelButton: true,
|
|
||||||
confirmButtonColor: '#3085d6',
|
|
||||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
|
||||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
|
||||||
cancelButtonColor: '#d33'
|
|
||||||
})
|
|
||||||
.then((result) => {
|
|
||||||
const dataId = $(this).data('id');
|
|
||||||
const row = $(this).closest('tr');
|
|
||||||
if (result.value) {
|
|
||||||
editor
|
|
||||||
.create( false )
|
|
||||||
.edit( this.parentNode, false)
|
|
||||||
.set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
|
|
||||||
.set( 'is_deleted', 1 )
|
|
||||||
.submit();
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.btn-remove', function(e) {
|
||||||
|
const dataId = $(this).attr('data-id');
|
||||||
|
const row = $(this).closest('tr');
|
||||||
|
if ($.isNumeric(dataId)) {
|
||||||
|
$.ajax({
|
||||||
|
url: `/tarifas/tarifaacabadolineas/delete/${dataId}`,
|
||||||
|
method: 'GET',
|
||||||
|
}).done((data, textStatus, jqXHR) => {
|
||||||
|
$('#confirm2delete').modal('toggle');
|
||||||
|
theTable.clearPipeline();
|
||||||
|
theTable.row($(row)).invalidate().draw();
|
||||||
|
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||||
|
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||||
|
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?=$this->section('css') ?>
|
<?=$this->section('css') ?>
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
<th><?= lang('Tarifaacabado.nombre') ?></th>
|
<th><?= lang('Tarifaacabado.nombre') ?></th>
|
||||||
<th><?= lang('Tarifaacabado.precioMin') ?></th>
|
<th><?= lang('Tarifaacabado.precioMin') ?></th>
|
||||||
<th><?= lang('Tarifaacabado.importeFijo') ?></th>
|
<th><?= lang('Tarifaacabado.importeFijo') ?></th>
|
||||||
|
<th><?= lang('Tarifaacabado.mostrar_en_presupuesto') ?></th>
|
||||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -89,10 +90,19 @@
|
|||||||
{ 'data': 'nombre' },
|
{ 'data': 'nombre' },
|
||||||
{ 'data': 'precio_min' },
|
{ 'data': 'precio_min' },
|
||||||
{ 'data': 'importe_fijo' },
|
{ 'data': 'importe_fijo' },
|
||||||
|
{ 'data': 'mostrar_en_presupuesto' },
|
||||||
{ 'data': actionBtns }
|
{ 'data': actionBtns }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
theTable.on( 'draw.dt', function () {
|
||||||
|
const boolCols = [3];
|
||||||
|
for (let coln of boolCols) {
|
||||||
|
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||||
|
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$(document).on('click', '.btn-edit', function(e) {
|
$(document).on('click', '.btn-edit', function(e) {
|
||||||
window.location.href = `/tarifas/tarifaacabado/edit/${$(this).attr('data-id')}`;
|
window.location.href = `/tarifas/tarifaacabado/edit/${$(this).attr('data-id')}`;
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12 col-lg-12 px-4">
|
<div class="col-md-12 col-lg-12 px-4">
|
||||||
<div class="mb-3">
|
|
||||||
|
<div class="mb-3">
|
||||||
<label for="nombre" class="form-label">
|
<label for="nombre" class="form-label">
|
||||||
<?=lang('Tarifaencuadernacion.nombre') ?>*
|
<?=lang('Tarifaencuadernacion.nombre') ?>*
|
||||||
</label>
|
</label>
|
||||||
@ -21,6 +22,15 @@
|
|||||||
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control" value="<?=old('importe_fijo', $tarifaEncuadernacionEntity->importe_fijo) ?>">
|
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control" value="<?=old('importe_fijo', $tarifaEncuadernacionEntity->importe_fijo) ?>">
|
||||||
</div><!--//.mb-3 -->
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
</div><!--//.col -->
|
<div class="mb-3">
|
||||||
|
<div class="form-check">
|
||||||
|
|
||||||
|
<label for="mostrar_en_presupuesto" class="form-check-label">
|
||||||
|
<input type="checkbox" id="mostrar_en_presupuesto" name="mostrar_en_presupuesto" value="1" class="form-check-input" <?= $tarifaEncuadernacionEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
|
||||||
|
<?= lang('Tarifaencuadernacion.mostrar_en_presupuesto') ?>
|
||||||
|
</label>
|
||||||
|
</div><!--//.form-check -->
|
||||||
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
|
</div><!--//.col -->
|
||||||
</div><!-- //.row -->
|
</div><!-- //.row -->
|
||||||
@ -70,6 +70,8 @@
|
|||||||
<div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordionEncuadernacionLineas">
|
<div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordionEncuadernacionLineas">
|
||||||
<div class="accordion-body">
|
<div class="accordion-body">
|
||||||
|
|
||||||
|
<p><?= lang("TarifaEncuadernacionLineas.moduleExplanation") ?></p>
|
||||||
|
|
||||||
<table id="tableOfTarifaencuadernacionlineas" class="table table-striped table-hover" style="width: 100%;">
|
<table id="tableOfTarifaencuadernacionlineas" class="table table-striped table-hover" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -117,11 +119,36 @@
|
|||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Delete row
|
||||||
$(document).on('click', '.btn-delete', function(e) {
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||||
|
if($(this).closest('table').attr('id').includes('tiradas')){
|
||||||
|
$(".btn-remove").attr('table', "tiradas");
|
||||||
|
}
|
||||||
|
else if($(this).closest('table').attr('id').includes('lineas')){
|
||||||
|
$(".btn-remove").attr('table', "lineas");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$(".btn-remove").attr('table', );
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var selected_tirada_id = -1;
|
var selected_tirada_id = -1;
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on('click', '.btn-remove', function(e) {
|
||||||
|
const dataId = $(this).attr('data-id');
|
||||||
|
const row = $(this).closest('tr');
|
||||||
|
if ($.isNumeric(dataId)) {
|
||||||
|
|
||||||
|
if($(this).attr('table').includes('tiradas')){
|
||||||
|
remove_tiradas(dataId, row);
|
||||||
|
}
|
||||||
|
else if ($(this).attr('table').includes('lineas')){
|
||||||
|
remove_lineas(dataId, row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
@ -278,14 +305,11 @@
|
|||||||
);
|
);
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|
||||||
// Delete row
|
// Delete row
|
||||||
$(document).on('click', '.btn-remove', function(e) {
|
function remove_lineas(dataId, row){
|
||||||
const dataId = $(this).attr('data-id');
|
|
||||||
const row = $(this).closest('tr');
|
$.ajax({
|
||||||
if ($.isNumeric(dataId)) {
|
url: `/tarifas/tarifaencuadernacionlineas/delete/${dataId}`,
|
||||||
/*$.ajax({
|
|
||||||
url: `/configuracion/papelimpresiontipologias/delete/${dataId}`,
|
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}).done((data, textStatus, jqXHR) => {
|
}).done((data, textStatus, jqXHR) => {
|
||||||
$('#confirm2delete').modal('toggle');
|
$('#confirm2delete').modal('toggle');
|
||||||
@ -294,43 +318,10 @@
|
|||||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||||
})*/
|
|
||||||
/*editor
|
|
||||||
.create( false )
|
|
||||||
.edit( this.parentNode, false)
|
|
||||||
.set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
|
|
||||||
.set( 'is_deleted', 1 )
|
|
||||||
.submit();*/
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
|
||||||
$('#tableOfTarifaencuadernacionlineas').on( 'click', 'tbody span.remove', function (e) {
|
|
||||||
|
|
||||||
Swal.fire({
|
|
||||||
title: '<?= lang('Basic.global.sweet.sureToDeleteTitle', [mb_strtolower(lang('Basic.global.sweet.line'))]) ?>',
|
|
||||||
text: '<?= lang('Basic.global.sweet.sureToDeleteText') ?>',
|
|
||||||
icon: 'warning',
|
|
||||||
showCancelButton: true,
|
|
||||||
confirmButtonColor: '#3085d6',
|
|
||||||
confirmButtonText: '<?= lang('Basic.global.sweet.deleteConfirmationButton') ?>',
|
|
||||||
cancelButtonText: '<?= lang('Basic.global.Cancel') ?>',
|
|
||||||
cancelButtonColor: '#d33'
|
|
||||||
})
|
|
||||||
.then((result) => {
|
|
||||||
const dataId = $(this).data('id');
|
|
||||||
const row = $(this).closest('tr');
|
|
||||||
if (result.value) {
|
|
||||||
editor
|
|
||||||
.create( false )
|
|
||||||
.edit( this.parentNode, false)
|
|
||||||
.set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
|
|
||||||
.set( 'is_deleted', 1 )
|
|
||||||
.submit();
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});*/
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -505,23 +496,22 @@
|
|||||||
|
|
||||||
|
|
||||||
// Delete row
|
// Delete row
|
||||||
$(document).on('click', '.btn-remove', function(e) {
|
function remove_tiradas(dataId, row){
|
||||||
const dataId = $(this).attr('data-id');
|
|
||||||
const row = $(this).closest('tr');
|
$.ajax({
|
||||||
if ($.isNumeric(dataId)) {
|
|
||||||
$.ajax({
|
|
||||||
url: `/tarifas/tarifaencuadernaciontiradas/delete/${dataId}`,
|
url: `/tarifas/tarifaencuadernaciontiradas/delete/${dataId}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
}).done((data, textStatus, jqXHR) => {
|
}).done((data, textStatus, jqXHR) => {
|
||||||
$('#confirm2delete').modal('toggle');
|
$('#confirm2delete').modal('toggle');
|
||||||
theTable2.clearPipeline();
|
theTable2.clearPipeline();
|
||||||
theTable2.row($(row)).invalidate().draw();
|
theTable2.row($(row)).invalidate().draw();
|
||||||
|
theTable.clearPipeline();
|
||||||
|
theTable.draw();
|
||||||
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||||
}).fail((jqXHR, textStatus, errorThrown) => {
|
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||||
popErrorAlert(jqXHR.responseJSON.messages.error)
|
popErrorAlert(jqXHR.statusText)
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
<th><?= lang('Tarifaencuadernacion.nombre') ?></th>
|
<th><?= lang('Tarifaencuadernacion.nombre') ?></th>
|
||||||
<th><?= lang('Tarifaencuadernacion.precioMin') ?></th>
|
<th><?= lang('Tarifaencuadernacion.precioMin') ?></th>
|
||||||
<th><?= lang('Tarifaencuadernacion.importeFijo') ?></th>
|
<th><?= lang('Tarifaencuadernacion.importeFijo') ?></th>
|
||||||
|
<th><?= lang('Tarifaencuadernacion.mostrar_en_presupuesto') ?></th>
|
||||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -89,10 +90,20 @@
|
|||||||
{ 'data': 'nombre' },
|
{ 'data': 'nombre' },
|
||||||
{ 'data': 'precio_min' },
|
{ 'data': 'precio_min' },
|
||||||
{ 'data': 'importe_fijo' },
|
{ 'data': 'importe_fijo' },
|
||||||
|
{ 'data': 'mostrar_en_presupuesto' },
|
||||||
{ 'data': actionBtns }
|
{ 'data': actionBtns }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
theTable.on( 'draw.dt', function () {
|
||||||
|
const boolCols = [3];
|
||||||
|
for (let coln of boolCols) {
|
||||||
|
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||||
|
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$(document).on('click', '.btn-edit', function(e) {
|
$(document).on('click', '.btn-edit', function(e) {
|
||||||
window.location.href = `/tarifas/tarifasencuadernacion/edit/${$(this).attr('data-id')}`;
|
window.location.href = `/tarifas/tarifasencuadernacion/edit/${$(this).attr('data-id')}`;
|
||||||
|
|||||||
@ -21,6 +21,16 @@
|
|||||||
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control" value="<?=old('importe_fijo', $tarifaManipuladoEntity->importe_fijo) ?>">
|
<input type="text" id="importe_fijo" name="importe_fijo" class="form-control" value="<?=old('importe_fijo', $tarifaManipuladoEntity->importe_fijo) ?>">
|
||||||
</div><!--//.mb-3 -->
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<div class="form-check">
|
||||||
|
|
||||||
|
<label for="mostrar_en_presupuesto" class="form-check-label">
|
||||||
|
<input type="checkbox" id="mostrar_en_presupuesto" name="mostrar_en_presupuesto" value="1" class="form-check-input" <?= $tarifaManipuladoEntity->mostrar_en_presupuesto == true ? 'checked' : ''; ?>>
|
||||||
|
<?= lang('Tarifamanipulado.mostrar_en_presupuesto') ?>
|
||||||
|
</label>
|
||||||
|
</div><!--//.form-check -->
|
||||||
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
</div><!--//.col -->
|
</div><!--//.col -->
|
||||||
|
|
||||||
</div><!-- //.row -->
|
</div><!-- //.row -->
|
||||||
@ -52,7 +52,7 @@
|
|||||||
<th><?= lang('TarifaManipuladoLineas.tiradaMax') ?></th>
|
<th><?= lang('TarifaManipuladoLineas.tiradaMax') ?></th>
|
||||||
<th><?= lang('TarifaManipuladoLineas.precioMin') ?></th>
|
<th><?= lang('TarifaManipuladoLineas.precioMin') ?></th>
|
||||||
<th><?= lang('TarifaManipuladoLineas.margen') ?></th>
|
<th><?= lang('TarifaManipuladoLineas.margen') ?></th>
|
||||||
<th></th>
|
<th style="min-width:100px"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -80,10 +80,10 @@
|
|||||||
|
|
||||||
const actionBtns = function(data) {
|
const actionBtns = function(data) {
|
||||||
return `
|
return `
|
||||||
<span class="edit"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></span>
|
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
|
||||||
<span class="cancel"></span>
|
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||||
<span class="remove"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}"></i></span>
|
<span class="cancel"></span>
|
||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -97,11 +97,11 @@
|
|||||||
table : "#tableOfTarifamanipuladolineas",
|
table : "#tableOfTarifamanipuladolineas",
|
||||||
idSrc: 'id',
|
idSrc: 'id',
|
||||||
fields: [ {
|
fields: [ {
|
||||||
name: "paginas_min"
|
name: "tirada_min"
|
||||||
}, {
|
}, {
|
||||||
name: "precio_max"
|
name: "precio_max"
|
||||||
}, {
|
}, {
|
||||||
name: "paginas_max"
|
name: "tirada_max"
|
||||||
}, {
|
}, {
|
||||||
name: "precio_min"
|
name: "precio_min"
|
||||||
}, {
|
}, {
|
||||||
@ -166,9 +166,9 @@
|
|||||||
async: true,
|
async: true,
|
||||||
}),
|
}),
|
||||||
columns: [
|
columns: [
|
||||||
{ 'data': 'paginas_min' },
|
{ 'data': 'tirada_min' },
|
||||||
{ 'data': 'precio_max' },
|
{ 'data': 'precio_max' },
|
||||||
{ 'data': 'paginas_max' },
|
{ 'data': 'tirada_max' },
|
||||||
{ 'data': 'precio_min' },
|
{ 'data': 'precio_min' },
|
||||||
{ 'data': 'margen' },
|
{ 'data': 'margen' },
|
||||||
{
|
{
|
||||||
@ -194,7 +194,7 @@
|
|||||||
editor: editor,
|
editor: editor,
|
||||||
formOptions: {
|
formOptions: {
|
||||||
submitTrigger: -1,
|
submitTrigger: -1,
|
||||||
submitHtml: '<i class="ti ti-device-floppy"/>'
|
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
||||||
}
|
}
|
||||||
} ]
|
} ]
|
||||||
} );
|
} );
|
||||||
@ -206,9 +206,9 @@
|
|||||||
editor.inline(
|
editor.inline(
|
||||||
theTable.cells(this.parentNode.parentNode, '*').nodes(),
|
theTable.cells(this.parentNode.parentNode, '*').nodes(),
|
||||||
{
|
{
|
||||||
cancelHtml: '<i class="ti ti-x"></i>',
|
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
|
||||||
cancelTrigger: 'span.cancel',
|
cancelTrigger: 'span.cancel',
|
||||||
submitHtml: '<i class="ti ti-device-floppy"></i>',
|
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
|
||||||
submitTrigger: 'span.edit',
|
submitTrigger: 'span.edit',
|
||||||
submit: 'allIfChanged'
|
submit: 'allIfChanged'
|
||||||
}
|
}
|
||||||
@ -243,6 +243,30 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Delete row
|
||||||
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
|
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.btn-remove', function(e) {
|
||||||
|
const dataId = $(this).attr('data-id');
|
||||||
|
const row = $(this).closest('tr');
|
||||||
|
if ($.isNumeric(dataId)) {
|
||||||
|
$.ajax({
|
||||||
|
url: `/tarifas/tarifamanipuladolineas/delete/${dataId}`,
|
||||||
|
method: 'GET',
|
||||||
|
}).done((data, textStatus, jqXHR) => {
|
||||||
|
$('#confirm2delete').modal('toggle');
|
||||||
|
theTable.clearPipeline();
|
||||||
|
theTable.row($(row)).invalidate().draw();
|
||||||
|
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||||
|
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||||
|
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?=$this->section('css') ?>
|
<?=$this->section('css') ?>
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
<th><?= lang('Tarifamanipulado.nombre') ?></th>
|
<th><?= lang('Tarifamanipulado.nombre') ?></th>
|
||||||
<th><?= lang('Tarifamanipulado.precioMin') ?></th>
|
<th><?= lang('Tarifamanipulado.precioMin') ?></th>
|
||||||
<th><?= lang('Tarifamanipulado.importeFijo') ?></th>
|
<th><?= lang('Tarifamanipulado.importeFijo') ?></th>
|
||||||
|
<th><?= lang('Tarifamanipulado.mostrar_en_presupuesto') ?></th>
|
||||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -88,15 +89,27 @@
|
|||||||
{ 'data': 'nombre' },
|
{ 'data': 'nombre' },
|
||||||
{ 'data': 'precio_min' },
|
{ 'data': 'precio_min' },
|
||||||
{ 'data': 'importe_fijo' },
|
{ 'data': 'importe_fijo' },
|
||||||
|
{ 'data': 'mostrar_en_presupuesto' },
|
||||||
{ 'data': actionBtns }
|
{ 'data': actionBtns }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
theTable.on( 'draw.dt', function () {
|
||||||
|
const boolCols = [3];
|
||||||
|
for (let coln of boolCols) {
|
||||||
|
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||||
|
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$(document).on('click', '.btn-edit', function(e) {
|
$(document).on('click', '.btn-edit', function(e) {
|
||||||
window.location.href = `/tarifas/tarifasmanipulado/edit/${$(this).attr('data-id')}`;
|
window.location.href = `/tarifas/tarifasmanipulado/edit/${$(this).attr('data-id')}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$(document).on('click', '.btn-delete', function(e) {
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||||
});
|
});
|
||||||
|
|||||||
@ -21,13 +21,13 @@
|
|||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
id="precio"
|
id="precio_pagina"
|
||||||
name="precio"
|
name="precio_pagina"
|
||||||
required
|
required
|
||||||
maxLength="31"
|
maxLength="31"
|
||||||
step="0.01"
|
step="0.01"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
value="<?= old('precio', $tarifapreimpresionEntity->precio) ?>"
|
value="<?= old('precio', $tarifapreimpresionEntity->precio_pagina) ?>"
|
||||||
>
|
>
|
||||||
</div><!--//.mb-3 -->
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||||
|
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||||
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
<?= $this->extend('themes/backend/vuexy/main/defaultlayout') ?>
|
||||||
<?= $this->section("content") ?>
|
<?= $this->section("content") ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
Reference in New Issue
Block a user