Miglioramenti minori
This commit is contained in:
parent
4e8b569b27
commit
ac2c2e0a6f
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace Common;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
abstract class Document extends Model
|
||||
{
|
||||
/**
|
||||
|
@ -17,9 +15,10 @@ abstract class Document extends Model
|
|||
}
|
||||
|
||||
/**
|
||||
* Funzione per l'arrotondamento degli importi;
|
||||
* Funzione per l'arrotondamento degli importi;.
|
||||
*
|
||||
* @param float $value
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
protected function round($value)
|
||||
|
|
|
@ -223,7 +223,7 @@ function translateTemplate()
|
|||
$template = \HTMLBuilder\HTMLBuilder::replace($template);
|
||||
|
||||
// Informazioni estese sulle azioni dell'utente
|
||||
if (!empty(post('op'))) {
|
||||
if (!empty(post('op')) && post('op') != 'send-email') {
|
||||
operationLog(post('op'));
|
||||
}
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
// Personalizzazioni di codice
|
||||
if (function_exists (custom) ){
|
||||
$custom = custom();
|
||||
$tables = customTables();
|
||||
if (!empty($custom) || !empty($tables)) {
|
||||
echo '
|
||||
if (function_exists(custom)) {
|
||||
$custom = custom();
|
||||
$tables = customTables();
|
||||
if (!empty($custom) || !empty($tables)) {
|
||||
echo '
|
||||
<div class="box box-warning">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title"><span class="tip" title="'.tr('Elenco delle personalizzazioni rilevabili dal gestionale').'.">
|
||||
|
@ -16,8 +16,8 @@ if (function_exists (custom) ){
|
|||
</div>
|
||||
<div class="box-body">';
|
||||
|
||||
if (!empty($custom)) {
|
||||
echo '
|
||||
if (!empty($custom)) {
|
||||
echo '
|
||||
<table class="table table-hover table-striped">
|
||||
<tr>
|
||||
<th width="10%">'.tr('Percorso').'</th>
|
||||
|
@ -25,36 +25,36 @@ if (function_exists (custom) ){
|
|||
<th width="15%">'.tr('Database personalizzato').'</th>
|
||||
</tr>';
|
||||
|
||||
foreach ($custom as $element) {
|
||||
echo '
|
||||
foreach ($custom as $element) {
|
||||
echo '
|
||||
<tr>
|
||||
<td>'.$element['path'].'</td>
|
||||
<td>'.($element['directory'] ? 'Si' : 'No').'</td>
|
||||
<td>'.($element['database'] ? 'Si' : 'No').'</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</table>
|
||||
|
||||
<p><strong>'.tr("Si sconsiglia l'aggiornamento senza il supporto dell'assistenza ufficiale").'.</strong></p>';
|
||||
} else {
|
||||
echo '
|
||||
} else {
|
||||
echo '
|
||||
<p>'.tr('Non ci sono strutture personalizzate').'.</p>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($tables)) {
|
||||
echo '
|
||||
if (!empty($tables)) {
|
||||
echo '
|
||||
<div class="alert alert-warning">
|
||||
<i class="fa fa-warning"></i>
|
||||
<b>Attenzione!</b> Ci sono delle tabelle non previste nella versione standard del gestionale: '.implode(', ', $tables).'.
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
echo '
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Aggiornamenti
|
||||
|
|
|
@ -99,13 +99,13 @@ function customStructure()
|
|||
foreach ($files as $file) {
|
||||
$file = str_replace(DOCROOT.'/', '', $file);
|
||||
$result = explode('/custom/', $file)[0];
|
||||
|
||||
$info = new SplFileInfo($file);
|
||||
if ($info->getExtension()!='jpg'){
|
||||
if (!in_array($result, $results)) {
|
||||
$results[] = $result;
|
||||
}
|
||||
}
|
||||
|
||||
$info = new SplFileInfo($file);
|
||||
if ($info->getExtension() != 'jpg') {
|
||||
if (!in_array($result, $results)) {
|
||||
$results[] = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ function customTables()
|
|||
return array_column($results, 'TABLE_NAME');
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Controlla se il database presenta alcune sezioni personalizzate.
|
||||
*
|
||||
* @return array
|
||||
|
|
|
@ -257,20 +257,19 @@ if (!empty($google)) {
|
|||
|
||||
$conto = $dbo->fetchOne('SELECT co_pianodeiconti2.numero as numero, co_pianodeiconti3.numero as numero_conto, co_pianodeiconti3.descrizione as descrizione FROM co_pianodeiconti3 INNER JOIN co_pianodeiconti2 ON co_pianodeiconti3.idpianodeiconti2=co_pianodeiconti2.id WHERE co_pianodeiconti3.id = '.prepare($record['idconto_fornitore']));
|
||||
|
||||
/*echo '
|
||||
<p>'.tr('Piano dei conti collegato: _NAME_', [
|
||||
'_NAME_' => $conto['numero'].'.'.$conto['numero_conto'].' '.$conto['descrizione'],
|
||||
]).Modules::link('Piano dei conti', null, '').'</p>';*/
|
||||
if (!empty($conto['numero_conto'])){
|
||||
$piano_dei_conti_fornitore = tr('_NAME_', [
|
||||
/*echo '
|
||||
<p>'.tr('Piano dei conti collegato: _NAME_', [
|
||||
'_NAME_' => $conto['numero'].'.'.$conto['numero_conto'].' '.$conto['descrizione'],
|
||||
]).Modules::link('Piano dei conti', null, '').'</p>';*/
|
||||
if (!empty($conto['numero_conto'])) {
|
||||
$piano_dei_conti_fornitore = tr('_NAME_', [
|
||||
'_NAME_' => $conto['numero'].'.'.$conto['numero_conto'].' '.$conto['descrizione'],
|
||||
]);
|
||||
}else{
|
||||
$piano_dei_conti_fornitore = tr('Nessuno');
|
||||
}
|
||||
} else {
|
||||
$piano_dei_conti_fornitore = tr('Nessuno');
|
||||
}
|
||||
|
||||
echo Modules::link('Piano dei conti', null, null, null, 'class="pull-right"');
|
||||
?>
|
||||
echo Modules::link('Piano dei conti', null, null, null, 'class="pull-right"'); ?>
|
||||
|
||||
{[ "type": "select", "label": "<?php echo tr('Piano dei conti fornitore'); ?>", "name": "piano_dei_conti_fornitore", "values": "list=\"\": \"<?php echo $piano_dei_conti_fornitore; ?>\"", "readonly": 1, "value": "", "extra": "" ]}
|
||||
|
||||
|
@ -336,21 +335,19 @@ echo Modules::link('Piano dei conti', null, null, null, 'class="pull-right"');
|
|||
// Collegamento con il conto
|
||||
$conto = $dbo->fetchOne('SELECT co_pianodeiconti2.numero as numero, co_pianodeiconti3.numero as numero_conto, co_pianodeiconti3.descrizione as descrizione FROM co_pianodeiconti3 INNER JOIN co_pianodeiconti2 ON co_pianodeiconti3.idpianodeiconti2=co_pianodeiconti2.id WHERE co_pianodeiconti3.id = '.prepare($record['idconto_cliente']));
|
||||
|
||||
/*echo '
|
||||
<p>'.tr('Piano dei conti collegato: _NAME_', [
|
||||
'_NAME_' => $conto['numero'].'.'.$conto['numero_conto'].' '.$conto['descrizione'],
|
||||
]).Modules::link('Piano dei conti', null, '').'</p>';*/
|
||||
if (!empty($conto['numero_conto'])){
|
||||
$piano_dei_conti_cliente = tr('_NAME_', [
|
||||
/*echo '
|
||||
<p>'.tr('Piano dei conti collegato: _NAME_', [
|
||||
'_NAME_' => $conto['numero'].'.'.$conto['numero_conto'].' '.$conto['descrizione'],
|
||||
]).Modules::link('Piano dei conti', null, '').'</p>';*/
|
||||
if (!empty($conto['numero_conto'])) {
|
||||
$piano_dei_conti_cliente = tr('_NAME_', [
|
||||
'_NAME_' => $conto['numero'].'.'.$conto['numero_conto'].' '.$conto['descrizione'],
|
||||
]);
|
||||
}else{
|
||||
$piano_dei_conti_cliente = tr('Nessuno');
|
||||
}
|
||||
} else {
|
||||
$piano_dei_conti_cliente = tr('Nessuno');
|
||||
}
|
||||
|
||||
echo Modules::link('Piano dei conti', null, null, null, 'class="pull-right"');
|
||||
|
||||
?> {[ "type": "select", "label": "<?php echo tr('Piano dei conti cliente'); ?>", "name": "piano_dei_conti_cliente", "values": "list=\"\": \"<?php echo $piano_dei_conti_cliente; ?>\"", "readonly": 1, "value": "", "extra": "" ]}
|
||||
echo Modules::link('Piano dei conti', null, null, null, 'class="pull-right"'); ?> {[ "type": "select", "label": "<?php echo tr('Piano dei conti cliente'); ?>", "name": "piano_dei_conti_cliente", "values": "list=\"\": \"<?php echo $piano_dei_conti_cliente; ?>\"", "readonly": 1, "value": "", "extra": "" ]}
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
|
|
@ -96,11 +96,11 @@ $_SESSION['superselect']['idanagrafica'] = $record['idanagrafica'];
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "<?php echo ($dir == 'uscita' ) ? tr('Fornitore') : tr('Destinatario'); ?>", "name": "idanagrafica", "required": 1, "value": "$idanagrafica$", "ajax-source": "clienti_fornitori", "readonly": "<?php echo $record['flag_completato']; ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo ($dir == 'uscita') ? tr('Fornitore') : tr('Destinatario'); ?>", "name": "idanagrafica", "required": 1, "value": "$idanagrafica$", "ajax-source": "clienti_fornitori", "readonly": "<?php echo $record['flag_completato']; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "<?php echo ($dir == 'uscita' ) ? tr('Partenza merce') : tr('Destinazione merce'); ?>", "name": "idsede", "ajax-source": "sedi", "value": "$idsede$", "readonly": "<?php echo $record['flag_completato']; ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo ($dir == 'uscita') ? tr('Partenza merce') : tr('Destinazione merce'); ?>", "name": "idsede", "ajax-source": "sedi", "value": "$idsede$", "readonly": "<?php echo $record['flag_completato']; ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -40,8 +40,8 @@ include_once __DIR__.'/../../core.php';
|
|||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<?php $records[0]['icon'] = (empty ($records[0]['icon'])) ? 'fa fa-envelope' : $records[0]['icon']; ?>
|
||||
{[ "type": "text", "label": "<?php echo tr('Icona'); ?>", "name": "icon", "value": "<?php echo $records[0]['icon'] ?>" ,"help":"<?php echo tr('Es. \'fa fa-envelope\''); ?>" ]}
|
||||
<?php $records[0]['icon'] = (empty($records[0]['icon'])) ? 'fa fa-envelope' : $records[0]['icon']; ?>
|
||||
{[ "type": "text", "label": "<?php echo tr('Icona'); ?>", "name": "icon", "value": "<?php echo $records[0]['icon']; ?>" ,"help":"<?php echo tr('Es. \'fa fa-envelope\''); ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1050,9 +1050,9 @@ switch (post('op')) {
|
|||
$query = 'DELETE FROM co_righe_documenti WHERE iddocumento='.prepare($id_record).' AND id='.prepare($idriga);
|
||||
$dbo->query($query);
|
||||
|
||||
$rs_righe = $dbo->fetchArray("SELECT * FROM co_righe_documenti WHERE idpreventivo=".prepare($idpreventivo));
|
||||
$rs_righe = $dbo->fetchArray('SELECT * FROM co_righe_documenti WHERE idpreventivo='.prepare($idpreventivo));
|
||||
|
||||
if (sizeof($rs_righe)==0) {
|
||||
if (sizeof($rs_righe) == 0) {
|
||||
// Se ci sono dei preventivi collegati li rimetto nello stato "In attesa di pagamento"
|
||||
for ($i = 0; $i < sizeof($rsp); ++$i) {
|
||||
$dbo->query("UPDATE co_preventivi SET idstato=(SELECT id FROM co_statipreventivi WHERE descrizione='In lavorazione') WHERE id=".prepare($rsp[$i]['idpreventivo']));
|
||||
|
|
|
@ -101,7 +101,7 @@ if (empty($record['is_fiscale'])) {
|
|||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "<?php echo tr('Stato FE'); ?>", "name": "codice_stato_fe", "required": 0, "values": "query=SELECT codice as id, descrizione as text FROM fe_stati_documento", "value": "$codice_stato_fe$", "disabled": <?php echo intval(Plugins\ExportFE\Connection::isEnabled()) ?>, "class": "unblockable" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Stato FE'); ?>", "name": "codice_stato_fe", "required": 0, "values": "query=SELECT codice as id, descrizione as text FROM fe_stati_documento", "value": "$codice_stato_fe$", "disabled": <?php echo intval(Plugins\ExportFE\Connection::isEnabled()); ?>, "class": "unblockable" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -197,7 +197,7 @@ if (!empty($record['is_fiscale'])) {
|
|||
|
||||
if (($n2 <= 0 && $record['stato'] == 'Emessa') || $differenza != 0) {
|
||||
?>
|
||||
<a class="btn btn-sm btn-primary <?php echo((!empty(Modules::get('Prima nota'))) ? '' : 'disabled'); ?>" href="javascript:;" onclick="launch_modal( 'Aggiungi prima nota', '<?php echo $rootdir; ?>/add.php?id_module=<?php echo Modules::get('Prima nota')['id']; ?>&iddocumento=<?php echo $id_record; ?>&dir=<?php echo $dir; ?>', 1 );"><i class="fa fa-euro"></i> <?php echo tr('Aggiungi prima nota'); ?>...</a><br><br>
|
||||
<a class="btn btn-sm btn-primary <?php echo (!empty(Modules::get('Prima nota'))) ? '' : 'disabled'; ?>" href="javascript:;" onclick="launch_modal( 'Aggiungi prima nota', '<?php echo $rootdir; ?>/add.php?id_module=<?php echo Modules::get('Prima nota')['id']; ?>&iddocumento=<?php echo $id_record; ?>&dir=<?php echo $dir; ?>', 1 );"><i class="fa fa-euro"></i> <?php echo tr('Aggiungi prima nota'); ?>...</a><br><br>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class Fattura extends Document
|
|||
|
||||
public function getModuleAttribute()
|
||||
{
|
||||
return $this->tipo->dir == 'entrata' ? 'Fatture di vendita':'Fatture di acquisto';
|
||||
return $this->tipo->dir == 'entrata' ? 'Fatture di vendita' : 'Fatture di acquisto';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,7 @@ FROM co_documenti INNER JOIN an_anagrafiche ON co_documenti.idanagrafica=an_anag
|
|||
return [
|
||||
'email' => $r['is_pec'] ? $r['pec'] : $r['email'],
|
||||
'id_anagrafica' => $r['idanagrafica'],
|
||||
'ragione_sociale' => $r['ragione_sociale'],
|
||||
'ragione_sociale' => $r['ragione_sociale'],
|
||||
'numero' => empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'],
|
||||
'note' => $r['note'],
|
||||
'data' => Translator::dateToLocale($r['data']),
|
||||
|
|
|
@ -20,7 +20,6 @@ echo '
|
|||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="id_sessione" value="'.$sessione['id'].'">
|
||||
<input type="hidden" name="idtecnico" value="'.$sessione['idtecnico'].'">';
|
||||
|
||||
|
||||
// Tecnico
|
||||
echo '
|
||||
|
|
|
@ -137,7 +137,7 @@ switch (post('op')) {
|
|||
flash()->info(tr('Preventivo modificato correttamente!'));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
// Duplica preventivo
|
||||
case 'copy':
|
||||
$dbo->query('CREATE TEMPORARY TABLE tmp SELECT * FROM co_preventivi WHERE id = '.prepare($id_record));
|
||||
|
@ -145,19 +145,19 @@ switch (post('op')) {
|
|||
$dbo->query('INSERT INTO co_preventivi SELECT NULL,tmp.* FROM tmp');
|
||||
$id_record = $dbo->lastInsertedID();
|
||||
$dbo->query('DROP TEMPORARY TABLE tmp');
|
||||
|
||||
// Codice preventivo: calcolo il successivo in base al formato specificato
|
||||
|
||||
// Codice preventivo: calcolo il successivo in base al formato specificato
|
||||
$numeropreventivo_template = setting('Formato codice preventivi');
|
||||
$numeropreventivo_template = str_replace('#', '%', $numeropreventivo_template);
|
||||
$rs = $dbo->fetchArray('SELECT numero FROM co_preventivi WHERE numero LIKE('.prepare(Util\Generator::complete($numeropreventivo_template)).') ORDER BY numero DESC LIMIT 0,1');
|
||||
$numero = Util\Generator::generate(setting('Formato codice preventivi'), $rs[0]['numero']);
|
||||
|
||||
$rs = $dbo->fetchArray('SELECT numero FROM co_preventivi WHERE numero LIKE('.prepare(Util\Generator::complete($numeropreventivo_template)).') ORDER BY numero DESC LIMIT 0,1');
|
||||
$numero = Util\Generator::generate(setting('Formato codice preventivi'), $rs[0]['numero']);
|
||||
|
||||
$dbo->query('UPDATE co_preventivi SET idstato=1, numero = '.$numero.', master_revision = id WHERE id='.prepare($id_record));
|
||||
|
||||
flash()->info(tr('Preventivo duplicato correttamente!'));
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'addintervento':
|
||||
if (post('idintervento') !== null) {
|
||||
// Selezione costi da intervento
|
||||
|
|
|
@ -2,11 +2,9 @@
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
|
||||
echo'
|
||||
<button type="button" class="btn btn-primary" onclick="if( confirm(\'Duplicare questo preventivo?\') ){ $(\'#form-copy\').submit(); }"> <i class="fa fa-copy"></i> '.tr('Duplica preventivo').'</button>';
|
||||
|
||||
|
||||
|
||||
if (!in_array($record['stato'], ['Bozza', 'Rifiutato', 'In attesa di conferma'])) {
|
||||
echo '
|
||||
<div class="dropdown">
|
||||
|
@ -35,11 +33,10 @@ echo '
|
|||
<input type="hidden" name="op" value="copy">
|
||||
</form>';
|
||||
|
||||
|
||||
//crea revisione
|
||||
echo '
|
||||
<form action="" method="post" id="form_crearevisione">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="op" value="add_revision">
|
||||
<input type="hidden" name="id_record" value="'.$id_record.'">
|
||||
</form>';
|
||||
</form>';
|
||||
|
|
|
@ -213,17 +213,15 @@ if (!empty($elementi)) {
|
|||
<ul>';
|
||||
|
||||
foreach ($elementi as $elemento) {
|
||||
|
||||
$descrizione = tr('_DOC_ num. _NUM_ del _DATE_', [
|
||||
'_DOC_' => $elemento['tipo_documento'],
|
||||
'_NUM_' => !empty($elemento['numero_esterno']) ? $elemento['numero_esterno'] : $elemento['numero'],
|
||||
'_DATE_' => Translator::dateToLocale($elemento['data']),
|
||||
]);
|
||||
|
||||
if (in_array($elemento['tipo_documento'],['Ordine cliente'])) {
|
||||
|
||||
if (in_array($elemento['tipo_documento'], ['Ordine cliente'])) {
|
||||
$modulo = 'Ordini cliente';
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$modulo = ($elemento['dir'] == 'entrata') ? 'Fatture di vendita' : 'Fatture di acquisto';
|
||||
}
|
||||
$id = $elemento['id'];
|
||||
|
|
|
@ -4,11 +4,10 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
if (isset($id_record)) {
|
||||
$record = $dbo->fetchOne('SELECT *, (SELECT options FROM zz_modules WHERE id = zz_segments.id_module) options, (SELECT name FROM zz_modules WHERE id = zz_segments.id_module) AS modulo, (SELECT COUNT(t.id) FROM zz_segments t WHERE t.id_module = zz_segments.id_module) AS n_sezionali FROM zz_segments WHERE id='.prepare($id_record));
|
||||
|
||||
|
||||
$array = preg_match('/(?<=FROM)\s([^\s]+)\s/', $record['options'], $table);
|
||||
if (strpos($table[0], 'co_documenti') !== false) {
|
||||
$righe = $dbo->fetchArray('SELECT COUNT(*) AS tot FROM '.$table[0].' WHERE id_segment = '.prepare($id_record));
|
||||
$tot = $righe[0]['tot'];
|
||||
}
|
||||
|
||||
$array = preg_match('/(?<=FROM)\s([^\s]+)\s/', $record['options'], $table);
|
||||
if (strpos($table[0], 'co_documenti') !== false) {
|
||||
$righe = $dbo->fetchArray('SELECT COUNT(*) AS tot FROM '.$table[0].' WHERE id_segment = '.prepare($id_record));
|
||||
$tot = $righe[0]['tot'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ foreach ($fields as $key => $name) {
|
|||
if (!empty($missing) && !$generated) {
|
||||
echo '
|
||||
<div class="alert alert-warning">
|
||||
<p><i class="fa fa-warning"></i> '.tr("Prima di procedere alla generazione della fattura elettronica completa i seguenti campi del tipo di pagamento: _FIELDS_", [
|
||||
<p><i class="fa fa-warning"></i> '.tr('Prima di procedere alla generazione della fattura elettronica completa i seguenti campi del tipo di pagamento: _FIELDS_', [
|
||||
'_FIELDS_' => '<b>'.implode(', ', $missing).'</b>',
|
||||
]).'</p>
|
||||
</div>';
|
||||
|
@ -148,8 +148,7 @@ echo '
|
|||
<i class="fa fa-eye"></i> '.tr('Visualizza').'
|
||||
</a>';
|
||||
|
||||
if (Interaction::isEnabled()) {
|
||||
$send = $generated && $record['codice_stato_fe'] == 'GEN';
|
||||
$send = Interaction::isEnabled() && $generated && $record['codice_stato_fe'] == 'GEN';
|
||||
|
||||
echo '
|
||||
|
||||
|
@ -192,7 +191,6 @@ if (Interaction::isEnabled()) {
|
|||
});
|
||||
}
|
||||
</script>';
|
||||
}
|
||||
|
||||
echo '
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class Connection
|
|||
];
|
||||
}
|
||||
} else {
|
||||
$options['json'] = $json;
|
||||
$options['form_params'] = $json;
|
||||
}
|
||||
|
||||
$options = array_merge($options, [
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace Plugins\ExportFE;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
/**
|
||||
* Classe per l'interazione con API esterne.
|
||||
*
|
||||
|
@ -20,11 +18,11 @@ class Interaction extends Connection
|
|||
$response = static::request('POST', 'send_xml', [], [
|
||||
'multipart' => [
|
||||
[
|
||||
'name' => 'xml',
|
||||
'name' => 'xml',
|
||||
'filename' => $fattura->getFilename(),
|
||||
'contents' => file_get_contents($file)
|
||||
'contents' => file_get_contents($file),
|
||||
],
|
||||
]
|
||||
],
|
||||
]);
|
||||
|
||||
$body = static::responseBody($response);
|
||||
|
|
|
@ -59,7 +59,7 @@ echo '
|
|||
<h3 class="box-title">
|
||||
'.tr('Carica un XML').'
|
||||
|
||||
<span class="tip" title="'.tr("Formati supportati: XML e P7M").'.">
|
||||
<span class="tip" title="'.tr('Formati supportati: XML e P7M').'.">
|
||||
<i class="fa fa-question-circle-o"></i>
|
||||
</span>
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ if (!empty($righe)) {
|
|||
{[ "type": "select", "name": "conto['.$key.']", "ajax-source": "conti-acquisti", "required": 1 ]}
|
||||
</td>
|
||||
<td>
|
||||
{[ "type": "select", "name": "articoli['.$key.']", "ajax-source": "articoli", "class": "", "icon-after": "add|'.Modules::get("Articoli")["id"].'" ]}
|
||||
{[ "type": "select", "name": "articoli['.$key.']", "ajax-source": "articoli", "class": "", "icon-after": "add|'.Modules::get('Articoli')['id'].'" ]}
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Plugins\ImportFE;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use Plugins\ExportFE\Connection;
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,8 +6,7 @@ use Plugins\ReceiptFE\Interaction;
|
|||
|
||||
if (!Interaction::isEnabled()) {
|
||||
echo '
|
||||
<p>'.tr('Il sistema di rilevazione automatico è attualmente disabilitato').'.</p>
|
||||
<p>'.tr('Per maggiori informazioni contatta gli sviluppatori ufficiali').'.</p>';
|
||||
<p>'.tr('Il sistema di rilevazione automatico è attualmente disabilitato').'. '.tr('Per maggiori informazioni contatta gli sviluppatori ufficiali').'.</p>';
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -49,10 +48,10 @@ echo '
|
|||
|
||||
swal({
|
||||
title: "'.tr('Ricevute da importare: _COUNT_', [
|
||||
'_COUNT_' => '" + count + "'
|
||||
'_COUNT_' => '" + count + "',
|
||||
]).'",
|
||||
html: "'.tr('Sono state individuate _COUNT_ ricevute da importare', [
|
||||
'_COUNT_' => '" + count + "'
|
||||
'_COUNT_' => '" + count + "',
|
||||
]).'.",
|
||||
showCancelButton: true,
|
||||
confirmButtonText: "'.tr('Procedi').'",
|
||||
|
@ -83,7 +82,7 @@ echo '
|
|||
success: function(data){
|
||||
data = JSON.parse(data);
|
||||
|
||||
var html = "'.tr("Le seguenti ricevute sono state considerate:").'";
|
||||
var html = "'.tr('Le seguenti ricevute sono state considerate:').'";
|
||||
|
||||
console.log(data);
|
||||
data.forEach(function(element) {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace Plugins\ReceiptFE;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use Plugins\ExportFE\Connection;
|
||||
|
||||
/**
|
||||
|
@ -27,7 +26,7 @@ class Interaction extends Connection
|
|||
]);
|
||||
$body = static::responseBody($response);
|
||||
|
||||
if($body['code'] != '200'){
|
||||
if ($body['code'] != '200') {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@ namespace Plugins\ReceiptFE;
|
|||
|
||||
use Modules\Fatture\Fattura;
|
||||
use Util\XML;
|
||||
use Uploads;
|
||||
use Modules;
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
|
|
|
@ -94,7 +94,7 @@ class Plugin extends Model
|
|||
public function getUploadDirectoryAttribute()
|
||||
{
|
||||
if (!empty($this->script)) {
|
||||
return $this->uploads_directory.'/'.basename($this->script, ".php");
|
||||
return $this->uploads_directory.'/'.basename($this->script, '.php');
|
||||
}
|
||||
|
||||
return $this->defaultUploadDirectory();
|
||||
|
|
|
@ -176,7 +176,6 @@ class Translator extends Util\Singleton
|
|||
|
||||
/**
|
||||
* Imposta l'oggetto responsabile della localizzazione di date e numeri.
|
||||
*
|
||||
*/
|
||||
protected static function setFormatter($locale, $options)
|
||||
{
|
||||
|
|
|
@ -37,10 +37,10 @@ class Generator
|
|||
/**
|
||||
* Genera un pattern sulla base del precedente.
|
||||
*
|
||||
* @param string $pattern
|
||||
* @param string $last
|
||||
* @param int $quantity
|
||||
* @param array $values
|
||||
* @param string $pattern
|
||||
* @param string $last
|
||||
* @param int $quantity
|
||||
* @param array $values
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
@ -45,6 +45,7 @@ class XML
|
|||
* TODO: controllare il funzionamento con gli allegati (https://forum.italia.it/t/in-produzione-xml-ricevuto-non-leggibile/5695/2).
|
||||
*
|
||||
* @param string $string File content
|
||||
*
|
||||
* @return string An arguably-valid XML string with the .p7m header and footer stripped away.
|
||||
*
|
||||
* @source https://www.ryadel.com/php-estrarre-contenuto-file-xml-p7m-cades-fattura-elettronica-pa/
|
||||
|
@ -64,9 +65,10 @@ class XML
|
|||
}
|
||||
|
||||
/**
|
||||
* Removes invalid characters from a UTF-8 XML string
|
||||
* Removes invalid characters from a UTF-8 XML string.
|
||||
*
|
||||
* @param string a XML string potentially containing invalid characters
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @source https://www.ryadel.com/php-eliminare-caratteri-non-validi-file-stringa-xml-utf8-utf-8/
|
||||
|
@ -90,11 +92,11 @@ class XML
|
|||
)/x';
|
||||
$string = preg_replace($regex, '', $string);
|
||||
|
||||
$result = "";
|
||||
$result = '';
|
||||
$current;
|
||||
$length = strlen($string);
|
||||
for ($i=0; $i < $length; $i++) {
|
||||
$current = ord($string{$i});
|
||||
for ($i = 0; $i < $length; ++$i) {
|
||||
$current = ord($string[$i]);
|
||||
if (($current == 0x9) ||
|
||||
($current == 0xA) ||
|
||||
($current == 0xD) ||
|
||||
|
@ -109,6 +111,7 @@ class XML
|
|||
}
|
||||
$string = $result;
|
||||
}
|
||||
|
||||
return $string;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class Validate
|
|||
$partita_iva = substr($partita_iva, 2);
|
||||
}
|
||||
|
||||
if (strlen($partita_iva) != 11 || preg_match("/^[0-9]+\$/D", $partita_iva) != 1) {
|
||||
if (strlen($partita_iva) != 11 || preg_match('/^[0-9]+$/D', $partita_iva) != 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -30,14 +30,14 @@ class Validate
|
|||
}
|
||||
|
||||
for ($i = 1; $i <= 9; $i += 2) {
|
||||
$c = 2*(ord($partita_iva[$i]) - ord('0'));
|
||||
$c = 2 * (ord($partita_iva[$i]) - ord('0'));
|
||||
if ($c > 9) {
|
||||
$c = $c - 9;
|
||||
}
|
||||
$s += $c;
|
||||
}
|
||||
|
||||
if ((10 - $s%10)%10 != ord($partita_iva[10]) - ord('0')) {
|
||||
if ((10 - $s % 10) % 10 != ord($partita_iva[10]) - ord('0')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -114,11 +114,8 @@ foreach ($interventi as $intervento) {
|
|||
|
||||
$totale_dirittochiamata += floatval($rs[$i]['prezzo_dirittochiamata']);
|
||||
array_push($idinterventi, "'".$intervento['id']."'");
|
||||
|
||||
|
||||
array_push($costi_interventi, get_costi_intervento($intervento['id']));
|
||||
|
||||
|
||||
array_push($costi_interventi, get_costi_intervento($intervento['id']));
|
||||
}
|
||||
|
||||
$body .= '<big><big><b>RIEPILOGO INTERVENTI DAL '.Translator::dateToLocale($_SESSION['period_start']).' al '.Translator::dateToLocale($_SESSION['period_end'])."</b></big></big><br/><br/>\n";
|
||||
|
@ -163,19 +160,18 @@ if (sizeof($info_intervento) > 0) {
|
|||
|
||||
// Tabella con i dati
|
||||
for ($i = 0; $i < sizeof($info_intervento); ++$i) {
|
||||
$subtotale_consuntivo = $costi_interventi[$i]['totale_addebito'];
|
||||
$totale_consuntivo += $costi_interventi[$i]['totale_addebito'];
|
||||
$subtotale_consuntivo = $costi_interventi[$i]['totale_addebito'];
|
||||
$totale_consuntivo += $costi_interventi[$i]['totale_addebito'];
|
||||
//$subtotale_consuntivo = floatval($costo_ore_cons[$i] + $costo_km_cons[$i] + $diritto_chiamata_cons[$i]);
|
||||
//$totale_consuntivo += $subtotale_consuntivo;
|
||||
|
||||
//$subtotale_calcolato = $costi_orari[$i] * $ore[$i] + $costi_km[$i] * $km[$i] + $diritto_chiamata[$i];
|
||||
//$totale_calcolato += $subtotale_calcolato;
|
||||
$subtotale_calcolato = $costi_interventi[$i]['totale_scontato'];
|
||||
$totale_calcolato += $costi_interventi[$i]['totale_scontato'];
|
||||
|
||||
$costi_orari[$i] = ($costi_interventi[$i]['manodopera_addebito']/$ore[$i]);
|
||||
|
||||
|
||||
$subtotale_calcolato = $costi_interventi[$i]['totale_scontato'];
|
||||
$totale_calcolato += $costi_interventi[$i]['totale_scontato'];
|
||||
|
||||
$costi_orari[$i] = ($costi_interventi[$i]['manodopera_addebito'] / $ore[$i]);
|
||||
|
||||
$body .= "<tr><td>\n";
|
||||
$body .= '<div style="width:75mm;"><span>'.$info_intervento[$i].'<br/><span style="font-size:10px; color:#777;"><b>Tecnici:</b></span></span><br/><small>'.$tecnici[$i]."</small></div>\n";
|
||||
$body .= "</td>\n";
|
||||
|
|
Loading…
Reference in New Issue