parent
d5e8bd3694
commit
1d8030c44e
|
@ -53,7 +53,7 @@ if (in_array($id_cliente, $tipi_anagrafica) or in_array($id_fornitore, $tipi_ana
|
|||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi fattura di vendita').'" data-href="add.php?id_module='.Modules::get('Fatture di vendita')['id'].'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file"></i>'.tr('Nuova fattura di vendita').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.Modules::get('Prima nota')['id'].'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.Modules::get('Prima nota')['id'].'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile (cliente)').'
|
||||
</a></li>';
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ if (in_array($id_cliente, $tipi_anagrafica) or in_array($id_fornitore, $tipi_ana
|
|||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi fattura di acquisto').'" data-href="add.php?id_module='.Modules::get('Fatture di acquisto')['id'].'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file fa-flip-horizontal"></i>'.tr('Nuova fattura di acquisto').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.Modules::get('Prima nota')['id'].'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.Modules::get('Prima nota')['id'].'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile (fornitore)').'
|
||||
</a></li>';
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,24 @@ if (!$is_cliente) {
|
|||
}
|
||||
|
||||
$nazione_anagrafica = $anagrafica->sedeLegale->nazione;
|
||||
|
||||
|
||||
// Avvisi problemi scheda anagrafica
|
||||
$problemi_anagrafica = [];
|
||||
if ($is_cliente && empty($record['idconto_cliente'])){
|
||||
array_push($problemi_anagrafica, ' Piano dei conti mancante per il cliente');
|
||||
}
|
||||
|
||||
if ($is_fornitore && empty($record['idconto_fornitore'])){
|
||||
array_push($problemi_anagrafica, ' Piano dei conti mancante per il fornitore');
|
||||
}
|
||||
|
||||
if (sizeof($problemi_anagrafica) > 0) {
|
||||
echo '<div class="alert alert-warning"><i class="fa fa-warning"></i> '.tr("Controllare: _CAMPI_" , [
|
||||
'_CAMPI_' => implode(', ', $problemi_anagrafica)
|
||||
]).'</div>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form action="" method="post" id="edit-form" autocomplete="<?php echo setting('Autocompletamento form'); ?>" >
|
||||
|
|
|
@ -49,81 +49,90 @@ if (Services::isEnabled()) {
|
|||
// Informazioni su Services
|
||||
$servizi = Cache::pool('Informazioni su Services')->content;
|
||||
|
||||
// Elaborazione dei servizi in scadenza
|
||||
$limite_scadenze = (new Carbon())->addDays(60);
|
||||
$servizi_in_scadenza = [];
|
||||
foreach ($servizi as $servizio) {
|
||||
// Gestione per data di scadenza
|
||||
$scadenza = new Carbon($servizio['expiration_at']);
|
||||
if (
|
||||
(isset($servizio['expiration_at']) && $scadenza->lessThan($limite_scadenze))
|
||||
) {
|
||||
$servizi_in_scadenza[] = $servizio['name'].' ('.$scadenza->diffForHumans().')';
|
||||
}
|
||||
// Gestione per crediti
|
||||
elseif (
|
||||
(isset($servizio['credits']) && $servizio['credits'] < 100)
|
||||
) {
|
||||
$servizi_in_scadenza[] = $servizio['name'].' ('.$servizio['credits'].' crediti)';
|
||||
}
|
||||
}
|
||||
if (!empty($servizi)){
|
||||
|
||||
echo '
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="box box-info">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">
|
||||
'.tr('Informazioni su Services').'
|
||||
</h3>
|
||||
// Elaborazione dei servizi in scadenza
|
||||
$limite_scadenze = (new Carbon())->addDays(60);
|
||||
$servizi_in_scadenza = [];
|
||||
foreach ($servizi as $servizio) {
|
||||
// Gestione per data di scadenza
|
||||
$scadenza = new Carbon($servizio['expiration_at']);
|
||||
if (
|
||||
(isset($servizio['expiration_at']) && $scadenza->lessThan($limite_scadenze))
|
||||
) {
|
||||
$servizi_in_scadenza[] = $servizio['name'].' ('.$scadenza->diffForHumans().')';
|
||||
}
|
||||
// Gestione per crediti
|
||||
elseif (
|
||||
(isset($servizio['credits']) && $servizio['credits'] < 100)
|
||||
) {
|
||||
$servizi_in_scadenza[] = $servizio['name'].' ('.$servizio['credits'].' crediti)';
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="box box-info">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">
|
||||
'.tr('Informazioni su Services').'
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">';
|
||||
|
||||
if (empty($servizi_in_scadenza)) {
|
||||
echo '
|
||||
<p>'.tr('Nessun servizio in scadenza').'.</p>';
|
||||
} else {
|
||||
echo '
|
||||
<p>'.tr('I seguenti servizi sono in scadenza:').'</p>
|
||||
<ul>';
|
||||
foreach ($servizi_in_scadenza as $servizio) {
|
||||
echo '
|
||||
<li>'.$servizio.'</li>';
|
||||
}
|
||||
echo '
|
||||
</ul>';
|
||||
}
|
||||
|
||||
echo '
|
||||
|
||||
<hr><br>
|
||||
|
||||
<h4>'.tr('Statistiche su Fatture Elettroniche').'</h4>
|
||||
<ul>
|
||||
<li>'.tr('Fatture transitate').': <span id="fe_numero"></span></li>
|
||||
<li>'.tr('Spazio occupato').': <span id="fe_spazio"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">';
|
||||
|
||||
if (empty($servizi_in_scadenza)) {
|
||||
echo '
|
||||
<p>'.tr('Nessun servizio in scadenza').'.</p>';
|
||||
} else {
|
||||
echo '
|
||||
<p>'.tr('I seguenti servizi sono in scadenza:').'</p>
|
||||
<ul>';
|
||||
foreach ($servizi_in_scadenza as $servizio) {
|
||||
echo '
|
||||
<li>'.$servizio.'</li>';
|
||||
}
|
||||
echo '
|
||||
</ul>';
|
||||
}
|
||||
|
||||
echo '
|
||||
|
||||
<hr><br>
|
||||
|
||||
<h4>'.tr('Statistiche su Fatture Elettroniche').'</h4>
|
||||
<ul>
|
||||
<li>'.tr('Fatture transitate').': <span id="fe_numero"></span></li>
|
||||
<li>'.tr('Spazio occupato').': <span id="fe_spazio"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function (){
|
||||
$.ajax({
|
||||
url: globals.rootdir + "/actions.php",
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
data: {
|
||||
id_module: globals.id_module,
|
||||
op: "informazioni-fe",
|
||||
},
|
||||
success: function (response) {
|
||||
$("#fe_numero").html(response.invoice_number);
|
||||
$("#fe_spazio").html(response.size);
|
||||
}
|
||||
<script>
|
||||
$(document).ready(function (){
|
||||
$.ajax({
|
||||
url: globals.rootdir + "/actions.php",
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
data: {
|
||||
id_module: globals.id_module,
|
||||
op: "informazioni-fe",
|
||||
},
|
||||
success: function (response) {
|
||||
$("#fe_numero").html(response.invoice_number);
|
||||
$("#fe_spazio").html(response.size);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
</script>';
|
||||
|
||||
}else{
|
||||
|
||||
echo '
|
||||
<div class="col-md-12 col-lg-6"><div class="alert alert-warning alert-dismissible" role="alert"><button class="close" type="button" data-dismiss="alert" aria-hidden="true"><span aria-hidden="true">×</span><span class="sr-only">'.tr('Chiudi').'</span></button><span><i class="fa fa-warning"></i> '.tr('Nessun servizio abilitato o "OSMCloud Services API Token" non valido').'.</span></div></div>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Widgets
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.n.c.
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
switch (filter('op')) {
|
||||
case 'update':
|
||||
$descrizione = filter('descrizione');
|
||||
$dir = filter('dir');
|
||||
$codice_tipo_documento_fe = filter('codice_tipo_documento_fe');
|
||||
|
||||
if (isset($descrizione) && isset($dir) && isset($codice_tipo_documento_fe)) {
|
||||
if ($dbo->fetchNum('SELECT * FROM `co_tipidocumento` WHERE `dir`='.prepare($dir).' AND `codice_tipo_documento_fe`='.prepare($codice_tipo_documento_fe).' AND `id`!='.prepare($id_record)) == 0) {
|
||||
|
||||
$predefined = post('predefined');
|
||||
if (!empty($predefined)) {
|
||||
$dbo->query('UPDATE co_tipidocumento SET predefined = 0');
|
||||
}
|
||||
|
||||
$enabled = post('enabled');
|
||||
if (!empty($enabled)) {
|
||||
$dbo->query('UPDATE co_tipidocumento SET `enabled` = 0');
|
||||
}
|
||||
|
||||
$dbo->update('co_tipidocumento', [
|
||||
'descrizione' => $descrizione,
|
||||
'dir' => $dir,
|
||||
'codice_tipo_documento_fe' => $codice_tipo_documento_fe,
|
||||
'help' => filter('help'),
|
||||
'predefined' => $predefined,
|
||||
'enabled' => $enabled,
|
||||
], ['id' => $id_record]);
|
||||
|
||||
flash()->info(tr('Salvataggio completato!'));
|
||||
} else {
|
||||
flash()->error(tr("E' già presente una tipologia di _TYPE_ con la stessa combinazione di direzione e tipo documento FE", [
|
||||
'_TYPE_' => 'tipo documento',
|
||||
]));
|
||||
}
|
||||
} else {
|
||||
flash()->error(tr('Ci sono stati alcuni errori durante il salvataggio'));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
$descrizione = filter('descrizione');
|
||||
$dir = filter('dir');
|
||||
$codice_tipo_documento_fe = filter('codice_tipo_documento_fe');
|
||||
|
||||
if (isset($descrizione) && isset($dir) && isset($codice_tipo_documento_fe)) {
|
||||
if ($dbo->fetchNum('SELECT * FROM `co_tipidocumento` WHERE `dir`='.prepare($dir).' AND `codice_tipo_documento_fe`='.prepare($codice_tipo_documento_fe)) == 0) {
|
||||
$dbo->insert('co_tipidocumento', [
|
||||
'descrizione' => $descrizione,
|
||||
'dir' => $dir,
|
||||
'codice_tipo_documento_fe' => $codice_tipo_documento_fe,
|
||||
]);
|
||||
$id_record = $dbo->lastInsertedID();
|
||||
|
||||
if (isAjaxRequest()) {
|
||||
echo json_encode(['id' => $id_record, 'text' => $descrizione]);
|
||||
}
|
||||
|
||||
flash()->info(tr('Aggiunta nuova tipologia di _TYPE_', [
|
||||
'_TYPE_' => 'tipo documento',
|
||||
]));
|
||||
} else {
|
||||
flash()->error(tr("E' già presente una tipologia di _TYPE_ con la stessa combinazione di direzione e tipo documento FE", [
|
||||
'_TYPE_' => 'tipo documento',
|
||||
]));
|
||||
}
|
||||
} else {
|
||||
flash()->error(tr('Ci sono stati alcuni errori durante il salvataggio'));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
$documenti = $dbo->fetchNum('SELECT id FROM co_documenti WHERE idtipodocumento ='.prepare($id_record));
|
||||
|
||||
if (isset($id_record) && empty($documenti)) {
|
||||
$dbo->query('DELETE FROM `co_tipidocumento` WHERE `id`='.prepare($id_record));
|
||||
flash()->info(tr('Tipologia di _TYPE_ eliminata con successo.', [
|
||||
'_TYPE_' => 'tipo documento',
|
||||
]));
|
||||
} else {
|
||||
|
||||
$dbo->update('co_tipidocumento', [
|
||||
'deleted_at' => date(),
|
||||
], ['id' => $id_record]);
|
||||
|
||||
flash()->info(tr('Tipologia di _TYPE_ eliminata con successo.', [
|
||||
'_TYPE_' => 'tipo documento',
|
||||
]));
|
||||
|
||||
|
||||
//flash()->error(tr('Sono presenti dei documenti collegati a questo tipo documento'));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.n.c.
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
?><form action="" method="post" id="add-form">
|
||||
<input type="hidden" name="op" value="add">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "text", "label": "<?php echo tr('Descrizione'); ?>", "name": "descrizione", "required": 1 ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "<?php echo tr('Direzione'); ?>", "name": "dir", "values": "list=\"\": \"Non specificato\", \"entrata\": \"<?php echo tr('Entrata'); ?>\", \"uscita\": \"<?php echo tr('Uscita'); ?>\"", "required": 1 ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "<?php echo tr('Codice tipo documento FE'); ?>", "name": "codice_tipo_documento_fe", "values": "query=SELECT codice AS id, CONCAT_WS(' - ', codice, descrizione) AS descrizione FROM fe_tipi_documento", "required": 1 ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PULSANTI -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-plus"></i> <?php echo tr('Aggiungi'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.n.c.
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
switch ($resource) {
|
||||
case 'tipi_documento':
|
||||
$query = 'SELECT id, descrizione FROM co_tipidocumento |where| ORDER BY descrizione ASC';
|
||||
|
||||
foreach ($elements as $element) {
|
||||
$filter[] = 'id='.prepare($element);
|
||||
}
|
||||
if (!empty($search)) {
|
||||
$search_fields[] = 'descrizione LIKE '.prepare('%'.$search.'%');
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.n.c.
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
?><form action="" method="post" id="edit-form">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="op" value="update">
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{[ "type": "text", "label": "<?php echo tr('Descrizione'); ?>", "name": "descrizione", "required": 1, "value": "$descrizione$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "<?php echo tr('Direzione'); ?>", "name": "dir", "value": "$dir$", "values": "list=\"\": \"Non specificato\", \"entrata\": \"<?php echo tr('Entrata'); ?>\", \"uscita\": \"<?php echo tr('Uscita'); ?>\"", "required": 1 ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "<?php echo tr('Codice tipo documento FE'); ?>", "name": "codice_tipo_documento_fe", "value": "$codice_tipo_documento_fe$", "values": "query=SELECT codice AS id, CONCAT_WS(' - ', codice, descrizione) AS descrizione FROM fe_tipi_documento", "required": 1 ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "checkbox", "label": "<?php echo tr('Tipo documento predefinito'); ?>", "name": "predefined", "value": "<?php echo intval($record['predefined']); ?>", "help":"<?php echo tr('Impostare questo tipo di documento predefinto per le fatture'); ?>." ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "checkbox", "label": "<?php echo tr('Attivo'); ?>", "name": "enabled", "value": "<?php echo intval($record['enabled']); ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
{[ "type": "text", "label": "<?php echo tr('Help'); ?>", "name": "help", "value": "$help$" ]}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
<?php
|
||||
// Collegamenti diretti (numerici)
|
||||
$numero_documenti = $dbo->fetchNum('SELECT id FROM co_documenti WHERE idtipodocumento='.prepare($id_record));
|
||||
|
||||
if (!empty($numero_documenti)) {
|
||||
echo '
|
||||
<div class="alert alert-danger">
|
||||
'.tr('Ci sono _NUM_ documenti collegati', [
|
||||
'_NUM_' => $numero_documenti,
|
||||
]).'.
|
||||
</div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<a class="btn btn-danger ask" data-backto="record-list">
|
||||
<i class="fa fa-trash"></i> <?php echo tr('Elimina'); ?>
|
||||
</a>
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
/*
|
||||
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
|
||||
* Copyright (C) DevCode s.n.c.
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
if (isset($id_record)) {
|
||||
$record = $dbo->fetchOne('SELECT * FROM `co_tipidocumento` WHERE id='.prepare($id_record));
|
||||
}
|
|
@ -171,12 +171,12 @@ UPDATE `co_iva` SET `codice_natura_fe` = 'N6.9' WHERE `codice_natura_fe` = 'N6';
|
|||
-- Aumento testo descrizione per righe attività (da 255 caratteri)
|
||||
ALTER TABLE `in_righe_interventi` CHANGE `descrizione` `descrizione` TEXT NULL;
|
||||
|
||||
ALTER TABLE `co_tipidocumento` CHANGE `descrizione` `descrizione` VARCHAR(125) NOT NULL;
|
||||
|
||||
-- Aggiunta tipologia documento TD 25
|
||||
INSERT INTO `co_tipidocumento` (`id`, `descrizione`, `dir`, `reversed`, `codice_tipo_documento_fe`) VALUES
|
||||
(NULL, "Fattura differita di cui all'art.21, comma 4, terzo periodo lett. b", 'entrata', '0', 'TD25'),
|
||||
(NULL, "Fattura differita di cui all'art.21, comma 4, terzo periodo lett. b", 'uscita', '0', 'TD25');
|
||||
|
||||
ALTER TABLE `co_tipidocumento` CHANGE `descrizione` `descrizione` VARCHAR(125) NOT NULL;
|
||||
(NULL, "Fattura differita di cui all'art.21, comma 4, terzo periodo lett. b (Dropshipping)", 'entrata', '0', 'TD25'),
|
||||
(NULL, "Fattura differita di cui all'art.21, comma 4, terzo periodo lett. b (Dropshipping)", 'uscita', '0', 'TD25');
|
||||
|
||||
-- Metodi di pagamento speculari per fatture di acquisto
|
||||
INSERT INTO `co_tipidocumento` (`id`, `descrizione`, `dir`, `reversed`, `codice_tipo_documento_fe`) VALUES
|
||||
|
@ -193,4 +193,29 @@ INSERT INTO `co_tipidocumento` (`id`, `descrizione`, `dir`, `reversed`, `codice_
|
|||
(NULL, 'Fattura per autoconsumo o per cessioni gratuite senza rivalsa', 'uscita', '0', 'TD27');
|
||||
|
||||
-- Setto 10 tentativi per email create più di una settimana fa che non sono state mai processate e non hanno ricevuto ne invio o fallimento
|
||||
UPDATE `em_emails` SET `attempt` = '10' WHERE `em_emails`.`attempt` = 0 AND `em_emails`.`failed_at` IS NULL AND `em_emails`.`sent_at` IS NULL AND `em_emails`.`processing_at` IS NULL AND `em_emails`.`created_at` <= DATE_SUB(NOW(), INTERVAL 7 DAY);
|
||||
UPDATE `em_emails` SET `attempt` = '10', `em_emails`.`failed_at` = NOW() WHERE `em_emails`.`attempt` = 0 AND `em_emails`.`failed_at` IS NULL AND `em_emails`.`sent_at` IS NULL AND `em_emails`.`processing_at` IS NULL AND `em_emails`.`created_at` <= DATE_SUB(NOW(), INTERVAL 7 DAY);
|
||||
|
||||
-- Aggiunto deleted_at per tipi di documento
|
||||
ALTER TABLE `co_tipidocumento` ADD `deleted_at` DATETIME NULL DEFAULT NULL AFTER `codice_tipo_documento_fe`;
|
||||
-- Aggiunti campi predefined, enabled, help per tipi di documento
|
||||
ALTER TABLE `co_tipidocumento` ADD `predefined` TINYINT NOT NULL DEFAULT '0' AFTER `codice_tipo_documento_fe`;
|
||||
ALTER TABLE `co_tipidocumento` ADD `enabled` TINYINT NOT NULL DEFAULT '1' AFTER `predefined`;
|
||||
ALTER TABLE `co_tipidocumento` ADD `help` VARCHAR(255) NULL AFTER `enabled`;
|
||||
UPDATE `co_tipidocumento` SET `predefined` = '1' WHERE `co_tipidocumento`.`descrizione` = 'Fattura immediata di vendita';
|
||||
UPDATE `co_tipidocumento` SET `predefined` = '1' WHERE `co_tipidocumento`.`descrizione` = 'Fattura immediata di acquisto';
|
||||
|
||||
UPDATE `co_tipidocumento` SET `help` = 'Fattura emessa entro le ore 24 del giorno di effettuazione dell’operazione.' WHERE `co_tipidocumento`.`descrizione` = 'Fattura immediata di acquisto';
|
||||
UPDATE `co_tipidocumento` SET `help` = 'Fattura emessa entro le ore 24 del giorno di effettuazione dell’operazione.' WHERE `co_tipidocumento`.`descrizione` = 'Fattura immediata di vendita';
|
||||
UPDATE `co_tipidocumento` SET `help` = "Fattura emessa entro il giorno 15 del mese successivo a quello di effettuazione dell'operazione (art. 21 comma 4 lett. a) del D.P.R. 633/1972)." WHERE `co_tipidocumento`.`descrizione` = 'Fattura differita di acquisto';
|
||||
UPDATE `co_tipidocumento` SET `help` = "Fattura emessa entro il giorno 15 del mese successivo a quello di effettuazione dell'operazione (art. 21 comma 4 lett. a) del D.P.R. 633/1972)." WHERE `co_tipidocumento`.`descrizione` = 'Fattura differita di vendita';
|
||||
|
||||
-- Innesto nuovo modulo Tipi documento
|
||||
INSERT INTO `zz_modules` (`id`, `name`, `title`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`, `use_notes`, `use_checklists`) VALUES (NULL, 'Tipi documento', 'Tipi documento', 'tipi_documento', 'SELECT |select| FROM `co_tipidocumento` WHERE 1=1 AND deleted_at IS NULL HAVING 2=2', '', 'fa fa-angle-right', '2.4.20', '2.4.20', '1', (SELECT `id` FROM `zz_modules` t WHERE t.`name` = 'Tabelle'), '1', '1', '0', '0');
|
||||
|
||||
INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`, `default`, `visible`) VALUES
|
||||
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Tipi documento'), 'Attivo', 'co_tipidocumento.enabled', 6, 1, 0, 0, 1),
|
||||
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Tipi documento'), 'Predefinito', 'co_tipidocumento.predefined', 5, 1, 0, 0, 1),1
|
||||
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Tipi documento'), 'Codice FE', 'co_tipidocumento.codice_tipo_documento_fe', 4, 1, 0, 0, 1),
|
||||
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Tipi documento'), 'Direzione', 'co_tipidocumento.dir', 3, 1, 0, 0, 1),
|
||||
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Tipi documento'), 'Descrizione', 'co_tipidocumento.descrizione', 2, 1, 0, 0, 1),
|
||||
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Tipi documento'), 'id', 'co_tipidocumento.id', 1, 1, 0, 0, 0);
|
Loading…
Reference in New Issue