Correzioni minori

This commit is contained in:
Thomas Zilio 2020-07-31 14:57:23 +02:00
parent f47c1ed25f
commit 7ee5b72cb3
6 changed files with 66 additions and 15 deletions

View File

@ -20,8 +20,8 @@ if ($dir == 'entrata') {
echo ' echo '
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-primary unblockable dropdown-toggle '.(((!empty($record['ref_documento']) || $record['stato'] != 'Bozza') and empty($record['is_reversed'])) ? '' : 'disabled').'" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button type="button" class="btn btn-primary unblockable dropdown-toggle '.(((!empty($record['ref_documento']) || $record['stato'] != 'Bozza') and empty($record['is_reversed'])) ? '' : 'disabled').'" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-magic"></i> '.tr('Crea').' <span class="caret"></span> <i class="fa fa-magic"></i> '.tr('Crea').'
<span class="sr-only">Toggle Dropdown</span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu dropdown-menu-right"> <ul class="dropdown-menu dropdown-menu-right">

View File

@ -36,3 +36,19 @@ function anteprimaFirma() {
openModal("'.tr('Anteprima e firma').'", "'.$module->fileurl('add_firma.php').'?id_module='.$id_module.'&id_record='.$id_record.'&anteprima=1"); openModal("'.tr('Anteprima e firma').'", "'.$module->fileurl('add_firma.php').'?id_module='.$id_module.'&id_record='.$id_record.'&anteprima=1");
} }
</script>'; </script>';
// Creazione altri documenti
echo '
<div class="btn-group">
<button class="btn btn-info dropdown-toggle '.(!$record['flag_completato'] ? 'disabled' : '').'" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-magic"></i> '.tr('Crea').'
<span class="caret"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right">
<li>
<a data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=fattura" data-toggle="modal" data-title="'.tr('Crea fattura').'">
<i class="fa fa-file"></i> '.tr('Fattura').'
</a>
</li>
</ul>
</div>';

View File

@ -0,0 +1,35 @@
<?php
include_once __DIR__.'/../../core.php';
use Modules\Interventi\Intervento;
$documento = Intervento::find($id_record);
$module = Modules::get($documento->module);
if (get('documento') == 'fattura') {
$final_module = 'Fatture di vendita';
$op = 'add_documento';
} elseif (get('documento') == 'ordine_fornitore') {
$final_module = 'Ordini fornitore';
$op = 'add_ordine_cliente';
} elseif (get('documento') == 'ordine') {
$final_module = 'Ordini cliente';
$op = 'add_documento';
} else {
$final_module = 'Ddt di vendita';
$op = 'add_documento';
}
$options = [
'op' => $op,
'type' => 'ordine',
'module' => $final_module,
'button' => tr('Aggiungi'),
'create_document' => true,
'serials' => true,
'documento' => $documento,
];
echo App::load('importa.php', [], $options, true);

View File

@ -3,33 +3,33 @@
include_once __DIR__.'/../../core.php'; include_once __DIR__.'/../../core.php';
echo ' echo '
<div class="dropdown"> <div class="btn-group">
<button class="btn btn-info dropdown-toggle '.(!in_array($record['stato'], ['Fatturato', 'Evaso', 'Bozza']) ? '' : 'disabled').'" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> <button class="btn btn-info dropdown-toggle '.(!in_array($record['stato'], ['Fatturato', 'Evaso', 'Bozza']) ? '' : 'disabled').'" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<i class="fa fa-magic"></i>&nbsp;'.tr('Crea').'... <i class="fa fa-magic"></i> '.tr('Crea').'
<span class="caret"></span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu dropdown-menu-right"> <ul class="dropdown-menu dropdown-menu-right">
<li> <li>
<a data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=intervento" data-toggle="modal" data-title="'.tr('Crea attività').'"> <a data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=intervento" data-toggle="modal" data-title="'.tr('Crea attività').'">
<i class="fa fa-wrench"></i>&nbsp;'.tr('Attività').' <i class="fa fa-wrench"></i> '.tr('Attività').'
</a> </a>
</li> </li>
<li> <li>
<a data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=ordine_fornitore" data-toggle="modal" data-title="'.tr('Crea ordine fornitore').'"> <a data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=ordine_fornitore" data-toggle="modal" data-title="'.tr('Crea ordine fornitore').'">
<i class="fa fa-file-o"></i>&nbsp;'.tr('Ordine fornitore').' <i class="fa fa-file-o"></i> '.tr('Ordine fornitore').'
</a> </a>
</li> </li>
<li> <li>
<a data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=ddt" data-toggle="modal" data-title="'.tr('Crea ddt').'"> <a data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=ddt" data-toggle="modal" data-title="'.tr('Crea ddt').'">
<i class="fa fa-truck"></i>&nbsp;'.tr('Ddt').' <i class="fa fa-truck"></i> '.tr('Ddt').'
</a> </a>
</li> </li>
<li> <li>
<a data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=fattura" data-toggle="modal" data-title="'.tr('Crea fattura').'"> <a data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=fattura" data-toggle="modal" data-title="'.tr('Crea fattura').'">
<i class="fa fa-file"></i>&nbsp;'.tr('Fattura').' <i class="fa fa-file"></i> '.tr('Fattura').'
</a> </a>
</li> </li>
</ul> </ul>

