mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en guardar LP
This commit is contained in:
@ -1074,7 +1074,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
protected function getPapelGenericoCubierta()
|
||||
{
|
||||
$model = model('App\Models\Configuracion\PapelGenericoModel');
|
||||
$data = $model->getPapelForComparador('color', true, false);
|
||||
$data = $model->getPapelForComparador('colorhq', true, false);
|
||||
array_unshift($data, (object)array(
|
||||
"id" => 0,
|
||||
"nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])
|
||||
@ -1085,7 +1085,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
protected function getPapelGenericoSobreCubierta()
|
||||
{
|
||||
$model = model('App\Models\Configuracion\PapelGenericoModel');
|
||||
$data = $model->getPapelForComparador('color', false, true);
|
||||
$data = $model->getPapelForComparador('colorhq', false, true);
|
||||
array_unshift($data, (object)array(
|
||||
"id" => 0,
|
||||
"nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])
|
||||
|
||||
@ -17,9 +17,9 @@ class Test extends BaseController
|
||||
|
||||
public function index()
|
||||
{
|
||||
$model = model('App\Models\Clientes\ClientePreciosModel') ;
|
||||
|
||||
echo '<pre>';
|
||||
var_dump($model->update_from_plantilla(5));
|
||||
$this->getPapelesCubierta();
|
||||
echo '</pre>';
|
||||
/*
|
||||
echo '<pre>';
|
||||
@ -116,6 +116,13 @@ class Test extends BaseController
|
||||
var_dump($data);
|
||||
}
|
||||
|
||||
public function getPapelesCubierta(){
|
||||
$model = model('App\Models\Configuracion\PapelGenericoModel');
|
||||
$data = $model->getPapelForComparador('colorhq', true, false);
|
||||
|
||||
var_dump($data);
|
||||
}
|
||||
|
||||
public function getGramaje(){
|
||||
$model = new PapelGenericoModel();
|
||||
$data = $model->getGramajeComparador("AHUESADO OFFSET", "bnhq" );
|
||||
|
||||
@ -93,7 +93,7 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
}
|
||||
|
||||
|
||||
public function getPapelForComparador($tipo, $is_cubierta = null, $is_sobrecubierta = null, $rotativa = null)
|
||||
public function getPapelForComparador($tipo, $is_cubierta = false, $is_sobrecubierta = false, $rotativa = false)
|
||||
{
|
||||
/*
|
||||
1.-> Tipo impresion
|
||||
@ -105,6 +105,7 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
->table($this->table . " t1")
|
||||
->select(
|
||||
"t1.id as id, t1.nombre AS nombre"
|
||||
// for debug, t2.nombre AS nombre_papel_impresion, t4.nombre AS maquina_nombre, t5.uso AS tarifa_uso, t5.tipo AS tarifa_tipo"
|
||||
)
|
||||
->distinct('t1.id')
|
||||
->join("lg_papel_impresion t2", "t2.papel_generico_id = t1.id", "left")
|
||||
@ -114,36 +115,48 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
||||
|
||||
->where("t1.is_deleted", 0)
|
||||
->where("t2.is_deleted", 0)
|
||||
->where("t2.isActivo", 1)
|
||||
->where("t3.active", 1)
|
||||
->where("t4.is_deleted", 0)
|
||||
->where("t4.tipo", "impresion")
|
||||
->where("t5.is_deleted", 0)
|
||||
->where("t5.tipo", $tipo);
|
||||
|
||||
if(!is_null($is_cubierta)){
|
||||
if($is_cubierta==true){
|
||||
if($is_cubierta==true){
|
||||
|
||||
$builder->where("t2.cubierta", 1);
|
||||
}
|
||||
$builder->where("t5.uso", 'cubierta');
|
||||
}
|
||||
else{
|
||||
$builder->where("t2.cubierta", 0);
|
||||
$builder->where("t5.uso", 'interior');
|
||||
}
|
||||
|
||||
if(!is_null($is_sobrecubierta)){
|
||||
if($is_sobrecubierta==true){
|
||||
if($is_sobrecubierta==true){
|
||||
$builder->where("t2.sobrecubierta", 1);
|
||||
}
|
||||
$builder->where("t5.uso", 'sobrecubierta');
|
||||
}
|
||||
else{
|
||||
$builder->where("t2.sobrecubierta", 0);
|
||||
}
|
||||
|
||||
if(!is_null($rotativa)){
|
||||
if($rotativa==true){
|
||||
if($is_cubierta==false && $is_sobrecubierta==false){
|
||||
$builder->where("t5.uso", 'interior');
|
||||
}
|
||||
|
||||
if($rotativa==true){
|
||||
$builder->where("t2.rotativa", 1);
|
||||
}
|
||||
}
|
||||
|
||||
return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
|
||||
$data = $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
|
||||
//var_dump($this->db->getLastQuery());
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getGramajeComparador(string $papel_generico_nombre="", $uso="")
|
||||
{
|
||||
if($uso == 'cubierta' || $uso == 'sobrecubierta')
|
||||
$tipo = 'color';
|
||||
$tipo = 'colorhq';
|
||||
else
|
||||
$tipo=$uso; // color y colorhq valen para los dos
|
||||
if($uso == 'bn')
|
||||
|
||||
@ -1076,10 +1076,12 @@
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#total_comp_rot').html("0.00");
|
||||
|
||||
if($('#tipoImpresion').select2('data')[0].id == 'negro'){
|
||||
$('#compPaginasColor').val('0')
|
||||
$('#compPaginasNegro').val($('#paginas').val())
|
||||
}
|
||||
|
||||
$('#compPaginasColor').val('0')
|
||||
$('#compPaginasColorhq').val('0')
|
||||
$('#compPaginasNegrohq').val('0');
|
||||
$('#compPaginasNegro').val($('#paginas').val())
|
||||
|
||||
|
||||
if( $('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||
$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||
@ -1095,12 +1097,11 @@
|
||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||
$('#total_comp_rot').html("0.00");
|
||||
|
||||
if($('#tipoImpresion').select2('data')[0].id == 'negrohq'){
|
||||
$('#compPaginasColorhq').val('0')
|
||||
$('#compPaginasNegrohq').val($('#paginas').val())
|
||||
$('#compGramajeNegohq').change().trigger()
|
||||
}
|
||||
|
||||
$('#compPaginasColorhq').val('0')
|
||||
$('#compPaginasColor').val('0')
|
||||
$('#compPaginasNegro').val('0')
|
||||
$('#compPaginasNegrohq').val($('#paginas').val())
|
||||
|
||||
if($('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||
!$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||
|
||||
@ -1112,7 +1113,7 @@
|
||||
|
||||
$('#tipoImpresion').on("select2:close", function () {
|
||||
|
||||
$('#paginas').change(),trigger();
|
||||
$('#paginas').change()
|
||||
})
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user