mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-26 16:27:47 +01:00
Merge sedi con ultimi commit
This commit is contained in:
commit
d9b22d99c8
10
ajax.php
10
ajax.php
@ -87,10 +87,12 @@ switch (get('op')) {
|
||||
|
||||
$results = [];
|
||||
foreach ($hooks as $hook) {
|
||||
$results[] = [
|
||||
'id' => $hook->id,
|
||||
'name' => $hook->name,
|
||||
];
|
||||
if ($hook->permission != '-') {
|
||||
$results[] = [
|
||||
'id' => $hook->id,
|
||||
'name' => $hook->name,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($results);
|
||||
|
@ -47,6 +47,11 @@ a.disabled {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
input[type=file]{
|
||||
height: initial;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#datetime {
|
||||
font-size: 11px;
|
||||
font-weight: normal;
|
||||
@ -314,7 +319,7 @@ span.form-control {
|
||||
|
||||
.nav-tabs-custom > .nav-tabs.pull-right > li > a.back-btn {
|
||||
font-size: 12px;
|
||||
color: #3C8DBC;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.navbar-nav > .notifications-menu > .dropdown-menu > li .menu > li > a, .navbar-nav > .messages-menu > .dropdown-menu > li .menu > li > a, .navbar-nav > .tasks-menu > .dropdown-menu > li .menu > li > a {
|
||||
@ -820,3 +825,22 @@ input.small-width {
|
||||
.box-info ul > li > :last-child {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.skin-default .nav.navbar-nav li a{
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.skin-default .nav.navbar-nav li a:hover{
|
||||
background: #222222;
|
||||
}
|
||||
|
||||
.row{
|
||||
overflow-wrap: break-word;
|
||||
word-wrap: break-word;
|
||||
-ms-word-break: break-all;
|
||||
word-break: break-all;
|
||||
word-break: break-word;
|
||||
-ms-hyphens: auto;
|
||||
-moz-hyphens: auto;
|
||||
-webkit-hyphens: auto;
|
||||
hyphens: auto;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
return [
|
||||
'include' => 'Common',
|
||||
'modules/aggiornamenti' => 'Modules\Aggiornamenti',
|
||||
'modules/anagrafiche' => 'Modules\Anagrafiche',
|
||||
'modules/articoli' => 'Modules\Articoli',
|
||||
'modules/ritenute' => 'Modules\Ritenute',
|
||||
|
@ -63,7 +63,15 @@ if (Auth::check()) {
|
||||
},
|
||||
success: function(data) {
|
||||
hooks = JSON.parse(data);
|
||||
|
||||
|
||||
$("#hooks-header").text(globals.translations.hooksExecuting);
|
||||
|
||||
if (hooks.length == 0) {
|
||||
$("#hooks-loading").hide();
|
||||
$("#hooks-number").text(0);
|
||||
$("#hooks-header").text(globals.translations.hookNone);
|
||||
}
|
||||
|
||||
hooks.forEach(function(item, index){
|
||||
executeHook(item, hooks.length);
|
||||
});
|
||||
|
@ -71,11 +71,11 @@ $settings = [
|
||||
//],
|
||||
'upload_max_filesize' => [
|
||||
'type' => 'value',
|
||||
'description' => '>16M',
|
||||
'description' => '>32M',
|
||||
],
|
||||
'post_max_size' => [
|
||||
'type' => 'value',
|
||||
'description' => '>16M',
|
||||
'description' => '>32M',
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -84,6 +84,7 @@ if (Auth::check()) {
|
||||
'details' => tr('Dettagli'),
|
||||
'waiting' => tr('Impossibile procedere'),
|
||||
'waiting_msg' => tr('Prima di proseguire devi selezionare alcuni elementi!'),
|
||||
'hooksExecuting' => tr('Hooks in esecuzione'),
|
||||
'hookExecuting' => tr('Hook "_NAME_" in esecuzione'),
|
||||
'hookMultiple' => tr('Hai _NUM_ notifiche'),
|
||||
'hookSingle' => tr('Hai 1 notifica'),
|
||||
@ -207,7 +208,8 @@ if (Auth::check()) {
|
||||
<span class="logo-lg">'.tr('OpenSTAManager').'</span>
|
||||
</a>
|
||||
<!-- Header Navbar: style can be found in header.less -->
|
||||
<nav class="navbar navbar-static-top" role="navigation">
|
||||
<nav class="navbar navbar-static-top" role="navigation">
|
||||
|
||||
<!-- Sidebar toggle button-->
|
||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
||||
<span class="sr-only">'.tr('Mostra/nascondi menu').'</span>
|
||||
@ -219,7 +221,7 @@ if (Auth::check()) {
|
||||
<!-- Navbar Left Menu -->
|
||||
<div class="navbar-left" class="hidden-xs">
|
||||
<ul class="nav navbar-nav" class="hidden-xs">
|
||||
<li><a href="#" id="daterange" style="color:'.$calendar.';background:inherit;" >
|
||||
<li><a href="#" id="daterange" style="color:'.$calendar.';" role="button" >
|
||||
<i class="fa fa-calendar" style="color:inherit"></i> <i class="fa fa-caret-down" style="color:inherit"></i>
|
||||
</a></li>
|
||||
|
||||
@ -233,38 +235,39 @@ if (Auth::check()) {
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="dropdown notifications-menu" >
|
||||
<a href="#" class="dropdown-toggle btn-github" data-toggle="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-bell-o"></i>
|
||||
<span class="label label-warning">
|
||||
<span id="hooks-loading"><i class="fa fa-spinner fa-spin"></i></span>
|
||||
<span id="hooks-count"></span>
|
||||
<span id="hooks-number"></span>
|
||||
<span id="hooks-counter" class="hide">0</span>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li class="header" id="hooks-header" ></li>
|
||||
<li class="header"><span class="small" id="hooks-header"></span></li>
|
||||
<li><ul class="menu" id="hooks">
|
||||
|
||||
</ul></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><a href="#" onclick="window.print()" class="btn-github tip" style="background-color:#5bc0de!important" title="'.tr('Stampa').'">
|
||||
<li><a href="#" onclick="window.print()" class="tip" title="'.tr('Stampa').'">
|
||||
<i class="fa fa-print"></i>
|
||||
</a></li>
|
||||
|
||||
<li><a href="'.$rootdir.'/bug.php" class="btn-github tip" title="'.tr('Segnalazione bug').'">
|
||||
<li><a href="'.$rootdir.'/bug.php" class="tip"title="'.tr('Segnalazione bug').'">
|
||||
<i class="fa fa-bug"></i>
|
||||
</a></li>
|
||||
|
||||
<li><a href="'.$rootdir.'/log.php" class="btn-github tip" title="'.tr('Log accessi').'">
|
||||
<li><a href="'.$rootdir.'/log.php" class="tip"title="'.tr('Log accessi').'">
|
||||
<i class="fa fa-book"></i>
|
||||
</a></li>
|
||||
|
||||
<li><a href="'.$rootdir.'/info.php" class="btn-github tip" title="'.tr('Informazioni').'">
|
||||
<li><a href="'.$rootdir.'/info.php" class="tip"title="'.tr('Informazioni').'">
|
||||
<i class="fa fa-info"></i>
|
||||
</a></li>
|
||||
|
||||
<li><a href="'.$rootdir.'/index.php?op=logout" class="btn-github tip" style="background-color:#dd4b39!important" title="'.tr('Esci').'">
|
||||
<li><a href="'.$rootdir.'/index.php?op=logout" class="bg-red tip" title="'.tr('Esci').'">
|
||||
<i class="fa fa-power-off"></i>
|
||||
</a></li>
|
||||
</ul>
|
||||
|
@ -1538,8 +1538,8 @@ function executeHook(hook, length){
|
||||
notification = '<li class="hook-element"><a href="' + (result.link ? result.link : "#") + '"><i class="' + result.icon + '"></i><span class="small" > ' + result.message + '</span></a></li>';
|
||||
|
||||
// Inserimento della notifica
|
||||
hooks_count = $("#hooks-count");
|
||||
number = parseInt(hooks_count.text());
|
||||
hooks_number = $("#hooks-number");
|
||||
number = parseInt(hooks_number.text());
|
||||
number = isNaN(number) ? 0 : number;
|
||||
|
||||
if(result.notify) {
|
||||
@ -1547,13 +1547,19 @@ function executeHook(hook, length){
|
||||
|
||||
$("#hooks").prepend(notification);
|
||||
} else {
|
||||
$("#hooks").append(notification);
|
||||
//$("#hooks").append(notification);
|
||||
}
|
||||
|
||||
hooks_count.text(number);
|
||||
hooks_number.text(number);
|
||||
|
||||
// Contatore dell'esecuzione degli hook
|
||||
hooks_counter = $("#hooks-counter");
|
||||
counter = parseInt(hooks_counter.text());
|
||||
counter++;
|
||||
hooks_counter.text(counter);
|
||||
|
||||
// Rimozione eventuale della rotella di caricamento
|
||||
if($(".hook-element").length == hooks.length) {
|
||||
if(counter == hooks.length) {
|
||||
$("#hooks-loading").hide();
|
||||
|
||||
if (number > 1){
|
||||
@ -1564,7 +1570,7 @@ function executeHook(hook, length){
|
||||
hookMessage = globals.translations.hookNone;
|
||||
}
|
||||
|
||||
$("#hooks-header").append('<span class="small">' + hookMessage + '</small>');
|
||||
$("#hooks-header").text(hookMessage);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -67,16 +67,16 @@ if (setting('Attiva aggiornamenti')) {
|
||||
|
||||
$upload_max_filesize = ini_get('upload_max_filesize');
|
||||
$upload_max_filesize = str_replace(['k', 'M'], ['000', '000000'], $upload_max_filesize);
|
||||
// Dimensione minima: 16MB
|
||||
if ($upload_max_filesize < 16000000) {
|
||||
$alerts['upload_max_filesize'] = '16MB';
|
||||
// Dimensione minima: 32MB
|
||||
if ($upload_max_filesize < 32000000) {
|
||||
$alerts['upload_max_filesize'] = '32MB';
|
||||
}
|
||||
|
||||
$post_max_size = ini_get('post_max_size');
|
||||
$post_max_size = str_replace(['k', 'M'], ['000', '000000'], $post_max_size);
|
||||
// Dimensione minima: 16MB
|
||||
if ($post_max_size < 16000000) {
|
||||
$alerts['post_max_size'] = '16MB';
|
||||
// Dimensione minima: 32MB
|
||||
if ($post_max_size < 32000000) {
|
||||
$alerts['post_max_size'] = '32MB';
|
||||
}
|
||||
|
||||
if (!empty($alerts)) {
|
||||
@ -147,10 +147,10 @@ function search(button) {
|
||||
</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<form action="'.ROOTDIR.'/controller.php?id_module='.$id_module.'" method="post" enctype="multipart/form-data" class="form-inline" id="update">
|
||||
<form action="'.ROOTDIR.'/controller.php?id_module='.$id_module.'" method="post" enctype="multipart/form-data" id="update">
|
||||
<input type="hidden" name="op" value="upload">
|
||||
|
||||
<label><input type="file" name="blob" id="blob"></label>
|
||||
{[ "type": "file", "name": "blob", "required": 1, "accept": ".zip" ]}
|
||||
|
||||
<button type="button" class="btn btn-primary pull-right" onclick="update()">
|
||||
<i class="fa fa-upload"></i> '.tr('Carica').'
|
||||
|
86
modules/aggiornamenti/src/UpdateHook.php
Normal file
86
modules/aggiornamenti/src/UpdateHook.php
Normal file
@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Aggiornamenti;
|
||||
|
||||
use Common\HookManager;
|
||||
use GuzzleHttp\Client;
|
||||
use Modules;
|
||||
use Update;
|
||||
|
||||
class UpdateHook extends HookManager
|
||||
{
|
||||
protected static $client = null;
|
||||
|
||||
public function manage()
|
||||
{
|
||||
$result = self::isAvailable();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function response($update)
|
||||
{
|
||||
$module = Modules::get('Aggiornamenti');
|
||||
$link = ROOTDIR.'/controller.php?id_module='.$module->id;
|
||||
|
||||
$message = tr("E' disponibile la versione _VERSION_ del gestionale", [
|
||||
'_VERSION_' => $update,
|
||||
]);
|
||||
|
||||
return [
|
||||
'icon' => 'fa fa-download text-info',
|
||||
'link' => $link,
|
||||
'message' => $message,
|
||||
'notify' => !empty($update),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Controlla se è disponibile un aggiornamento nella repository GitHub.
|
||||
*
|
||||
* @return string|bool
|
||||
*/
|
||||
public static function isAvailable()
|
||||
{
|
||||
$api = self::getAPI();
|
||||
|
||||
$version = ltrim($api['tag_name'], 'v');
|
||||
$current = Update::getVersion();
|
||||
|
||||
if (version_compare($current, $version) < 0) {
|
||||
return $version;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce l'oggetto per la connessione all'API del progetto.
|
||||
*
|
||||
* @return Client
|
||||
*/
|
||||
protected static function getClient()
|
||||
{
|
||||
if (!isset(self::$client)) {
|
||||
self::$client = new Client([
|
||||
'base_uri' => 'https://api.github.com/repos/devcode-it/openstamanager/',
|
||||
'verify' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
return self::$client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce i contenuti JSON dell'API del progetto.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected static function getAPI()
|
||||
{
|
||||
$response = self::getClient()->request('GET', 'releases');
|
||||
$body = $response->getBody();
|
||||
|
||||
return json_decode($body, true)[0];
|
||||
}
|
||||
}
|
@ -29,7 +29,7 @@ echo '
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Nome').'", "name": "nome", "required": 0 ]}
|
||||
{[ "type": "text", "label": "'.tr('Nome').'", "name": "nome", "id": "nome_", "required": 0 ]}
|
||||
</div>
|
||||
|
||||
|
||||
@ -131,22 +131,22 @@ echo
|
||||
|
||||
<script>
|
||||
// Abilito solo ragione sociale oppure solo nome-cognome in base a cosa compilo
|
||||
$('#nome, #cognome', '#bs-popup, #bs-popup2').blur(function(){
|
||||
if ($('#nome', '#bs-popup, #bs-popup2').val() == '' && $('#cognome', '#bs-popup, #bs-popup2').val() == '' ){
|
||||
$('#nome, #cognome', '#bs-popup, #bs-popup2').prop('disabled', true).prop('required', false);
|
||||
$('#nome_, #cognome', '#bs-popup, #bs-popup2').blur(function(){
|
||||
if ($('#nome_', '#bs-popup, #bs-popup2').val() == '' && $('#cognome', '#bs-popup, #bs-popup2').val() == '' ){
|
||||
$('#nome_, #cognome', '#bs-popup, #bs-popup2').prop('disabled', true).prop('required', false);
|
||||
$('#ragione_sociale', '#bs-popup, #bs-popup2').prop('disabled', false).prop('required', true);
|
||||
}else{
|
||||
$('#nome, #cognome', '#bs-popup, #bs-popup2').prop('disabled', false).prop('required', true);
|
||||
$('#nome_, #cognome', '#bs-popup, #bs-popup2').prop('disabled', false).prop('required', true);
|
||||
$('#ragione_sociale', '#bs-popup, #bs-popup2').prop('disabled', true).prop('required', false);
|
||||
}
|
||||
});
|
||||
|
||||
$('#ragione_sociale', '#bs-popup, #bs-popup2').blur(function(){
|
||||
if ($('#ragione_sociale', '#bs-popup, #bs-popup2').val() == '' ){
|
||||
$('#nome, #cognome', '#bs-popup, #bs-popup2').prop('disabled', false).prop('required', true);
|
||||
$('#nome_, #cognome', '#bs-popup, #bs-popup2').prop('disabled', false).prop('required', true);
|
||||
$('#ragione_sociale', '#bs-popup, #bs-popup2').prop('disabled', true).prop('required', false);
|
||||
}else{
|
||||
$('#nome, #cognome', '#bs-popup, #bs-popup2').prop('disabled', true).prop('required', false);
|
||||
$('#nome_, #cognome', '#bs-popup, #bs-popup2').prop('disabled', true).prop('required', false);
|
||||
$('#ragione_sociale', '#bs-popup, #bs-popup2').prop('disabled', false).prop('required', true);
|
||||
}
|
||||
});
|
||||
|
@ -104,7 +104,7 @@ if (!$cliente) {
|
||||
$help_codice_destinatario .= '<b>'.tr("Non è necessario comunicare il proprio codice destinatario ai fornitori in quanto è sufficiente che questo sia registrato nel portale del Sistema Di Interscambio dell'Agenzia Entrate (SDI)").'.</b>';
|
||||
}
|
||||
?>
|
||||
{[ "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'); ?>" ]}
|
||||
{[ "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 ($record['tipo'] == 'Privato') ? 'disabled' : ''; ?>", "help": "<?php echo tr($help_codice_destinatario); ?>", "readonly": "<?php echo intval($anagrafica->sedeLegale->nazione->iso2 != 'IT'); ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
|
@ -203,7 +203,7 @@ class Anagrafica extends Model
|
||||
|
||||
public function setCodiceDestinatarioAttribute($value)
|
||||
{
|
||||
if (empty($this->tipo) || $this->tipo == 'Privato' || in_array($value, ['999999', '0000000']) || $this->sedeLegale->nazione->iso2 != 'IT') {
|
||||
if ($this->tipo == 'Privato' || in_array($value, ['999999', '0000000']) || $this->sedeLegale->nazione->iso2 != 'IT') {
|
||||
$codice_destinatario = '';
|
||||
} else {
|
||||
$codice_destinatario = $value;
|
||||
|
@ -6,24 +6,34 @@ $backup_dir = Backup::getDirectory();
|
||||
|
||||
switch (filter('op')) {
|
||||
case 'getfile':
|
||||
$file = filter('file');
|
||||
$number = filter('number');
|
||||
$number = intval($number);
|
||||
|
||||
download($backup_dir.'/'.$file, $file);
|
||||
$backups = Backup::getList();
|
||||
$backup = $backups[$number];
|
||||
$filename = basename($backup);
|
||||
|
||||
download($backup, $filename);
|
||||
|
||||
break;
|
||||
|
||||
case 'del':
|
||||
$file = filter('file');
|
||||
$number = filter('number');
|
||||
$number = intval($number);
|
||||
|
||||
delete($backup_dir.'/'.$file);
|
||||
$backups = Backup::getList();
|
||||
$backup = $backups[$number];
|
||||
$filename = basename($backup);
|
||||
|
||||
if (!file_exists($backup_dir.'/'.$file)) {
|
||||
delete($backup);
|
||||
|
||||
if (!file_exists($backup)) {
|
||||
flash()->info(tr('Backup _FILE_ eliminato!', [
|
||||
'_FILE_' => '"'.$file.'"',
|
||||
'_FILE_' => '"'.$filename.'"',
|
||||
]));
|
||||
} else {
|
||||
flash()->error(tr("Errore durante l'eliminazione del backup _FILE_!", [
|
||||
'_FILE_' => '"'.$file.'"',
|
||||
'_FILE_' => '"'.$filename.'"',
|
||||
]));
|
||||
}
|
||||
|
||||
@ -39,9 +49,14 @@ switch (filter('op')) {
|
||||
break;
|
||||
|
||||
case 'size':
|
||||
$file = filter('file');
|
||||
$number = filter('number');
|
||||
$number = intval($number);
|
||||
|
||||
echo Util\FileSystem::size($backup_dir.'/'.$file);
|
||||
$backups = Backup::getList();
|
||||
$backup = $backups[$number];
|
||||
$filename = basename($backup);
|
||||
|
||||
echo Util\FileSystem::size($backup);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -55,13 +70,17 @@ if (filter('op') == 'restore') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (post('folder') == null) {
|
||||
$path = $_FILES['blob']['tmp_name'] ?: $backup_dir.'/'.post('zip');
|
||||
if (filter('number') == null) {
|
||||
$path = $_FILES['blob']['tmp_name'];
|
||||
} else {
|
||||
$path = $backup_dir.'/'.post('folder');
|
||||
$number = filter('number');
|
||||
$number = intval($number);
|
||||
|
||||
$backups = Backup::getList();
|
||||
$path = $backups[$number];
|
||||
}
|
||||
|
||||
Backup::restore($path, post('folder') == null);
|
||||
Backup::restore($path, is_file($path));
|
||||
|
||||
flash()->info(tr('Backup ripristinato correttamente!'));
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ function backup(){
|
||||
}
|
||||
|
||||
// Caricamento
|
||||
function loadSize(name, id){
|
||||
function loadSize(number, id){
|
||||
$("#" + id).html("'.tr('Calcolo in corso').'...");
|
||||
|
||||
$.ajax({
|
||||
@ -83,7 +83,7 @@ function loadSize(name, id){
|
||||
data: {
|
||||
id_module: globals.id_module,
|
||||
op: "size",
|
||||
file: name,
|
||||
number: number,
|
||||
},
|
||||
success: function(data) {
|
||||
$("#" + id).html(data);
|
||||
@ -127,7 +127,7 @@ echo '
|
||||
<form action="" method="post" enctype="multipart/form-data" id="restore">
|
||||
<input type="hidden" name="op" value="restore">
|
||||
|
||||
<label><input type="file" name="blob" id="blob"></label>
|
||||
{[ "type": "file", "name": "blob", "required": 1, "accept": ".zip" ]}
|
||||
|
||||
<button type="button" class="btn btn-primary pull-right" onclick="restore()">
|
||||
<i class="fa fa-upload"></i> '.tr('Ripristina').'...
|
||||
@ -143,11 +143,11 @@ if (file_exists($backup_dir)) {
|
||||
$backups_zip = [];
|
||||
$backups_file = [];
|
||||
|
||||
foreach ($backups as $backup) {
|
||||
foreach ($backups as $key => $backup) {
|
||||
if (ends_with($backup, '.zip')) {
|
||||
$backups_zip[] = $backup;
|
||||
$backups_zip[$key] = $backup;
|
||||
} else {
|
||||
$backups_file[] = $backup;
|
||||
$backups_file[$key] = $backup;
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,17 +183,17 @@ if (file_exists($backup_dir)) {
|
||||
</small></p>
|
||||
|
||||
<script>
|
||||
loadSize("'.$name.'", "c-'.$id.'");
|
||||
loadSize("'.$id.'", "c-'.$id.'");
|
||||
</script>
|
||||
|
||||
<a class="btn btn-primary" href="'.$rootdir.'/modules/backups/actions.php?op=getfile&file='.$name.'" target="_blank"><i class="fa fa-download"></i> '.tr('Scarica').'</a>
|
||||
<a class="btn btn-primary" href="'.$rootdir.'/modules/backups/actions.php?op=getfile&number='.$id.'" target="_blank"><i class="fa fa-download"></i> '.tr('Scarica').'</a>
|
||||
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-warning ask" data-backto="record-edit" data-method="post" data-op="restore" data-zip="'.$name.'" data-msg="'.tr('Vuoi ripristinare questo backup?').'" data-button="Ripristina" data-class="btn btn-lg btn-warning">
|
||||
<a class="btn btn-warning ask" data-backto="record-edit" data-method="post" data-op="restore" data-number="'.$id.'" data-msg="'.tr('Vuoi ripristinare questo backup?').'" data-button="Ripristina" data-class="btn btn-lg btn-warning">
|
||||
<i class="fa fa-upload"></i>
|
||||
</a>
|
||||
|
||||
<a class="btn btn-danger ask" title="'.tr('Elimina backup').'" data-backto="record-list" data-op="del" data-file="'.$name.'">
|
||||
<a class="btn btn-danger ask" title="'.tr('Elimina backup').'" data-backto="record-list" data-op="del" data-number="'.$id.'">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
</div>
|
||||
@ -233,17 +233,17 @@ if (file_exists($backup_dir)) {
|
||||
</small></p>
|
||||
|
||||
<script>
|
||||
loadSize("'.$name.'", "n-'.$id.'");
|
||||
loadSize("'.$id.'", "n-'.$id.'");
|
||||
</script>
|
||||
|
||||
<a class="btn btn-sm btn-warning disabled" href="javascript:;"><i class="fa fa-times"></i> '.tr('Non scaricabile').'</a>
|
||||
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-warning ask" data-backto="record-edit" data-method="post" data-op="restore" data-folder="'.$name.'" data-msg="'.tr('Vuoi ripristinare questo backup?').'" data-button="Ripristina" data-class="btn btn-lg btn-warning">
|
||||
<a class="btn btn-warning ask" data-backto="record-edit" data-method="post" data-op="restore" data-number="'.$id.'" data-msg="'.tr('Vuoi ripristinare questo backup?').'" data-button="Ripristina" data-class="btn btn-lg btn-warning">
|
||||
<i class="fa fa-upload"></i>
|
||||
</a>
|
||||
|
||||
<a class="btn btn-danger ask" title="'.tr('Elimina backup').'" data-backto="record-list" data-op="del" data-file="'.$name.'">
|
||||
<a class="btn btn-danger ask" title="'.tr('Elimina backup').'" data-backto="record-list" data-op="del" data-number="'.$id.'">
|
||||
<i class="fa fa-trash"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -18,7 +18,7 @@ switch ($resource) {
|
||||
}
|
||||
|
||||
if (!empty($search)) {
|
||||
$search_fields[] = 'nome LIKE '.prepare('%'.$search.'%');
|
||||
$search_fields[] = 'co_contratti.nome LIKE '.prepare('%'.$search.'%');
|
||||
}
|
||||
|
||||
$custom['totale'] = 'totale';
|
||||
|
@ -2,15 +2,28 @@
|
||||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
$rs = $dbo->fetchArray('SELECT *, ( (SELECT SUM(co_righe_contratti.qta) FROM co_righe_contratti WHERE co_righe_contratti.um=\'ore\' AND co_righe_contratti.idcontratto=co_contratti.id) - IFNULL( (SELECT SUM(in_interventi_tecnici.ore) FROM in_interventi_tecnici INNER JOIN in_interventi ON in_interventi_tecnici.idintervento=in_interventi.id WHERE in_interventi.id_contratto=co_contratti.id AND in_interventi.idstatointervento IN (SELECT in_statiintervento.idstatointervento FROM in_statiintervento WHERE in_statiintervento.completato = 1)), 0) ) AS ore, DATEDIFF( data_conclusione, NOW() ) AS giorni_rimanenti, (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica=co_contratti.idanagrafica) AS ragione_sociale FROM co_contratti WHERE idstato IN(SELECT id FROM co_staticontratti WHERE is_fatturabile = 1) AND rinnovabile=1 AND ( ( (SELECT SUM(co_righe_contratti.qta) FROM co_righe_contratti WHERE co_righe_contratti.um=\'ore\' AND co_righe_contratti.idcontratto=co_contratti.id) - IFNULL( (SELECT SUM(in_interventi_tecnici.ore) FROM in_interventi_tecnici INNER JOIN in_interventi ON in_interventi_tecnici.idintervento=in_interventi.id WHERE in_interventi.id_contratto=co_contratti.id AND in_interventi.idstatointervento IN (SELECT in_statiintervento.idstatointervento FROM in_statiintervento WHERE in_statiintervento.completato = 1)), 0) ) < co_contratti.ore_preavviso_rinnovo OR NOW() > DATE_ADD( data_conclusione, INTERVAL - ABS(giorni_preavviso_rinnovo) DAY) ) AND YEAR(data_conclusione) > 1970 HAVING ISNULL((SELECT id FROM co_contratti contratti WHERE contratti.idcontratto_prev=co_contratti.id )) ORDER BY giorni_rimanenti ASC');
|
||||
$rs = $dbo->fetchArray('SELECT *,
|
||||
((SELECT SUM(co_righe_contratti.qta) FROM co_righe_contratti WHERE co_righe_contratti.um=\'ore\' AND co_righe_contratti.idcontratto=co_contratti.id) - IFNULL( (SELECT SUM(in_interventi_tecnici.ore) FROM in_interventi_tecnici INNER JOIN in_interventi ON in_interventi_tecnici.idintervento=in_interventi.id WHERE in_interventi.id_contratto=co_contratti.id AND in_interventi.idstatointervento IN (SELECT in_statiintervento.idstatointervento FROM in_statiintervento WHERE in_statiintervento.completato = 1)), 0) ) AS ore_rimanenti,
|
||||
DATEDIFF(data_conclusione, NOW()) AS giorni_rimanenti,
|
||||
data_conclusione,
|
||||
ore_preavviso_rinnovo,
|
||||
giorni_preavviso_rinnovo,
|
||||
(SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica=co_contratti.idanagrafica) AS ragione_sociale
|
||||
FROM co_contratti WHERE
|
||||
idstato IN (SELECT id FROM co_staticontratti WHERE is_fatturabile = 1) AND
|
||||
rinnovabile = 1 AND
|
||||
YEAR(data_conclusione) > 1970 AND
|
||||
(SELECT id FROM co_contratti contratti WHERE contratti.idcontratto_prev = co_contratti.id) IS NULL
|
||||
HAVING (ore_rimanenti < ore_preavviso_rinnovo OR DATEDIFF(data_conclusione, NOW()) < ABS(giorni_preavviso_rinnovo))
|
||||
ORDER BY giorni_rimanenti ASC, ore_rimanenti ASC');
|
||||
|
||||
if (!empty($rs)) {
|
||||
echo '
|
||||
<table class="table table-hover">
|
||||
<tr>
|
||||
<th width="50%">'.tr('Contratto').'</th>
|
||||
<th width="15%">'.tr('Data inizio').'</th>
|
||||
<th width="15%">'.tr('Data conclusione').'</th>
|
||||
<th width="15%" class="text-center">'.tr('Data inizio').'</th>
|
||||
<th width="15%" class="text-center">'.tr('Data conclusione').'</th>
|
||||
<th width="20%">'.tr('Rinnovo').'</th>
|
||||
</tr>';
|
||||
|
||||
@ -22,13 +35,18 @@ if (!empty($rs)) {
|
||||
// Se scaduto, segna la riga in rosso
|
||||
$class = (strtotime($r['data_conclusione']) < strtotime(date('Y-m-d')) && !empty($data_conclusione)) ? 'danger' : '';
|
||||
|
||||
if ($class != 'danger') {
|
||||
if (isset($r['ore_rimanenti'])) {
|
||||
// Se ore finite, segna la riga in rosso
|
||||
$class = ($r['ore'] < 1 && !empty($r['ore'])) ? 'danger' : '';
|
||||
if ($class != 'danger') {
|
||||
$class = ($r['ore_rimanenti'] < 0) ? 'warning' : '';
|
||||
}
|
||||
|
||||
$ore_rimanenti = ($r['ore_rimanenti'] >= 0) ? tr('ore rimanenti: _NUM_') : tr('ore in aggiunta: _NUM_');
|
||||
$ore_rimanenti = str_replace('_NUM_', abs($r['ore_rimanenti']), $ore_rimanenti);
|
||||
}
|
||||
|
||||
$scadenza = ($r['giorni_rimanenti'] > 0) ? tr('scade fra _DAYS_ giorni') : tr('scaduto da _DAYS_ giorni');
|
||||
$scadenza = str_replace('_DAYS_', $r['giorni_rimanenti'], $scadenza);
|
||||
$scadenza = ($r['giorni_rimanenti'] > 0) ? tr('scade tra _DAYS_ giorni') : tr('scaduto da _DAYS_ giorni');
|
||||
$scadenza = str_replace('_DAYS_', abs($r['giorni_rimanenti']), $scadenza);
|
||||
|
||||
echo '
|
||||
<tr class="'.$class.'">
|
||||
@ -38,7 +56,7 @@ if (!empty($rs)) {
|
||||
</td>
|
||||
<td class="text-center">'.$data_accettazione.'</td>
|
||||
<td class="text-center">'.$data_conclusione.'</td>
|
||||
<td class="text-center">'.$scadenza.'</td>
|
||||
<td>'.$scadenza.(isset($r['ore_rimanenti']) ? ' ('.$ore_rimanenti.')' : '').'</td>
|
||||
</tr>';
|
||||
}
|
||||
echo '
|
||||
|
@ -317,7 +317,7 @@ if (!empty($rsp)) {
|
||||
$rsp_old = $dbo->fetchNum($qp_old);
|
||||
|
||||
if ($rsp_old > 0) {
|
||||
echo '<div class="alert alert-warning alert-dismissible" role="alert"><i class="fa fa-exclamation-triangle"></i><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> '.tr('Ci sono '.$rsp_old.' interventi scaduti da pianificare.').'</div>';
|
||||
echo '<div class="alert alert-warning alert-dismissible text-sm" role="alert"><i class="fa fa-exclamation-triangle"></i><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> '.tr('Ci sono '.$rsp_old.' attività scadute.').'</div>';
|
||||
}
|
||||
|
||||
$mesi = months();
|
||||
@ -457,7 +457,7 @@ if ($vista == 'mese') {
|
||||
|
||||
$(this).parent().parent().find('li input[type=checkbox]').each(function(i) { // loop through each checkbox
|
||||
this.checked = true;
|
||||
$.when (session_set_array( 'dashboard,idzone', this.value, 0 )).promise().then(function() {
|
||||
$.when (session_set_array( 'dashboard,idzone', this.value, 0 )).promise().then(function() {
|
||||
$('#calendar').fullCalendar('refetchEvents');
|
||||
});
|
||||
|
||||
@ -473,7 +473,7 @@ if ($vista == 'mese') {
|
||||
|
||||
$(this).parent().parent().find('li input[type=checkbox]').each(function() { // loop through each checkbox
|
||||
this.checked = false;
|
||||
$.when (session_set_array( 'dashboard,idstatiintervento', this.value, 1 )).promise().then(function() {
|
||||
$.when (session_set_array( 'dashboard,idstatiintervento', this.value, 1 )).promise().then(function() {
|
||||
$('#calendar').fullCalendar('refetchEvents');
|
||||
});
|
||||
|
||||
@ -487,7 +487,7 @@ if ($vista == 'mese') {
|
||||
|
||||
$(this).parent().parent().find('li input[type=checkbox]').each(function() { // loop through each checkbox
|
||||
this.checked = false;
|
||||
$.when (session_set_array( 'dashboard,idtipiintervento', this.value, 1 )).promise().then(function() {
|
||||
$.when (session_set_array( 'dashboard,idtipiintervento', this.value, 1 )).promise().then(function() {
|
||||
$('#calendar').fullCalendar('refetchEvents');
|
||||
});
|
||||
|
||||
@ -502,7 +502,7 @@ if ($vista == 'mese') {
|
||||
|
||||
$(this).parent().parent().find('li input[type=checkbox]').each(function() { // loop through each checkbox
|
||||
this.checked = false;
|
||||
$.when (session_set_array( 'dashboard,idtecnici', this.value, 1 )).promise().then(function() {
|
||||
$.when (session_set_array( 'dashboard,idtecnici', this.value, 1 )).promise().then(function() {
|
||||
$('#calendar').fullCalendar('refetchEvents');
|
||||
});
|
||||
|
||||
|
@ -6,6 +6,7 @@ include_once __DIR__.'/../../core.php';
|
||||
|
||||
// Info contratto
|
||||
$documento = DDT::find($id_record);
|
||||
$dir = $documento->direzione;
|
||||
|
||||
// Impostazioni per la gestione
|
||||
$options = [
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$block_edit = !empty($note_accredito) || $record['stato'] == 'Emessa';
|
||||
$block_edit = !empty($note_accredito) || $record['stato'] == 'Emessa' || $record['stato'] == 'Pagato' || $record['stato'] == 'Parzialmente pagato';
|
||||
|
||||
$rs = $dbo->fetchArray('SELECT co_tipidocumento.descrizione, dir FROM co_tipidocumento INNER JOIN co_documenti ON co_tipidocumento.id=co_documenti.idtipodocumento WHERE co_documenti.id='.prepare($id_record));
|
||||
$dir = $rs[0]['dir'];
|
||||
@ -461,7 +461,7 @@ if ($tipodoc == 'Fattura accompagnatoria di vendita') {
|
||||
<div class="col-md-12">
|
||||
<div class="pull-left">
|
||||
<?php
|
||||
if ($record['stato'] != 'Pagato' && $record['stato'] != 'Emessa') {
|
||||
if (!$block_edit) {
|
||||
if (empty($record['ref_documento'])) {
|
||||
if ($dir == 'entrata') {
|
||||
// Lettura interventi non rifiutati, non fatturati e non collegati a preventivi o contratti
|
||||
|
@ -5,13 +5,15 @@ use Modules\Fatture\Fattura;
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$documento = Fattura::find($id_record);
|
||||
$dir = $documento->direzione;
|
||||
|
||||
// Impostazioni per la gestione
|
||||
$options = [
|
||||
'op' => 'manage_riga',
|
||||
'action' => 'add',
|
||||
'dir' => $documento->direzione,
|
||||
'conti' => $documento->direzione == 'entrata' ? 'conti-vendite' : 'conti-acquisti', 'idanagrafica' => $documento['idanagrafica'],
|
||||
'conti' => $documento->direzione == 'entrata' ? 'conti-vendite' : 'conti-acquisti',
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'show-ritenuta-contributi' => !empty($documento['id_ritenuta_contributi']),
|
||||
'imponibile_scontato' => $documento->imponibile_scontato,
|
||||
'totale' => $documento->totale,
|
||||
@ -36,7 +38,7 @@ $result = [
|
||||
];
|
||||
|
||||
// Leggo l'iva predefinita per l'anagrafica e se non c'è leggo quella predefinita generica
|
||||
$iva = $dbo->fetchArray('SELECT idiva_'.($dir == 'uscita' ? 'acquisti' : 'vendite').' AS idiva FROM an_anagrafiche WHERE idanagrafica='.prepare($idanagrafica));
|
||||
$iva = $dbo->fetchArray('SELECT idiva_'.($dir == 'uscita' ? 'acquisti' : 'vendite').' AS idiva FROM an_anagrafiche WHERE idanagrafica='.prepare($documento['idanagrafica']));
|
||||
$result['idiva'] = $iva[0]['idiva'] ?: setting('Iva predefinita');
|
||||
|
||||
// Aggiunta sconto di default da listino per le vendite
|
||||
@ -49,7 +51,7 @@ if ($listino[0]['prc_guadagno'] > 0) {
|
||||
|
||||
// Leggo la ritenuta d'acconto predefinita per l'anagrafica e se non c'è leggo quella predefinita generica
|
||||
// id_ritenuta_acconto_vendite oppure id_ritenuta_acconto_acquisti
|
||||
$ritenuta_acconto = $dbo->fetchOne('SELECT id_ritenuta_acconto_'.($dir == 'uscita' ? 'acquisti' : 'vendite').' AS id_ritenuta_acconto FROM an_anagrafiche WHERE idanagrafica='.prepare($idanagrafica));
|
||||
$ritenuta_acconto = $dbo->fetchOne('SELECT id_ritenuta_acconto_'.($dir == 'uscita' ? 'acquisti' : 'vendite').' AS id_ritenuta_acconto FROM an_anagrafiche WHERE idanagrafica='.prepare($documento['idanagrafica']));
|
||||
$id_ritenuta_acconto = $ritenuta_acconto['id_ritenuta_acconto'];
|
||||
if ($dir == 'entrata' && empty($id_ritenuta_acconto)) {
|
||||
$id_ritenuta_acconto = setting("Percentuale ritenuta d'acconto");
|
||||
|
@ -35,7 +35,6 @@ switch ($resource) {
|
||||
}
|
||||
|
||||
$results['results'] = $data;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -18,7 +18,7 @@ foreach ($imports as $key => $value) {
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "file", "label": "<?php echo tr('File'); ?>", "name": "blob", "required": 1, "extra": "accept=\".csv\"" ]}
|
||||
{[ "type": "file", "label": "<?php echo tr('File'); ?>", "name": "blob", "required": 1, "accept": ".csv" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
@ -188,7 +188,6 @@ switch (post('op')) {
|
||||
aggiorna_sedi_movimenti('interventi', $id_record);
|
||||
break;
|
||||
|
||||
|
||||
// Eliminazione intervento
|
||||
case 'delete':
|
||||
// Elimino anche eventuali file caricati
|
||||
|
@ -20,13 +20,16 @@ foreach ($fields as $name => $value) {
|
||||
$query .= ', '.$value." AS '".str_replace("'", "\'", $name)."'";
|
||||
}
|
||||
|
||||
$query .= ' FROM in_interventi WHERE idanagrafica IN('.implode(',', $idanagrafiche).') ';
|
||||
$query .= ' FROM in_interventi ';
|
||||
|
||||
$where = [];
|
||||
foreach ($fields as $name => $value) {
|
||||
$query .= ' OR '.$value.' LIKE "%'.$term.'%"';
|
||||
$where[] = $value.' LIKE "%'.$term.'%"';
|
||||
}
|
||||
|
||||
$query .= Modules::getAdditionalsQuery('Interventi');
|
||||
$query .= ' WHERE ('.implode(' OR ', $where).') ';
|
||||
|
||||
$query .= ' '.Modules::getAdditionalsQuery('Interventi');
|
||||
|
||||
$rs = $dbo->fetchArray($query);
|
||||
|
||||
|
@ -6,6 +6,7 @@ include_once __DIR__.'/../../core.php';
|
||||
|
||||
// Info contratto
|
||||
$documento = Ordine::find($id_record);
|
||||
$dir = $documento->direzione;
|
||||
|
||||
// Impostazioni per la gestione
|
||||
$options = [
|
||||
|
@ -57,16 +57,16 @@ for ($x = 0; $x < $n1; ++$x) {
|
||||
for ($z = 0; $z < $n3; ++$z) {
|
||||
$totale_conto_liv3 = [];
|
||||
|
||||
echo " <tr><td>\n";
|
||||
|
||||
// Se il conto non ha documenti collegati posso eliminarlo
|
||||
$query = "SELECT id FROM co_movimenti WHERE idconto='".$rs3[$z]['id']."'";
|
||||
$nr = $dbo->fetchNum($query);
|
||||
|
||||
// Calcolo totale conto da elenco movimenti di questo conto
|
||||
$query = "SELECT co_movimenti.*, dir FROM (co_movimenti LEFT OUTER JOIN co_documenti ON co_movimenti.iddocumento=co_documenti.id) LEFT OUTER JOIN co_tipidocumento ON co_documenti.idtipodocumento=co_tipidocumento.id WHERE co_movimenti.idconto='".$rs3[$z]['id']."' AND co_movimenti.data >= '".$_SESSION['period_start']."' AND co_movimenti.data <= '".$_SESSION['period_end']."' ORDER BY co_movimenti.data ASC";
|
||||
$query = "SELECT co_movimenti.*, dir FROM (co_movimenti LEFT OUTER JOIN co_documenti ON co_movimenti.iddocumento=co_documenti.id) LEFT OUTER JOIN co_tipidocumento ON co_documenti.idtipodocumento=co_tipidocumento.id WHERE co_movimenti.idconto='".$rs3[$z]['id']."' AND co_movimenti.data >= '".$_SESSION['period_start']."' AND co_movimenti.data <= '".$_SESSION['period_end']."' ORDER BY co_movimenti.data DESC";
|
||||
$rs = $dbo->fetchArray($query);
|
||||
|
||||
echo " <tr style='".((!empty($rs)) ? '':'opacity: 0.5;' )."' ><td>\n";
|
||||
|
||||
$tools = " <span class='hide tools'>\n";
|
||||
|
||||
// Stampa mastrino
|
||||
|
@ -193,10 +193,15 @@ if ($records[0]['iddocumento'] == 0) {
|
||||
<script>
|
||||
globals.cifre_decimali = 2;
|
||||
|
||||
$(document).ready( function(){
|
||||
$(document).ready(function(){
|
||||
totale_ok();
|
||||
|
||||
<?php
|
||||
if ($dir == 'uscita') {
|
||||
echo '
|
||||
$("#email-button").remove();';
|
||||
}
|
||||
|
||||
if ($record['iddocumento'] != 0) {
|
||||
?>
|
||||
$('input[name*=scadenza]').keyup( function(){ totale_ok(); } );
|
||||
|
@ -24,6 +24,6 @@ return [
|
||||
'pagamento' => $r['pagamento'],
|
||||
'totale' => Translator::numberToLocale(abs($r['totale'])),
|
||||
'data_scadenza' => Translator::dateToLocale($r['scadenza']),
|
||||
'data' => Translator::dateToLocale($r['scadenza']),
|
||||
'data' => Translator::dateToLocale($r['data']),
|
||||
'logo_azienda' => !empty($logo_azienda) ? '<img src="'.$logo_azienda.'" />' : '',
|
||||
];
|
||||
|
@ -69,7 +69,7 @@ echo '
|
||||
<div class="box-body" id="upload">
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<label><input type="file" name="blob" id="blob"></label>
|
||||
{[ "type": "file", "name": "blob", "required": 1 ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
|
@ -24,21 +24,13 @@ class InvoiceHook extends HookManager
|
||||
});
|
||||
|
||||
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
||||
$icon = 'fa fa-file-text-o';
|
||||
|
||||
if ($count > 0) {
|
||||
$message = tr('Ci sono _NUM_ fatture passive da importare', [
|
||||
'_NUM_' => $count,
|
||||
]);
|
||||
$icon_color = 'text-yellow';
|
||||
} else {
|
||||
$message = tr('Nessuna fattura passiva da importare');
|
||||
$icon_color = 'text-green';
|
||||
$link = '#';
|
||||
}
|
||||
$message = tr('Ci sono _NUM_ fatture passive da importare', [
|
||||
'_NUM_' => $count,
|
||||
]);
|
||||
|
||||
return [
|
||||
'icon' => $icon.' '.$icon_color,
|
||||
'icon' => 'fa fa-file-text-o text-yellow',
|
||||
'link' => $link,
|
||||
'message' => $message,
|
||||
'notify' => !empty($count),
|
||||
|
@ -27,6 +27,7 @@ switch ($operazione) {
|
||||
'idtipointervento' => post('idtipointervento'),
|
||||
'richiesta' => post('richiesta'),
|
||||
'idimpianti' => implode(',', post('idimpianti')),
|
||||
'idsede' => implode(',', post('idsede_c')),
|
||||
], ['id' => $id_record]);
|
||||
|
||||
flash()->info(tr('Promemoria inserito!'));
|
||||
|
@ -60,9 +60,7 @@ if (!empty($records)) {
|
||||
} elseif (empty($record['idsede'])) {
|
||||
$info_sede = tr('Sede legale');
|
||||
} else {
|
||||
$sede = $dbo->fetchOne("SELECT id, CONCAT( CONCAT_WS( ' (', CONCAT_WS(', ', nomesede, citta), indirizzo ), ')') AS descrizione FROM an_sedi WHERE id=".prepare($record['idsede']));
|
||||
|
||||
$info_sede = $sede[0]['descrizione'];
|
||||
$info_sede = $dbo->fetchOne("SELECT id, CONCAT( CONCAT_WS( ' (', CONCAT_WS(', ', nomesede, citta), indirizzo ), ')') AS descrizione FROM an_sedi WHERE id=".prepare($record['idsede']))['descrizione'];
|
||||
}
|
||||
|
||||
// Intervento svolto
|
||||
|
@ -12,9 +12,9 @@ if (!Interaction::isEnabled()) {
|
||||
}
|
||||
|
||||
echo '
|
||||
<p>'.tr('Le ricevute delle Fatture Elettroniche permettono di individuare se una determinata fattura rilasciata è stata accettata dal Sistema Di Interscambio e dal cliente relativo').'.</p>
|
||||
<p>'.tr('Le ricevute delle Fatture Elettroniche permettono di individuare se una determinata fattura tramessa è stata accettata dal Sistema Di Interscambio').'.</p>
|
||||
|
||||
<p>'.tr("Tramite il pulsante _BTN_ è possibile procedere all controllo automatico di queste ricevute, che aggiorneranno di conseguenza lo $requesto dei documenti relativi e verranno allegate ad essi", [
|
||||
<p>'.tr("Tramite il pulsante _BTN_ è possibile procedere al recupero delle ricevute, aggiornando automaticamente lo stato delle relative fatture e allegandole ad esse", [
|
||||
'_BTN_' => '<b>Ricerca</b>',
|
||||
]).'.</p>
|
||||
<br>';
|
||||
|
@ -24,21 +24,13 @@ class ReceiptHook extends HookManager
|
||||
});
|
||||
|
||||
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
||||
$icon = 'fa fa-ticket';
|
||||
|
||||
if ($count > 0) {
|
||||
$message = tr('Ci sono _NUM_ ricevute da importare', [
|
||||
'_NUM_' => $count,
|
||||
]);
|
||||
$icon_color = 'fa fa-ticket text-yellow';
|
||||
} else {
|
||||
$message = tr('Nessuna ricevuta da importare');
|
||||
$icon_color = 'fa fa-ticket text-green';
|
||||
$link = '#';
|
||||
}
|
||||
$message = tr('Ci sono _NUM_ ricevute da importare', [
|
||||
'_NUM_' => $count,
|
||||
]);
|
||||
|
||||
return [
|
||||
'icon' => $icon.' '.$icon_color,
|
||||
'icon' => 'fa fa-ticket text-yellow',
|
||||
'link' => $link,
|
||||
'message' => $message,
|
||||
'notify' => !empty($count),
|
||||
|
@ -108,10 +108,11 @@ class Ricevuta
|
||||
$fattura = $this->getFattura();
|
||||
|
||||
// Modifica lo stato solo se la fattura non è già stata consegnata (per evitare problemi da doppi invii)
|
||||
// In realtà per le PA potrebbe esserci lo stato NE (che può essere positiva o negativa) successivo alla RC
|
||||
//if ($fattura->codice_stato_fe == 'RC') {
|
||||
//return;
|
||||
//}
|
||||
// In realtà per le PA potrebbe esserci lo stato NE (che può essere positiva o negativa) successivo alla RC,
|
||||
// quindi aggiungo eccezzione nel caso il nuovo codice della ricevuta sia NE
|
||||
if ($fattura->codice_stato_fe == 'RC' AND $codice != 'NE' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Processo la ricevuta e salvo data ricezione, codice e messaggio
|
||||
$descrizione = $this->xml['Destinatario']['Descrizione'];
|
||||
|
@ -47,7 +47,7 @@ class API extends \Util\Singleton
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
if (!self::isAPIRequest() || (!Auth::check() && self::getRequest()['resource'] != 'login')) {
|
||||
if (!Auth::check() && self::getRequest()['resource'] != 'login') {
|
||||
throw new InvalidArgumentException();
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,11 @@ class ButtonManager implements ManagerInterface
|
||||
{
|
||||
$options['parameters'] = isset($options['parameters']) ? $options['parameters'] : null;
|
||||
|
||||
// Impostazione id HTML automatico
|
||||
if (empty($options['html_id'])) {
|
||||
$options['html_id'] = ($options['type'] == 'print') ? 'print-button' : 'email-button';
|
||||
}
|
||||
|
||||
if (isset($options['id'])) {
|
||||
$result = $this->link($options);
|
||||
} else {
|
||||
@ -59,13 +64,13 @@ class ButtonManager implements ManagerInterface
|
||||
// Modal
|
||||
if (isset($info['type']) && $info['type'] == 'modal') {
|
||||
$result = '
|
||||
<a '.$class.' data-href="'.$info['link'].'" data-toggle="modal" data-title="'.$title.'">';
|
||||
<a '.$class.' data-href="'.$info['link'].'" data-toggle="modal" data-title="'.$title.'" id="'.$options['html_id'].'">';
|
||||
}
|
||||
|
||||
// Link normale
|
||||
else {
|
||||
$result = '
|
||||
<a '.$class.' href="'.$info['link'].'" target="_blank">';
|
||||
<a '.$class.' href="'.$info['link'].'" target="_blank" id="'.$options['html_id'].'">';
|
||||
}
|
||||
|
||||
$result .= '
|
||||
@ -95,7 +100,7 @@ class ButtonManager implements ManagerInterface
|
||||
|
||||
if ($count > 1) {
|
||||
$result = '
|
||||
<div class="btn-group">';
|
||||
<div class="btn-group" id="'.$options['html_id'].'">';
|
||||
|
||||
$predefined = array_search(1, array_column($list, 'predefined'));
|
||||
if ($predefined !== false) {
|
||||
@ -143,6 +148,7 @@ class ButtonManager implements ManagerInterface
|
||||
'id_record' => $options['id_record'],
|
||||
'class' => $options['class'],
|
||||
'parameters' => $options['parameters'],
|
||||
'html_id' => $options['html_id'],
|
||||
]);
|
||||
} else {
|
||||
$result = ' ';
|
||||
|
@ -5,6 +5,7 @@ namespace Models;
|
||||
use Carbon\Carbon;
|
||||
use Carbon\CarbonInterval;
|
||||
use Common\Model;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Traits\StoreTrait;
|
||||
|
||||
class Hook extends Model
|
||||
@ -13,9 +14,23 @@ class Hook extends Model
|
||||
|
||||
protected $table = 'zz_hooks';
|
||||
|
||||
protected $appends = [
|
||||
'permission',
|
||||
];
|
||||
|
||||
protected $cached = null;
|
||||
protected $use_cached = null;
|
||||
|
||||
/**
|
||||
* Restituisce i permessi relativi all'account in utilizzo.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPermissionAttribute()
|
||||
{
|
||||
return $this->module->permission;
|
||||
}
|
||||
|
||||
public function getIsCachedAttribute()
|
||||
{
|
||||
if (!isset($this->use_cached)) {
|
||||
@ -81,4 +96,20 @@ class Hook extends Model
|
||||
|
||||
return $this->cached;
|
||||
}
|
||||
|
||||
/* Relazioni Eloquent */
|
||||
|
||||
public function module()
|
||||
{
|
||||
return $this->belongsTo(Module::class, 'id_module');
|
||||
}
|
||||
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::addGlobalScope('enabled', function (Builder $builder) {
|
||||
$builder->where('enabled', true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -377,6 +377,7 @@ class Update
|
||||
$previous = [];
|
||||
|
||||
$files = glob($directory.'/*.{php,sql}', GLOB_BRACE);
|
||||
natsort($files);
|
||||
foreach ($files as $file) {
|
||||
$infos = pathinfo($file);
|
||||
$version = str_replace('_', '.', $infos['filename']);
|
||||
|
@ -99,7 +99,7 @@ foreach ($interventi as $intervento) {
|
||||
|
||||
$riga_tecnici .= "</table>\n";
|
||||
|
||||
$line = '<span>Intervento <b>'.$intervento['Numero'].'</b> del <b>'.Translator::timestampToLocale($intervento['Data inizio'])."</b><br/><small style='color:#444;'>".nl2br($intervento['richiesta'])."</small></span><br/>\n";
|
||||
$line = '<span>Intervento <b>'.$intervento['Numero'].'</b> del <b>'.Translator::timestampToLocale($intervento['Data inizio'])."</b><br/><small style='color:#444;'>".nl2br($intervento['descrizione'])."</small></span><br/>\n";
|
||||
|
||||
// Se l'elenco non è di un singolo cliente stampo anche la sua ragione sociale
|
||||
if (!$singolo_cliente) {
|
||||
@ -256,7 +256,7 @@ if (sizeof($info_intervento) > 0) {
|
||||
}
|
||||
|
||||
// Conteggio articoli utilizzati
|
||||
$query = "SELECT *, (SELECT percentuale FROM co_iva WHERE id=(SELECT idiva_vendita FROM mg_articoli WHERE id=idarticolo)) AS prciva_vendita, (SELECT orario_inizio FROM in_interventi_tecnici WHERE idintervento=mg_articoli_interventi.idintervento GROUP BY idintervento HAVING idintervento=mg_articoli_interventi.idintervento) AS data_intervento, (SELECT prc_guadagno FROM mg_listini WHERE id=(SELECT idlistino_vendite FROM an_anagrafiche WHERE idanagrafica=(SELECT idanagrafica FROM in_interventi WHERE id=mg_articoli_interventi.idintervento) ) ) AS prc_guadagno, (SELECT codice FROM mg_articoli WHERE id=idarticolo) AS codice_art, CONCAT_WS(serial, 'SN: ', ', ') AS codice, SUM(qta) AS sumqta FROM `mg_articoli_interventi` JOIN mg_prodotti ON mg_articoli_interventi.idarticolo = mg_prodotti.id_articolo GROUP BY idarticolo, idintervento, lotto HAVING idintervento IN(".implode(',', $idinterventi).") AND NOT idarticolo='0' ORDER BY idarticolo ASC";
|
||||
$query = "SELECT *, (SELECT codice FROM in_interventi WHERE in_interventi.id = mg_articoli_interventi.idintervento ) AS codice, (SELECT percentuale FROM co_iva WHERE id=(SELECT idiva_vendita FROM mg_articoli WHERE id=idarticolo)) AS prciva_vendita, (SELECT orario_inizio FROM in_interventi_tecnici WHERE idintervento=mg_articoli_interventi.idintervento GROUP BY idintervento HAVING idintervento=mg_articoli_interventi.idintervento) AS data_intervento, (SELECT prc_guadagno FROM mg_listini WHERE id=(SELECT idlistino_vendite FROM an_anagrafiche WHERE idanagrafica=(SELECT idanagrafica FROM in_interventi WHERE id=mg_articoli_interventi.idintervento) ) ) AS prc_guadagno, (SELECT codice FROM mg_articoli WHERE id=idarticolo) AS codice_art, CONCAT_WS(serial, 'SN: ', ', ') AS codice, SUM(qta) AS sumqta FROM `mg_articoli_interventi` JOIN mg_prodotti ON mg_articoli_interventi.idarticolo = mg_prodotti.id_articolo GROUP BY idarticolo, idintervento, lotto HAVING idintervento IN(".implode(',', $idinterventi).") AND NOT idarticolo='0' ORDER BY idarticolo ASC";
|
||||
$rs2 = $dbo->fetchArray($query);
|
||||
if (sizeof($rs2) > 0) {
|
||||
$body .= "<table style=\"width:100%;\" class=\"table_values\" cellspacing=\"2\" cellpadding=\"5\" style=\"border-color:#aaa;\">\n";
|
||||
@ -290,7 +290,7 @@ if (sizeof($rs2) > 0) {
|
||||
$body .= '<br/><small>'.$rs2[$i]['codice']."</small>\n";
|
||||
}
|
||||
|
||||
$body .= '<br/><span><small style="color:#777;">Intervento '.$rs2[$i]['idintervento'].' del '.Translator::dateToLocale($rs2[$i]['data_intervento'])."</small></span>\n";
|
||||
$body .= '<br/><span><small style="color:#777;">Intervento '.$rs2[$i]['codice'].' del '.Translator::dateToLocale($rs2[$i]['data_intervento'])."</small></span>\n";
|
||||
$body .= "</td>\n";
|
||||
|
||||
// Quantità
|
||||
@ -326,7 +326,7 @@ if (sizeof($rs2) > 0) {
|
||||
}
|
||||
|
||||
// Conteggio spese aggiuntive
|
||||
$query = 'SELECT *, (SELECT orario_inizio FROM in_interventi_tecnici WHERE idintervento=in_righe_interventi.idintervento GROUP BY idintervento HAVING idintervento=in_righe_interventi.idintervento ORDER BY orario_inizio) AS data_intervento FROM in_righe_interventi WHERE idintervento IN('.implode(',', $idinterventi).') ORDER BY id ASC';
|
||||
$query = 'SELECT *, (SELECT codice FROM in_interventi WHERE in_interventi.id = in_righe_interventi.idintervento ) AS codice, (SELECT orario_inizio FROM in_interventi_tecnici WHERE idintervento=in_righe_interventi.idintervento GROUP BY idintervento HAVING idintervento=in_righe_interventi.idintervento ORDER BY orario_inizio) AS data_intervento FROM in_righe_interventi WHERE idintervento IN('.implode(',', $idinterventi).') ORDER BY id ASC';
|
||||
$rs2 = $dbo->fetchArray($query);
|
||||
|
||||
if (sizeof($rs2) > 0) {
|
||||
@ -359,7 +359,7 @@ if (sizeof($rs2) > 0) {
|
||||
// Articolo
|
||||
$body .= "<tr><td class='first_cell'>\n";
|
||||
$body .= '<span>'.$rs2[$i]['descrizione']."</span><br/>\n";
|
||||
$body .= '<span><small style="color:#777;">Intervento '.$rs2[$i]['idintervento'].' del '.Translator::dateToLocale($rs2[$i]['data_intervento'])."</small></span>\n";
|
||||
$body .= '<span><small style="color:#777;">Intervento '.$rs2[$i]['codice'].' del '.Translator::dateToLocale($rs2[$i]['data_intervento'])."</small></span>\n";
|
||||
$body .= "</td>\n";
|
||||
|
||||
// Quantità
|
||||
|
@ -1,5 +1,9 @@
|
||||
<?php
|
||||
include("../core.php");
|
||||
// Fix del calcolo del bollo
|
||||
$fatture = \Modules\Fatture\Fattura::all();
|
||||
foreach ($fatture as $fattura) {
|
||||
$fattura->save();
|
||||
}
|
||||
|
||||
// Spostamento automezzi su sedi
|
||||
$automezzi = $dbo->fetchArray('SELECT * FROM dt_automezzi');
|
||||
@ -60,4 +64,4 @@ foreach ($files as $key => $value) {
|
||||
$files[$key] = realpath(DOCROOT.'/'.$value);
|
||||
}
|
||||
|
||||
delete($files);
|
||||
delete($files);
|
||||
|
@ -1,3 +1,32 @@
|
||||
-- Fix colonna Totale per Fatture
|
||||
UPDATE `zz_views` SET `query` = '(SELECT SUM(subtotale - sconto + iva + rivalsainps - ritenutaacconto) FROM co_righe_documenti WHERE co_righe_documenti.iddocumento=co_documenti.id GROUP BY iddocumento) + iva_rivalsainps' WHERE `zz_views`.`id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Fatture di vendita') AND name = 'Totale';
|
||||
UPDATE `zz_views` SET `query` = '(SELECT SUM(subtotale - sconto + iva + rivalsainps - ritenutaacconto) FROM co_righe_documenti WHERE co_righe_documenti.iddocumento=co_documenti.id GROUP BY iddocumento) + iva_rivalsainps' WHERE `zz_views`.`id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Fatture di acquisto') AND name = 'Totale';
|
||||
|
||||
-- Fix widget Contratti in scadenza per mostrare i contratti con ore in esaurimento
|
||||
UPDATE `zz_widgets` SET `query` = 'SELECT COUNT(id) AS dato,
|
||||
((SELECT SUM(co_righe_contratti.qta) FROM co_righe_contratti WHERE co_righe_contratti.um=\'ore\' AND co_righe_contratti.idcontratto=co_contratti.id) - IFNULL( (SELECT SUM(in_interventi_tecnici.ore) FROM in_interventi_tecnici INNER JOIN in_interventi ON in_interventi_tecnici.idintervento=in_interventi.id WHERE in_interventi.id_contratto=co_contratti.id AND in_interventi.idstatointervento IN (SELECT in_statiintervento.idstatointervento FROM in_statiintervento WHERE in_statiintervento.completato = 1)), 0) ) AS ore_rimanenti,
|
||||
DATEDIFF(data_conclusione, NOW()) AS giorni_rimanenti,
|
||||
data_conclusione,
|
||||
ore_preavviso_rinnovo,
|
||||
giorni_preavviso_rinnovo,
|
||||
(SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica=co_contratti.idanagrafica) AS ragione_sociale
|
||||
FROM co_contratti WHERE
|
||||
idstato IN (SELECT id FROM co_staticontratti WHERE is_fatturabile = 1) AND
|
||||
rinnovabile = 1 AND
|
||||
YEAR(data_conclusione) > 1970 AND
|
||||
(SELECT id FROM co_contratti contratti WHERE contratti.idcontratto_prev = co_contratti.id) IS NULL
|
||||
HAVING (ore_rimanenti < ore_preavviso_rinnovo OR DATEDIFF(data_conclusione, NOW()) < ABS(giorni_preavviso_rinnovo))
|
||||
ORDER BY giorni_rimanenti ASC, ore_rimanenti ASC' WHERE `zz_widgets`.`name` = 'Contratti in scadenza';
|
||||
|
||||
-- Miglioramento hooks
|
||||
ALTER TABLE `zz_hooks` ADD `enabled` boolean NOT NULL DEFAULT 1, ADD `id_module` int(11) NOT NULL;
|
||||
UPDATE `zz_hooks` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Fatture di vendita') WHERE `name` = 'Ricevute';
|
||||
UPDATE `zz_hooks` SET `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Fatture di acquisto') WHERE `name` = 'Fatture';
|
||||
ALTER TABLE `zz_hooks` ADD FOREIGN KEY (`id_module`) REFERENCES `zz_modules`(`id`) ON DELETE CASCADE;
|
||||
|
||||
INSERT INTO `zz_hooks` (`id`, `name`, `class`, `frequency`, `id_module`) VALUES
|
||||
(NULL, 'Ricevute', 'Modules\\Aggiornamenti\\UpdateHook', '7 day', (SELECT `id` FROM `zz_modules` WHERE `name` = 'Aggiornamenti'));
|
||||
|
||||
--
|
||||
-- Aggiunta nuovi campi per tracciamento sedi
|
||||
--
|
||||
@ -58,4 +87,4 @@ UPDATE `mg_movimenti` SET `idsede_azienda` (SELECT `idsede_partenza` FROM `dt_dd
|
||||
|
||||
-- Aggiorno idsede_azienda e controparte per documenti
|
||||
UPDATE `mg_movimenti` SET `idsede_controparte` (SELECT `idsede_destinazione` FROM `co_documenti` WHERE `co_documenti`.`id` = `mg_movimenti`.`iddocumento`) WHERE `iddocumento`!=0;
|
||||
UPDATE `mg_movimenti` SET `idsede_azienda` (SELECT `idsede_destinazione` FROM `co_documenti` WHERE `co_documenti`.`id` = `mg_movimenti`.`iddocumento`) WHERE `iddocumento`!=0;
|
||||
UPDATE `mg_movimenti` SET `idsede_azienda` (SELECT `idsede_destinazione` FROM `co_documenti` WHERE `co_documenti`.`id` = `mg_movimenti`.`iddocumento`) WHERE `iddocumento`!=0;
|
||||
|
@ -86,8 +86,8 @@ UPDATE `zz_views` SET `query` = 'co_movimenti.idmastrino' WHERE `name` = 'id' AN
|
||||
INSERT INTO `fe_stati_documento` (`codice`, `descrizione`, `icon`) VALUES ('AT', 'Attestazione trasmissione', 'fa fa-check text-warning');
|
||||
|
||||
-- Aggiungo deleted_at per co_statipreventivi e co_staticontratti
|
||||
ALTER TABLE `co_statipreventivi` ADD `deleted_at` DATETIME NULL AFTER `updated_at`;
|
||||
ALTER TABLE `co_staticontratti` ADD `deleted_at` DATETIME NULL AFTER `updated_at`;
|
||||
ALTER TABLE `co_statipreventivi` ADD `deleted_at` DATETIME NULL;
|
||||
ALTER TABLE `co_staticontratti` ADD `deleted_at` DATETIME NULL;
|
||||
|
||||
-- Aggiunto modulo per gestire gli stati dei preventivi
|
||||
INSERT INTO `zz_modules` (`id`, `name`, `title`, `directory`, `options`, `options2`, `icon`, `version`, `compatibility`, `order`, `parent`, `default`, `enabled`) VALUES (NULL, 'Stati dei preventivi', 'Stati dei preventivi','stati_preventivo', 'SELECT |select| FROM `co_statipreventivi` WHERE 1=1 AND deleted_at IS NULL HAVING 2=2', '', 'fa fa-angle-right', '2.4.9', '2.4.9', '1', (SELECT `id` FROM `zz_modules` t WHERE t.`name` = 'Preventivi'), '1', '1');
|
||||
@ -254,7 +254,7 @@ ALTER TABLE `zz_settings` CHANGE `help` `help` varchar(255);
|
||||
UPDATE `zz_settings` SET `help` = NULL WHERE `help` = '';
|
||||
|
||||
ALTER TABLE `co_documenti` CHANGE `bollo` `bollo` decimal(12,4), CHANGE `data_stato_fe` `data_stato_fe` TIMESTAMP NULL, ADD `addebita_bollo` BOOLEAN NOT NULL DEFAULT TRUE, ADD `id_riga_bollo` int(11), ADD FOREIGN KEY (`id_riga_bollo`) REFERENCES `co_righe_documenti`(`id`) ON DELETE SET NULL;
|
||||
UPDATE `co_documenti` SET `bollo` = NULL;
|
||||
UPDATE `co_documenti` SET `bollo` = NULL WHERE `idstatodocumento` = (SELECT `id` FROM `co_statidocumento` WHERE `descrizione` = 'Bozza');
|
||||
UPDATE `co_documenti` SET `data_registrazione` = NULL WHERE `data_registrazione` = 0000-00-00;
|
||||
UPDATE `co_documenti` SET `data_registrazione` = `data` WHERE `data_registrazione` IS NULL AND idtipodocumento IN (SELECT id FROM co_tipidocumento WHERE dir = 'uscita');
|
||||
UPDATE `co_documenti` SET `data_competenza` = `data_registrazione`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user