Revert "Merge branch 'master' into 2.4.6"
This reverts commit3045e8083d
, reversing changes made to114c4714c4
.
This commit is contained in:
parent
3045e8083d
commit
c07946f9d5
27
CHANGELOG.md
27
CHANGELOG.md
|
@ -4,10 +4,6 @@ Tutti i maggiori cambiamenti di questo progetto saranno documentati in questo fi
|
|||
|
||||
Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://keepachangelog.com/), e il progetto segue il [Semantic Versioning](http://semver.org/) per definire le versioni delle release.
|
||||
|
||||
- [2.4.5 (2019-01-10)](#245-2019-01-10)
|
||||
- [Aggiunto (Added)](#aggiunto-added)
|
||||
- [Modificato (Changed)](#modificato-changed)
|
||||
- [Fixed](#fixed)
|
||||
- [2.4.4 (2018-12-12)](#244-2018-12-12)
|
||||
- [Aggiunto (Added)](#aggiunto-added)
|
||||
- [Fixed](#fixed)
|
||||
|
@ -48,33 +44,12 @@ Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://k
|
|||
- [Fixed](#fixed-7)
|
||||
|
||||
|
||||
## 2.4.5 (2019-01-10)
|
||||
|
||||
### Aggiunto (Added)
|
||||
|
||||
- Introduzione dello split payment
|
||||
- Introduzione dei campi Nome e Cognome per le anagrafiche
|
||||
- Introduzione della possibilità di non verificare il certificato SSL per gli account email
|
||||
- Introduzione calcolo del guadagno in fase di aggiunta righe nei documenti
|
||||
|
||||
### Modificato (Changed)
|
||||
|
||||
- Miglioramento della generazione xml per le Fatture Elettroniche
|
||||
- Miglioramento procedura importazione xml per le Fatture Elettroniche
|
||||
- Gestite righe di tipo descrizione nelle Fatture Elettroniche
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix calcolo codice intervento
|
||||
- Fix dei filtri per la stampa del riepilogo interventi
|
||||
- Risolti altri bug minori
|
||||
|
||||
## 2.4.4 (2018-12-12)
|
||||
|
||||
### Aggiunto (Added)
|
||||
|
||||
- Controllo sulla presenza di personalizzazioni nel modulo **Aggiornamenti**
|
||||
- Stati multipli per le Fatture Elettroniche (per ampliamenti futuri)
|
||||
- Stati multipli per la Fatture Elettroniche (per ampliamenti futuri)
|
||||
|
||||
### Fixed
|
||||
|
||||
|
|
|
@ -56,11 +56,4 @@ $(document).ready(function () {
|
|||
}, 350);
|
||||
});
|
||||
|
||||
// Forza l'evento "blur" nei campi di testo per formattare i numeri con
|
||||
// jquery inputmask prima del submit
|
||||
setTimeout( function(){
|
||||
$('form').on('submit', function(){
|
||||
$('input').trigger('blur');
|
||||
});
|
||||
}, 1000 );
|
||||
});
|
||||
|
|
|
@ -39,7 +39,7 @@ if (!$cliente) {
|
|||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "<?php echo tr('Denominazione'); ?>", "name": "ragione_sociale", "required": 1, "value": "$ragione_sociale$", "extra": "autocomplete=\"off\"" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Denominazione'); ?>", "name": "ragione_sociale", "required": 1, "value": "$ragione_sociale$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
|
@ -54,11 +54,11 @@ if (!$cliente) {
|
|||
<div class="row">
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "nome", "required": 0, "value": "$nome$", "extra": "autocomplete=\"off\"" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "nome", "required": 0, "value": "$nome$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "<?php echo tr('Cognome'); ?>", "name": "cognome", "required": 0, "value": "$cognome$", "extra": "autocomplete=\"off\"" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Cognome'); ?>", "name": "cognome", "required": 0, "value": "$cognome$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
|
@ -95,7 +95,6 @@ if (!$cliente) {
|
|||
|
||||
<div class="col-md-2">
|
||||
<?php
|
||||
<<<<<<< HEAD
|
||||
$help_codice_destinatario = tr("Per impostare il codice specificare prima 'Tipologia' e 'Nazione' dell'anagrafica").':<br><ul>
|
||||
<li>'.tr('Ente pubblico (B2G/PA) - Codice Univoco Ufficio (www.indicepa.gov.it), 6 caratteri').'</li>
|
||||
<li>'.tr('Azienda (B2B) - Codice Destinatario, 7 caratteri').'</li>
|
||||
|
@ -107,11 +106,6 @@ if (!$cliente) {
|
|||
}
|
||||
?>
|
||||
{[ "type": "text", "label": "<?php echo ($record['tipo'] == 'Ente pubblico') ? tr('Codice unico ufficio') : tr('Codice destinatario'); ?>", "name": "codice_destinatario", "required": 0, "class": "text-center text-uppercase alphanumeric-mask", "value": "$codice_destinatario$", "maxlength": <?php echo ($record['tipo'] == 'Ente pubblico') ? '6' : '7'; ?>, "extra": "<?php echo (empty($record['tipo']) or ($record['tipo'] == 'Privato')) ? 'disabled' : ''; ?>", "help": "<?php echo tr($help_codice_destinatario); ?>", "readonly": "<?php echo intval($anagrafica->sedeLegale->nazione->iso2 != 'IT'); ?>" ]}
|
||||
=======
|
||||
$help_text = '<b>Attenzione</b>: per impostare il codice specificare prima \'Tipologia\' e \'Nazione\' dell\'anagrafica:<br><ul><li>Ente pubblico (B2G/PA) - Codice Univoco Ufficio (www.indicepa.gov.it), 6 caratteri</li><li>Azienda (B2B) - Codice Destinatario, 7 caratteri</li><li>Privato (B2C) - viene utilizzato il Codice Fiscale</li></ul>'.((in_array($id_azienda, $tipi_anagrafica)) ? '<p>N.B. <b>non è necessario</b> comunicare il proprio codice destinatario ai fornitori in quanto è sufficiente che questo sia registrato nel portale del Sistema Di Interscambio dell\'Agenzia Entrate (SDI)</p>' : '').'';
|
||||
?>
|
||||
{[ "type": "text", "label": "<?php echo ($record['tipo'] == 'Ente pubblico') ? tr('Codice unico ufficio') : tr('Codice destinatario'); ?>", "name": "codice_destinatario", "required": 0, "class": "text-center text-uppercase alphanumeric-mask", "value": "$codice_destinatario$", "maxlength": <?php echo ($record['tipo'] == 'Ente pubblico') ? '6' : '7'; ?>, "extra": "<?php echo (empty($record['tipo']) or ($record['tipo'] == 'Privato')) ? 'disabled' : ''; ?>", "help": "<?php echo tr($help_text); ?>", "readonly": "<?php echo intval($anagrafica->sedeLegale->nazione->iso2 != 'IT'); ?>" ]}
|
||||
>>>>>>> master
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
|
@ -458,14 +452,7 @@ if (!empty($google)) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
//se non è l'anagrafica azienda, ma cliente o fornitore
|
||||
if ($cliente or $fornitore) {
|
||||
?>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
@ -612,7 +599,7 @@ if (!empty($elementi)) {
|
|||
$modulo = 'Contratti';
|
||||
} elseif (in_array($elemento['tipo_documento'], ['Ordine cliente', 'Ordine fornitore'])) {
|
||||
$modulo = ($elemento['dir'] == 'entrata') ? 'Ordini cliente' : 'Ordini fornitore';
|
||||
} elseif (in_array($elemento['tipo_documento'], ['Ddt in uscita', 'Ddt in entrata'])) {
|
||||
} elseif (in_array($elemento['tipo_documento'], ['Ddt di vendita', 'Ddt di acquisto'])) {
|
||||
$modulo = ($elemento['dir'] == 'entrata') ? 'Ddt di vendita' : 'Ddt di acquisto';
|
||||
} else {
|
||||
$modulo = ($elemento['dir'] == 'entrata') ? 'Fatture di vendita' : 'Fatture di acquisto';
|
||||
|
@ -673,26 +660,23 @@ if (empty($record['deleted_at'])) {
|
|||
});
|
||||
|
||||
// Abilito solo ragione sociale oppure solo nome-cognome in base a cosa compilo
|
||||
$('#nome, #cognome').bind("keyup change", function(e) {
|
||||
$('#nome, #cognome').keyup(function(){
|
||||
if ($('#nome').val() == '' && $('#cognome').val() == '' ){
|
||||
$('#nome, #cognome').prop('disabled', true).prop('required', false);
|
||||
$('#ragione_sociale').prop('disabled', false).prop('required', true);
|
||||
$('#ragione_sociale').focus();
|
||||
}else{
|
||||
$('#nome, #cognome').prop('disabled', false).prop('required', true);
|
||||
$('#ragione_sociale').prop('disabled', true).prop('required', false);
|
||||
}
|
||||
});
|
||||
|
||||
$('#ragione_sociale').bind("keyup change", function(e) {
|
||||
$('#ragione_sociale').keyup(function(){
|
||||
if ($('#ragione_sociale').val() == '' ){
|
||||
$('#nome, #cognome').prop('disabled', false).prop('required', true);
|
||||
$('#ragione_sociale').prop('disabled', true).prop('required', false);
|
||||
$('#nome').focus();
|
||||
}else{
|
||||
$('#nome, #cognome').prop('disabled', true).prop('required', false);
|
||||
$('#ragione_sociale').prop('disabled', false).prop('required', true);
|
||||
$('#ragione_sociale').focus();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -63,9 +63,7 @@ switch (post('op')) {
|
|||
|
||||
// Ricerca di eventuale anagrafica corrispondente
|
||||
if (!empty($primary_key)) {
|
||||
//impedisco di aggiornare la mia anagrafica azienda
|
||||
if ($dati_anagrafica[$primary_key] != setting('Azienda predefinita'))
|
||||
$anagrafica = Anagrafica::where($primary_key, '=', $dati_anagrafica[$primary_key])->first();
|
||||
$anagrafica = Anagrafica::where($primary_key, '=', $dati_anagrafica[$primary_key])->first();
|
||||
}
|
||||
|
||||
if (empty($anagrafica)) {
|
||||
|
|
|
@ -4,7 +4,7 @@ include_once __DIR__.'/../../../core.php';
|
|||
|
||||
switch ($resource) {
|
||||
case 'contratti':
|
||||
$query = 'SELECT co_contratti.id AS id, CONCAT("Contratto ", numero, " del ", DATE_FORMAT(data_bozza, "%d/%m/%Y"), " - ", co_contratti.nome, " [", (SELECT `descrizione` FROM `co_staticontratti` WHERE `co_staticontratti`.`id` = `idstato`) , "]") AS descrizione, (SELECT SUM(subtotale) FROM co_righe_contratti WHERE idcontratto=co_contratti.id) AS totale, (SELECT SUM(sconto) FROM co_righe_contratti WHERE idcontratto=co_contratti.id) AS sconto, (SELECT COUNT(id) FROM co_righe_contratti WHERE idcontratto=co_contratti.id) AS n_righe FROM co_contratti INNER JOIN an_anagrafiche ON co_contratti.idanagrafica=an_anagrafiche.idanagrafica |where| ORDER BY id';
|
||||
$query = 'SELECT co_contratti.id AS id, CONCAT("Contratto ", numero, " del ", DATE_FORMAT(data_bozza, "%d/%m/%Y"), " - ", nome, " [", (SELECT `descrizione` FROM `co_staticontratti` WHERE `co_staticontratti`.`id` = `idstato`) , "]") AS descrizione, (SELECT SUM(subtotale) FROM co_righe_contratti WHERE idcontratto=co_contratti.id) AS totale, (SELECT SUM(sconto) FROM co_righe_contratti WHERE idcontratto=co_contratti.id) AS sconto, (SELECT COUNT(id) FROM co_righe_contratti WHERE idcontratto=co_contratti.id) AS n_righe FROM co_contratti INNER JOIN an_anagrafiche ON co_contratti.idanagrafica=an_anagrafiche.idanagrafica |where| ORDER BY id';
|
||||
|
||||
foreach ($elements as $element) {
|
||||
$filter[] = 'id='.prepare($element);
|
||||
|
|
|
@ -878,7 +878,7 @@ switch (post('op')) {
|
|||
|
||||
// Inserimento riga normale
|
||||
else {
|
||||
$dbo->query('INSERT INTO co_righe_documenti(iddocumento, idcontratto, is_descrizione, descrizione, subtotale, sconto, sconto_unitario, tipo_sconto, sconto_globale, idiva, desc_iva, iva, iva_indetraibile, um, qta, idconto, `order`) values('.prepare($id_record).', '.prepare($idcontratto).', '.prepare($rs_righe[$i]['is_descrizione']).', '.prepare($rs_righe[$i]['descrizione']).', '.prepare($rs_righe[$i]['subtotale']).', '.prepare($rs_righe[$i]['sconto']).', '.prepare($rs_righe[$i]['sconto_unitario']).', '.prepare($rs_righe[$i]['tipo_sconto']).', '.prepare($rs_righe[$i]['sconto_globale']).', '.prepare($rs_righe[$i]['idiva']).', '.prepare($rs_righe[$i]['desc_iva']).', '.prepare($rs_righe[$i]['iva']).', '.prepare($rs_righe[$i]['iva_indetraibile']).', '.prepare($rs_righe[$i]['um']).', '.prepare($rs_righe[$i]['qta']).', '.prepare($idconto).', '.prepare($rs_righe[$i]['order']).')');
|
||||
$dbo->query('INSERT INTO co_righe_documenti(iddocumento, idcontratto, is_descrizione, descrizione, subtotale, sconto, sconto_unitario, tipo_sconto, sconto_globale, idiva, desc_iva, iva, iva_indetraibile, um, qta, `order`) values('.prepare($id_record).', '.prepare($idcontratto).', '.prepare($rs_righe[$i]['is_descrizione']).', '.prepare($rs_righe[$i]['descrizione']).', '.prepare($rs_righe[$i]['subtotale']).', '.prepare($rs_righe[$i]['sconto']).', '.prepare($rs_righe[$i]['sconto_unitario']).', '.prepare($rs_righe[$i]['tipo_sconto']).', '.prepare($rs_righe[$i]['sconto_globale']).', '.prepare($rs_righe[$i]['idiva']).', '.prepare($rs_righe[$i]['desc_iva']).', '.prepare($rs_righe[$i]['iva']).', '.prepare($rs_righe[$i]['iva_indetraibile']).', '.prepare($rs_righe[$i]['um']).', '.prepare($rs_righe[$i]['qta']).', '.prepare($rs_righe[$i]['order']).')');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,16 +35,16 @@ if ($dir == 'entrata') {
|
|||
<?php
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
$rs2 = $dbo->fetchArray('SELECT piva, codice_fiscale, citta, indirizzo, cap, provincia, id_nazione, tipo FROM an_anagrafiche WHERE idanagrafica='.prepare($record['idanagrafica']));
|
||||
$rs2 = $dbo->fetchArray('SELECT piva, codice_fiscale, citta, indirizzo, cap, provincia, id_nazione FROM an_anagrafiche WHERE idanagrafica='.prepare($record['idanagrafica']));
|
||||
$campi_mancanti = [];
|
||||
|
||||
if ($rs2[0]['codice_fiscale'] == '' and ($rs2[0]['tipo'] == 'Privato' or $rs2[0]['tipo'] == 'Ente pubblico')) {
|
||||
array_push($campi_mancanti, 'Codice fiscale');
|
||||
}
|
||||
else if ($rs2[0]['piva'] == '') {
|
||||
|
||||
if ($rs2[0]['piva'] == '') {
|
||||
array_push($campi_mancanti, 'Partita IVA');
|
||||
}
|
||||
|
||||
/*if ($rs2[0]['codice_fiscale'] == '') {
|
||||
array_push($campi_mancanti, 'Codice fiscale');
|
||||
}
|
||||
*/
|
||||
if ($rs2[0]['citta'] == '') {
|
||||
array_push($campi_mancanti, 'Città');
|
||||
}
|
||||
|
|
|
@ -33,17 +33,25 @@ foreach ($righe as $riga) {
|
|||
$riga['sconto'] = abs($riga['sconto']);
|
||||
$riga['iva'] = abs($riga['iva']);
|
||||
|
||||
if (empty($riga['is_descrizione'])) {
|
||||
$riga['descrizione_conto'] = $dbo->fetchOne('SELECT descrizione FROM co_pianodeiconti3 WHERE id = '.prepare($riga['idconto']))['descrizione'];
|
||||
}
|
||||
|
||||
$extra = '';
|
||||
|
||||
$ref_modulo = null;
|
||||
$ref_id = null;
|
||||
|
||||
// Preventivi
|
||||
if (!empty($riga['idpreventivo'])) {
|
||||
$delete = 'unlink_preventivo';
|
||||
}
|
||||
// Contratti
|
||||
elseif (!empty($riga['idcontratto'])) {
|
||||
$delete = 'unlink_contratto';
|
||||
}
|
||||
// Intervento
|
||||
elseif (!empty($riga['idintervento'])) {
|
||||
$delete = 'unlink_intervento';
|
||||
}
|
||||
// Articoli
|
||||
if ($riga instanceof Articolo) {
|
||||
elseif ($riga instanceof Articolo) {
|
||||
$ref_modulo = Modules::get('Articoli')['id'];
|
||||
$ref_id = $riga['idarticolo'];
|
||||
|
||||
|
@ -54,30 +62,6 @@ foreach ($righe as $riga) {
|
|||
$extra = '';
|
||||
$mancanti = 0;
|
||||
}
|
||||
// Intervento
|
||||
elseif (!empty($riga['idintervento'])) {
|
||||
//$ref_modulo = Modules::get('Interventi')['id'];
|
||||
//$ref_id = $riga['idintervento'];
|
||||
$delete = 'unlink_intervento';
|
||||
}
|
||||
// Preventivi
|
||||
elseif (!empty($riga['idpreventivo'])) {
|
||||
//$ref_modulo = Modules::get('Preventivi')['id'];
|
||||
//$ref_id = $riga['idpreventivo'];
|
||||
$delete = 'unlink_preventivo';
|
||||
}
|
||||
// Contratti
|
||||
elseif (!empty($riga['idcontratto'])) {
|
||||
//$ref_modulo = Modules::get('Contratti')['id'];
|
||||
//$ref_id = $riga['idcontratto'];
|
||||
|
||||
$contratto = $dbo->fetchOne('SELECT codice_cig,codice_cup,id_documento_fe FROM co_contratti WHERE id = '.prepare($riga['idcontratto']));
|
||||
$riga['codice_cig'] = $contratto['codice_cig'];
|
||||
$riga['codice_cup'] = $contratto['codice_cup'];
|
||||
$riga['id_documento_fe'] = $contratto['id_documento_fe'];
|
||||
|
||||
$delete = 'unlink_contratto';
|
||||
}
|
||||
// Righe generiche
|
||||
else {
|
||||
$delete = 'unlink_riga';
|
||||
|
@ -95,19 +79,11 @@ foreach ($righe as $riga) {
|
|||
}
|
||||
}
|
||||
|
||||
$extra_riga = '';
|
||||
$extra_riga = tr('_DESCRIZIONE_CONTO_ _CODICE_CIG_ _CODICE_CUP_ _ID_DOCUMENTO_', [
|
||||
'_DESCRIZIONE_CONTO_' => $riga['descrizione_conto'] ?: null,
|
||||
'_CODICE_CIG_' => $riga['codice_cig'] ? '<br>CIG: '.$riga['codice_cig'] : null,
|
||||
'_CODICE_CUP_' => $riga['codice_cup'] ? '<br>CUP: '.$riga['codice_cup'] : null,
|
||||
'_ID_DOCUMENTO_' => $riga['id_documento_fe'] ? '<br>DOC: '.$riga['id_documento_fe'] : null,
|
||||
]);
|
||||
|
||||
echo '
|
||||
<tr data-id="'.$riga['id'].'" '.$extra.'>
|
||||
<td>
|
||||
'.Modules::link($ref_modulo, $ref_id, $riga['descrizione']).'
|
||||
<small class="pull-right text-muted">'.$extra_riga.'</small>';
|
||||
<small class="pull-right text-muted">'.$riga['descrizione_conto'].'</small>';
|
||||
|
||||
if (!empty($riga['abilita_serial'])) {
|
||||
if (!empty($mancanti)) {
|
||||
|
@ -135,7 +111,7 @@ foreach ($righe as $riga) {
|
|||
<br>'.Modules::link('Fatture di vendita', $record['ref_documento'], $text, $text);
|
||||
}
|
||||
|
||||
$ref = doc_references($riga, $dir, ['iddocumento']);
|
||||
$ref = doc_references($r, $dir, ['iddocumento']);
|
||||
if (!empty($ref)) {
|
||||
echo '
|
||||
<br>'.Modules::link($ref['module'], $ref['id'], $ref['description'], $ref['description']);
|
||||
|
|
|
@ -141,44 +141,34 @@ $_SESSION['superselect']['idanagrafica'] = $record['idanagrafica'];
|
|||
</div>
|
||||
|
||||
<?php
|
||||
// Visualizzo solo se l'anagrafica cliente è un ente pubblico
|
||||
if (!empty($record['idcontratto'])) {
|
||||
$contratto = $dbo->fetchOne('SELECT codice_cig,codice_cup,id_documento_fe FROM co_contratti WHERE id = '.prepare($record['idcontratto']));
|
||||
$record['id_documento_fe'] = $contratto['id_documento_fe'];
|
||||
$record['codice_cup'] = $contratto['codice_cup'];
|
||||
$record['codice_cig'] = $contratto['codice_cig'];
|
||||
}
|
||||
|
||||
// Visualizzo solo se l'attività non è già collegata ad un contratto
|
||||
if (empty($record['idcontratto'])) {
|
||||
?>
|
||||
<!-- Fatturazione Elettronica PA-->
|
||||
<div class="panel panel-primary <?php echo (($record['tipo_anagrafica']) == 'Ente pubblico') ? 'show' : 'hide'; ?>" >
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><?php echo tr('Dati appalto'); ?>
|
||||
<?php if (!empty($record['idcontratto'])) {
|
||||
?>
|
||||
<span class="tip" title="<?php echo tr('E\' possibile specificare i dati dell\'appalto solo se il cliente è di tipo \'Ente pubblico\' e l\'attività non risulta già collegata ad un contratto.'); ?>" > <i class="fa fa-question-circle-o"></i></span>
|
||||
</h3>
|
||||
<?php
|
||||
} ?>
|
||||
<h3 class="panel-title"><?php echo tr('Dati appalto'); ?></h3>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{[ "type": "<?php echo !empty($record['idcontratto']) ? 'span' : 'text'; ?>", "label": "<?php echo tr('Identificatore Documento'); ?>", "name": "id_documento_fe", "required": 0, "value": "<?php echo $record['id_documento_fe']; ?>", "maxlength": 20, "readonly": "<?php echo $record['flag_completato']; ?>", "extra": "" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Identificatore Documento'); ?>", "name": "id_documento_fe", "required": 0, "value": "$id_documento_fe$", "maxlength": 20, "readonly": "<?php echo $record['flag_completato']; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "<?php echo !empty($record['idcontratto']) ? 'span' : 'text'; ?>", "label": "<?php echo tr('Codice CIG'); ?>", "name": "codice_cig", "required": 0, "value": "<?php echo $record['codice_cig']; ?>", "maxlength": 15, "readonly": "<?php echo $record['flag_completato']; ?>", "extra": "" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Codice CIG'); ?>", "name": "codice_cig", "required": 0, "value": "$codice_cig$", "maxlength": 15, "readonly": "<?php echo $record['flag_completato']; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "<?php echo !empty($record['idcontratto']) ? 'span' : 'text'; ?>", "label": "<?php echo tr('Codice CUP'); ?>", "name": "codice_cup", "required": 0, "value": "<?php echo $record['codice_cup']; ?>", "maxlength": 15, "readonly": "<?php echo $record['flag_completato']; ?>", "extra": "" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Codice CUP'); ?>", "name": "codice_cup", "required": 0, "value": "$codice_cup$", "maxlength": 15, "readonly": "<?php echo $record['flag_completato']; ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- ORE LAVORO -->
|
||||
<div class="panel panel-primary">
|
||||
|
|
|
@ -77,10 +77,9 @@ switch ($op) {
|
|||
$idanagrafica = post('idanagrafica');
|
||||
$nome = post('nome');
|
||||
$idtecnico = post('idtecnico');
|
||||
$idsede = post('idsede');
|
||||
|
||||
if (!empty($matricola)) {
|
||||
$dbo->query('INSERT INTO my_impianti(matricola, idanagrafica, nome, data, idtecnico, idsede) VALUES ('.prepare($matricola).', '.prepare($idanagrafica).', '.prepare($nome).', NOW(), '.prepare($idtecnico).', '.prepare($idsede).')');
|
||||
$dbo->query('INSERT INTO my_impianti(matricola, idanagrafica, nome, data, idtecnico) VALUES ('.prepare($matricola).', '.prepare($idanagrafica).', '.prepare($nome).', NOW(), '.prepare($idtecnico).')');
|
||||
|
||||
$id_record = $dbo->lastInsertedID();
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
if (!in_array($record['stato'], ['Fatturato'])) {
|
||||
if (!in_array($record['stato'], ['Evaso', 'Fatturato'])) {
|
||||
echo '
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-info dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
|
@ -19,7 +19,7 @@ if (!in_array($record['stato'], ['Fatturato'])) {
|
|||
</li>';
|
||||
}
|
||||
|
||||
if (in_array($record['stato'], ['Bozza', 'Evaso', 'Parzialmente evaso', 'Parzialmente fatturato'])) {
|
||||
if (in_array($record['stato'], ['Bozza', 'Parzialmente fatturato'])) {
|
||||
echo '
|
||||
<li>
|
||||
<a data-href="'.$rootdir.'/modules/fatture/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').'
|
||||
|
|
|
@ -5,7 +5,7 @@ include_once __DIR__.'/../../../core.php';
|
|||
switch ($resource) {
|
||||
case 'preventivi':
|
||||
if (isset($superselect['idanagrafica'])) {
|
||||
$query = 'SELECT co_preventivi.id AS id, an_anagrafiche.idanagrafica, CONCAT("Preventivo ", numero, " del ", DATE_FORMAT(data_bozza, "%d/%m/%Y"), " - ", co_preventivi.nome, " [", (SELECT `descrizione` FROM `co_statipreventivi` WHERE `co_statipreventivi`.`id` = `idstato`) , "]") AS descrizione, co_preventivi.idtipointervento, (SELECT descrizione FROM in_tipiintervento WHERE in_tipiintervento.idtipointervento = co_preventivi.idtipointervento) AS idtipointervento_descrizione, (SELECT tempo_standard FROM in_tipiintervento WHERE in_tipiintervento.idtipointervento = co_preventivi.idtipointervento) AS tempo_standard, (SELECT SUM(subtotale) FROM co_righe_preventivi WHERE idpreventivo=co_preventivi.id GROUP BY idpreventivo) AS totale, (SELECT SUM(sconto) FROM co_righe_preventivi WHERE idpreventivo=co_preventivi.id GROUP BY idpreventivo) AS sconto FROM co_preventivi INNER JOIN an_anagrafiche ON co_preventivi.idanagrafica=an_anagrafiche.idanagrafica |where| ORDER BY id';
|
||||
$query = 'SELECT co_preventivi.id AS id, an_anagrafiche.idanagrafica, CONCAT("Preventivo ", numero, " del ", DATE_FORMAT(data_bozza, "%d/%m/%Y"), " - ", nome, " [", (SELECT `descrizione` FROM `co_statipreventivi` WHERE `co_statipreventivi`.`id` = `idstato`) , "]") AS descrizione, co_preventivi.idtipointervento, (SELECT descrizione FROM in_tipiintervento WHERE in_tipiintervento.idtipointervento = co_preventivi.idtipointervento) AS idtipointervento_descrizione, (SELECT tempo_standard FROM in_tipiintervento WHERE in_tipiintervento.idtipointervento = co_preventivi.idtipointervento) AS tempo_standard, (SELECT SUM(subtotale) FROM co_righe_preventivi WHERE idpreventivo=co_preventivi.id GROUP BY idpreventivo) AS totale, (SELECT SUM(sconto) FROM co_righe_preventivi WHERE idpreventivo=co_preventivi.id GROUP BY idpreventivo) AS sconto FROM co_preventivi INNER JOIN an_anagrafiche ON co_preventivi.idanagrafica=an_anagrafiche.idanagrafica |where| ORDER BY id';
|
||||
|
||||
foreach ($elements as $element) {
|
||||
$filter[] = 'id='.prepare($element);
|
||||
|
@ -45,7 +45,7 @@ switch ($resource) {
|
|||
break;
|
||||
|
||||
case 'preventivi_aperti':
|
||||
$query = 'SELECT co_preventivi.id AS id, CONCAT(numero, " ", co_preventivi.nome, " (", ragione_sociale, ")") AS descrizione FROM co_preventivi INNER JOIN an_anagrafiche ON co_preventivi.idanagrafica=an_anagrafiche.idanagrafica |where| ORDER BY id';
|
||||
$query = 'SELECT co_preventivi.id AS id, CONCAT(numero, " ", nome, " (", ragione_sociale, ")") AS descrizione FROM co_preventivi INNER JOIN an_anagrafiche ON co_preventivi.idanagrafica=an_anagrafiche.idanagrafica |where| ORDER BY id';
|
||||
|
||||
foreach ($elements as $element) {
|
||||
$filter[] = 'idpreventivo='.prepare($element);
|
||||
|
|
|
@ -242,7 +242,7 @@ include_once __DIR__.'/../../core.php';
|
|||
<!-- PULSANTI -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<button type='button' class="btn btn-primary" id='btn_crea_modello'><i class="fa fa-plus"></i> <?php echo tr('Aggiungi e crea modello'); ?></button>
|
||||
<button type='button' class="btn btn-default" id='btn_crea_modello'><i class="fa fa-plus"></i> <?php echo tr('Aggiungi e crea modello'); ?></button>
|
||||
<button type="submit" class="btn btn-primary" id='btn_submit'><i class="fa fa-plus"></i> <?php echo tr('Aggiungi'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -338,10 +338,10 @@ include_once __DIR__.'/../../core.php';
|
|||
$('#bs-popup #modello_primanota').change(function(){
|
||||
|
||||
if ($(this).val()!=''){
|
||||
$('#btn_crea_modello').html('<i class="fa fa-edit"></i> '+'<?php echo tr('Aggiungi e modifica modello'); ?>');
|
||||
$('#btn_crea_modello').text('<?php echo tr('Aggiungi e modifica modello'); ?>');
|
||||
$('#bs-popup #idmastrino').val($(this).val());
|
||||
}else{
|
||||
$('#btn_crea_modello').html('<i class="fa fa-plus"></i> '+'<?php echo tr('Aggiungi e crea modello'); ?>');
|
||||
$('#btn_crea_modello').text('<?php echo tr('Aggiungi e crea modello'); ?>');
|
||||
$('#bs-popup #idmastrino').val(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -657,8 +657,7 @@ class FatturaElettronica
|
|||
public function getRighe()
|
||||
{
|
||||
if (empty($this->righe)) {
|
||||
//AND is_descrizione = 0
|
||||
$this->righe = database()->fetchArray('SELECT * FROM `co_righe_documenti` WHERE `sconto_globale` = 0 AND `iddocumento` = '.prepare($this->getDocumento()['id']));
|
||||
$this->righe = database()->fetchArray('SELECT * FROM `co_righe_documenti` WHERE `sconto_globale` = 0 AND is_descrizione = 0 AND `iddocumento` = '.prepare($this->getDocumento()['id']));
|
||||
}
|
||||
|
||||
return $this->righe;
|
||||
|
@ -967,28 +966,15 @@ class FatturaElettronica
|
|||
if (!empty($anagrafica['codice_fiscale'])) {
|
||||
$result['CodiceFiscale'] = $anagrafica['codice_fiscale'];
|
||||
}
|
||||
|
||||
if (!empty($anagrafica['nome']) or !empty($anagrafica['cognome'])){
|
||||
|
||||
$result['Anagrafica'] = [
|
||||
//'Denominazione' => $anagrafica['ragione_sociale'],
|
||||
'Nome' => $anagrafica['nome'],
|
||||
'Cognome' => $anagrafica['cognome'],
|
||||
// TODO: 'Titolo' => $anagrafica['ragione_sociale'],
|
||||
// TODO: CodEORI
|
||||
];
|
||||
|
||||
|
||||
}else{
|
||||
$result['Anagrafica'] = [
|
||||
'Denominazione' => $anagrafica['ragione_sociale'],
|
||||
//'Nome' => $anagrafica['nome'],
|
||||
//'Cognome' => $anagrafica['cognome'],
|
||||
// TODO: 'Titolo' => $anagrafica['ragione_sociale'],
|
||||
// TODO: CodEORI
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
$result['Anagrafica'] = [
|
||||
'Denominazione' => $anagrafica['ragione_sociale'],
|
||||
// TODO: 'Nome' => $azienda['ragione_sociale'],
|
||||
// TODO: 'Cognome' => $azienda['ragione_sociale'],
|
||||
// TODO: 'Titolo' => $azienda['ragione_sociale'],
|
||||
// TODO: CodEORI
|
||||
];
|
||||
|
||||
// Informazioni specifiche azienda
|
||||
if ($azienda) {
|
||||
$result['RegimeFiscale'] = setting('Regime Fiscale');
|
||||
|
@ -1206,12 +1192,7 @@ class FatturaElettronica
|
|||
|
||||
// Importo Totale Documento (2.1.1.9)
|
||||
// Importo totale del documento al netto dell'eventuale sconto e comprensivo di imposta a debito del cessionario / committente
|
||||
<<<<<<< HEAD
|
||||
$result['ImportoTotaleDocumento'] = $fattura->netto;
|
||||
=======
|
||||
$fattura = Modules\Fatture\Fattura::find($documento['id']);
|
||||
$result['ImportoTotaleDocumento'] = abs($fattura->netto);
|
||||
>>>>>>> master
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
@ -1405,14 +1386,6 @@ class FatturaElettronica
|
|||
$riga['subtotale'] = abs($riga['subtotale']);
|
||||
$riga['qta'] = abs($riga['qta']);
|
||||
$riga['sconto'] = abs($riga['sconto']);
|
||||
|
||||
//Fix per righe di tipo descrizione, copio idiva dalla prima riga del documento che non è di tipo descrizione, riportando di conseguenza eventuali % e/o nature
|
||||
if (!empty($riga['is_descrizione'])){
|
||||
$riga['idiva'] = $database->fetchOne('SELECT `idiva` FROM `co_righe_documenti` WHERE `is_descrizione` = 0 AND `iddocumento` = '.prepare($documento['id']))['idiva'];
|
||||
}
|
||||
|
||||
//Fix per qta, deve sempre essere impostata almeno a 1
|
||||
$riga['qta'] = (!empty($riga['qta'])) ? $riga['qta'] : 1;
|
||||
|
||||
$prezzo_unitario = $riga['subtotale'] / $riga['qta'];
|
||||
$prezzo_totale = $riga['subtotale'] - $riga['sconto'];
|
||||
|
@ -1488,22 +1461,7 @@ class FatturaElettronica
|
|||
if (!empty($riga['riferimento_amministrazione'])) {
|
||||
$dettaglio['RiferimentoAmministrazione'] = $riga['riferimento_amministrazione'];
|
||||
}
|
||||
|
||||
|
||||
// AltriDatiGestionali (2.2.1.16) - Ritenuta ENASARCO
|
||||
$riga['ritenutaenasarco'] = floatval($riga['ritenutaenasarco']);
|
||||
if (!empty($riga['ritenutaenasarco'])) {
|
||||
|
||||
$ritenutaenasarco = [
|
||||
'TipoDato' => 'CASSA-PREV',
|
||||
'RiferimentoTesto' => 'ENASARCO - TC07',
|
||||
'RiferimentoNumero' => $riga['ritenutaenasarco'],
|
||||
];
|
||||
|
||||
$dettaglio['AltriDatiGestionali'] = $ritenutaenasarco;
|
||||
}
|
||||
|
||||
|
||||
$result[] = [
|
||||
'DettaglioLinee' => $dettaglio,
|
||||
];
|
||||
|
@ -1515,8 +1473,8 @@ class FatturaElettronica
|
|||
foreach ($riepiloghi_percentuale as $riepilogo) {
|
||||
$iva = [
|
||||
'AliquotaIVA' => $riepilogo['percentuale'],
|
||||
'ImponibileImporto' => abs($riepilogo['totale']),
|
||||
'Imposta' => abs($riepilogo['iva']),
|
||||
'ImponibileImporto' => $riepilogo['totale'],
|
||||
'Imposta' => $riepilogo['iva'],
|
||||
'EsigibilitaIVA' => $riepilogo['esigibilita'],
|
||||
];
|
||||
|
||||
|
@ -1543,8 +1501,8 @@ class FatturaElettronica
|
|||
$iva = [
|
||||
'AliquotaIVA' => 0,
|
||||
'Natura' => $riepilogo['codice_natura_fe'],
|
||||
'ImponibileImporto' => abs($riepilogo['totale']),
|
||||
'Imposta' => abs($riepilogo['iva']),
|
||||
'ImponibileImporto' => $riepilogo['totale'],
|
||||
'Imposta' => $riepilogo['iva'],
|
||||
'EsigibilitaIVA' => $riepilogo['esigibilita'],
|
||||
];
|
||||
|
||||
|
@ -1583,7 +1541,7 @@ class FatturaElettronica
|
|||
$pagamento = [
|
||||
'ModalitaPagamento' => $co_pagamenti['codice_modalita_pagamento_fe'],
|
||||
'DataScadenzaPagamento' => $scadenza['scadenza'],
|
||||
'ImportoPagamento' => abs($scadenza['da_pagare']),
|
||||
'ImportoPagamento' => $scadenza['da_pagare'],
|
||||
];
|
||||
|
||||
if (!empty($documento['idbanca'])) {
|
||||
|
@ -1598,10 +1556,12 @@ class FatturaElettronica
|
|||
$pagamento['BIC'] = $co_banche['bic'];
|
||||
}
|
||||
}
|
||||
|
||||
$result[]['DettaglioPagamento'] = $pagamento;
|
||||
}
|
||||
|
||||
$result[] = [
|
||||
'DettaglioPagamento' => $pagamento,
|
||||
];
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ switch (filter('op')) {
|
|||
case 'generate':
|
||||
$fattura_pa = new FatturaElettronica(post('filename'));
|
||||
|
||||
$id_record = $fattura_pa->saveFattura(post('pagamento'), post('id_segment'), post('id_tipo') );
|
||||
$id_record = $fattura_pa->saveFattura(post('pagamento'), post('id_segment'));
|
||||
$fattura_pa->saveRighe(post('articoli'), post('iva'), post('conto'));
|
||||
$fattura_pa->getFattura()->updateSconto();
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ echo '
|
|||
|
||||
<div class="col-md-3">
|
||||
<button type="button" class="btn btn-primary pull-right" onclick="upload(this)">
|
||||
<i class="fa fa-upload"></i> '.tr('Carica documento fornitore').'
|
||||
<i class="fa fa-upload"></i> '.tr('Carica fattura di acquisto').'
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -27,7 +27,6 @@ $citta = $sede['Comune'];
|
|||
$provincia = $sede['Provincia'];
|
||||
|
||||
echo '
|
||||
<<<<<<< HEAD
|
||||
<h4>'.
|
||||
$ragione_sociale.'<br>
|
||||
<small>
|
||||
|
@ -36,89 +35,33 @@ echo '
|
|||
'.$cap.' '.$citta.' ('.$provincia.')<br>
|
||||
</small>
|
||||
</h4><br>';
|
||||
=======
|
||||
<div class="row" >
|
||||
<div class="col-md-6" >
|
||||
<h4>'.
|
||||
$ragione_sociale.'<br>
|
||||
<small>
|
||||
'.(!empty($codice_fiscale) ? (tr('Codice Fiscale').': '.$codice_fiscale.'<br>') : '').'
|
||||
'.(!empty($partita_iva) ? (tr('Partita IVA').': '.$partita_iva.'<br>') : '').'
|
||||
'.$cap.' '.$citta.' ('.$provincia.')<br>
|
||||
</small>
|
||||
</h4>
|
||||
</div>';
|
||||
echo '
|
||||
<div class="col-md-6">
|
||||
<h4>'.$fattura_pa->getBody()['DatiGenerali']['DatiGeneraliDocumento']['Numero'].'<br>
|
||||
<small>
|
||||
'.database()->fetchOne('SELECT CONCAT("('.$fattura_pa->getBody()['DatiGenerali']['DatiGeneraliDocumento']['TipoDocumento'].') ", descrizione) AS descrizione FROM fe_tipi_documento WHERE codice = '.prepare($fattura_pa->getBody()['DatiGenerali']['DatiGeneraliDocumento']['TipoDocumento']))['descrizione'].'
|
||||
<br>'.Translator::dateToLocale($fattura_pa->getBody()['DatiGenerali']['DatiGeneraliDocumento']['Data']).'
|
||||
<br>'.$fattura_pa->getBody()['DatiGenerali']['DatiGeneraliDocumento']['Divisa'].'
|
||||
</small>
|
||||
</h4>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
// Se il blocco DatiPagamento è valorizzato (opzionale)
|
||||
if (!empty($fattura_pa->getBody()['DatiPagamento'])){
|
||||
|
||||
$pagamenti = $fattura_pa->getBody()['DatiPagamento'];
|
||||
|
||||
$metodi = $pagamenti['DettaglioPagamento'];
|
||||
$metodi = isset($metodi[0]) ? $metodi : [$metodi];
|
||||
$codice_modalita_pagamento = $metodi[0]['ModalitaPagamento'];
|
||||
|
||||
echo '
|
||||
<h4>'.tr('Pagamento').'</h4>
|
||||
|
||||
<p>'.tr('La fattura importata presenta _NUM_ rat_E_ di pagamento con le seguenti scadenze', [
|
||||
'_NUM_' => count($metodi),
|
||||
'_E_' => ((count($metodi)>1) ? 'e': 'a'),
|
||||
]).':</p>
|
||||
<ol>';
|
||||
|
||||
// Scadenze di pagamento
|
||||
foreach ($metodi as $metodo) {
|
||||
|
||||
echo '
|
||||
<li>';
|
||||
|
||||
//DataScadenzaPagamento è un nodo opzionale per il blocco DatiPagamento
|
||||
if (!empty($metodo['DataScadenzaPagamento'])){
|
||||
echo Translator::dateToLocale($metodo['DataScadenzaPagamento']).' ';
|
||||
}
|
||||
|
||||
echo Translator::numberToLocale($metodo['ImportoPagamento']).' € ';
|
||||
echo '('.((!empty($metodo['ModalitaPagamento'])) ? database()->fetchOne('SELECT descrizione FROM fe_modalita_pagamento WHERE codice = '.prepare($metodo['ModalitaPagamento']))['descrizione'] : '' ).')';
|
||||
|
||||
|
||||
echo '
|
||||
</li>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</ol>';
|
||||
|
||||
}
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
// Tipo del documento
|
||||
$codice_tipo_documento_fe = (intval(database()->fetchNum('SELECT id FROM co_tipidocumento WHERE codice_tipo_documento_fe = '.prepare($fattura_pa->getBody()['DatiGenerali']['DatiGeneraliDocumento']['TipoDocumento']).''))) ? $fattura_pa->getBody()['DatiGenerali']['DatiGeneraliDocumento']['TipoDocumento'] : '%';
|
||||
$query = 'SELECT id, CONCAT (descrizione, IF((codice_tipo_documento_fe IS NULL), \'\', CONCAT( \' (\', codice_tipo_documento_fe, \')\' ) )) as descrizione FROM co_tipidocumento WHERE dir = \'uscita\' AND codice_tipo_documento_fe LIKE '.prepare($codice_tipo_documento_fe);
|
||||
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Tipo fattura').'", "name": "id_tipo", "required": 1, "values": "query='.$query.'" ]}';
|
||||
// Pagamenti
|
||||
$pagamenti = $fattura_pa->getBody()['DatiPagamento'];
|
||||
|
||||
$metodi = $pagamenti['DettaglioPagamento'];
|
||||
$metodi = isset($metodi[0]) ? $metodi : [$metodi];
|
||||
|
||||
// prc '.($pagamenti['CondizioniPagamento'] == 'TP01' ? '!' : '').'= 100 AND
|
||||
$query = 'SELECT id, CONCAT (descrizione, IF((codice_modalita_pagamento_fe IS NULL), \"\", CONCAT( \" (\", codice_modalita_pagamento_fe, \")\" ) )) as descrizione FROM co_pagamenti';
|
||||
if (!empty($codice_modalita_pagamento)) {
|
||||
$query .= ' WHERE codice_modalita_pagamento_fe = '.prepare($codice_modalita_pagamento);
|
||||
$query = 'SELECT id, descrizione FROM co_pagamenti WHERE codice_modalita_pagamento_fe = '.prepare($metodi[0]['ModalitaPagamento']).' GROUP BY descrizione ORDER BY descrizione ASC';
|
||||
|
||||
echo '
|
||||
<h4>'.tr('Pagamento').'</h4>
|
||||
|
||||
<p>'.tr('La fattura importata presenta _NUM_ rate di pagamento con le seguenti scadenze', [
|
||||
'_NUM_' => count($metodi),
|
||||
]).':</p>
|
||||
<ul>';
|
||||
|
||||
// Scadenze di pagamento
|
||||
foreach ($metodi as $metodo) {
|
||||
echo '
|
||||
<li>'.Translator::dateToLocale($metodo['DataScadenzaPagamento']).'</li>';
|
||||
}
|
||||
$query .= ' GROUP BY descrizione ORDER BY descrizione ASC';
|
||||
|
||||
|
||||
echo '
|
||||
</ul>';
|
||||
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Pagamento').'", "name": "pagamento", "required": 1, "values": "query='.$query.'" ]}';
|
||||
|
||||
|
|
|
@ -137,10 +137,11 @@ class FatturaElettronica
|
|||
// Informazioni sull'anagrafica
|
||||
$REA = $xml['IscrizioneREA'];
|
||||
if (!empty($REA)) {
|
||||
if (!empty($REA['Ufficio']) and !empty($REA['NumeroREA'])) {
|
||||
$anagrafica->codicerea = $REA['Ufficio'].'-'.$REA['NumeroREA'];
|
||||
}
|
||||
|
||||
|
||||
if (!empty($REA['Ufficio']) and !empty($REA['NumeroREA'])) {
|
||||
$anagrafica->codicerea = $REA['Ufficio'].'-'.$REA['NumeroREA'];
|
||||
}
|
||||
|
||||
if (!empty($REA['CapitaleSociale'])) {
|
||||
$anagrafica->capitale_sociale = $REA['CapitaleSociale'];
|
||||
}
|
||||
|
@ -294,28 +295,18 @@ class FatturaElettronica
|
|||
*
|
||||
* @return int
|
||||
*/
|
||||
public function saveFattura($id_pagamento, $id_sezionale, $id_tipo)
|
||||
public function saveFattura($id_pagamento, $id_sezionale)
|
||||
{
|
||||
|
||||
|
||||
$anagrafica = static::createAnagrafica($this->getHeader()['CedentePrestatore']);
|
||||
$anagrafica = static::createAnagrafica($this->getHeader()['CedentePrestatore']);
|
||||
|
||||
$dati_generali = $this->getBody()['DatiGenerali']['DatiGeneraliDocumento'];
|
||||
$data = $dati_generali['Data'];
|
||||
|
||||
//Fix temporaneo per gestire TD02,TD03,TD06 non ancora previsti in OSM
|
||||
/*if ($dati_generali['TipoDocumento']=='TD02' OR $dati_generali['TipoDocumento']=='TD03' OR $dati_generali['TipoDocumento']=='TD06'){
|
||||
$id_tipo = 'TD01';
|
||||
}
|
||||
|
||||
$id_tipo = database()->fetchOne('SELECT id FROM co_tipidocumento WHERE codice_tipo_documento_fe = '.prepare($dati_generali['TipoDocumento']))['id'];*/
|
||||
|
||||
$numero_esterno = $dati_generali['Numero'];
|
||||
$progressivo_invio = $this->getHeader()['DatiTrasmissione']['ProgressivoInvio'];
|
||||
|
||||
//$descrizione_tipo = empty($this->getBody()['DatiGenerali']['DatiTrasporto']) ? 'Fattura immediata di acquisto' : 'Fattura accompagnatoria di acquisto';
|
||||
$tipo = TipoFattura::where('id', $id_tipo)->first();
|
||||
|
||||
$descrizione_tipo = empty($this->getBody()['DatiGenerali']['DatiTrasporto']) ? 'Fattura immediata di acquisto' : 'Fattura accompagnatoria di acquisto';
|
||||
$tipo = TipoFattura::where('descrizione', $descrizione_tipo)->first();
|
||||
|
||||
$fattura = Fattura::build($anagrafica, $tipo, $data, $id_sezionale);
|
||||
$this->fattura = $fattura;
|
||||
|
||||
|
@ -347,14 +338,6 @@ class FatturaElettronica
|
|||
// TODO: salvare in fattura
|
||||
}
|
||||
|
||||
$causali = $dati_generali['Causale'];
|
||||
if (count($causali)>0) {
|
||||
foreach($causali AS $causale){
|
||||
$note .= $causale;
|
||||
}
|
||||
$fattura->note = $note;
|
||||
}
|
||||
|
||||
// Bollo
|
||||
$bollo = $dati_generali['DatiBollo'];
|
||||
if (!empty($bollo)) {
|
||||
|
|
|
@ -114,7 +114,7 @@ class FileManager implements ManagerInterface
|
|||
</button>';
|
||||
} elseif (strtolower($extension) == 'xml') {
|
||||
$result .= '
|
||||
<a class="btn btn-xs btn-info" href="'.ROOTDIR.'/plugins/exportFE/view.php?id_record='.$r['id_record'].'" target="_blank">
|
||||
<a class="btn btn-xs btn-info" href="'.ROOTDIR.'/plugins/exportFE/view.php?id_record='.$r['id'].'" target="_blank">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>';
|
||||
} else {
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace Util;
|
||||
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
* Classe dedicata all'interpretazione dei file XML.
|
||||
*
|
||||
|
@ -21,16 +19,9 @@ class XML
|
|||
public static function read($string)
|
||||
{
|
||||
$content = static::stripP7MData($string);
|
||||
|
||||
libxml_use_internal_errors(true);
|
||||
$content = static::sanitizeXML($content);
|
||||
|
||||
$xml = simplexml_load_string($content, 'SimpleXMLElement', LIBXML_NOCDATA);
|
||||
if ($xml === false) {
|
||||
$message = libxml_get_last_error()->message;
|
||||
|
||||
throw new UnexpectedValueException($message);
|
||||
}
|
||||
|
||||
$result = json_decode(json_encode($xml), true);
|
||||
|
||||
return $result;
|
||||
|
|
|
@ -12,7 +12,7 @@ $settings = [
|
|||
],
|
||||
'header-height' => 35,
|
||||
'footer-height' => 5,
|
||||
'header-font-size' => 11,
|
||||
'header-font-size' => 12,
|
||||
];
|
||||
|
||||
return $settings;
|
||||
|
|
|
@ -54,7 +54,7 @@ echo '
|
|||
</td>
|
||||
<td colspan="2" style="height:10mm;padding-top:2mm;">
|
||||
<p class="small-bold">'.tr('Banca di appoggio', [], ['upper' => true]).'</p>
|
||||
<p><small>$appoggiobancario$</small></p>
|
||||
<p>$appoggiobancario$</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -117,7 +117,7 @@ $replaces = array_merge($replaces, [
|
|||
'rootdir' => ROOTDIR,
|
||||
'directory' => Prints::get($id_print)['full_directory'],
|
||||
'footer' => !empty($footer) ? $footer : '',
|
||||
'dicitura_fissa_fattura' => setting('Dicitura fissa fattura').((!empty(setting('OSMCloud Services API Token'))) ? tr(' Documento privo di valenza fiscale dell\'art 21 dpr 633/72.'): ''),
|
||||
'dicitura_fissa_fattura' => setting('Dicitura fissa fattura'),
|
||||
]);
|
||||
|
||||
unset($replace);
|
||||
|
|
|
@ -34,7 +34,6 @@ echo "
|
|||
// RIGHE PREVENTIVO CON ORDINAMENTO UNICO
|
||||
$righe = $dbo->fetchArray("SELECT *,
|
||||
IFNULL((SELECT `codice` FROM `mg_articoli` WHERE `id` = `or_righe_ordini`.`idarticolo`), '') AS codice_articolo,
|
||||
IFNULL((SELECT `immagine` FROM `mg_articoli` WHERE `id` = `or_righe_ordini`.`idarticolo`), '') AS immagine_articolo,
|
||||
(SELECT GROUP_CONCAT(`serial` SEPARATOR ', ') FROM `mg_prodotti` WHERE `id_riga_ordine` = `or_righe_ordini`.`id`) AS seriali,
|
||||
(SELECT `percentuale` FROM `co_iva` WHERE `id` = `or_righe_ordini`.`idiva`) AS perc_iva
|
||||
FROM `or_righe_ordini` WHERE idordine=".prepare($id_record).' ORDER BY `order`');
|
||||
|
@ -45,13 +44,7 @@ foreach ($righe as $r) {
|
|||
|
||||
echo '
|
||||
<tr>
|
||||
<td>';
|
||||
|
||||
if (!empty($r['immagine_articolo'])) {
|
||||
//echo '<img src="files/articoli/'.$r['immagine_articolo'].'" height="120"></img><div class="clearfix" ></div>';
|
||||
}
|
||||
|
||||
echo '
|
||||
<td>
|
||||
'.nl2br($r['descrizione']);
|
||||
|
||||
// Codice articolo
|
||||
|
|
|
@ -18,7 +18,7 @@ if (is_array($_SESSION['module_'.$id_module])) {
|
|||
$field_name = str_replace('search_', '', $field);
|
||||
$field_name = str_replace('__', ' ', $field_name);
|
||||
$field_name = str_replace('-', ' ', $field_name);
|
||||
array_push($search_filters, '`'.$field_name.'` LIKE "%'.$value.'%"');
|
||||
array_push($search_filters, '`'.$field_name.'` LIKE "%'.$field_value.'%"');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ ALTER TABLE `co_righe_documenti` ADD `data_inizio_periodo` date, ADD `data_fine_
|
|||
ALTER TABLE `co_documenti` ADD `tipo_resa` VARCHAR(3);
|
||||
|
||||
-- Colonna nome impianto
|
||||
INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `search_inside`, `order_by`, `visible`, `summable`, `default` ) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'MyImpianti'), 'Nome', 'nome', 2, 1, 0, 0, NULL, NULL, 1, 0, 1);
|
||||
INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `search_inside`, `order_by`, `visible`, `summable`, `default` ) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'MyImpianti'), 'Nome', 'nome', 2, 1, 0, 0, NULL, NULL, 0, 0, 0);
|
||||
|
||||
-- Colonna causale predefinita
|
||||
INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `search_inside`, `order_by`, `visible`, `summable`, `default` ) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Causali'), 'Predefinita', 'IF(predefined, ''Sì'', ''No'')', 2, 1, 0, 0, NULL, NULL, 0, 0, 0);
|
||||
|
|
|
@ -47,34 +47,5 @@ ALTER TABLE `an_anagrafiche` CHANGE `nome_cognome` `nome` VARCHAR(255) NOT NULL;
|
|||
ALTER TABLE `an_anagrafiche` ADD `cognome` VARCHAR(255) NOT NULL AFTER `nome`;
|
||||
|
||||
-- Colonna Rif. fattura (Prima nota)
|
||||
INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `search_inside`, `order_by`, `visible`, `summable`, `default` ) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Prima nota'), 'Rif. fattura', '(SELECT numero_esterno FROM co_documenti WHERE id = iddocumento)', 2, 1, 0, 0, NULL, NULL, 1, 0, 0);
|
||||
INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `search`, `slow`, `format`, `search_inside`, `order_by`, `visible`, `summable`, `default` ) VALUES (NULL, (SELECT `id` FROM `zz_modules` WHERE `name` = 'Prima nota'), 'Rif. fattura', 'IF((iddocumento != ''),(SELECT numero_esterno FROM co_documenti WHERE id = iddocumento), ''-'')', 2, 1, 0, 0, NULL, NULL, 1, 0, 0);
|
||||
|
||||
-- Aumento decimali percentuali delle rate pagamenti a 2
|
||||
ALTER TABLE `co_pagamenti` CHANGE `prc` `prc` DECIMAL(5,2) NOT NULL;
|
||||
|
||||
-- Ordino gestione documentale per data, nome
|
||||
UPDATE `zz_modules` SET `options` = '{ "main_query": [ { "type": "table", "fields": "Categoria, Nome, Data", "query": "SELECT id,(SELECT descrizione FROM zz_documenti_categorie WHERE zz_documenti_categorie.id = idcategoria) AS Categoria, zz_documenti.nome AS Nome, DATE_FORMAT( zz_documenti.`data`, ''%d/%m/%Y'' ) AS `Data` FROM zz_documenti WHERE `data` >= ''|period_start|'' AND `data` <= ''|period_end|'' HAVING 1=1 ORDER BY data, nome"} ]}' WHERE `zz_modules`.`name` = 'Gestione documentale';
|
||||
|
||||
-- Ordino Ddt anche per created_at (nel caso di stessa data e che il cast del numero esterno non sia efficace)
|
||||
UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM `dt_ddt` INNER JOIN `dt_tipiddt` ON `dt_ddt`.`idtipoddt` = `dt_tipiddt`.`id` WHERE 1=1 AND `dir` = ''entrata'' AND `data` >= ''|period_start|'' AND `data` <= ''|period_end|'' HAVING 2=2 ORDER BY `data` DESC, CAST(`numero_esterno` AS UNSIGNED) DESC,`dt_ddt`.created_at DESC' WHERE `zz_modules`.`name` = 'Ddt di vendita';
|
||||
|
||||
UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM `dt_ddt` INNER JOIN `dt_tipiddt` ON `dt_ddt`.`idtipoddt` = `dt_tipiddt`.`id` WHERE 1=1 AND `dir` = ''uscita'' AND `data` >= ''|period_start|'' AND `data` <= ''|period_end|'' HAVING 2=2 ORDER BY `data` DESC, CAST(`numero_esterno` AS UNSIGNED) DESC, `dt_ddt`.created_at DESC' WHERE `zz_modules`.`id` = 'Ddt di acquisto';
|
||||
|
||||
-- Aggiunti pagamenti mancanti Assegno circolare,Contanti presso Tesoreria, Vaglia cambiario, Bollettino bancario, RID, RID utenze, RID veloce, MAV, Quietanza erario, Giroconto su conti di contabilità speciale, Domiciliazione bancaria, Domiciliazione postale, Bollettino di c/c postale, SEPA Direct Debit, SEPA Direct Debit CORE, SEPA Direct Debit B2B, Trattenuta su somme già riscosse
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'Assegno circolare', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP03');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'Contanti presso Tesoreria', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP04');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'Vaglia cambiario', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP06');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'Bollettino bancario', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP07');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'RID', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP09');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'RID utenze', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP10');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'RID veloce', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP11');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'MAV', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP13');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'Quietanza erario', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP14');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'Giroconto su conti di contabilità speciale', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP15');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'Domiciliazione bancaria', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP16');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'Domiciliazione postale', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP17');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'Bollettino di c/c postale', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP18');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'SEPA Direct Debit', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP19');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'SEPA Direct Debit CORE', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP20');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'SEPA Direct Debit B2B', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP21');
|
||||
INSERT INTO `co_pagamenti` (`id`, `descrizione`, `giorno`, `num_giorni`, `prc`, `created_at`, `updated_at`, `idconto_vendite`, `idconto_acquisti`, `codice_modalita_pagamento_fe`) VALUES (NULL, 'Trattenuta su somme già riscosse', '0', '1', '100', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, 'MP22');
|
||||
|
|
Loading…
Reference in New Issue