View File

@ -85,5 +85,5 @@ function open_movimento(id_mastrino, id_module){
</script>'; </script>';
} else { } else {
echo ' echo '
<span>&nbsp;'.tr('Nessun movimento presente').'</span>'; <span>'.tr('Nessun movimento presente').'</span>';
} }

View File

@ -23,35 +23,35 @@ $stati_abilitati = $dbo->fetchOne('SELECT GROUP_CONCAT(`descrizione` SEPARATOR "
// Creazione altri documenti // Creazione altri documenti
echo ' echo '
<div style="margin-left:4px;" class="dropdown pull-right"> <div class="btn-group">
<button class="btn btn-info dropdown-toggle '.($disabled ? '' : 'disabled tip').'" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" '.($disabled ? '' : 'disabled').' title="'.($disabled ? '' : tr('Per creare un documento deve essere inserita almeno una riga e lo stato del preventivo deve essere tra: _STATE_LIST_', [ <button class="btn btn-info dropdown-toggle '.($disabled ? '' : 'disabled tip').'" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" '.($disabled ? '' : 'disabled').' title="'.($disabled ? '' : tr('Per creare un documento deve essere inserita almeno una riga e lo stato del preventivo deve essere tra: _STATE_LIST_', [
'_STATE_LIST_' => $stati_abilitati, '_STATE_LIST_' => $stati_abilitati,
])).'" > ])).'" >
<i class="fa fa-magic"></i>&nbsp;'.tr('Crea').'... <i class="fa fa-magic"></i> '.tr('Crea').'
<span class="caret"></span> <span class="caret"></span>
</button> </button>
<ul class="dropdown-menu dropdown-menu-right"> <ul class="dropdown-menu dropdown-menu-right">
<li> <li>
<a class="'.($disabled ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=contratto" data-toggle="modal" data-title="'.tr('Crea contratto').'"> <a class="'.($disabled ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=contratto" data-toggle="modal" data-title="'.tr('Crea contratto').'">
<i class="fa fa-file-o"></i>&nbsp;'.tr('Contratto').' <i class="fa fa-file-o"></i> '.tr('Contratto').'
</a> </a>
</li> </li>
<li> <li>
<a class="'.($disabled ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=ordine" data-toggle="modal" data-title="'.tr('Crea ordine cliente').'"> <a class="'.($disabled ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=ordine" data-toggle="modal" data-title="'.tr('Crea ordine cliente').'">
<i class="fa fa-file-o"></i>&nbsp;'.tr('Ordine cliente').' <i class="fa fa-file-o"></i> '.tr('Ordine cliente').'
</a> </a>
</li> </li>
<li> <li>
<a class="'.($disabled ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=ddt" data-toggle="modal" data-title="'.tr('Crea ordine cliente').'"> <a class="'.($disabled ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=ddt" data-toggle="modal" data-title="'.tr('Crea ordine cliente').'">
<i class="fa fa-truck"></i>&nbsp;'.tr('DDT in uscita').' <i class="fa fa-truck"></i> '.tr('DDT in uscita').'
</a> </a>
</li> </li>
<li> <li>
<a class="'.($disabled ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=fattura" data-toggle="modal" data-title="'.tr('Crea fattura').'"> <a class="'.($disabled ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=fattura" data-toggle="modal" data-title="'.tr('Crea fattura').'">
<i class="fa fa-file"></i>&nbsp;'.tr('Fattura').' <i class="fa fa-file"></i> '.tr('Fattura').'
</a> </a>
</li> </li>
</ul> </ul>