* Copyright (C) 2023 SuperAdmin
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see
';
// print_r($_REQUEST);
// print '';
$hex = GETPOST('color');
list($r, $g, $b) = sscanf($hex, "#%02x%02x%02x");
echo "$hex -> $r $g $b";
$rgb = $r.", ".$g.", ".$b;
// dolibarr_set_const($db, "COLOR_PDF_R", $r, 'chaine', 1, '', $conf->entity);
// dolibarr_set_const($db, "COLOR_PDF_G", $g, 'chaine', 1, '', $conf->entity);
// dolibarr_set_const($db, "COLOR_PDF_B", $b, 'chaine', 1, '', $conf->entity);
}
/*
* View
*/
$form = new Form($db);
$formother = new FormOther($db);
$help_url = '';
$page_name = "CFDIMX - Facturas";
$arrayofjs = array('/cfdimx/js/cfdimx.js.php');
llxHeader('', $langs->trans($page_name), $help_url, '', 0, 0, $arrayofjs);
// Subheader
$linkback = ''.$langs->trans("BackToModuleList").'';
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
// Configuration header
$head = cfdimxAdminPrepareHead();
print dol_get_fiche_head($head, 'dolibarr', $langs->trans($page_name), 0, 'bill');
$head = cfdimxAdminDolibarrPrepareHead();
print dol_get_fiche_head($head, 'facture', $langs->trans($page_name), 0, 'bill');
$config->getInfoTabFactura();
if(is_array($config->factura_list_const) && count($config->factura_list_const) > 0){
print '| Estatus | '; print 'Funcionalidad | '; print 'Extrafields | '; print '
|---|---|---|
| '; $url = $_SERVER['PHP_SELF'].'?action=update&const='.$value["label"].'&valor='.$value["valor"]; if((int)DOL_VERSION > 15){ $url .= "&token=".newToken(); } $formulario = ''; $icono_boton = ($value["valor"] == 0 ? 'switch_off' : 'switch_on'); $label_boton = ($value["valor"] == 0 ? 'Activar '.$langs->trans($value["label"]) : 'Desactivar '.$langs->trans($value["label"])); if(in_array($value["posicion"], array(8))){ if($value["valor"] == 1){ $limite = 0; for($i = 0; $i < count($value["const"]); $i++){ $limite = $value["const"][$i]["valor"]; } $formulario .= ''; } }elseif(in_array($value["posicion"], array(9))){ $url = '#'; $icono_boton = 'switch_on'; $label_boton = ''; $formulario .= ''; }else{ } print ''; print img_picto($label_boton, $icono_boton); print ''; print ' | '; print ''; print $langs->trans($value["label"]); if($formulario != ''){ print $formulario; } print ' | '; print ''; if($value["extrafields"] == 0){ print ''; print $langs->trans("VIEW_EXTRAFIELDS"); print ''; }else{ $icono = ($value["extrafields"] == 1 ? 'list' : 'info'); print $form->textwithpicto('', $value["info_extrafields"], 1, $icono,'', 0, 3, ''); } print ' | '; print '
| Estatus | '; print 'Funcionalidad | '; print 'Extrafields | '; print '
|---|---|---|
| '; $url = $_SERVER['PHP_SELF'].'?action=update&const='.$value["label"].'&valor='.$value["valor"]; if((int)DOL_VERSION > 15){ $url .= "&token=".newToken(); } $formulario = ''; $icono_boton = ($value["valor"] == 0 ? 'switch_off' : 'switch_on'); $label_boton = ($value["valor"] == 0 ? 'Activar '.$langs->trans($value["label"]) : 'Desactivar '.$langs->trans($value["label"])); if(in_array($value["posicion"], array(8))){ if($value["valor"] == 1){ $limite = 0; for($i = 0; $i < count($value["const"]); $i++){ $limite = $value["const"][$i]["valor"]; } $formulario .= ''; } }elseif(in_array($value["posicion"], array(9))){ $url = '#'; $icono_boton = 'switch_on'; $label_boton = ''; $formulario .= ''; }elseif(in_array($value["posicion"], array(13, 14))){ $icono_boton = 'switch_on'; $label_boton = ''; $url = '#'; $formulario .= ''; } print ''; print img_picto($label_boton, $icono_boton); print ''; print ' | '; print ''; print $langs->trans($value["label"]); if($formulario != ''){ print $formulario; } print ' | '; print ''; if($value["extrafields"] == 0){ print ''; print $langs->trans("VIEW_EXTRAFIELDS"); print ''; }else{ $icono = ($value["extrafields"] == 1 ? 'list' : 'info'); print $form->textwithpicto('', $value["info_extrafields"], 1, $icono,'', 0, 3, ''); } print ' | '; print '
| '; print ''; print ' '; print 'Ajustes PDF - Producto de Catálogo/Líneas de Factura'; print ' | '; print '|||
|---|---|---|---|
| ';
print img_picto('', 'product').' Producto';
$img = ' '; $img .= 'Los campos marcados en color rojo son las opciones disponibles en la Ficha del Producto para crear la descripción del Producto.'; $img .= ' '; $img .= " ";
print $form->textwithpicto('', $img, 1, 'fa-info-circle','', 0, 3, '');
print ' | ';
print '';
print img_picto('', 'bill').' Líneas de Factura';
$img = ' '; $img .= 'Los campos marcados en color rojo son las opciones disponibles en la Línea de la Factura para crear la descripción del Producto.'; $img .= ' '; $img .= " ";
print $form->textwithpicto('', $img, 1, 'fa-info-circle','', 0, 3, '');
print ' | ';
print '||
| '; $url = $_SERVER['PHP_SELF'].'?action=update&const='.$valor["label"].'&valor='.$valor["valor"]; if((int)DOL_VERSION > 15){ $url .= "&token=".newToken(); } $formulario = ''; $icono_boton = ($valor["valor"] == 1 ? 'switch_on' : 'switch_off'); $label_boton = ($valor["valor"] == 2 ? 'Activar '.$langs->trans($valor["label"]) : 'Desactivar '.$langs->trans($valor["label"])); print ''; print img_picto($label_boton, $icono_boton); print ''; print ' | '; print ''; print $langs->trans($valor["label"]); print ' | '; } if($value["posicion"] < 3){ print ''; } print ' | |