mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-11 17:10:40 +01:00
Merge branch 'master' of https://github.com/devcode-it/openstamanager
This commit is contained in:
commit
a7d1feabf3
22
CHANGELOG.md
22
CHANGELOG.md
@ -4,7 +4,8 @@ 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.14](#2414)
|
||||
- [2.4.15 (2020-05-01)](#2415-2020-05-01)
|
||||
- [2.4.14 (2020-04-23)](#2414-2020-04-23)
|
||||
- [2.4.13 (2020-02-05)](#2413-2020-02-05)
|
||||
- [2.4.12 (2019-12-30)](#2412-2019-12-30)
|
||||
- [2.4.11 (2019-11-29)](#2411-2019-11-29)
|
||||
@ -24,7 +25,23 @@ Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://k
|
||||
- [2.2 (2016-11-10)](#22-2016-11-10)
|
||||
- [2.1 (2015-04-02)](#21-2015-04-02)
|
||||
|
||||
## 2.4.14
|
||||
## 2.4.15 (2020-05-01)
|
||||
|
||||
### Aggiunto (Added)
|
||||
- Aggiunta impostazione per abilitare la notifica di nuove pre-release oltre a release stabili
|
||||
|
||||
### Modificato (Changed)
|
||||
- Ordinamento righe documenti anche in funzione dell'ID
|
||||
- Ottimizzato oscuramento campi prezzi per i tecnici quando è attiva l'opzione di nascondere i prezzi al tecnico
|
||||
|
||||
### Fixed
|
||||
- Bugfix Dashboard su vista settimanale e giornaliera (causato dalla nuova versione di JQuery)
|
||||
- Fix importazione Fattura Elettronica
|
||||
- Fix eliminazione campi dal Modulo Viste (#794)
|
||||
- Fix permessi API sync calendario per aggiungere il filtro cliente
|
||||
- Fix esportazione dati in CSV per leggere correttamente importi con le migliaia
|
||||
|
||||
## 2.4.14 (2020-04-23)
|
||||
|
||||
### Aggiunto (Added)
|
||||
- Nuove funzionalità nell'importazione delle Fatture Elettroniche
|
||||
@ -40,6 +57,7 @@ Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://k
|
||||
- Aggiunta azione di cambiamento massivo dello stato negli **Interventi**
|
||||
- Aggiunto controllo sulla numerazione di **Fatture di acquisto** e **DDT in entrata**, con miglioramento delle informazioni per la numerazione delle **Fatture di vendita**
|
||||
- Supporto alla data di fine nella selezione dashboard (#556)
|
||||
- Aggiunta nuove aliquote e Nature IVA, e nuovi tipi documenti di Fattura Elettronica come da provvedimento Agenzia delle Entrate del 28/02/2020
|
||||
|
||||
### Modificato (Changed)
|
||||
- Revisione e aggiornamento dei plugin *Pianificazione interventi* e *Pianficazione fatturazione*
|
||||
|
@ -1,5 +1,5 @@
|
||||
<p align="center">
|
||||
<a href="http://openstamanager.com">
|
||||
<a href="https://openstamanager.com">
|
||||
<img src="https://www.openstamanager.com/wp-content/uploads/2015/04/logo_full-2.png">
|
||||
</a>
|
||||
|
||||
@ -7,11 +7,11 @@
|
||||
Il software gestionale open-source per l'assistenza tecnica e la fatturazione.
|
||||
<br>
|
||||
<br>
|
||||
<a href="http://openstamanager.com">Sito web</a>
|
||||
<a href="https://www.openstamanager.com">Sito web</a>
|
||||
·
|
||||
<a href="https://docs.openstamanager.com/">Documentazione</a>
|
||||
·
|
||||
<a href="http://openstamanager.com/forum">Forum</a>
|
||||
<a href="https://forum.openstamanager.com">Forum</a>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
|
@ -17,7 +17,7 @@ $total = Util\Query::readQuery($structure);
|
||||
// Ricerca
|
||||
$search = [];
|
||||
for ($i = 0; $i < count($columns); ++$i) {
|
||||
if (!empty($columns[$i]['search']['value'])) {
|
||||
if (!empty($columns[$i]['search']['value']) || $columns[$i]['search']['value']=='0') {
|
||||
$search[$total['fields'][$i]] = $columns[$i]['search']['value'];
|
||||
}
|
||||
}
|
||||
|
@ -9,13 +9,23 @@ function start_inputmask(element) {
|
||||
var date = dateFormatMoment(globals.date_format).toLowerCase();
|
||||
|
||||
$(element + ".date-mask").not('.bound').inputmask(date, {
|
||||
"placeholder": date
|
||||
placeholder: date
|
||||
}).addClass('bound');
|
||||
|
||||
$(element + '.email-mask').not('.bound').inputmask('Regex', {
|
||||
regex: "^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^-]+(?:\\.[a-zA-Z0-9_!#$%&'*+/=?`{|}~^-]+)*@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$",
|
||||
}).addClass('bound');
|
||||
|
||||
$(element + '.rea-mask').not('.bound').inputmask( {
|
||||
mask: "AA-999999{1,15}",
|
||||
casing: "upper",
|
||||
}).addClass('bound');
|
||||
|
||||
$(element + '.provincia-mask').not('.bound').inputmask( {
|
||||
mask: "AA",
|
||||
casing: "upper",
|
||||
}).addClass('bound');
|
||||
|
||||
$(element + '.alphanumeric-mask').not('.bound').inputmask('Regex', {
|
||||
regex: "[A-Za-z0-9#_|\/\\-.]*",
|
||||
}).addClass('bound');
|
||||
|
@ -44,4 +44,14 @@ $(document).ready(function () {
|
||||
window.dispatchEvent(new Event('resize'));
|
||||
}, 350);
|
||||
});
|
||||
|
||||
// Mostra/nasconde sidebar sx
|
||||
$(".sidebar-toggle").on("click", function(){
|
||||
if ($( "body" ).hasClass( "sidebar-collapse" )){
|
||||
session_set("settings,sidebar-collapse",0,1,0);
|
||||
}else{
|
||||
session_set("settings,sidebar-collapse",1,0,0);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -33,6 +33,7 @@
|
||||
"ext-simplexml": "*",
|
||||
"ext-xsl": "*",
|
||||
"ext-zip": "*",
|
||||
"ext-fileinfo": "*",
|
||||
"aluguest/ical-easy-reader": "^1.5",
|
||||
"danielstjules/stringy": "^3.1",
|
||||
"davidepastore/codice-fiscale": "^0.4.0",
|
||||
|
@ -51,7 +51,7 @@ gulp.task('JS', function () {
|
||||
debugging: config.debug,
|
||||
}))
|
||||
.pipe(concat('app.min.js'))
|
||||
.pipe(minifyJS())
|
||||
.pipe(minifyJS()) // Commentare per togliere la minificazione
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.js));
|
||||
|
||||
gulp.start('srcJS');
|
||||
@ -63,14 +63,14 @@ gulp.task('srcJS', function () {
|
||||
config.development + '/' + config.paths.js + '/*.js',
|
||||
])
|
||||
.pipe(concat('custom.min.js'))
|
||||
.pipe(minifyJS())
|
||||
.pipe(minifyJS()) // Commentare per togliere la minificazione
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.js));
|
||||
|
||||
gulp.src([
|
||||
config.development + '/' + config.paths.js + '/functions/*.js',
|
||||
])
|
||||
.pipe(concat('functions.min.js'))
|
||||
.pipe(minifyJS())
|
||||
.pipe(minifyJS()) // Commentare per togliere la minificazione
|
||||
.pipe(gulp.dest(config.production + '/' + config.paths.js));
|
||||
});
|
||||
|
||||
|
@ -4,6 +4,7 @@ include_once __DIR__.'/../core.php';
|
||||
|
||||
if (Auth::check()) {
|
||||
echo '
|
||||
</div>
|
||||
</div><!-- /.row -->
|
||||
</section><!-- /.content -->
|
||||
</aside><!-- /.content-wrapper -->
|
||||
|
@ -40,7 +40,7 @@ if ($module['name'] != 'Contratti' && $module['name'] != 'Preventivi') {
|
||||
$disabled = empty($result['idarticolo']);
|
||||
|
||||
echo '
|
||||
<div class="row" id="prezzi_articolo">
|
||||
<div class="row '.(!empty($options['nascondi_prezzi']) ? 'hidden' : '').'" id="prezzi_articolo">
|
||||
<div class="col-md-4 text-center">
|
||||
<button type="button" class="btn btn-sm btn-info btn-block '.($disabled ? 'disabled' : '').'" '.($disabled ? 'disabled' : '').' onclick="$(\'#prezziacquisto\').toggleClass(\'hide\'); $(\'#prezziacquisto\').load(\''.ROOTDIR."/ajax_complete.php?module=Articoli&op=getprezziacquisto&idarticolo=' + ( $('#idarticolo option:selected').val() || $('#idarticolo').val()) + '&idanagrafica=".$options['idanagrafica'].'\');">
|
||||
<i class="fa fa-search"></i> '.tr('Ultimi prezzi di acquisto').'
|
||||
|
@ -9,7 +9,7 @@ echo App::internalLoad('conti.php', $result, $options);
|
||||
// Iva
|
||||
echo '
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-4 '.(!empty($options['nascondi_prezzi']) ? 'hidden' : '').'">
|
||||
{[ "type": "select", "label": "'.tr('Iva').'", "name": "idiva", "required": 1, "value": "'.$result['idiva'].'", "ajax-source": "iva" ]}
|
||||
</div>';
|
||||
|
||||
@ -27,12 +27,7 @@ echo '
|
||||
</div>';
|
||||
|
||||
echo '
|
||||
<div class="row">';
|
||||
|
||||
// Fix per Altre spese intervento
|
||||
if ($module['name'] == 'Interventi') {
|
||||
$options['dir'] = 'entrata';
|
||||
}
|
||||
<div class="row '.(!empty($options['nascondi_prezzi']) ? 'hidden' : '').'">';
|
||||
|
||||
$width = $options['dir'] == 'entrata' ? 4 : 6;
|
||||
$label = $options['dir'] == 'entrata' ? tr('Prezzo unitario di vendita') : tr('Prezzo unitario');
|
||||
@ -56,10 +51,11 @@ if ($options['dir'] == 'entrata') {
|
||||
}
|
||||
|
||||
var guadagno = prezzo - sconto - costo_unitario;
|
||||
var margine = (((prezzo - sconto)*100)/prezzo_acquisto)-100;
|
||||
var parent = $("#costo_unitario").closest("div").parent();
|
||||
var div = parent.find("div[id*=\"errors\"]");
|
||||
|
||||
div.html("<small>'.tr('Guadagno').': " + guadagno.toLocale() + " " + globals.currency + "</small>");
|
||||
div.html("<small>'.tr('Guadagno').': " + guadagno.toLocale() + " " + globals.currency + " '.tr('Margine').': " + margine.toLocale() + " %</small>");
|
||||
if (guadagno < 0) {
|
||||
parent.addClass("has-error");
|
||||
div.addClass("text-danger").removeClass("text-success");
|
||||
|
@ -15,7 +15,9 @@ abstract class Document extends Model implements ReferenceInterface
|
||||
{
|
||||
$results = $this->mergeCollections($this->descrizioni, $this->righe, $this->articoli, $this->sconti);
|
||||
|
||||
return $results->sortBy('order');
|
||||
return $results->sortBy(function ($item) {
|
||||
return [$item->order, $item->id];
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -260,7 +260,7 @@ if (Auth::check()) {
|
||||
}
|
||||
}
|
||||
|
||||
$hide_sidebar = Auth::check() && setting('Nascondere la barra sinistra di default');
|
||||
$hide_sidebar = Auth::check() && (setting('Nascondere la barra sinistra di default') or $_SESSION['settings']['sidebar-collapse']);
|
||||
echo '
|
||||
|
||||
</head>
|
||||
@ -306,8 +306,8 @@ if (Auth::check()) {
|
||||
</a>
|
||||
|
||||
<!-- Navbar Left Menu -->
|
||||
<div class="navbar-left" class="hidden-xs">
|
||||
<ul class="nav navbar-nav" class="hidden-xs">
|
||||
<div class="navbar-left hidden-xs">
|
||||
<ul class="nav navbar-nav hidden-xs">
|
||||
<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>
|
||||
@ -339,19 +339,19 @@ if (Auth::check()) {
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><a href="#" onclick="window.print()" class="tip" 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="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="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="tip"title="'.tr('Informazioni').'">
|
||||
<li><a href="'.$rootdir.'/info.php" class="tip" title="'.tr('Informazioni').'">
|
||||
<i class="fa fa-info"></i>
|
||||
</a></li>
|
||||
|
||||
|
@ -79,7 +79,7 @@ function directory($path)
|
||||
/**
|
||||
* Copy a file, or recursively copy a folder and its contents.
|
||||
*
|
||||
* @param string $source Source path
|
||||
* @param array|string $source Source path
|
||||
* @param string $dest Destination path
|
||||
* @param array|string $ignores Paths to ingore
|
||||
*
|
||||
|
5758
locale/catalog.pot
5758
locale/catalog.pot
File diff suppressed because it is too large
Load Diff
@ -49,11 +49,13 @@ class UpdateHook extends CachedManager
|
||||
{
|
||||
$api = self::getAPI();
|
||||
|
||||
$version = ltrim($api['tag_name'], 'v');
|
||||
$current = Update::getVersion();
|
||||
if (!$api['prerelease'] or setting('Abilita canale pre-release per aggiornamenti')) {
|
||||
$version = ltrim($api['tag_name'], 'v');
|
||||
$current = Update::getVersion();
|
||||
|
||||
if (version_compare($current, $version) < 0) {
|
||||
return $version;
|
||||
if (version_compare($current, $version) < 0) {
|
||||
return $version;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -144,7 +144,7 @@ switch ($resource) {
|
||||
$where = [];
|
||||
if (empty($filter)) {
|
||||
$where[] = 'deleted_at IS NULL';
|
||||
$where[] = "an_tipianagrafiche_anagrafiche.idtipoanagrafica IN (SELECT idtipoanagrafica FROM an_tipianagrafiche WHERE descrizione = 'Cliente' OR descrizione = 'Fornitore')";
|
||||
$where[] = "an_tipianagrafiche_anagrafiche.idtipoanagrafica IN (SELECT idtipoanagrafica FROM an_tipianagrafiche WHERE descrizione = 'Cliente' OR descrizione = 'Fornitore' OR descrizione = 'Azienda')";
|
||||
}
|
||||
|
||||
if (!empty($search)) {
|
||||
|
@ -23,8 +23,13 @@ switch (post('op')) {
|
||||
}
|
||||
|
||||
if (App::debug()) {
|
||||
$operations = [
|
||||
'delete-bulk' => tr('Elimina selezionati'),
|
||||
$operations['delete-bulk'] = [
|
||||
'text' => '<span><i class="fa fa-trash"></i> '.tr('Elimina selezionati').'</span>',
|
||||
'data' => [
|
||||
'msg' => tr('Vuoi davvero eliminare le anagrafiche selezionate?'),
|
||||
'button' => tr('Procedi'),
|
||||
'class' => 'btn btn-lg btn-danger',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ if (in_array($id_cliente, $tipi_anagrafica) or in_array($id_fornitore, $tipi_ana
|
||||
|
||||
if (in_array($id_cliente, $tipi_anagrafica)) {
|
||||
echo '
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi intervento').'" data-href="add.php?id_module='.Modules::get('Interventi')['id'].'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-wrench"></i>'.tr('Nuovo intervento').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi attività').'" data-href="add.php?id_module='.Modules::get('Interventi')['id'].'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-wrench"></i>'.tr('Nuova attività').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi preventivo').'" data-href="add.php?id_module='.Modules::get('Preventivi')['id'].'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-text"></i>'.tr('Nuovo preventivo').'
|
||||
|
@ -157,7 +157,7 @@ if (!$is_cliente) {
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{[ "type": "text", "label": "<?php echo tr('Provincia'); ?>", "name": "provincia", "maxlength": 2, "class": "text-center text-uppercase", "value": "$provincia$", "extra": "onkeyup=\"this.value = this.value.toUpperCase();\"" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Provincia'); ?>", "name": "provincia", "maxlength": 2, "class": "text-center provincia-mask text-uppercase", "value": "$provincia$", "extra": "onkeyup=\"this.value = this.value.toUpperCase();\"" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
@ -354,7 +354,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
|
||||
|
||||
if (!empty($conto['numero_conto'])) {
|
||||
$piano_dei_conti_cliente = tr('_NAME_', [
|
||||
'_NAME_' => $conto['numero'].'.'.$conto['numero_conto'].' '.$conto['descrizione'],
|
||||
'_NAME_' => $conto['numero'].'.'.$conto['numero_conto'].' '.htmlentities($conto['descrizione']),
|
||||
]);
|
||||
echo Modules::link('Piano dei conti', null, null, null, 'class="pull-right"', 1, 'movimenti-'.$conto['id']);
|
||||
} else {
|
||||
@ -444,23 +444,27 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{[ "type": "text", "label": "<?php echo tr('Codice registro imprese'); ?>", "name": "codiceri", "value": "$codiceri$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "text", "label": "<?php echo tr('Numero d\'iscrizione registro imprese'); ?>", "name": "codiceri", "value": "$codiceri$", "help": "<?php echo tr('Il numero registro imprese è il numero di iscrizione attribuito dal Registro Imprese della Camera di Commercio.'); ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "text", "label": "<?php echo tr('Codice R.E.A.').'<small>('.tr('provincia-C.C.I.A.A.').')</small>'; ?>", "name": "codicerea", "value": "$codicerea$", "help": "<?php echo tr('Formato: _PATTERN_', [
|
||||
{[ "type": "text", "label": "<?php echo tr('Codice R.E.A.').' <small>('.tr('provincia-C.C.I.A.A.').')</small>'; ?>", "name": "codicerea", "value": "$codicerea$", "class": "rea-mask", "help": "<?php echo tr('Formato: _PATTERN_', [
|
||||
'_PATTERN_' => 'RM-123456',
|
||||
]); ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
<!-- campi già specificati in Codice R.E.A., da eliminare nelle prossime release -->
|
||||
<!--div class="col-md-3">
|
||||
{[ "type": "text", "label": "<?php echo tr('Num. iscr. C.C.I.A.A.'); ?>", "name": "cciaa", "value": "$cciaa$" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "text", "label": "<?php echo tr('Città iscr. C.C.I.A.A.'); ?>", "name": "cciaa_citta", "value": "$cciaa_citta$" ]}
|
||||
</div>
|
||||
</div-->
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
|
@ -10,25 +10,25 @@ unset($_SESSION['superselect']['id_categoria']);
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "<?php echo tr('Codice:'); ?>", "name": "codice", "required": 0, "value": "<?php echo htmlentities(filter('codice')) ?: ''; ?>", "help": "<?php echo tr('Se non specificato, il codice verrà calcolato automaticamente'); ?>", "validation": "codice" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Codice'); ?>", "name": "codice", "required": 0, "value": "<?php echo htmlentities(filter('codice')) ?: ''; ?>", "help": "<?php echo tr('Se non specificato, il codice verrà calcolato automaticamente'); ?>", "validation": "codice" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "<?php echo tr('Barcode:'); ?>", "name": "barcode", "required": 0, "value": "<?php echo htmlentities(filter('barcode')) ?: ''; ?>", "validation": "barcode" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Barcode'); ?>", "name": "barcode", "required": 0, "value": "<?php echo htmlentities(filter('barcode')) ?: ''; ?>", "validation": "barcode" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "text", "label": "<?php echo tr('Descrizione:'); ?>", "name": "descrizione", "required": 1, "value": "<?php echo htmlentities(filter('descrizione')) ?: ''; ?>" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Descrizione'); ?>", "name": "descrizione", "required": 1, "value": "<?php echo htmlentities(filter('descrizione')) ?: ''; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "<?php echo tr('Categoria:'); ?>", "name": "categoria", "required": 0, "ajax-source": "categorie", "icon-after": "add|<?php echo Modules::get('Categorie articoli')['id']; ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Categoria'); ?>", "name": "categoria", "required": 0, "ajax-source": "categorie", "icon-after": "add|<?php echo Modules::get('Categorie articoli')['id']; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "<?php echo tr('Sottocategoria:'); ?>", "name": "subcategoria", "id": "subcategoria_add", "ajax-source": "sottocategorie", "icon-after": "add|<?php echo Modules::get('Categorie articoli')['id']; ?>||hide" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Sottocategoria'); ?>", "name": "subcategoria", "id": "subcategoria_add", "ajax-source": "sottocategorie", "icon-after": "add|<?php echo Modules::get('Categorie articoli')['id']; ?>||hide" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -70,9 +70,9 @@ switch ($resource) {
|
||||
case 'getprezziacquisto':
|
||||
echo '<small>';
|
||||
// Ultimi 5 acquisti totali
|
||||
$documenti = $dbo->fetchArray('SELECT iddocumento AS id, "Fattura" AS tipo, "Fatture di vendita" AS modulo, (subtotale-sconto)/qta AS costo_unitario, (SELECT numero FROM co_documenti WHERE id=iddocumento) AS n_documento, (SELECT numero_esterno FROM co_documenti WHERE id=iddocumento) AS n2_documento, (SELECT data FROM co_documenti WHERE id=iddocumento) AS data_documento FROM co_righe_documenti WHERE idarticolo='.prepare($idarticolo).' AND iddocumento IN(SELECT id FROM co_documenti WHERE idtipodocumento IN(SELECT id FROM co_tipidocumento WHERE dir="uscita"))
|
||||
$documenti = $dbo->fetchArray('SELECT iddocumento AS id, "Fattura" AS tipo, "Fatture di acquisto" AS modulo, (subtotale-sconto)/qta AS costo_unitario, (SELECT numero FROM co_documenti WHERE id=iddocumento) AS n_documento, (SELECT numero_esterno FROM co_documenti WHERE id=iddocumento) AS n2_documento, (SELECT data FROM co_documenti WHERE id=iddocumento) AS data_documento FROM co_righe_documenti WHERE idarticolo='.prepare($idarticolo).' AND iddocumento IN(SELECT id FROM co_documenti WHERE idtipodocumento IN(SELECT id FROM co_tipidocumento WHERE dir="uscita"))
|
||||
UNION
|
||||
SELECT idddt AS id, "Ddt" AS tipo, "Ddt di vendita" AS modulo, (subtotale-sconto)/qta AS costo_unitario, (SELECT numero FROM dt_ddt WHERE id=idddt) AS n_documento, (SELECT numero_esterno FROM dt_ddt WHERE id=idddt) AS n2_documento, (SELECT data FROM dt_ddt WHERE id=idddt) AS data_documento FROM dt_righe_ddt WHERE idarticolo='.prepare($idarticolo).' AND idddt IN(SELECT id FROM dt_ddt WHERE idtipoddt IN(SELECT id FROM dt_tipiddt WHERE dir="uscita")) LIMIT 0,5');
|
||||
SELECT idddt AS id, "Ddt" AS tipo, "Ddt di acquisto" AS modulo, (subtotale-sconto)/qta AS costo_unitario, (SELECT numero FROM dt_ddt WHERE id=idddt) AS n_documento, (SELECT numero_esterno FROM dt_ddt WHERE id=idddt) AS n2_documento, (SELECT data FROM dt_ddt WHERE id=idddt) AS data_documento FROM dt_righe_ddt WHERE idarticolo='.prepare($idarticolo).' AND idddt IN(SELECT id FROM dt_ddt WHERE idtipoddt IN(SELECT id FROM dt_tipiddt WHERE dir="uscita")) LIMIT 0,5');
|
||||
|
||||
if (sizeof($documenti) > 0) {
|
||||
echo "<br/><table cellspacing='0' class='table-striped table-bordered' >\n";
|
||||
|
@ -6,6 +6,7 @@ $link_id = Modules::get('Articoli')['id'];
|
||||
|
||||
$fields = [
|
||||
'Codice' => 'codice',
|
||||
'Barcode' => 'barcode',
|
||||
'Descrizione' => 'descrizione',
|
||||
'Categoria' => '(SELECT nome FROM mg_categorie WHERE mg_categorie.id = mg_articoli.id_categoria)',
|
||||
'Subcategoria' => '(SELECT nome FROM mg_categorie WHERE mg_categorie.id = mg_articoli.id_sottocategoria)',
|
||||
|
@ -18,6 +18,7 @@ switch ($resource) {
|
||||
mg_articoli.idconto_acquisto,
|
||||
mg_articoli.prezzo_vendita,
|
||||
mg_articoli.prezzo_acquisto,
|
||||
mg_articoli.servizio,
|
||||
categoria.`nome` AS categoria,
|
||||
sottocategoria.`nome` AS sottocategoria,
|
||||
co_iva.descrizione AS iva_vendita,
|
||||
@ -56,6 +57,7 @@ switch ($resource) {
|
||||
categoria.`nome` AS categoria,
|
||||
sottocategoria.`nome` AS sottocategoria,
|
||||
co_iva.descrizione AS iva_vendita,
|
||||
mg_articoli.servizio,
|
||||
CONCAT(conto_vendita_categoria .numero, ".", conto_vendita_sottocategoria.numero, " ", conto_vendita_sottocategoria.descrizione) AS idconto_vendita_title,
|
||||
CONCAT(conto_acquisto_categoria .numero, ".", conto_acquisto_sottocategoria.numero, " ", conto_acquisto_sottocategoria.descrizione) AS idconto_acquisto_title
|
||||
FROM mg_articoli
|
||||
@ -179,7 +181,7 @@ switch ($resource) {
|
||||
|
||||
$results[count($results) - 1]['children'][] = [
|
||||
'id' => $r['id'],
|
||||
'text' => $r['codice'].' - '.$r['descrizione'].' ('.Translator::numberToLocale($qta).(!empty($r['um']) ? ' '.$r['um'] : '').')',
|
||||
'text' => $r['codice'].' - '.$r['descrizione'].' S = '.$r['servizio'].' ('.Translator::numberToLocale($qta).(!empty($r['um']) ? ' '.$r['um'] : '').')',
|
||||
'codice' => $r['codice'],
|
||||
'descrizione' => $r['descrizione'],
|
||||
'barcode' => $r['barcode'],
|
||||
@ -193,6 +195,7 @@ switch ($resource) {
|
||||
'idconto_acquisto_title' => $r['idconto_acquisto_title'],
|
||||
'prezzo_acquisto' => $r['prezzo_acquisto'],
|
||||
'prezzo_vendita' => $prezzo_vendita,
|
||||
'disabled' => ($r['qta'] <= 0 && !$superselect['permetti_movimento_a_zero'] && !$r['servizio'] ? true : false),
|
||||
];
|
||||
}
|
||||
|
||||
|
41
modules/articoli/bulk.php
Normal file
41
modules/articoli/bulk.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
switch (post('op')) {
|
||||
case 'delete-bulk':
|
||||
|
||||
|
||||
foreach ($id_records as $id) {
|
||||
|
||||
$elementi = $dbo->fetchArray('SELECT `co_documenti`.`id`, `co_documenti`.`data`, `co_documenti`.`numero`, `co_documenti`.`numero_esterno`, `co_tipidocumento`.`descrizione` AS tipo_documento, `co_tipidocumento`.`dir` FROM `co_documenti` JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento` WHERE `co_documenti`.`id` IN (SELECT `iddocumento` FROM `co_righe_documenti` WHERE `idarticolo` = '.prepare($id).')
|
||||
|
||||
UNION SELECT `dt_ddt`.`id`, `dt_ddt`.`data`, `dt_ddt`.`numero`, `dt_ddt`.`numero_esterno`, `dt_tipiddt`.`descrizione` AS tipo_documento, `dt_tipiddt`.`dir` FROM `dt_ddt` JOIN `dt_tipiddt` ON `dt_tipiddt`.`id` = `dt_ddt`.`idtipoddt` WHERE `dt_ddt`.`id` IN (SELECT `idddt` FROM `dt_righe_ddt` WHERE `idarticolo` = '.prepare($id).')
|
||||
|
||||
UNION SELECT `co_preventivi`.`id`, `co_preventivi`.`data_bozza`, `co_preventivi`.`numero`, 0 AS numero_esterno , "Preventivo" AS tipo_documento, 0 AS dir FROM `co_preventivi` WHERE `co_preventivi`.`id` IN (SELECT `idpreventivo` FROM `co_righe_preventivi` WHERE `idarticolo` = '.prepare($id).') ORDER BY `data`');
|
||||
|
||||
if (!empty($elementi)) {
|
||||
$dbo->query('UPDATE mg_articoli SET deleted_at = NOW() WHERE id = '.prepare($id).Modules::getAdditionalsQuery($id_module));
|
||||
}else{
|
||||
$dbo->query('DELETE FROM `mg_articoli` WHERE id = '.prepare($id).Modules::getAdditionalsQuery($id_module));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
flash()->info(tr('Articoli eliminati!'));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (App::debug()) {
|
||||
$operations['delete-bulk'] = [
|
||||
'text' => '<span><i class="fa fa-trash"></i> '.tr('Elimina selezionati').'</span>',
|
||||
'data' => [
|
||||
'msg' => tr('Vuoi davvero eliminare gli articoli selezionati?'),
|
||||
'button' => tr('Procedi'),
|
||||
'class' => 'btn btn-lg btn-danger',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
return $operations;
|
@ -17,7 +17,7 @@ $_SESSION['superselect']['id_categoria'] = $record['id_categoria'];
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{[ "type": "image", "label": "<?php echo tr('Immagine'); ?>", "name": "immagine", "class": "img-thumbnail", "value": "<?php echo $articolo->image; ?>" ]}
|
||||
{[ "type": "image", "label": "<?php echo tr('Immagine'); ?>", "name": "immagine", "class": "img-thumbnail", "value": "<?php echo $articolo->image; ?>", "accept": "image/x-png,image/gif,image/jpeg" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
|
@ -71,7 +71,7 @@ switch (filter('op')) {
|
||||
$original = filter('id_original');
|
||||
|
||||
if (isset($nome) && isset($nota) && isset($colore)) {
|
||||
if (isset($id_record)) {
|
||||
if (!empty($id_record)) {
|
||||
$dbo->query('UPDATE `mg_categorie` SET `nome`='.prepare($nome).', `nota`='.prepare($nota).', `colore`='.prepare($colore).' WHERE `id`='.prepare($id_record));
|
||||
} else {
|
||||
$dbo->query('INSERT INTO `mg_categorie` (`nome`,`nota`,`colore`, `parent`) VALUES ('.prepare($nome).', '.prepare($nota).', '.prepare($colore).', '.prepare($original).')');
|
||||
|
49
modules/contratti/actions.php
Executable file → Normal file
49
modules/contratti/actions.php
Executable file → Normal file
@ -383,5 +383,54 @@ $riga = $contratto->getRiga($type, $id_riga);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'add_preventivo':
|
||||
|
||||
$preventivo = \Modules\Preventivi\Preventivo::find(post('id_documento'));
|
||||
|
||||
// Creazione del contratto al volo
|
||||
if (post('create_document') == 'on') {
|
||||
|
||||
$contratto = Contratto::build($preventivo->anagrafica, $preventivo->nome);
|
||||
|
||||
$contratto->idpagamento = $preventivo->idpagamento;
|
||||
$contratto->idsede = $preventivo->idsede;
|
||||
|
||||
$contratto->id_documento_fe = $preventivo->id_documento_fe;
|
||||
$contratto->codice_cup = $preventivo->codice_cup;
|
||||
$contratto->codice_cig = $preventivo->codice_cig;
|
||||
$contratto->num_item = $preventivo->num_item;
|
||||
|
||||
$contratto->descrizione = $preventivo->descrizione;
|
||||
$contratto->esclusioni = $preventivo->esclusioni;
|
||||
|
||||
$contratto->save();
|
||||
|
||||
$id_record = $contratto->id;
|
||||
}
|
||||
|
||||
$parziale = false;
|
||||
$righe = $preventivo->getRighe();
|
||||
foreach ($righe as $riga) {
|
||||
if (post('evadere')[$riga->id] == 'on' and !empty(post('qta_da_evadere')[$riga->id])) {
|
||||
$qta = post('qta_da_evadere')[$riga->id];
|
||||
|
||||
$copia = $riga->copiaIn($contratto, $qta);
|
||||
|
||||
$copia->save();
|
||||
}
|
||||
|
||||
if ($riga->qta != $riga->qta_evasa) {
|
||||
$parziale = true;
|
||||
}
|
||||
}
|
||||
|
||||
ricalcola_costiagg_ordine($id_record);
|
||||
|
||||
flash()->info(tr('Preventivo _NUM_ aggiunto!', [
|
||||
'_NUM_' => $preventivo->numero,
|
||||
]));
|
||||
|
||||
break;
|
||||
}
|
||||
|
68
modules/contratti/add_preventivo.php
Normal file
68
modules/contratti/add_preventivo.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
use Modules\Contratti\Contratto;
|
||||
use Modules\Preventivi\Preventivo;
|
||||
|
||||
$documento_finale = Contratto::find($id_record);
|
||||
|
||||
$id_documento = get('id_documento');
|
||||
if (!empty($id_documento)) {
|
||||
$documento = Preventivo::find($id_documento);
|
||||
|
||||
$options = [
|
||||
'op' => 'add_preventivo',
|
||||
'type' => 'preventivo',
|
||||
'button' => tr('Aggiungi'),
|
||||
'documento' => $documento,
|
||||
'documento_finale' => $documento_finale,
|
||||
];
|
||||
|
||||
echo App::load('importa.php', [], $options, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$id_anagrafica = $documento_finale->idanagrafica;
|
||||
|
||||
$_SESSION['superselect']['idanagrafica'] = $id_anagrafica;
|
||||
|
||||
echo '
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "select", "label": "'.tr('Preventivo').'", "name": "id_documento", "ajax-source": "preventivi" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="righe_documento">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info" id="box-loading">
|
||||
<i class="fa fa-spinner fa-spin"></i> '.tr('Caricamento in corso').'...
|
||||
</div>';
|
||||
|
||||
$file = basename(__FILE__);
|
||||
echo '
|
||||
<script>$(document).ready(init)</script>
|
||||
|
||||
<script>
|
||||
var content = $("#righe_documento");
|
||||
var loader = $("#box-loading");
|
||||
|
||||
$(document).ready(function(){
|
||||
loader.hide();
|
||||
});
|
||||
|
||||
$("#id_documento").on("change", function(){
|
||||
loader.show();
|
||||
|
||||
var id = $(this).selectData() ? $(this).selectData().id : "";
|
||||
|
||||
content.html("");
|
||||
content.load("'.$structure->fileurl($file).'?id_module='.$id_module.'&id_record='.$id_record.'&id_documento=" + id, function() {
|
||||
loader.hide();
|
||||
});
|
||||
});
|
||||
</script>';
|
0
modules/contratti/crea_documento.php
Executable file → Normal file
0
modules/contratti/crea_documento.php
Executable file → Normal file
@ -7,6 +7,7 @@ $block_edit = $record['is_completato'];
|
||||
unset($_SESSION['superselect']['idsede_destinazione']);
|
||||
unset($_SESSION['superselect']['idanagrafica']);
|
||||
$_SESSION['superselect']['idanagrafica'] = $record['idanagrafica'];
|
||||
$_SESSION['superselect']['permetti_movimento_a_zero'] = true;
|
||||
|
||||
?>
|
||||
<form action="" method="post" id="edit-form">
|
||||
@ -92,7 +93,7 @@ $_SESSION['superselect']['idanagrafica'] = $record['idanagrafica'];
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "number", "label": "<?php echo tr('Validità offerta'); ?>", "name": "validita", "decimals": "0", "value": "$validita$", "icon-after": "giorni" ]}
|
||||
{[ "type": "number", "label": "<?php echo tr('Validità offerta'); ?>", "name": "validita", "decimals": "2", "value": "$validita$", "icon-after": "giorni" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
@ -100,11 +101,11 @@ $_SESSION['superselect']['idanagrafica'] = $record['idanagrafica'];
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "number", "label": "<?php echo tr('Preavviso per rinnovo'); ?>", "name": "giorni_preavviso_rinnovo", "decimals": "0", "value": "$giorni_preavviso_rinnovo$", "icon-after": "giorni", "disabled": <?php echo $record['rinnovabile'] ? 0 : 1; ?> ]}
|
||||
{[ "type": "number", "label": "<?php echo tr('Preavviso per rinnovo'); ?>", "name": "giorni_preavviso_rinnovo", "decimals": "2", "value": "$giorni_preavviso_rinnovo$", "icon-after": "giorni", "disabled": <?php echo $record['rinnovabile'] ? 0 : 1; ?> ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "number", "label": "<?php echo tr('Ore rimanenti rinnovo'); ?>", "name": "ore_preavviso_rinnovo", "decimals": "0", "value": "$ore_preavviso_rinnovo$", "icon-after": "ore", "disabled": <?php echo $record['rinnovabile'] ? 0 : 1; ?>, "help": "<?php echo tr('Ore residue nel contratto prima di visualizzare una avviso per un eventuale rinnovo anticipato.'); ?>" ]}
|
||||
{[ "type": "number", "label": "<?php echo tr('Ore rimanenti rinnovo'); ?>", "name": "ore_preavviso_rinnovo", "decimals": "2", "value": "$ore_preavviso_rinnovo$", "icon-after": "ore", "disabled": <?php echo $record['rinnovabile'] ? 0 : 1; ?>, "help": "<?php echo tr('Ore residue nel contratto prima di visualizzare una avviso per un eventuale rinnovo anticipato.'); ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -5,7 +5,8 @@ include_once __DIR__.'/../../core.php';
|
||||
echo '
|
||||
<table class="table table-striped table-hover table-condensed table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<tr>
|
||||
<th width="35" class="text-center" >'.tr('#').'</th>
|
||||
<th>'.tr('Descrizione').'</th>
|
||||
<th class="text-center tip" width="150" title="'.tr('da evadere').' / '.tr('totale').'">'.tr('Q.tà').' <i class="fa fa-question-circle-o"></i></th>
|
||||
<th class="text-center" width="150">'.tr('Prezzo unitario').'</th>
|
||||
@ -22,6 +23,12 @@ foreach ($righe as $riga) {
|
||||
echo '
|
||||
<tr data-id="'.$riga->id.'">';
|
||||
|
||||
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.(($riga->order)+1).'
|
||||
</td>';
|
||||
|
||||
// Descrizione
|
||||
$descrizione = nl2br($riga->descrizione);
|
||||
if ($riga->isArticolo()) {
|
||||
@ -140,7 +147,7 @@ $totale = abs($contratto->totale);
|
||||
// Totale totale imponibile
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@ -153,7 +160,7 @@ echo '
|
||||
if (!empty($sconto)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"> <i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@ -165,7 +172,7 @@ if (!empty($sconto)) {
|
||||
// Totale totale imponibile
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@ -178,7 +185,7 @@ if (!empty($sconto)) {
|
||||
// Totale iva
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Iva', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@ -190,7 +197,7 @@ echo '
|
||||
// Totale contratto
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Totale', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@ -230,4 +237,4 @@ $(document).ready(function(){
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
</script>';
|
@ -1,121 +0,0 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
// TODO: aggiornare con la funzione months()
|
||||
$mesi = [
|
||||
tr('Gennaio'),
|
||||
tr('Febbraio'),
|
||||
tr('Marzo'),
|
||||
tr('Aprile'),
|
||||
tr('Maggio'),
|
||||
tr('Giugno'),
|
||||
tr('Luglio'),
|
||||
tr('Agosto'),
|
||||
tr('Settembre'),
|
||||
tr('Ottobre'),
|
||||
tr('Novembre'),
|
||||
tr('Dicembre'),
|
||||
];
|
||||
|
||||
// Righe inserite
|
||||
$qp = "SELECT *, DATE_FORMAT( data_richiesta, '%m-%Y') AS mese, (SELECT descrizione FROM in_tipiintervento WHERE idtipointervento=co_promemoria.idtipointervento) AS tipointervento, (SELECT idanagrafica FROM co_contratti WHERE id=idcontratto) AS idcliente, (SELECT ragione_sociale FROM co_contratti INNER JOIN an_anagrafiche ON co_contratti.idanagrafica=an_anagrafiche.idanagrafica WHERE co_contratti.id=idcontratto) AS ragione_sociale, (SELECT CONCAT('Contratto ', numero, ' del ', DATE_FORMAT(data_bozza, '%d/%m/%Y'), ' - ', nome, ' [', (SELECT `descrizione` FROM `co_staticontratti` WHERE `co_staticontratti`.`id` = `idstato`) , ']') FROM co_contratti WHERE id = co_promemoria.idcontratto) contratto, (SELECT id FROM co_contratti WHERE id = co_promemoria.idcontratto) idcontratto FROM co_promemoria WHERE idcontratto IN ( SELECT id FROM co_contratti WHERE idstato IN(SELECT id FROM co_staticontratti WHERE is_pianificabile = 1) ) AND idintervento IS NULL ORDER BY DATE_FORMAT( data_richiesta, '%Y-%m') ASC, ragione_sociale ASC";
|
||||
$rsp = $dbo->fetchArray($qp);
|
||||
|
||||
if (!empty($rsp)) {
|
||||
// Elenco interventi da pianificare
|
||||
foreach ($rsp as $i => $r) {
|
||||
// Se cambia il mese ricreo l'intestazione della tabella
|
||||
if (!isset($rsp[$i - 1]) || $r['mese'] != $rsp[$i - 1]['mese']) {
|
||||
if ($i == 0) {
|
||||
$attr = '';
|
||||
$class = 'fa-minus-circle';
|
||||
} else {
|
||||
$attr = 'style="display:none;"';
|
||||
$class = 'fa-plus-circle';
|
||||
}
|
||||
|
||||
echo "
|
||||
<h4>
|
||||
<a class='clickable' onclick=\"if( $('#t1_".$i."').css('display') == 'none' ){ $(this).children('i').removeClass('fa-plus-circle'); $(this).children('i').addClass('fa-minus-circle'); }else{ $(this).children('i').addClass('fa-plus-circle'); $(this).children('i').removeClass('fa-minus-circle'); } $('#t1_".$i."').slideToggle();\">
|
||||
<i class='fa ".$class."'></i> ".$mesi[intval(date('m', strtotime($r['data_richiesta']))) - 1].' '.date('Y', strtotime($r['data_richiesta'])).'
|
||||
</a>
|
||||
</h4>';
|
||||
|
||||
echo '
|
||||
<div id="t1_'.$i.'" '.$attr.'>
|
||||
<table class="table table-hover table-striped datatables">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="120">'.tr('Cliente').'</th>
|
||||
<th width="250">'.tr('Contratto').'</th>
|
||||
<th width="90">'.tr('Entro').'</th>
|
||||
<th width="150">'.tr('Tipo attività').'</th>
|
||||
<th width="300">'.tr('Descrizione').'</th>
|
||||
<th width="100">'.tr('Sede').'</th>
|
||||
<th width="18"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>';
|
||||
}
|
||||
|
||||
echo '
|
||||
<tr id="int_'.$r['id'].'">
|
||||
<td><a target="_blank" >'.Modules::link(Modules::get('Anagrafiche')['id'], $r['idcliente'], $r['ragione_sociale']).'</a></td>
|
||||
<td><a target="_blank" >'.Modules::link(Modules::get('Contratti')['id'], $r['idcontratto'], $r['contratto']).'</a></td>
|
||||
<td>'.Translator::dateToLocale($r['data_richiesta']).'</td>
|
||||
<td>'.$r['tipointervento'].'</td>
|
||||
<td>'.nl2br($r['richiesta']).'</td>';
|
||||
|
||||
echo '
|
||||
<td>';
|
||||
// Sede
|
||||
if ($r['idsede'] == '-1') {
|
||||
echo '- '.('Nessuna').' -';
|
||||
} elseif (empty($r['idsede'])) {
|
||||
echo tr('Sede legale');
|
||||
} else {
|
||||
$rsp2 = $dbo->fetchArray("SELECT id, CONCAT( CONCAT_WS( ' (', CONCAT_WS(', ', nomesede, citta), indirizzo ), ')') AS descrizione FROM an_sedi WHERE id=".prepare($r['idsede']));
|
||||
|
||||
echo $rsp2[0]['descrizione'];
|
||||
}
|
||||
echo '
|
||||
</td>';
|
||||
|
||||
// Pulsanti
|
||||
echo '
|
||||
<td>';
|
||||
if (empty($r['idintervento'])) {
|
||||
echo "
|
||||
<a class=\"btn btn-primary\" title=\"Pianifica ora!\" onclick=\"launch_modal( '".tr('Pianifica intervento')."', '".$rootdir.'/add.php?id_module='.Modules::get('Interventi')['id'].'&ref=dashboard&idcontratto='.urlencode($r['idcontratto']).'&idcontratto_riga='.$r['id']."');\">
|
||||
<i class='fa fa-calendar'></i>
|
||||
</a>";
|
||||
}
|
||||
echo '
|
||||
</td>
|
||||
</tr>';
|
||||
|
||||
if (!isset($rsp[$i + 1]) || $r['mese'] != $rsp[$i + 1]['mese']) {
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '
|
||||
<p>'.tr('Non ci sono interventi da pianificare').'.</p>';
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.datatables').DataTable({
|
||||
"oLanguage": { "sUrl": "<?php echo $rootdir; ?>/assets/dist/js/i18n/datatables/<?php echo $lang; ?>.min.json" },
|
||||
"paging": false,
|
||||
"info": false
|
||||
});
|
||||
} );
|
||||
</script>
|
@ -1,111 +0,0 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
// TODO: aggiornare con la funzione months()
|
||||
$mesi = [
|
||||
tr('Gennaio'),
|
||||
tr('Febbraio'),
|
||||
tr('Marzo'),
|
||||
tr('Aprile'),
|
||||
tr('Maggio'),
|
||||
tr('Giugno'),
|
||||
tr('Luglio'),
|
||||
tr('Agosto'),
|
||||
tr('Settembre'),
|
||||
tr('Ottobre'),
|
||||
tr('Novembre'),
|
||||
tr('Dicembre'),
|
||||
];
|
||||
|
||||
// Righe inserite
|
||||
$qp = "SELECT *, DATE_FORMAT( data_scadenza, '%m-%Y') AS mese, (SELECT idanagrafica FROM co_contratti WHERE id=idcontratto) AS idcliente, (SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica=(SELECT idanagrafica FROM co_contratti WHERE id=idcontratto)) AS ragione_sociale, (SELECT matricola FROM my_impianti WHERE id=co_ordiniservizio.idimpianto) AS impianto, (SELECT nome FROM my_impianti WHERE id=co_ordiniservizio.idimpianto) AS impianto, (SELECT idsede FROM my_impianti WHERE id=co_ordiniservizio.idimpianto) AS idsede FROM co_ordiniservizio WHERE idcontratto IN( SELECT id FROM co_contratti WHERE idstato IN(SELECT id FROM co_staticontratti WHERE is_pianificabile = 1) ) AND idintervento IS NULL ORDER BY DATE_FORMAT( data_scadenza, '%m-%Y') ASC, idcliente ASC";
|
||||
$rsp = $dbo->fetchArray($qp);
|
||||
|
||||
if (!empty($rsp)) {
|
||||
// Elenco interventi da pianificare
|
||||
foreach ($rsp as $i => $r) {
|
||||
// Se cambia il mese ricreo l'intestazione della tabella
|
||||
if (!isset($rsp[$i - 1]) || $r['mese'] != $rsp[$i - 1]['mese']) {
|
||||
if ($i == 0) {
|
||||
$attr = '';
|
||||
$class = 'fa-minus-circle';
|
||||
} else {
|
||||
$attr = 'style="display:none;"';
|
||||
$class = 'fa-plus-circle';
|
||||
}
|
||||
|
||||
echo "
|
||||
<h4>
|
||||
<a class='clickable' onclick=\"if( $('#t1_".$i."').css('display') == 'none' ){ $(this).children('i').removeClass('fa-plus-circle'); $(this).children('i').addClass('fa-minus-circle'); }else{ $(this).children('i').addClass('fa-plus-circle'); $(this).children('i').removeClass('fa-minus-circle'); } $('#t1_".$i."').slideToggle();\">
|
||||
<i class='fa ".$class."'></i> ".$mesi[intval(date('m', strtotime($r['data_scadenza']))) - 1].' '.date('Y', strtotime($r['data_scadenza'])).'
|
||||
</a>
|
||||
</h4>';
|
||||
|
||||
echo '
|
||||
<div id="t1_'.$i.'" '.$attr.'>
|
||||
<table class="table table-hover table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="10%">'.tr('Entro il').'</th>
|
||||
<th width="45%">'.tr('Ragione sociale').'</th>
|
||||
<th width="20%">'.tr('Sede').'</th>
|
||||
<th width="20%">'.tr('Impianto').'</th>
|
||||
<th width="5%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>';
|
||||
}
|
||||
|
||||
echo '
|
||||
<tr id="int_'.$r['id'].'">
|
||||
<td>'.Translator::dateToLocale($r['data_scadenza']).'</td>
|
||||
<td>
|
||||
'.Modules::link('Anagrafiche', $r['idcliente'], $r['ragione_sociale']).'
|
||||
</td>';
|
||||
|
||||
echo '
|
||||
<td>';
|
||||
// Sede
|
||||
if ($r['idsede'] == '-1') {
|
||||
echo '- '.('Nessuna').' -';
|
||||
} elseif (empty($r['idsede'])) {
|
||||
echo tr('Sede legale');
|
||||
} else {
|
||||
$rsp2 = $dbo->fetchArray("SELECT id, CONCAT( CONCAT_WS( ' (', CONCAT_WS(', ', nomesede, citta), indirizzo ), ')') AS descrizione FROM an_sedi WHERE id=".prepare($r['idsede']));
|
||||
|
||||
echo $rsp2[0]['descrizione'];
|
||||
}
|
||||
echo '
|
||||
</td>';
|
||||
|
||||
echo
|
||||
'<td>
|
||||
'.Modules::link('MyImpianti', $r['idimpianto'], $r['matricola'].' - '.$r['impianto']).'
|
||||
</td>';
|
||||
|
||||
// Pulsanti
|
||||
echo '
|
||||
<td>';
|
||||
if (empty($r['idintervento'])) {
|
||||
echo "
|
||||
<a class=\"btn btn-primary\" title=\"Pianifica ora!\" onclick=\"launch_modal( 'Pianifica intervento', '".$rootdir.'/add.php?id_module='.Modules::get('Interventi')['id'].'&ref=dashboard&idcontratto='.urlencode($r['idcontratto']).'&idordineservizio='.$r['id']."');\">
|
||||
<i class='fa fa-calendar'></i>
|
||||
</a>";
|
||||
}
|
||||
echo '
|
||||
</td>
|
||||
</tr>';
|
||||
|
||||
if (!isset($rsp[$i + 1]) || $r['mese'] != $rsp[$i + 1]['mese']) {
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '
|
||||
<p>'.tr('Non ci sono ordini di servizio da pianificare').'.</p>';
|
||||
}
|
@ -85,7 +85,7 @@ switch (get('op')) {
|
||||
}
|
||||
|
||||
// Lettura dati intervento
|
||||
$query = 'SELECT *, in_interventi.codice, idstatointervento AS parent_idstato, idtipointervento AS parent_idtipo, (SELECT descrizione FROM in_statiintervento WHERE idstatointervento=parent_idstato) AS stato, (SELECT descrizione FROM in_tipiintervento WHERE idtipointervento=parent_idtipo) AS tipo, (SELECT nomesede FROM an_sedi WHERE id=idsede_destinazione) AS sede, (SELECT idzona FROM an_anagrafiche WHERE idanagrafica=in_interventi.idanagrafica) AS idzona FROM in_interventi LEFT JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica WHERE in_interventi.id='.prepare($id).' '.Modules::getAdditionalsQuery('Interventi');
|
||||
$query = 'SELECT *, in_interventi.codice, idstatointervento AS parent_idstato, in_interventi.idtipointervento AS parent_idtipo, (SELECT GROUP_CONCAT(CONCAT(matricola, " - ", nome) SEPARATOR ", ") FROM my_impianti INNER JOIN my_impianti_interventi ON my_impianti.id=my_impianti_interventi.idimpianto WHERE my_impianti_interventi.idintervento='.prepare($id).' GROUP BY my_impianti_interventi.idintervento) AS impianti, (SELECT descrizione FROM in_statiintervento WHERE idstatointervento=parent_idstato) AS stato, (SELECT descrizione FROM in_tipiintervento WHERE idtipointervento=parent_idtipo) AS tipo, (SELECT nomesede FROM an_sedi WHERE id=idsede_destinazione) AS sede, (SELECT idzona FROM an_anagrafiche WHERE idanagrafica=in_interventi.idanagrafica) AS idzona FROM in_interventi LEFT JOIN in_interventi_tecnici ON in_interventi.id =in_interventi_tecnici.idintervento LEFT JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica WHERE in_interventi.id='.prepare($id).' '.Modules::getAdditionalsQuery('Interventi');
|
||||
$rs = $dbo->fetchArray($query);
|
||||
|
||||
$desc_tipointervento = $rs[0]['tipo'];
|
||||
@ -115,6 +115,10 @@ switch (get('op')) {
|
||||
|
||||
$tooltip_text .= '<b>'.tr('Tecnici').'</b>: '.implode(', ', $tecnici).'<br/>';
|
||||
|
||||
if ($rs[0]['impianti'] != '') {
|
||||
$tooltip_text .= '<b>'.tr('Impianti').'</b>: '.$rs[0]['impianti'].'<br/>';
|
||||
}
|
||||
|
||||
if ($rs[0]['richiesta'] != '') {
|
||||
$tooltip_text .= '<b>'.tr('Richiesta').'</b>: '.nl2br($rs[0]['richiesta']).'<br/>';
|
||||
}
|
||||
@ -133,14 +137,24 @@ switch (get('op')) {
|
||||
break;
|
||||
|
||||
case 'load_intreventi':
|
||||
|
||||
$mese = $_GET['mese'];
|
||||
|
||||
// Righe inserite
|
||||
$qp = "SELECT co_promemoria.id, idcontratto, richiesta,co_contratti.nome AS nomecontratto, DATE_FORMAT( data_richiesta, '%m%Y') AS mese, data_richiesta, an_anagrafiche.ragione_sociale, 'promemoria' AS ref, (SELECT descrizione FROM in_tipiintervento WHERE idtipointervento=co_promemoria.idtipointervento) AS tipointervento FROM (co_promemoria INNER JOIN co_contratti ON co_promemoria.idcontratto=co_contratti.id) INNER JOIN an_anagrafiche ON co_contratti.idanagrafica=an_anagrafiche.idanagrafica WHERE idcontratto IN( SELECT id FROM co_contratti WHERE idstato IN(SELECT id FROM co_staticontratti WHERE is_pianificabile = 1) ) AND idintervento IS NULL
|
||||
|
||||
UNION SELECT co_ordiniservizio.id, idcontratto, '', co_contratti.nome AS nomecontratto, DATE_FORMAT( data_scadenza, '%m%Y') AS mese, data_scadenza, an_anagrafiche.ragione_sociale, 'ordine' AS ref, (SELECT descrizione FROM in_tipiintervento WHERE descrizione='Ordine di servizio') AS tipointervento FROM (co_ordiniservizio INNER JOIN co_contratti ON co_ordiniservizio.idcontratto=co_contratti.id) INNER JOIN an_anagrafiche ON co_contratti.idanagrafica=an_anagrafiche.idanagrafica WHERE idcontratto IN( SELECT id FROM co_contratti WHERE idstato IN(SELECT id FROM co_staticontratti WHERE is_pianificabile = 1) ) AND idintervento IS NULL
|
||||
|
||||
$qp = "SELECT
|
||||
co_promemoria.id,
|
||||
idcontratto,
|
||||
richiesta,co_contratti.nome AS nomecontratto,
|
||||
DATE_FORMAT( data_richiesta, '%m%Y') AS mese,
|
||||
data_richiesta,
|
||||
an_anagrafiche.ragione_sociale,
|
||||
'promemoria' AS ref,
|
||||
(SELECT descrizione FROM in_tipiintervento WHERE idtipointervento=co_promemoria.idtipointervento) AS tipointervento
|
||||
FROM co_promemoria
|
||||
INNER JOIN co_contratti ON co_promemoria.idcontratto=co_contratti.id
|
||||
INNER JOIN an_anagrafiche ON co_contratti.idanagrafica=an_anagrafiche.idanagrafica
|
||||
WHERE
|
||||
idcontratto IN(SELECT id FROM co_contratti WHERE idstato IN(SELECT id FROM co_staticontratti WHERE is_pianificabile = 1)) AND
|
||||
idintervento IS NULL
|
||||
ORDER BY data_richiesta ASC";
|
||||
|
||||
$rsp = $dbo->fetchArray($qp);
|
||||
@ -164,8 +178,9 @@ switch (get('op')) {
|
||||
echo '
|
||||
<div class="fc-event '.$class.'" data-id="'.$r['id'].'" data-idcontratto="'.$r['idcontratto'].'" data-ref="'.$r['ref'].'">'.(($r['ref'] == 'intervento') ? '<i class=\'fa fa-wrench pull-right\'></i>' : '<i class=\'fa fa-file-text-o pull-right\'></i>').'
|
||||
<b>'.$r['ragione_sociale'].'</b><br>'.Translator::dateToLocale($r['data_richiesta']).' ('.$r['tipointervento'].')<div class="request" >'.(!empty($r['richiesta']) ? ' - '.$r['richiesta'] : '').'</div>'.(!empty($r['nomecontratto']) ? '<br><b>Contratto:</b> '.$r['nomecontratto'] : '').
|
||||
(!empty($r['data_scadenza'] and $r['data_scadenza'] != '0000-00-00 00:00:00') ? '<br><small>'.tr('entro il: ').''.Translator::dateToLocale($r['data_scadenza']).'</small>' : '').'
|
||||
</div>';
|
||||
(!empty($r['data_scadenza'] and $r['data_scadenza'] != '0000-00-00 00:00:00') ? '<br><small>'.tr('entro il: ').Translator::dateToLocale($r['data_scadenza']).'</small>' : '').
|
||||
(($r['ref'] == 'intervento') ? (Modules::link('Interventi', $r['id'], '<i class="fa fa-eye"></i>', null, 'title="'.tr("Visualizza scheda").'" class="btn btn-primary btn-xs pull-right"')) : (Modules::link('Contratti', $r['idcontratto'], '<i class="fa fa-eye"></i>', null, 'title="'.tr("Visualizza scheda").'" class="btn btn-primary btn-xs pull-right"'))).
|
||||
'</div>';
|
||||
}
|
||||
} ?>
|
||||
<script type="text/javascript">
|
||||
|
@ -292,13 +292,6 @@ WHERE
|
||||
idcontratto IN (SELECT id FROM co_contratti WHERE idstato IN (SELECT id FROM co_staticontratti WHERE is_pianificabile = 1))
|
||||
AND idintervento IS NULL
|
||||
|
||||
UNION SELECT data_scadenza AS data FROM co_ordiniservizio
|
||||
INNER JOIN co_contratti ON co_ordiniservizio.idcontratto=co_contratti.id
|
||||
INNER JOIN an_anagrafiche ON co_contratti.idanagrafica=an_anagrafiche.idanagrafica
|
||||
WHERE
|
||||
idcontratto IN (SELECT id FROM co_contratti WHERE idstato IN (SELECT id FROM co_staticontratti WHERE is_pianificabile = 1))
|
||||
AND idintervento IS NULL
|
||||
|
||||
UNION SELECT IF(data_scadenza IS NULL, data_richiesta, data_scadenza) AS data FROM in_interventi
|
||||
INNER JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica
|
||||
WHERE (SELECT COUNT(*) FROM in_interventi_tecnici WHERE in_interventi_tecnici.idintervento = in_interventi.id) = 0';
|
||||
@ -323,8 +316,6 @@ if (!empty($risultati_da_programmare)) {
|
||||
// Controllo pianificazioni mesi precedenti
|
||||
$query_mesi_precenti = 'SELECT co_promemoria.id FROM co_promemoria INNER JOIN co_contratti ON co_promemoria.idcontratto=co_contratti.id WHERE idstato IN(SELECT id FROM co_staticontratti WHERE is_pianificabile = 1) AND idintervento IS NULL AND DATE_ADD(co_promemoria.data_richiesta, INTERVAL 1 DAY) <= NOW()
|
||||
|
||||
UNION SELECT co_ordiniservizio.id FROM co_ordiniservizio INNER JOIN co_contratti ON co_ordiniservizio.idcontratto=co_contratti.id WHERE idstato IN(SELECT id FROM co_staticontratti WHERE is_pianificabile = 1) AND idintervento IS NULL AND DATE_ADD(co_ordiniservizio.data_scadenza, INTERVAL 1 DAY) <= NOW()
|
||||
|
||||
UNION SELECT in_interventi.id FROM in_interventi INNER JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica WHERE (SELECT COUNT(*) FROM in_interventi_tecnici WHERE in_interventi_tecnici.idintervento = in_interventi.id) = 0 AND DATE_ADD(IF(in_interventi.data_scadenza IS NULL, in_interventi.data_richiesta, in_interventi.data_scadenza), INTERVAL 1 DAY) <= NOW()';
|
||||
$numero_mesi_precenti = $dbo->fetchNum($query_mesi_precenti);
|
||||
|
||||
@ -607,7 +598,7 @@ echo "
|
||||
?>
|
||||
lazyFetching: true,
|
||||
slotEventOverlap :false,
|
||||
selectHelper: true,
|
||||
selectHelper: false,
|
||||
eventLimit: false, // allow "more" link when too many events
|
||||
allDaySlot: false,
|
||||
loading: function(isLoading, view) {
|
||||
@ -627,9 +618,7 @@ if (Modules::getPermission('Interventi') == 'rw') {
|
||||
ora_al = moment(date).add(1, 'hours').format("HH:mm");
|
||||
|
||||
ref = $(this).data('ref');
|
||||
if (ref == 'ordine') {
|
||||
nome = 'idordineservizio';
|
||||
} else if (ref == 'promemoria') {
|
||||
if (ref == 'promemoria') {
|
||||
nome = 'idcontratto_riga';
|
||||
} else {
|
||||
nome = 'id_intervento';
|
||||
@ -651,7 +640,7 @@ if (Modules::getPermission('Interventi') == 'rw') {
|
||||
ora_dal = moment(start).format("HH:mm");
|
||||
ora_al = moment(end).format("HH:mm");
|
||||
|
||||
launch_modal('<?php echo tr('Aggiungi intervento'); ?>', globals.rootdir + '/add.php?id_module=<?php echo Modules::get('Interventi')['id']; ?>&ref=dashboard&data=' + data + '&data_fine=' + data_fine + '&orario_inizio=' + ora_dal + '&orario_fine=' + ora_al, 1);
|
||||
launch_modal('<?php echo tr('Aggiungi attività'); ?>', globals.rootdir + '/add.php?id_module=<?php echo Modules::get('Interventi')['id']; ?>&ref=dashboard&data=' + data + '&data_fine=' + data_fine + '&orario_inizio=' + ora_dal + '&orario_fine=' + ora_al, 1);
|
||||
|
||||
$('#calendar').fullCalendar('unselect');
|
||||
},
|
||||
|
@ -116,7 +116,7 @@ switch (post('op')) {
|
||||
|
||||
// Controllo sulla presenza di DDT con lo stesso numero secondario
|
||||
$direzione = $ddt->direzione;
|
||||
if ($direzione == 'uscita') {
|
||||
if ($direzione == 'uscita' and !empty($numero_esterno)) {
|
||||
$count = DDT::where('numero_esterno', $numero_esterno)
|
||||
->where('id', '!=', $id_record)
|
||||
->where('idanagrafica', '=', $id_anagrafica)
|
||||
|
@ -34,7 +34,6 @@ $id_anagrafica = !empty(get('idanagrafica')) ? get('idanagrafica') : '';
|
||||
<div class="col-md-4">
|
||||
{[ "type": "date", "label": "<?php echo tr('Data'); ?>", "name": "data", "required": 1, "value": "-now-" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "<?php echo $label; ?>", "name": "idanagrafica", "id": "idanagrafica_add", "required": 1, "value": "<?php echo $id_anagrafica; ?>", "ajax-source": "clienti_fornitori", "icon-after": "add|<?php echo Modules::get('Anagrafiche')['id']; ?>|tipoanagrafica=<?php echo $tipo_anagrafica; ?>" ]}
|
||||
</div>
|
||||
|
@ -30,7 +30,7 @@ $id_anagrafica = $documento_finale->idanagrafica;
|
||||
echo '
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "select", "label": "'.tr('Ordine').'", "name": "id_documento", "values": "query=SELECT or_ordini.id, CONCAT(IF(numero_esterno != \'\', numero_esterno, numero), \' del \', DATE_FORMAT(data, \'%d-%m-%Y\')) AS descrizione FROM or_ordini WHERE idanagrafica='.prepare($id_anagrafica).' AND idstatoordine IN (SELECT id FROM or_statiordine WHERE descrizione IN(\'Bozza\', \'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoordine=(SELECT id FROM or_tipiordine WHERE dir='.prepare($dir).' LIMIT 0,1) AND or_ordini.id IN (SELECT idordine FROM or_righe_ordini WHERE or_righe_ordini.idordine = or_ordini.id AND (qta - qta_evasa) > 0) ORDER BY data DESC, numero DESC" ]}
|
||||
{[ "type": "select", "label": "'.tr('Ordine').'", "name": "id_documento", "values": "query=SELECT or_ordini.id, CONCAT(IF(numero_esterno != \'\', numero_esterno, numero), \' del \', DATE_FORMAT(data, \'%d-%m-%Y\')) AS descrizione FROM or_ordini WHERE idanagrafica='.prepare($id_anagrafica).' AND idstatoordine IN (SELECT id FROM or_statiordine WHERE descrizione IN(\'Accettato\', \'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoordine=(SELECT id FROM or_tipiordine WHERE dir='.prepare($dir).' LIMIT 0,1) AND or_ordini.id IN (SELECT idordine FROM or_righe_ordini WHERE or_righe_ordini.idordine = or_ordini.id AND (qta - qta_evasa) > 0) ORDER BY data DESC, numero DESC" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -18,6 +18,7 @@ unset($_SESSION['superselect']['codice_modalita_pagamento_fe']);
|
||||
$_SESSION['superselect']['idanagrafica'] = $record['idanagrafica'];
|
||||
$_SESSION['superselect']['idsede_partenza'] = $record['idsede_partenza'];
|
||||
$_SESSION['superselect']['idsede_destinazione'] = $record['idsede_destinazione'];
|
||||
$_SESSION['superselect']['permetti_movimento_a_zero'] = ($dir == 'uscita' ? true : false);
|
||||
|
||||
?>
|
||||
<form action="" method="post" id="edit-form">
|
||||
@ -108,28 +109,28 @@ $_SESSION['superselect']['idsede_destinazione'] = $record['idsede_destinazione']
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<?php echo Modules::link('Anagrafiche', $record['idanagrafica'], null, null, 'class="pull-right"'); ?>
|
||||
{[ "type": "select", "label": "<?php echo ($dir == 'uscita') ? tr('Fornitore') : tr('Destinatario'); ?>", "name": "idanagrafica", "required": 1, "value": "$idanagrafica$", "ajax-source": "clienti_fornitori" ]}
|
||||
{[ "type": "select", "label": "<?php echo ($dir == 'uscita') ? tr('Mittente') : tr('Destinatario'); ?>", "name": "idanagrafica", "required": 1, "value": "$idanagrafica$", "ajax-source": "clienti_fornitori" ]}
|
||||
</div>
|
||||
|
||||
<?php
|
||||
if ($dir == 'entrata') {
|
||||
?>
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "<?php echo tr('Partenza merce'); ?>", "name": "idsede_partenza", "ajax-source": "sedi_azienda", "value": "$idsede_partenza$", "readonly": "<?php echo sizeof($articolo) ? 1 : 0; ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Partenza merce'); ?>", "name": "idsede_partenza", "ajax-source": "sedi_azienda", "value": "$idsede_partenza$", "readonly": "<?php echo sizeof($articolo) ? 1 : 0; ?>", "help": "<?php echo tr('Sedi di partenza dalla mia azienda'); ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "<?php echo tr('Destinazione merce'); ?>", "name": "idsede_destinazione", "ajax-source": "sedi", "value": "$idsede_destinazione$" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Destinazione merce'); ?>", "name": "idsede_destinazione", "ajax-source": "sedi", "value": "$idsede_destinazione$", "help": "<?php echo tr('Sedi del destinatario'); ?>" ]}
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "<?php echo tr('Partenza merce'); ?>", "name": "idsede_partenza", "ajax-source": "sedi", "value": "$idsede_partenza$" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Partenza merce'); ?>", "name": "idsede_partenza", "ajax-source": "sedi", "value": "$idsede_partenza$", "help": "<?php echo tr('Sedi del mittente'); ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "<?php echo tr('Destinazione merce'); ?>", "name": "idsede_destinazione", "ajax-source": "sedi_azienda", "value": "$idsede_destinazione$" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Destinazione merce'); ?>", "name": "idsede_destinazione", "ajax-source": "sedi_azienda", "value": "$idsede_destinazione$", "help": "<?php echo tr('Sedi di arrivo nella mia azienda'); ?>" ]}
|
||||
</div>
|
||||
|
||||
<?php
|
||||
@ -274,9 +275,10 @@ $_SESSION['superselect']['idsede_destinazione'] = $record['idsede_destinazione']
|
||||
<?php
|
||||
|
||||
if (!$block_edit) {
|
||||
// Lettura ordini
|
||||
$ordini_query = 'SELECT COUNT(*) AS tot FROM or_ordini WHERE idanagrafica='.prepare($record['idanagrafica']).' AND idstatoordine IN (SELECT id FROM or_statiordine WHERE descrizione IN(\'Bozza\', \'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoordine=(SELECT id FROM or_tipiordine WHERE dir='.prepare($dir).') AND or_ordini.id IN (SELECT idordine FROM or_righe_ordini WHERE or_righe_ordini.idordine = or_ordini.id AND (qta - qta_evasa) > 0)';
|
||||
// Lettura ordini (cliente o fornitore)
|
||||
$ordini_query = 'SELECT COUNT(*) AS tot FROM or_ordini WHERE idanagrafica='.prepare($record['idanagrafica']).' AND idstatoordine IN (SELECT id FROM or_statiordine WHERE descrizione IN(\'Accettato\', \'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoordine=(SELECT id FROM or_tipiordine WHERE dir='.prepare($dir).') AND or_ordini.id IN (SELECT idordine FROM or_righe_ordini WHERE or_righe_ordini.idordine = or_ordini.id AND (qta - qta_evasa) > 0)';
|
||||
$ordini = $dbo->fetchArray($ordini_query)[0]['tot'];
|
||||
|
||||
echo '
|
||||
<a class="btn btn-sm btn-primary'.(!empty($ordini) ? '' : ' disabled').'" data-href="'.$rootdir.'/modules/ddt/add_ordine.php?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="modal" data-title="Aggiungi ordine">
|
||||
<i class="fa fa-plus"></i> '.tr('Ordine').'
|
||||
|
@ -6,6 +6,7 @@ echo '
|
||||
<table class="table table-striped table-hover table-condensed table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="35" class="text-center" >'.tr('#').'</th>
|
||||
<th>'.tr('Descrizione').'</th>
|
||||
<th class="text-center tip" width="150" title="'.tr('da evadere').' / '.tr('totale').'">'.tr('Q.tà').' <i class="fa fa-question-circle-o"></i></th>
|
||||
<th class="text-center" width="150">'.tr('Prezzo unitario').'</th>
|
||||
@ -36,7 +37,14 @@ foreach ($righe as $riga) {
|
||||
}
|
||||
|
||||
echo '
|
||||
<tr data-id="'.$riga->id.'" '.$extra.'>
|
||||
<tr data-id="'.$riga->id.'" '.$extra.'>';
|
||||
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.(($riga->order)+1).'
|
||||
</td>';
|
||||
|
||||
echo '
|
||||
<td>';
|
||||
if ($riga->isArticolo()) {
|
||||
echo '
|
||||
@ -171,7 +179,7 @@ $totale = abs($ddt->totale);
|
||||
// IMPONIBILE
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
@ -186,7 +194,7 @@ echo '
|
||||
if (!empty($sconto)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"> <i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b>
|
||||
</td>
|
||||
|
||||
@ -200,7 +208,7 @@ if (!empty($sconto)) {
|
||||
// TOTALE IMPONIBILE
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
@ -215,7 +223,7 @@ if (!empty($sconto)) {
|
||||
// IVA
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('IVA', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
@ -229,7 +237,7 @@ echo '
|
||||
// TOTALE
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Totale', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
@ -271,4 +279,4 @@ $(document).ready(function(){
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
</script>';
|
@ -28,10 +28,15 @@ switch (post('op')) {
|
||||
$idtipodocumento = post('idtipodocumento');
|
||||
$id_segment = post('id_segment');
|
||||
|
||||
if ($dir == 'uscita') {
|
||||
$numero_esterno = post('numero_esterno');
|
||||
}
|
||||
|
||||
$anagrafica = Anagrafica::find($idanagrafica);
|
||||
$tipo = Tipo::find($idtipodocumento);
|
||||
|
||||
$fattura = Fattura::build($anagrafica, $tipo, $data, $id_segment);
|
||||
$fattura = Fattura::build($anagrafica, $tipo, $data, $id_segment, $numero_esterno);
|
||||
|
||||
$id_record = $fattura->id;
|
||||
|
||||
flash()->info(tr('Aggiunta fattura numero _NUM_!', [
|
||||
@ -265,6 +270,7 @@ switch (post('op')) {
|
||||
$new->numero_esterno = Fattura::getNextNumeroSecondario($new->data, $new->direzione, $new->id_segment);
|
||||
}
|
||||
|
||||
$new->codice_stato_fe = null;
|
||||
$new->stato()->associate($stato);
|
||||
$new->save();
|
||||
|
||||
@ -700,6 +706,7 @@ switch (post('op')) {
|
||||
$nota->idbanca = $fattura->idbanca;
|
||||
$nota->idsede_partenza = $fattura->idsede_partenza;
|
||||
$nota->idsede_destinazione = $fattura->idsede_destinazione;
|
||||
$nota->split_payment = $fattura->split_payment;
|
||||
$nota->save();
|
||||
|
||||
$righe = $fattura->getRighe();
|
||||
|
@ -24,7 +24,20 @@ $id_anagrafica = !empty(get('idanagrafica')) ? get('idanagrafica') : $user['idan
|
||||
<input type="hidden" name="id_record" value="">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
<?php
|
||||
if ($dir == 'uscita') {
|
||||
echo '
|
||||
<div class="col-md-3">
|
||||
{[ "type": "text", "label": "'.tr('N. fattura del fornitore').'", "required": 1, "name": "numero_esterno","class": "text-center", "value": "" ]}
|
||||
</div>';
|
||||
$size = 3;
|
||||
} else {
|
||||
$size = 6;
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="col-md-<?php echo $size; ?>">
|
||||
{[ "type": "date", "label": "<?php echo tr('Data'); ?>", "name": "data", "required": 1, "value": "-now-" ]}
|
||||
</div>
|
||||
|
||||
|
@ -19,6 +19,7 @@ $_SESSION['superselect']['idsede_destinazione'] = $record['idsede_destinazione']
|
||||
$_SESSION['superselect']['idanagrafica'] = $record['idanagrafica'];
|
||||
$_SESSION['superselect']['ddt'] = $dir;
|
||||
$_SESSION['superselect']['split_payment'] = $record['split_payment'];
|
||||
$_SESSION['superselect']['permetti_movimento_a_zero'] = ($dir == 'uscita' ? true : false);
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
$conto = 'vendite';
|
||||
@ -594,7 +595,7 @@ if (!$block_edit) {
|
||||
</div>';
|
||||
}
|
||||
|
||||
// Lettura ddt
|
||||
// Lettura ddt (entrata o uscita)
|
||||
$ddt_query = 'SELECT COUNT(*) AS tot FROM dt_ddt WHERE idanagrafica='.prepare($record['idanagrafica']).' AND idstatoddt IN (SELECT id FROM dt_statiddt WHERE descrizione IN(\'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoddt IN (SELECT id FROM dt_tipiddt WHERE dir='.prepare($dir).') AND dt_ddt.id IN (SELECT idddt FROM dt_righe_ddt WHERE dt_righe_ddt.idddt = dt_ddt.id AND (qta - qta_evasa) > 0)';
|
||||
$ddt = $dbo->fetchArray($ddt_query)[0]['tot'];
|
||||
echo '
|
||||
@ -602,7 +603,7 @@ if (!$block_edit) {
|
||||
<i class="fa fa-plus"></i> Ddt
|
||||
</a>';
|
||||
|
||||
// Lettura ordini
|
||||
// Lettura ordini (cliente o fornitore)
|
||||
$ordini_query = 'SELECT COUNT(*) AS tot FROM or_ordini WHERE idanagrafica='.prepare($record['idanagrafica']).' AND idstatoordine IN (SELECT id FROM or_statiordine WHERE descrizione IN(\'Accettato\', \'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoordine=(SELECT id FROM or_tipiordine WHERE dir='.prepare($dir).') AND or_ordini.id IN (SELECT idordine FROM or_righe_ordini WHERE or_righe_ordini.idordine = or_ordini.id AND (qta - qta_evasa) > 0)';
|
||||
$ordini = $dbo->fetchArray($ordini_query)[0]['tot'];
|
||||
echo '
|
||||
|
@ -7,6 +7,7 @@ echo '
|
||||
<table class="table table-striped table-hover table-condensed table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="35" class="text-center" >'.tr('#').'</th>
|
||||
<th>'.tr('Descrizione').'</th>
|
||||
<th class="text-center" width="150">'.tr('Q.tà').'</th>
|
||||
<th class="text-center" width="150">'.tr('Prezzo unitario').'</th>
|
||||
@ -69,7 +70,14 @@ foreach ($righe as $riga) {
|
||||
}
|
||||
|
||||
echo '
|
||||
<tr data-id="'.$riga->id.'" '.$extra.'>
|
||||
<tr data-id="'.$riga->id.'" '.$extra.'>';
|
||||
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.(($riga->order)+1).'
|
||||
</td>';
|
||||
|
||||
echo '
|
||||
<td>';
|
||||
|
||||
if ($riga->isArticolo()) {
|
||||
@ -240,7 +248,7 @@ echo '
|
||||
if (!empty($sconto)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"><i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b>
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -252,7 +260,7 @@ if (!empty($sconto)) {
|
||||
// TOTALE IMPONIBILE
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -266,7 +274,7 @@ if (!empty($sconto)) {
|
||||
if (!empty($fattura->rivalsa_inps)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">';
|
||||
<td colspan="5" class="text-right">';
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
@ -287,7 +295,7 @@ if (!empty($fattura->rivalsa_inps)) {
|
||||
if (!empty($iva)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">';
|
||||
<td colspan="5" class="text-right">';
|
||||
|
||||
if ($records[0]['split_payment']) {
|
||||
echo '<b>'.tr('Iva a carico del destinatario', [], ['upper' => true]).':</b>';
|
||||
@ -306,7 +314,7 @@ if (!empty($iva)) {
|
||||
// TOTALE
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Totale', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -319,7 +327,7 @@ echo '
|
||||
if (!empty($fattura->ritenuta_acconto)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr("Ritenuta d'acconto", [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -333,7 +341,7 @@ if (!empty($fattura->ritenuta_acconto)) {
|
||||
if (!empty($fattura->totale_ritenuta_contributi)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Ritenuta contributi', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -347,7 +355,7 @@ if (!empty($fattura->totale_ritenuta_contributi)) {
|
||||
if ($totale != $netto_a_pagare) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Netto a pagare', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -389,4 +397,4 @@ $(document).ready(function(){
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
</script>';
|
@ -46,7 +46,7 @@ class Fattura extends Document
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function build(Anagrafica $anagrafica, Tipo $tipo_documento, $data, $id_segment)
|
||||
public static function build(Anagrafica $anagrafica, Tipo $tipo_documento, $data, $id_segment, $numero_esterno = null)
|
||||
{
|
||||
$model = parent::build();
|
||||
|
||||
@ -76,6 +76,9 @@ class Fattura extends Document
|
||||
$model->data_registrazione = $data;
|
||||
$model->data_competenza = $data;
|
||||
$model->id_segment = $id_segment;
|
||||
if ($numero_esterno) {
|
||||
$model->numero_esterno = $numero_esterno;
|
||||
}
|
||||
|
||||
$model->idconto = $id_conto;
|
||||
|
||||
|
@ -113,10 +113,6 @@ switch (post('op')) {
|
||||
$promemoria->pianifica($intervento);
|
||||
}
|
||||
|
||||
if (!empty(post('idordineservizio'))) {
|
||||
$dbo->query('UPDATE co_ordiniservizio SET idintervento='.prepare($id_record).' WHERE id='.prepare(post('idordineservizio')));
|
||||
}
|
||||
|
||||
// Collegamenti intervento/impianti
|
||||
$impianti = (array) post('idimpianti');
|
||||
if (!empty($impianti)) {
|
||||
|
@ -47,35 +47,12 @@ if (null !== filter('orario_inizio') && '00:00:00' != filter('orario_inizio')) {
|
||||
$orario_fine = date('H', time() + 60 * 60).':00:00';
|
||||
}
|
||||
|
||||
// Se sto pianificando un contratto, leggo tutti i dati del contratto per predisporre l'aggiunta intervento
|
||||
//ref (intervento,promemoria,ordine)
|
||||
|
||||
$id_intervento = filter('id_intervento');
|
||||
$idcontratto = filter('idcontratto');
|
||||
$idcontratto_riga = filter('idcontratto_riga');
|
||||
$idordineservizio = filter('idordineservizio');
|
||||
|
||||
if (!empty($idcontratto) && !empty($idordineservizio)) {
|
||||
$rs = $dbo->fetchArray('SELECT *, (SELECT idzona FROM an_anagrafiche WHERE idanagrafica = co_contratti.idanagrafica) AS idzona FROM co_contratti WHERE id='.prepare($idcontratto));
|
||||
$idanagrafica = $rs[0]['idanagrafica'];
|
||||
$idzona = $rs[0]['idzona'];
|
||||
|
||||
// Info riga pianificata
|
||||
$rs = $dbo->fetchArray('SELECT * FROM co_ordiniservizio WHERE idcontratto='.prepare($idcontratto).' AND id='.prepare($idordineservizio));
|
||||
$data = $rs[0]['data_scadenza'];
|
||||
$idimpianto = $rs[0]['id'];
|
||||
|
||||
// Seleziono "Ordine di servizio" come tipo intervento
|
||||
$rs = $dbo->fetchArray("SELECT idtipointervento FROM in_tipiintervento WHERE descrizione='Ordine di servizio'");
|
||||
$idtipointervento = $rs[0]['idtipointervento'];
|
||||
|
||||
// Spunto il tecnico di default assegnato all'impianto
|
||||
$rs = $dbo->fetchArray('SELECT idtecnico FROM my_impianti WHERE id='.prepare($idimpianto));
|
||||
$idtecnico = $rs[0]['idtecnico'] ?: '';
|
||||
}
|
||||
|
||||
// Se sto pianificando un contratto, leggo tutti i dati del contratto per predisporre l'aggiunta intervento
|
||||
elseif (!empty($idcontratto) && !empty($idcontratto_riga)) {
|
||||
if (!empty($idcontratto) && !empty($idcontratto_riga)) {
|
||||
$rs = $dbo->fetchArray('SELECT *, (SELECT idzona FROM an_anagrafiche WHERE idanagrafica = co_contratti.idanagrafica) AS idzona FROM co_contratti WHERE id='.prepare($idcontratto));
|
||||
$idanagrafica = $rs[0]['idanagrafica'];
|
||||
$idzona = $rs[0]['idzona'];
|
||||
@ -173,10 +150,6 @@ if (!empty($idcontratto_riga)) {
|
||||
echo '<input type="hidden" name="idcontratto_riga" value="'.$idcontratto_riga.'">';
|
||||
}
|
||||
|
||||
if (!empty($idordineservizio)) {
|
||||
echo '<input type="hidden" name="idordineservizio" value="'.$idordineservizio.'">';
|
||||
}
|
||||
|
||||
if (!empty($id_intervento)) {
|
||||
echo '<input type="hidden" name="id_intervento" value="'.$id_intervento.'">';
|
||||
}
|
||||
@ -443,7 +416,7 @@ if (!empty($id_intervento)) {
|
||||
$('#modals > div #idtipointervento').change( function(){
|
||||
|
||||
if ($(this).selectData() && (($(this).selectData().tempo_standard)>0) && ('<?php echo filter('orario_fine'); ?>' == '')){
|
||||
|
||||
|
||||
orario_inizio = moment($('#modals > div #orario_inizio').val(), globals.timestamp_format, globals.locale).isValid() ? $('#modals > div #orario_inizio').val() : false;
|
||||
//console.log(orario_inizio);
|
||||
//da sistemare
|
||||
|
@ -11,6 +11,7 @@ $_SESSION['superselect']['idanagrafica'] = $record['idanagrafica'];
|
||||
$_SESSION['superselect']['idsede_partenza'] = $record['idsede_partenza'];
|
||||
$_SESSION['superselect']['idsede_partenza'];
|
||||
$_SESSION['superselect']['idsede_destinazione'] = $record['idsede_destinazione'];
|
||||
$_SESSION['superselect']['permetti_movimento_a_zero'] = false;
|
||||
|
||||
?><form action="" method="post" id="edit-form">
|
||||
<input type="hidden" name="op" value="update">
|
||||
|
@ -141,8 +141,7 @@ function aggiungi_intervento_in_fattura($id_intervento, $id_fattura, $descrizion
|
||||
$riga->id_rivalsa_inps = $id_rivalsa_inps;
|
||||
|
||||
$riga->prezzo_unitario = $sessione->prezzo_orario;
|
||||
$riga->sconto_unitario = $sessione->sconto_unitario;
|
||||
$riga->tipo_sconto = $sessione->tipo_sconto;
|
||||
$riga->setSconto($sessione->sconto_unitario, $sessione->tipo_sconto);
|
||||
|
||||
$riga->qta = $gruppo->sum('ore');
|
||||
|
||||
@ -180,7 +179,7 @@ function aggiungi_intervento_in_fattura($id_intervento, $id_fattura, $descrizion
|
||||
|
||||
// Viaggi raggruppati per costo
|
||||
$viaggi = $sessioni->where('prezzo_km_unitario', '>', 0)->groupBy(function ($item, $key) {
|
||||
return $item['prezzo_km_unitario'];
|
||||
return $item['prezzo_km_unitario'].'|'.$item['scontokm_unitario'].'|'.$item['tipo_scontokm'];
|
||||
});
|
||||
foreach ($viaggi as $gruppo) {
|
||||
$viaggio = $gruppo->first();
|
||||
@ -201,8 +200,7 @@ function aggiungi_intervento_in_fattura($id_intervento, $id_fattura, $descrizion
|
||||
$riga->id_rivalsa_inps = $id_rivalsa_inps;
|
||||
|
||||
$riga->prezzo_unitario = $viaggio->prezzo_km_unitario;
|
||||
$riga->sconto_unitario = $sessione->scontokm_unitario;
|
||||
$riga->tipo_sconto = $sessione->tipo_scontokm;
|
||||
$riga->setSconto($viaggio->scontokm_unitario, $viaggio->tipo_scontokm);
|
||||
|
||||
$riga->qta = $gruppo->sum('km');
|
||||
|
||||
|
@ -5,6 +5,7 @@ use Modules\Interventi\Intervento;
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$documento = Intervento::find($id_record);
|
||||
$show_prezzi = Auth::user()['gruppo'] != 'Tecnici' || (Auth::user()['gruppo'] == 'Tecnici' && setting('Mostra i prezzi al tecnico'));
|
||||
|
||||
// Impostazioni per la gestione
|
||||
$options = [
|
||||
@ -13,6 +14,7 @@ $options = [
|
||||
'dir' => $documento->direzione,
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
'nascondi_prezzi' => !$show_prezzi,
|
||||
];
|
||||
|
||||
// Dati di default
|
||||
|
@ -5,6 +5,7 @@ use Modules\Interventi\Intervento;
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$documento = Intervento::find($id_record);
|
||||
$show_prezzi = Auth::user()['gruppo'] != 'Tecnici' || (Auth::user()['gruppo'] == 'Tecnici' && setting('Mostra i prezzi al tecnico'));
|
||||
|
||||
// Impostazioni per la gestione
|
||||
$options = [
|
||||
@ -13,6 +14,7 @@ $options = [
|
||||
'dir' => $documento->direzione,
|
||||
'idanagrafica' => $documento['idanagrafica'],
|
||||
'totale_imponibile' => $documento->totale_imponibile,
|
||||
'nascondi_prezzi' => !$show_prezzi,
|
||||
];
|
||||
|
||||
// Dati della riga
|
||||
|
@ -15,11 +15,11 @@ if (!$righe->isEmpty()) {
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.tr('Descrizione').'</th>
|
||||
<th class="text-center" width="8%">'.tr('Q.tà').'</th>
|
||||
<th class="text-center" width="15%">'.tr('Prezzo di acquisto').'</th>';
|
||||
<th class="text-center" width="8%">'.tr('Q.tà').'</th>';
|
||||
|
||||
if ($show_prezzi) {
|
||||
echo '
|
||||
<th class="text-center" width="15%">'.tr('Prezzo di acquisto').'</th>
|
||||
<th class="text-center" width="15%">'.tr('Prezzo di vendita').'</th>
|
||||
<th class="text-center" width="10%">'.tr('Iva').'</th>
|
||||
<th class="text-center" width="15%">'.tr('Imponibile').'</th>';
|
||||
@ -74,13 +74,13 @@ if (!$righe->isEmpty()) {
|
||||
'.Translator::numberToLocale($r['qta'], 'qta').' '.$r['um'].'
|
||||
</td>';
|
||||
|
||||
//Costo unitario
|
||||
echo '
|
||||
if ($show_prezzi) {
|
||||
//Costo unitario
|
||||
echo '
|
||||
<td class="text-right">
|
||||
'.moneyFormat($riga->costo_unitario).'
|
||||
</td>';
|
||||
|
||||
if ($show_prezzi) {
|
||||
// Prezzo unitario
|
||||
echo '
|
||||
<td class="text-right">
|
||||
|
@ -6,6 +6,7 @@ use API\Interfaces\CreateInterface;
|
||||
use API\Interfaces\RetrieveInterface;
|
||||
use API\Interfaces\UpdateInterface;
|
||||
use API\Resource;
|
||||
use Modules;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Interventi\Intervento;
|
||||
use Modules\Interventi\Stato;
|
||||
@ -20,6 +21,7 @@ class Interventi extends Resource implements RetrieveInterface, CreateInterface,
|
||||
$period_end = date('Y-m-d', strtotime($today.' +7 days'));
|
||||
$period_start = date('Y-m-d', strtotime($today.' -2 months'));
|
||||
|
||||
// AND `in_statiintervento`.`is_completato`=0
|
||||
$query = "SELECT `in_interventi`.`id`,
|
||||
`in_interventi`.`codice`,
|
||||
`in_interventi`.`data_richiesta`,
|
||||
@ -46,11 +48,18 @@ class Interventi extends Resource implements RetrieveInterface, CreateInterface,
|
||||
LEFT JOIN `an_sedi` ON `in_interventi`.`idsede_destinazione` = `an_sedi`.`id`
|
||||
WHERE EXISTS(SELECT `orario_fine` FROM `in_interventi_tecnici` WHERE `in_interventi_tecnici`.`idintervento` = `in_interventi`.`id` AND `orario_fine` BETWEEN :period_start AND :period_end)";
|
||||
|
||||
$query .= '
|
||||
HAVING 2=2
|
||||
ORDER BY `in_interventi`.`data_richiesta` DESC';
|
||||
|
||||
$parameters = [
|
||||
':period_end' => $period_end,
|
||||
':period_start' => $period_start,
|
||||
];
|
||||
|
||||
$module = Modules::get('Interventi');
|
||||
$query = Modules::replaceAdditionals($module->id, $query);
|
||||
|
||||
return [
|
||||
'query' => $query,
|
||||
'parameters' => $parameters,
|
||||
|
@ -13,7 +13,7 @@ class Sessioni extends Resource implements RetrieveInterface, CreateInterface, D
|
||||
{
|
||||
$user = $this->getUser();
|
||||
|
||||
$query = 'SELECT id, idtecnico AS id_tecnico, idintervento AS id_intervento, orario_inizio, orario_fine FROM in_interventi_tecnici WHERE `idintervento` = :id_intervento';
|
||||
$query = 'SELECT id, idtecnico AS id_tecnico, idintervento AS id_intervento, orario_inizio, orario_fine, ragione_sociale AS tecnico FROM in_interventi_tecnici INNER JOIN an_anagrafiche ON idanagrafica = idtecnico WHERE `idintervento` = :id_intervento';
|
||||
|
||||
$parameters = [
|
||||
':id_intervento' => $request['id_intervento'],
|
||||
|
@ -28,6 +28,10 @@ class Sync extends Resource implements RetrieveInterface, UpdateInterface
|
||||
$query .= ' AND in_interventi_tecnici.idtecnico = '.prepare($user['idanagrafica']);
|
||||
}
|
||||
|
||||
if ($user->anagrafica->isTipo('Cliente')) {
|
||||
$query .= ' AND in_interventi.idanagrafica = '.prepare($user['idanagrafica']);
|
||||
}
|
||||
|
||||
$rs = $database->fetchArray($query);
|
||||
|
||||
$result = '';
|
||||
|
@ -363,6 +363,16 @@ class Sessione extends Model
|
||||
return $this->imponibile - $this->spesa;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce lo sconto della riga corrente in euro.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getScontoAttribute()
|
||||
{
|
||||
return $this->sconto_totale_manodopera + $this->sconto_totale_viaggio;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restituisce il margine percentuale relativo all'elemento.
|
||||
*
|
||||
|
@ -14,6 +14,7 @@ if ($module['name'] == 'Ordini cliente') {
|
||||
|
||||
unset($_SESSION['superselect']['codice_modalita_pagamento_fe']);
|
||||
$_SESSION['superselect']['idanagrafica'] = $record['idanagrafica'];
|
||||
$_SESSION['superselect']['permetti_movimento_a_zero'] = true;
|
||||
|
||||
?><form action="" method="post" id="edit-form">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
|
@ -5,7 +5,8 @@ include_once __DIR__.'/../../core.php';
|
||||
echo '
|
||||
<table class="table table-striped table-hover table-condensed table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<tr>
|
||||
<th width="35" class="text-center" >'.tr('#').'</th>
|
||||
<th>'.tr('Descrizione').'</th>
|
||||
<th class="text-center tip" width="150" title="'.tr('da evadere').' / '.tr('totale').'">'.tr('Q.tà').' <i class="fa fa-question-circle-o"></i></th>
|
||||
<th class="text-center" width="150">'.tr('Prezzo unitario').'</th>
|
||||
@ -36,7 +37,15 @@ foreach ($righe as $riga) {
|
||||
}
|
||||
|
||||
echo '
|
||||
<tr data-id="'.$riga->id.'" '.$extra.'>
|
||||
<tr data-id="'.$riga->id.'" '.$extra.'>';
|
||||
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.(($riga->order)+1).'
|
||||
</td>';
|
||||
|
||||
|
||||
echo '
|
||||
<td>';
|
||||
|
||||
if ($riga->isArticolo()) {
|
||||
@ -171,7 +180,7 @@ $totale = abs($ordine->totale);
|
||||
// IMPONIBILE
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -184,7 +193,7 @@ echo '
|
||||
if (!empty($sconto)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"> <i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b>
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -196,7 +205,7 @@ if (!empty($sconto)) {
|
||||
// TOTALE IMPONIBILE
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -209,7 +218,7 @@ if (!empty($sconto)) {
|
||||
// IVA
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Iva', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -221,7 +230,7 @@ echo '
|
||||
// TOTALE
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Totale', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -261,4 +270,4 @@ $(document).ready(function(){
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
</script>';
|
@ -20,7 +20,7 @@ if ($bilancio_gia_aperto) {
|
||||
|
||||
<?php
|
||||
// Livello 1
|
||||
$query1 = 'SELECT * FROM `co_pianodeiconti1` ORDER BY id DESC';
|
||||
$query1 = 'SELECT * FROM `co_pianodeiconti1` ORDER BY id ASC';
|
||||
$primo_livello = $dbo->fetchArray($query1);
|
||||
|
||||
foreach ($primo_livello as $conto_primo) {
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||
use Modules\Preventivi\Components\Articolo;
|
||||
@ -68,7 +69,9 @@ switch (post('op')) {
|
||||
case 'copy':
|
||||
// Copia del preventivo
|
||||
$new = $preventivo->replicate();
|
||||
$new->numero = Preventivo::getNextNumero($new->data_bozza);
|
||||
$new->numero = Preventivo::getNextNumero( Carbon::now() );
|
||||
$new->data_bozza = Carbon::now();
|
||||
$new->data_conclusione = Carbon::now()->addMonth();
|
||||
$new->stato = 'Bozza';
|
||||
$new->save();
|
||||
|
||||
|
6
modules/preventivi/buttons.php
Executable file → Normal file
6
modules/preventivi/buttons.php
Executable file → Normal file
@ -34,6 +34,12 @@ echo '
|
||||
<i class="fa fa-file"></i> '.tr('Fattura').'
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="'.($disabled ? '' : 'disabled').'" data-href="'.$structure->fileurl('crea_documento.php').'?id_module='.$id_module.'&id_record='.$id_record.'&documento=contratto" data-toggle="modal" data-title="'.tr('Crea contratto').'">
|
||||
<i class="fa fa-file-o"></i> '.tr('Contratto').'
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>';
|
||||
|
||||
|
5
modules/preventivi/crea_documento.php
Executable file → Normal file
5
modules/preventivi/crea_documento.php
Executable file → Normal file
@ -9,9 +9,12 @@ $documento = Preventivo::find($id_record);
|
||||
if (get('documento') == 'fattura') {
|
||||
$final_module = 'Fatture di vendita';
|
||||
$op = 'add_documento';
|
||||
} else {
|
||||
} elseif (get('documento') == 'ordine') {
|
||||
$final_module = 'Ordini cliente';
|
||||
$op = 'add_preventivo';
|
||||
} else {
|
||||
$final_module = 'Contratti';
|
||||
$op = 'add_preventivo';
|
||||
}
|
||||
|
||||
$options = [
|
||||
|
@ -7,6 +7,7 @@ unset($_SESSION['superselect']['idsede_partenza']);
|
||||
unset($_SESSION['superselect']['idsede_destinazione']);
|
||||
unset($_SESSION['superselect']['idanagrafica']);
|
||||
$_SESSION['superselect']['idanagrafica'] = $record['idanagrafica'];
|
||||
$_SESSION['superselect']['permetti_movimento_a_zero'] = true;
|
||||
|
||||
// Mostro un avviso se ci sono più revisioni del preventivo
|
||||
if (count($preventivo->revisioni) > 1) {
|
||||
|
@ -5,7 +5,8 @@ include_once __DIR__.'/../../core.php';
|
||||
echo '
|
||||
<table class="table table-striped table-hover table-condensed table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<tr>
|
||||
<th width="35" class="text-center" >'.tr('#').'</th>
|
||||
<th>'.tr('Descrizione').'</th>
|
||||
<th class="text-center tip" width="150" title="'.tr('da evadere').' / '.tr('totale').'">'.tr('Q.tà').' <i class="fa fa-question-circle-o"></i></th>
|
||||
<th class="text-center" width="150">'.tr('Prezzo unitario').'</th>
|
||||
@ -22,6 +23,11 @@ foreach ($righe as $riga) {
|
||||
echo '
|
||||
<tr data-id="'.$riga->id.'">';
|
||||
|
||||
echo '
|
||||
<td class="text-center">
|
||||
'.(($riga->order)+1).'
|
||||
</td>';
|
||||
|
||||
// Descrizione
|
||||
$descrizione = nl2br($riga->descrizione);
|
||||
if ($riga->isArticolo()) {
|
||||
@ -139,7 +145,7 @@ $totale = abs($preventivo->totale);
|
||||
// Totale imponibile scontato
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="4" class="text-right">
|
||||
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@ -152,7 +158,7 @@ echo '
|
||||
if (!empty($sconto)) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"> <i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@ -164,7 +170,7 @@ if (!empty($sconto)) {
|
||||
// Totale imponibile scontato
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -177,7 +183,7 @@ if (!empty($sconto)) {
|
||||
// Totale iva
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Iva', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@ -189,7 +195,7 @@ echo '
|
||||
// Totale
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
<b>'.tr('Totale', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
@ -205,7 +211,7 @@ $margine_icon = ($margine <= 0 and $preventivo->totale > 0) ? 'warning' : 'check
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
'.tr('Costi').':
|
||||
</td>
|
||||
<td align="right">
|
||||
@ -215,7 +221,7 @@ echo '
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">
|
||||
<td colspan="5" class="text-right">
|
||||
'.tr('Margine (_PRC_%)', [
|
||||
'_PRC_' => numberFormat($preventivo->margine_percentuale),
|
||||
]).':
|
||||
@ -257,4 +263,4 @@ $(document).ready(function(){
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
</script>';
|
@ -181,6 +181,8 @@ echo '
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{( "name": "filelist_and_upload", "id_module": "$id_module$", "id_record": "$id_record$" )}
|
||||
|
||||
{( "name": "log_email", "id_module": "$id_module$", "id_record": "$id_record$" )}
|
||||
|
||||
<?php
|
||||
|
@ -90,7 +90,7 @@ var chart_options = {
|
||||
ticks: {
|
||||
// Include a dollar sign in the ticks
|
||||
callback: function(value, index, values) {
|
||||
return \'€ \' + value;
|
||||
return \''.html_entity_decode(currency()).' \' + value;
|
||||
}
|
||||
}
|
||||
}]
|
||||
@ -261,7 +261,7 @@ echo '
|
||||
<canvas class="box-body collapse in" id="interventi" height="100"></canvas>
|
||||
</div>';
|
||||
|
||||
// Script per il grafico del fatturato
|
||||
// Script per il grafico degli interventi per tipologia
|
||||
echo '
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
@ -1,8 +1,10 @@
|
||||
<?php
|
||||
|
||||
use Models\Module;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
use Models\Module;
|
||||
$enable_readonly = !setting('Modifica Viste di default');
|
||||
|
||||
echo '
|
||||
<form action="" method="post" role="form">
|
||||
|
@ -42,18 +42,18 @@ foreach ($fields as $key => $field) {
|
||||
<div id="field-'.$field['id'].'" class="box-body collapse">
|
||||
<div class="row">
|
||||
<input type="hidden" value="'.$field['id'].'" name="id['.$key.']">
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
{[ "type": "text", "label": "'.tr('Nome').'", "name": "name['.$key.']", "value": "'.$field['name'].'", "readonly": "'.(!$editable).'", "help": "'.tr('Nome con cui il campo viene identificato e visualizzato nella tabella').'" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "textarea", "label": "'.tr('Query prevista').'", "name": "query['.$key.']", "value": "'.prepareToField($field['query']).'", "readonly": "'.(!$editable).'", "required": "1", "help": "'.tr('Nome effettivo del campo sulla tabella oppure subquery che permette di ottenere il valore del campo').'.<br>'.tr('ATTENZIONE: utilizza sempre i caratteri < o > seguiti da spazio!').'" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Gruppi con accesso').'", "name": "gruppi['.$key.'][]", "multiple": "1", "values": "query=SELECT id, nome AS descrizione FROM zz_groups ORDER BY id ASC", "value": "';
|
||||
@ -63,35 +63,35 @@ foreach ($fields as $key => $field) {
|
||||
|
||||
echo ', "help": "'.tr('Gruppi di utenti in grado di visualizzare questo campo').'" ]}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-xs-12 col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Visibilità').'", "name": "visible['.$key.']", "values": "list=\"0\":\"'.tr('Nascosto (variabili di stato)').'\",\"1\": \"'.tr('Visibile nella sezione').'\"", "value": "'.$field['visible'].'", "help": "'.tr('Stato del campo: visibile nella tabella oppure nascosto').'" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{[ "type": "checkbox", "label": "'.tr('Ricercabile').'", "name": "search['.$key.']", "value": "'.$field['search'].'", "help": "'.tr('Indica se il campo è ricercabile').'" ]}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "checkbox", "label": "'.tr('Ricerca lenta').'", "name": "slow['.$key.']", "value": "'.$field['slow'].'", "help": "'.tr("Indica se la ricerca per questo campo è lenta (da utilizzare nel caso di evidenti rallentamenti, mostra solo un avviso all'utente").'" ]}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "checkbox", "label": "'.tr('Sommabile').'", "name": "sum['.$key.']", "value": "'.$field['summable'].'", "help": "'.tr('Indica se il campo è da sommare').'" ]}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "checkbox", "label": "'.tr('Formattabile').'", "name": "format['.$key.']", "value": "'.$field['format'].'", "help": "'.tr('Indica se il campo è formattabile in modo automatico').'" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Ricerca tramite').'", "name": "search_inside['.$key.']", "value": "'.$field['search_inside'].'", "readonly": "'.(!$editable).'", "help": "'.tr('Query personalizzata per la ricerca (consigliata per colori e icone)').'.<br>'.tr('ATTENZIONE: utilizza sempre i caratteri < o > seguiti da spazio!').'" ]}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "'.tr('Ordina tramite').'", "name": "order_by['.$key.']", "value": "'.$field['order_by'].'", "readonly": "'.(!$editable).'", "help": "'.tr("Query personalizzata per l'ordinamento (date e numeri formattati tramite query)").'.<br>'.tr('ATTENZIONE: utilizza sempre i caratteri < o > seguiti da spazio!').'" ]}
|
||||
</div>
|
||||
@ -108,7 +108,7 @@ echo '
|
||||
<button type="button" class="btn btn-info" id="add">
|
||||
<i class="fa fa-plus"></i> '.tr('Aggiungi nuovo campo').'
|
||||
</button>
|
||||
|
||||
|
||||
<button type="submit" class="btn btn-success">
|
||||
<i class="fa fa-check"></i> '.tr('Salva').'
|
||||
</button>
|
||||
@ -122,7 +122,7 @@ echo '
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">'.tr('Ordine di visualizzazione').' <span class="tip pull-right" title="'.tr('Trascina per ordinare le colonne').'."><i class="fa fa-question-circle-o"></i></span></h3>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="panel-body sortable">';
|
||||
|
||||
foreach ($fields as $field) {
|
||||
@ -215,17 +215,17 @@ echo '
|
||||
var n = '.$key.';
|
||||
$(document).on("click", "#add", function(){
|
||||
cleanup_inputs();
|
||||
|
||||
|
||||
n++;
|
||||
var text = replaceAll($("#template").html(), "-id-", "" + n);
|
||||
|
||||
|
||||
$(this).parent().parent().parent().find(".data").append(text);
|
||||
restart_inputs();
|
||||
});
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#save").addClass("hide");
|
||||
|
||||
|
||||
$(".sortable" ).disableSelection();
|
||||
$(".sortable").each(function() {
|
||||
$(this).sortable({
|
||||
@ -234,14 +234,14 @@ echo '
|
||||
dropOnEmpty: true,
|
||||
scroll: true,
|
||||
update: function(event, ui) {
|
||||
|
||||
|
||||
var order = "";
|
||||
$("div.panel-body.sortable p[data-id]").each( function(){
|
||||
order += ","+$(this).data("id");
|
||||
});
|
||||
|
||||
|
||||
order = order.replace(/^,/, "");
|
||||
|
||||
|
||||
$.post("'.$rootdir.'/actions.php", {
|
||||
id: ui.item.data("id"),
|
||||
id_module: '.$id_module.',
|
||||
|
@ -21,7 +21,7 @@
|
||||
"geocomplete": "^1.7.0",
|
||||
"hotkeys-js": "3.7.3",
|
||||
"inputmask": "3.3.9",
|
||||
"jquery": "^3.2.1",
|
||||
"jquery": "3.4.1",
|
||||
"jquery-form": "^4.2.1",
|
||||
"jquery-ui-touch-punch": "^0.2.3",
|
||||
"jquery.shorten": "^1.0.0",
|
||||
|
@ -344,7 +344,7 @@ class FatturaElettronica
|
||||
'versione' => ($cliente['tipo'] == 'Ente pubblico') ? 'FPA12' : 'FPR12',
|
||||
'xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#',
|
||||
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
||||
'xsi:schemaLocation' => 'http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2 http://www.fatturapa.gov.it/export/fatturazione/sdi/fatturapa/v1.2/Schema_del_file_xml_FatturaPA_versione_1.2.xsd',
|
||||
'xsi:schemaLocation' => 'http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2.1 http://www.fatturapa.gov.it/export/fatturazione/sdi/fatturapa/v1.2.1/Schema_del_file_xml_FatturaPA_versione_1.2.1.xsd',
|
||||
];
|
||||
foreach ($attributes as $key => $value) {
|
||||
$rootNode->setAttribute($key, $value);
|
||||
|
@ -8,8 +8,8 @@ echo '
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
var btn = $("#compilazione_automatica");
|
||||
|
||||
if (!btn.hasClass("disabled")) {
|
||||
|
||||
if (!$("#compilazione_automatica").not("disabled")) {
|
||||
btn.click();
|
||||
}
|
||||
});
|
||||
|
@ -291,8 +291,11 @@ if (!empty($righe)) {
|
||||
}
|
||||
|
||||
// Individuazione articolo con codice relativo
|
||||
$id_articolo = null;
|
||||
$codice_principale = $codici[0]['CodiceValore'];
|
||||
$id_articolo = $database->fetchOne('SELECT id FROM mg_articoli WHERE codice = '.prepare($codice_principale))['id'];
|
||||
if (!empty($codice_principale)) {
|
||||
$id_articolo = $database->fetchOne('SELECT id FROM mg_articoli WHERE codice = '.prepare($codice_principale))['id'];
|
||||
}
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
|
@ -337,6 +337,9 @@ class FatturaElettronica
|
||||
|
||||
$fattura->save();
|
||||
|
||||
// Fix generazione idsede
|
||||
$fattura->refresh();
|
||||
|
||||
return $fattura;
|
||||
}
|
||||
|
||||
|
@ -59,11 +59,11 @@ foreach ($raggruppamenti as $mese => $raggruppamento) {
|
||||
<tr>
|
||||
<td>
|
||||
'.dateFormat($pianificazione->data_scadenza).'
|
||||
<br><small>'.reference($contratto)."</small>
|
||||
<br><small>'.reference($contratto).'</small>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<a href='".$rootdir.'/editor.php?id_module='.Modules::get('Anagrafiche')['id'].'&id_record='.$anagrafica->id."'>".nl2br($anagrafica->ragione_sociale).'</a>
|
||||
'.Modules::link('Anagrafiche', $anagrafica->id, nl2br($anagrafica->ragione_sociale)).'
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
@ -84,8 +84,9 @@ switch ($operazione) {
|
||||
->where('idtipointervento', $promemoria_originale->tipo->id)
|
||||
->get()
|
||||
->groupBy(function ($item) {
|
||||
return $item->data_richiesta;
|
||||
return $item->data_richiesta->toDateString();
|
||||
});
|
||||
|
||||
$date_preimpostate = $promemoria_contratto->keys()->toArray();
|
||||
|
||||
$data_conclusione = $contratto->data_conclusione;
|
||||
@ -129,7 +130,7 @@ switch ($operazione) {
|
||||
$date_con_promemoria[] = dateFormat($data_promemoria);
|
||||
}
|
||||
|
||||
// Creazione intervento collegato se non prensente
|
||||
// Creazione intervento collegato se non presente
|
||||
if (post('pianifica_intervento') && empty($promemoria->intervento)) {
|
||||
// Creazione intervento
|
||||
$intervento = Intervento::build($contratto->anagrafica, $promemoria_originale->tipo, $stato, $data_richiesta);
|
||||
|
@ -14,6 +14,15 @@ class Promemoria extends Document
|
||||
|
||||
protected $table = 'co_promemoria';
|
||||
|
||||
/**
|
||||
* The attributes that should be mutated to dates.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dates = [
|
||||
'data_richiesta',
|
||||
];
|
||||
|
||||
/**
|
||||
* Crea un nuovo promemoria.
|
||||
*
|
||||
|
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
use Plugins\PianificazioneInterventi\Promemoria;
|
||||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
$elenco_promemoria = Promemoria::doesntHave('intervento')->get();
|
||||
if ($elenco_promemoria->isEmpty()) {
|
||||
echo '
|
||||
<p>'.tr('Non ci sono promemoria da pianificare').'.</p>';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$raggruppamenti = $elenco_promemoria->groupBy(function ($item) {
|
||||
return ucfirst($item->data_richiesta->formatLocalized('%B %Y'));
|
||||
});
|
||||
|
||||
$counter = 0;
|
||||
foreach ($raggruppamenti as $mese => $raggruppamento) {
|
||||
++$counter;
|
||||
|
||||
// Se cambia il mese ricreo l'intestazione della tabella
|
||||
if ($counter == 1) {
|
||||
$attr = '';
|
||||
$class = 'fa-minus-circle';
|
||||
} else {
|
||||
$attr = 'style="display:none;"';
|
||||
$class = 'fa-plus-circle';
|
||||
}
|
||||
|
||||
echo "
|
||||
<h4>
|
||||
<a class='clickable' onclick=\"if( $('#promemoria_pianificare_".$counter."').css('display') == 'none' ){ $(this).children('i').removeClass('fa-plus-circle'); $(this).children('i').addClass('fa-minus-circle'); }else{ $(this).children('i').addClass('fa-plus-circle'); $(this).children('i').removeClass('fa-minus-circle'); } $('#promemoria_pianificare_".$counter."').slideToggle();\">
|
||||
<i class='fa ".$class."'></i> ".$mese.'
|
||||
</a>
|
||||
</h4>';
|
||||
|
||||
echo '
|
||||
<div id="promemoria_pianificare_'.$counter.'" '.$attr.'>
|
||||
<table class="table table-hover table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="120">'.tr('Cliente').'</th>
|
||||
<th width="250">'.tr('Contratto').'</th>
|
||||
<th width="90">'.tr('Entro').'</th>
|
||||
<th width="150">'.tr('Tipo attività').'</th>
|
||||
<th width="300">'.tr('Descrizione').'</th>
|
||||
<th width="100">'.tr('Sede').'</th>
|
||||
<th width="18"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>';
|
||||
|
||||
// Elenco promemoria da pianificare
|
||||
foreach ($elenco_promemoria as $promemoria) {
|
||||
$contratto = $promemoria->contratto;
|
||||
$anagrafica = $contratto->anagrafica;
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<td>
|
||||
'.Modules::link('Anagrafiche', $anagrafica->id, nl2br($anagrafica->ragione_sociale)).'
|
||||
</td>
|
||||
|
||||
<td>
|
||||
'.reference($contratto).'
|
||||
</td>
|
||||
|
||||
<td>'.dateFormat($promemoria->data_richiesta).'</td>
|
||||
<td>'.$promemoria->tipo->descrizione.'</td>
|
||||
<td>'.nl2br($promemoria->richiesta).'</td>
|
||||
|
||||
<td>';
|
||||
|
||||
// Sede
|
||||
if ($promemoria->idsede == '-1') {
|
||||
echo '- '.('Nessuna').' -';
|
||||
} elseif (empty($promemoria->idsede)) {
|
||||
echo tr('Sede legale');
|
||||
} else {
|
||||
$rsp2 = $dbo->fetchArray("SELECT id, CONCAT( CONCAT_WS( ' (', CONCAT_WS(', ', nomesede, citta), indirizzo ), ')') AS descrizione FROM an_sedi WHERE id=".prepare($promemoria->idsede));
|
||||
|
||||
echo $rsp2[0]['descrizione'];
|
||||
}
|
||||
|
||||
echo '
|
||||
</td>';
|
||||
|
||||
// Pulsanti
|
||||
echo '
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary btn-sm" title="Pianifica intervento ora..." data-toggle="tooltip" onclick="launch_modal(\'Pianifica intervento\', \''.$rootdir.'/add.php?id_module='.Modules::get('Interventi')['id'].'&ref=interventi_contratti&idcontratto='.$contratto->id.'&idcontratto_riga='.$promemoria->id.'\');">
|
||||
<i class="fa fa-calendar"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
echo '
|
||||
</tbody>
|
||||
</table>
|
||||
</div>';
|
||||
}
|
@ -7,10 +7,24 @@ use Plugins\ReceiptFE\Interaction;
|
||||
echo '
|
||||
<p>'.tr('Le ricevute delle Fatture Elettroniche permettono di individuare se una determinata fattura tramessa è stata accettata dal Sistema Di Interscambio').'.</p>';
|
||||
if (Interaction::isEnabled()) {
|
||||
|
||||
echo '
|
||||
<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>'.tr('Ricerca ricevute').'</b>',
|
||||
'_BTN_' => '<i class="fa fa-refresh"></i> <b>'.tr('Ricerca ricevute').'</b>',
|
||||
]).'.</p>';
|
||||
|
||||
//controllo se ci sono fatture in elaborazione da più di 7 giorni per le quali non ho ancora una ricevuta
|
||||
$fatture_generate = $dbo->fetchArray('SELECT `co_documenti`.`numero_esterno`, `co_documenti`.`data`, `co_documenti`.`data_stato_fe` FROM `co_documenti` JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento` WHERE `co_tipidocumento`.`dir` = \'entrata\' AND `co_documenti`.`codice_stato_fe` = \'WAIT\' AND `co_documenti`.`data_stato_fe` >= "'.$_SESSION['period_start'].'" AND `co_documenti`.`data_stato_fe`<(NOW() - INTERVAL 7 DAY) ORDER BY `co_documenti`.`data_stato_fe` ');
|
||||
|
||||
foreach ($fatture_generate as $fattura_generata) {
|
||||
echo '
|
||||
<div class="alert alert-warning"><i class="fa fa-warning" ></i> '.tr('Attenzione: la fattura _NUM_ del _DATA_ è in attesa di una ricevuta dal _DATA_STATO_FE.', [
|
||||
'_NUM_' => $fattura_generata['numero_esterno'],
|
||||
'_DATA_' => Translator::dateToLocale($fattura_generata['data']),
|
||||
'_DATA_STATO_FE' => Translator::timestampToLocale($fattura_generata['data_stato_fe'])
|
||||
]).'</div>';
|
||||
}
|
||||
|
||||
}
|
||||
echo '
|
||||
<div class="box box-success">
|
||||
@ -67,7 +81,7 @@ echo '
|
||||
if (Interaction::isEnabled()) {
|
||||
echo '
|
||||
<p>'.tr('Per vedere le ricevute da importare utilizza il pulsante _BUTTON_', [
|
||||
'_BUTTON_' => '<b>"'.tr('Ricerca ricevute').'"</b>',
|
||||
'_BUTTON_' => '<i class="fa fa-refresh"></i> <b>'.tr('Ricerca ricevute').'</b>',
|
||||
]).'.</p>';
|
||||
} else {
|
||||
include $structure->filepath('list.php');
|
||||
|
@ -38,7 +38,7 @@ echo '
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
{[ "type": "text", "label": "'.tr('Provincia').'", "name": "provincia", "maxlength": 2, "class": "text-center text-uppercase", "extra": "onkeyup=\"this.value = this.value.toUpperCase();\"" ]}
|
||||
{[ "type": "text", "label": "'.tr('Provincia').'", "name": "provincia", "maxlength": 2, "class": "text-center provincia-mask text-uppercase", "extra": "onkeyup=\"this.value = this.value.toUpperCase();\"" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
|
@ -45,7 +45,7 @@ echo '
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
{[ "type": "text", "label": "'.tr('Provincia').'", "name": "provincia", "value": "$provincia$", "maxlength": 2, "class": "text-center text-uppercase", "extra": "onkeyup=\"this.value = this.value.toUpperCase();\"" ]}
|
||||
{[ "type": "text", "label": "'.tr('Provincia').'", "name": "provincia", "value": "$provincia$", "maxlength": 2, "class": "text-center provincia-mask text-uppercase", "extra": "onkeyup=\"this.value = this.value.toUpperCase();\"" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
|
@ -14,7 +14,10 @@ $calendar_id = filter('calendar_id');
|
||||
$start = filter('start');
|
||||
$end = filter('end');
|
||||
|
||||
$anagrafica = Anagrafica::find($id_record);
|
||||
$anagrafica = Anagrafica::withTrashed()->find($id_record);
|
||||
if (empty($anagrafica)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Preventivi
|
||||
$preventivi = Preventivo::whereBetween('data_bozza', [$start, $end])
|
||||
|
@ -66,7 +66,7 @@
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="$importo">
|
||||
<xsl:value-of select="format-number($importo, '###.###.##0,00', 'euro')" />
|
||||
<xsl:value-of select="format-number($importo, '###.###.##0,00######', 'euro')" />
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
@ -100,7 +100,7 @@
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="$importo">
|
||||
<xsl:value-of select="format-number($importo, '###.###.##0,00', 'euro')" />
|
||||
<xsl:value-of select="format-number($importo, '###.###.##0,00######', 'euro')" />
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
@ -390,12 +390,7 @@
|
||||
translate( TipoDato,
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
||||
'abcdefghijklmnopqrstuvwxyz'
|
||||
) != 'aswswhouse'
|
||||
and
|
||||
translate( TipoDato,
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
||||
'abcdefghijklmnopqrstuvwxyz'
|
||||
) != 'aswtriga' ">
|
||||
) != 'aswswhouse' ">
|
||||
|
||||
|
||||
<div class="tx-xsmall">
|
||||
@ -658,17 +653,7 @@
|
||||
|
||||
<xsl:template match="DatiRitenuta">
|
||||
|
||||
<table class="tbFoglio">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title"> Dati ritenuta d'acconto</th>
|
||||
<th class="perc">Aliquota ritenuta</th>
|
||||
<th>Causale </th>
|
||||
<th width="15%">Importo </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td >
|
||||
|
||||
@ -682,11 +667,23 @@
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$TR='RT01'">
|
||||
(ritenuta persone fisiche)
|
||||
Ritenuta persone fisiche
|
||||
</xsl:when>
|
||||
<xsl:when test="$TR='RT02'">
|
||||
(ritenuta persone giuridiche)
|
||||
Ritenuta persone giuridiche
|
||||
</xsl:when>
|
||||
<xsl:when test="$TR='RT03'">
|
||||
Contributo INPS
|
||||
</xsl:when>
|
||||
<xsl:when test="$TR='RT04'">
|
||||
Contributo ENASARCO
|
||||
</xsl:when>
|
||||
<xsl:when test="$TR='RT05'">
|
||||
Contributo ENPAM
|
||||
</xsl:when>
|
||||
<xsl:when test="$TR='RT06'">
|
||||
Altro contributo previdenziale
|
||||
</xsl:when>
|
||||
<xsl:when test="$TR=''">
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
@ -714,7 +711,7 @@
|
||||
<xsl:value-of select="CausalePagamento" />
|
||||
</xsl:variable>
|
||||
<xsl:if test="$CP!=''">
|
||||
(decodifica come da modello 770S)
|
||||
(decodifica come da modello CU)
|
||||
</xsl:if>
|
||||
|
||||
</xsl:if>
|
||||
@ -729,8 +726,7 @@
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="DettaglioPagamento">
|
||||
@ -951,63 +947,61 @@
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$RF='RF01'">
|
||||
(ordinario)
|
||||
ordinario
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF02'">
|
||||
(contribuenti minimi)
|
||||
contribuenti minimi
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF03'">
|
||||
(nuove iniziative produttive)
|
||||
nuove iniziative produttive - Non più valido in quanto abrogato dalla legge di stabilità 2015
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF04'">
|
||||
(agricoltura e attività connesse e pesca)
|
||||
agricoltura e attività connesse e pesca
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF05'">
|
||||
(vendita sali e tabacchi)
|
||||
vendita sali e tabacchi
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF06'">
|
||||
(commercio fiammiferi)
|
||||
commercio fiammiferi
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF07'">
|
||||
(editoria)
|
||||
editoria
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF08'">
|
||||
(gestione servizi telefonia pubblica)
|
||||
gestione servizi telefonia pubblica
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF09'">
|
||||
(rivendita documenti di trasporto pubblico e di sosta)
|
||||
rivendita documenti di trasporto pubblico e di sosta
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF10'">
|
||||
(intrattenimenti, giochi e altre attività di cui alla tariffa allegata al DPR 640/72)
|
||||
intrattenimenti, giochi e altre attività di cui alla tariffa allegata al DPR 640/72
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF11'">
|
||||
(agenzie viaggi e turismo)
|
||||
agenzie viaggi e turismo
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF12'">
|
||||
(agriturismo)
|
||||
agriturismo
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF13'">
|
||||
(vendite a domicilio)
|
||||
vendite a domicilio
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF14'">
|
||||
(rivendita beni usati, oggetti d’arte,
|
||||
d’antiquariato o da collezione)
|
||||
rivendita beni usati, oggetti d’arte, d’antiquariato o da collezione
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF15'">
|
||||
(agenzie di vendite all’asta di oggetti d’arte,
|
||||
antiquariato o da collezione)
|
||||
agenzie di vendite all’asta di oggetti d’arte, antiquariato o da collezione
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF16'">
|
||||
(IVA per cassa P.A.)
|
||||
IVA per cassa P.A.
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF17'">
|
||||
(IVA per cassa - art. 32-bis, D.L. 83/2012)
|
||||
IVA per cassa - art. 32-bis, D.L. 83/2012
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF19'">
|
||||
(Regime forfettario)
|
||||
Regime forfettario
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF18'">
|
||||
(altro)
|
||||
altro
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF=''">
|
||||
</xsl:when>
|
||||
@ -1205,68 +1199,66 @@
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$RF='RF01'">
|
||||
(ordinario)
|
||||
ordinario
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF02'">
|
||||
(contribuenti minimi)
|
||||
contribuenti minimi
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF03'">
|
||||
(nuove iniziative produttive)
|
||||
nuove iniziative produttive - Non più valido in quanto abrogato dalla legge di stabilità 2015
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF04'">
|
||||
(agricoltura e attività connesse e pesca)
|
||||
agricoltura e attività connesse e pesca
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF05'">
|
||||
(vendita sali e tabacchi)
|
||||
vendita sali e tabacchi
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF06'">
|
||||
(commercio fiammiferi)
|
||||
commercio fiammiferi
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF07'">
|
||||
(editoria)
|
||||
editoria
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF08'">
|
||||
(gestione servizi telefonia pubblica)
|
||||
gestione servizi telefonia pubblica
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF09'">
|
||||
(rivendita documenti di trasporto pubblico e di sosta)
|
||||
rivendita documenti di trasporto pubblico e di sosta
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF10'">
|
||||
(intrattenimenti, giochi e altre attività di cui alla tariffa allegata al DPR 640/72)
|
||||
intrattenimenti, giochi e altre attività di cui alla tariffa allegata al DPR 640/72
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF11'">
|
||||
(agenzie viaggi e turismo)
|
||||
agenzie viaggi e turismo
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF12'">
|
||||
(agriturismo)
|
||||
agriturismo
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF13'">
|
||||
(vendite a domicilio)
|
||||
vendite a domicilio
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF14'">
|
||||
(rivendita beni usati, oggetti d’arte,
|
||||
d’antiquariato o da collezione)
|
||||
rivendita beni usati, oggetti d’arte, d’antiquariato o da collezione
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF15'">
|
||||
(agenzie di vendite all’asta di oggetti d’arte,
|
||||
antiquariato o da collezione)
|
||||
agenzie di vendite all’asta di oggetti d’arte, antiquariato o da collezione
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF16'">
|
||||
(IVA per cassa P.A.)
|
||||
IVA per cassa P.A.
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF17'">
|
||||
(IVA per cassa - art. 32-bis, D.L. 83/2012)
|
||||
IVA per cassa - art. 32-bis, D.L. 83/2012
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF19'">
|
||||
(Regime forfettario)
|
||||
Regime forfettario
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF='RF18'">
|
||||
(altro)
|
||||
altro
|
||||
</xsl:when>
|
||||
<xsl:when test="$RF=''">
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<span>(!!! codice non previsto !!!)</span>
|
||||
<span>!!! codice non previsto !!!</span>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
@ -1807,7 +1799,14 @@
|
||||
<tr>
|
||||
|
||||
<th>Tipologia documento</th>
|
||||
<th class="perc">Art. 73</th>
|
||||
<xsl:if test="$IsFPRS='0'">
|
||||
<th class="perc">Art. 73</th>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$IsFPRS='1'">
|
||||
<th class="perc">Imposta bollo</th>
|
||||
</xsl:if>
|
||||
|
||||
<th >Numero documento</th>
|
||||
<th class="data">Data documento</th>
|
||||
<th >Codice destinatario</th>
|
||||
@ -1827,35 +1826,69 @@
|
||||
</xsl:variable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$TD='TD01'">
|
||||
(fattura)
|
||||
fattura
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD02'">
|
||||
(acconto/anticipo su fattura)
|
||||
acconto/anticipo su fattura
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD03'">
|
||||
(acconto/anticipo su parcella)
|
||||
acconto/anticipo su parcella
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD04'">
|
||||
(nota di credito)
|
||||
nota di credito
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD05'">
|
||||
(nota di debito)
|
||||
nota di debito
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD06'">
|
||||
(parcella)
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD20'">
|
||||
(autofattura)
|
||||
parcella
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD16'">
|
||||
integrazione fattura reverse charge interno
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD17'">
|
||||
integrazione/autofattura per acquisto servizi da estero
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD18'">
|
||||
integrazione per acquisto beni intracomunitari
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD19'">
|
||||
integrazione/autofattura per acquisto beni ex art.17 c.2 DPR 633/72
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD20'">
|
||||
autofattura per regolarizzazione e integrazione delle fatture - art.6 c.8 d.lgs.471/97 o art.46 c.5 D.L.331/93
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD21'">
|
||||
autofattura per splafonamento
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD22'">
|
||||
estrazione beni da Deposito IVA
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD23'">
|
||||
estrazione beni da Deposito IVA con versamento IVA
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD24'">
|
||||
fattura differita - art.21 c.4 lett. a)
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD25'">
|
||||
fattura differita - art.21 c.4 terzo periodo lett. b)
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD26'">
|
||||
cessione di beni ammortizzabili e per passaggi interni - art.36 DPR 633/72
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD27'">
|
||||
fattura per autoconsumo o per cessioni gratuite senza rivalsa
|
||||
</xsl:when>
|
||||
|
||||
<!--FPRS-->
|
||||
<xsl:when test="$TD='TD07'">
|
||||
(fattura semplificata)
|
||||
fattura semplificata
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD08'">
|
||||
(nota di credito semplificata)
|
||||
nota di credito semplificata
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD='TD09'">
|
||||
(nota di debito semplificata)
|
||||
nota di debito semplificata
|
||||
</xsl:when>
|
||||
<xsl:when test="$TD=''">
|
||||
</xsl:when>
|
||||
@ -1867,11 +1900,21 @@
|
||||
</xsl:if>
|
||||
</td>
|
||||
|
||||
<td class="ritenuta" >
|
||||
<xsl:if test="DatiGenerali/DatiGeneraliDocumento/Art73">
|
||||
<xsl:value-of select="DatiGenerali/DatiGeneraliDocumento/Art73" />
|
||||
</xsl:if>
|
||||
</td>
|
||||
<xsl:if test="$IsFPRS='0'">
|
||||
<td class="ritenuta" >
|
||||
<xsl:if test="DatiGenerali/DatiGeneraliDocumento/Art73">
|
||||
<xsl:value-of select="DatiGenerali/DatiGeneraliDocumento/Art73" />
|
||||
</xsl:if>
|
||||
</td>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="$IsFPRS='1'">
|
||||
<td class="textCenter">
|
||||
<xsl:if test="DatiGenerali/DatiGeneraliDocumento/BolloVirtuale">
|
||||
<xsl:value-of select="DatiGenerali/DatiGeneraliDocumento/BolloVirtuale" />
|
||||
</xsl:if>
|
||||
</td>
|
||||
</xsl:if>
|
||||
|
||||
<td class="textCenter" >
|
||||
|
||||
@ -1927,6 +1970,7 @@
|
||||
|
||||
<xsl:for-each select="DatiGenerali/DatiGeneraliDocumento/Causale" >
|
||||
<xsl:value-of select="." />
|
||||
<br/>
|
||||
</xsl:for-each>
|
||||
|
||||
</xsl:if>
|
||||
@ -2441,7 +2485,7 @@
|
||||
<tr >
|
||||
|
||||
<th colspan="2">
|
||||
Importo bollo
|
||||
Imposta bollo
|
||||
</th>
|
||||
<th colspan="3">
|
||||
Sconto/Maggiorazione
|
||||
@ -2459,11 +2503,19 @@
|
||||
|
||||
<tr >
|
||||
<td colspan="2" class="import" >
|
||||
<xsl:if test="DatiGenerali/DatiGeneraliDocumento/DatiBollo/ImportoBollo">
|
||||
|
||||
<xsl:value-of select="format-number(DatiGenerali/DatiGeneraliDocumento/DatiBollo/ImportoBollo, '###.###.##0,00', 'euro')" />
|
||||
|
||||
</xsl:if>
|
||||
|
||||
<xsl:if test="DatiGenerali/DatiGeneraliDocumento/DatiBollo">
|
||||
<xsl:choose>
|
||||
<xsl:when test="DatiGenerali/DatiGeneraliDocumento/DatiBollo/ImportoBollo">
|
||||
<xsl:value-of select="format-number(DatiGenerali/DatiGeneraliDocumento/DatiBollo/ImportoBollo, '###.###.##0,00', 'euro')" />
|
||||
</xsl:when>
|
||||
<xsl:when test="DatiGenerali/DatiGeneraliDocumento/DatiBollo/BolloVirtuale">
|
||||
<xsl:value-of select="DatiGenerali/DatiGeneraliDocumento/DatiBollo/BolloVirtuale" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
|
||||
</td>
|
||||
<td colspan="3" class="import">
|
||||
<xsl:for-each select="DatiGenerali/DatiGeneraliDocumento/ScontoMaggiorazione" >
|
||||
@ -2510,7 +2562,25 @@
|
||||
<!-- Dati Ritenuta Acconto -->
|
||||
<xsl:if test="DatiGenerali/DatiGeneraliDocumento/DatiRitenuta">
|
||||
<div class="separa"> </div>
|
||||
<xsl:apply-templates select="DatiGenerali/DatiGeneraliDocumento/DatiRitenuta"/>
|
||||
|
||||
<table class="tbFoglio">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title"> Dati ritenuta d'acconto</th>
|
||||
<th class="perc">Aliquota ritenuta</th>
|
||||
<th>Causale </th>
|
||||
<th width="15%">Importo </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<xsl:for-each select="DatiGenerali/DatiGeneraliDocumento/DatiRitenuta" >
|
||||
<xsl:apply-templates select="." />
|
||||
</xsl:for-each>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</xsl:if>
|
||||
<!-- Fine Dati Ritenuta -->
|
||||
|
||||
@ -2616,6 +2686,9 @@
|
||||
<xsl:when test="$MP='MP22'">
|
||||
Trattenuta su somme già riscosse
|
||||
</xsl:when>
|
||||
<xsl:when test="$MP='MP23'">
|
||||
PagoPA
|
||||
</xsl:when>
|
||||
<xsl:when test="$MP=''">
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
|
@ -200,12 +200,12 @@ class App
|
||||
$name = str_replace('|lang|', $replace, $element);
|
||||
|
||||
if (file_exists(DOCROOT.str_replace(ROOTDIR, '', $name))) {
|
||||
$element = $name;
|
||||
$assets_element = $name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$result[$key] = $element.'?v='.$version;
|
||||
$result[$key] = $assets_element.'?v='.$version;
|
||||
}
|
||||
|
||||
$assets[$section] = $result;
|
||||
|
@ -143,7 +143,7 @@ class SelectHandler implements HandlerInterface
|
||||
}
|
||||
|
||||
$html .= '
|
||||
<option value="'.prepareToField($element['id']).'" '.implode(' ', $attributes).'>'.$element['text'].'</option>';
|
||||
<option value="'.prepareToField($element['id']).'" '.implode(' ', $attributes).($element['disabled'] ? 'disabled' : '').'>'.$element['text'].'</option>';
|
||||
}
|
||||
|
||||
return $html;
|
||||
|
@ -188,9 +188,6 @@ class WidgetManager implements ManagerInterface
|
||||
if (!empty($widget['more_link'])) {
|
||||
$result .= '
|
||||
</a>';
|
||||
|
||||
$result .= '
|
||||
</li>';
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
@ -241,6 +241,10 @@ class Upload extends Model
|
||||
|
||||
$filepath = $upload->filepath;
|
||||
|
||||
if (!in_array(mime_content_type($filepath), ['image/x-png', 'image/gif', 'image/jpeg'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$driver = extension_loaded('gd') ? 'gd' : 'imagick';
|
||||
ImageManagerStatic::configure(['driver' => $driver]);
|
||||
|
||||
|
@ -153,11 +153,11 @@ class Settings
|
||||
}
|
||||
|
||||
$result = '
|
||||
{[ "type": "select", "label": "'.$setting->nome.'", "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "values": '.json_encode($list).', "value": "'.$setting->valore.'", "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}';
|
||||
{[ "type": "select", "multiple": 0, "label": "'.$setting->nome.'", "readonly": "'.!$setting->editable.'", "name": "setting['.$setting->id.']", "values": '.json_encode($list).', "value": "'.$setting->valore.'", "required": "'.intval($required).'", "help": "'.$setting->help.'" ]}';
|
||||
}
|
||||
|
||||
// Lista multipla
|
||||
if (preg_match("/multiple\[(.+?)\]/", $setting->tipo, $m)) {
|
||||
elseif (preg_match("/multiple\[(.+?)\]/", $setting->tipo, $m)) {
|
||||
$values = explode(',', $m[1]);
|
||||
|
||||
$list = [];
|
||||
|
@ -406,6 +406,10 @@ class Uploads
|
||||
$fileinfo = self::fileInfo($filepath);
|
||||
$directory = empty($directory) ? dirname($filepath) : $directory;
|
||||
|
||||
if (!in_array(mime_content_type($filepath), ['image/x-png', 'image/gif', 'image/jpeg'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$driver = extension_loaded('gd') ? 'gd' : 'imagick';
|
||||
Intervention\Image\ImageManagerStatic::configure(['driver' => $driver]);
|
||||
|
||||
|
@ -54,9 +54,9 @@ class Zip
|
||||
/**
|
||||
* Crea un file zip comprimendo ricorsivamente tutte le sottocartelle a partire da una cartella specificata.
|
||||
*
|
||||
* @param string $source
|
||||
* @param string $destination
|
||||
* @param array $ignores
|
||||
* @param array|string $source
|
||||
* @param string $destination
|
||||
* @param array $ignores
|
||||
*/
|
||||
public static function create($source, $destination, $ignores = [])
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
// Creazione righe fantasma
|
||||
$autofill = new \Util\Autofill($options['pricing'] ? 5 : 2);
|
||||
$autofill = new \Util\Autofill($options['pricing'] ? 6 : 3);
|
||||
$rows_per_page = 16;
|
||||
if (!empty($options['last-page-footer'])) {
|
||||
$rows_per_page += 10;
|
||||
@ -15,6 +15,7 @@ echo "
|
||||
<table class='table table-striped table-bordered' id='contents'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='text-center' style='width:5%'>".tr('#', [], ['upper' => true])."</th>
|
||||
<th class='text-center'>".tr('Descrizione', [], ['upper' => true])."</th>
|
||||
<th class='text-center' style='width:10%'>".tr('Q.tà', [], ['upper' => true]).'</th>';
|
||||
|
||||
@ -39,7 +40,14 @@ foreach ($righe as $riga) {
|
||||
$autofill->count($r['descrizione']);
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<tr>';
|
||||
|
||||
echo'
|
||||
<td class=\'text-center\' >
|
||||
'.($r['order']+1).'</td>';
|
||||
|
||||
|
||||
echo'
|
||||
<td>
|
||||
'.nl2br($r['descrizione']);
|
||||
|
||||
|
@ -88,7 +88,7 @@ echo '
|
||||
echo '
|
||||
<table class="table-bordered">
|
||||
<tr>
|
||||
<th class="small" class style="width:25%">
|
||||
<th class="small" class style="width:25%;">
|
||||
'.tr('Aspetto beni', [], ['upper' => true]).'
|
||||
</th>
|
||||
|
||||
|
@ -6,7 +6,7 @@ $v_iva = [];
|
||||
$v_totale = [];
|
||||
|
||||
// Creazione righe fantasma
|
||||
$autofill = new \Util\Autofill(5, 40);
|
||||
$autofill = new \Util\Autofill(6, 40);
|
||||
$rows_per_page = $fattura_accompagnatoria ? 15 : 20;
|
||||
if (!empty($options['last-page-footer'])) {
|
||||
$rows_per_page += 7;
|
||||
@ -18,6 +18,7 @@ echo "
|
||||
<table class='table table-striped table-bordered' id='contents'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='text-center' style='width:5%'>".tr('#', [], ['upper' => true])."</th>
|
||||
<th class='text-center' style='width:50%'>".tr('Descrizione', [], ['upper' => true])."</th>
|
||||
<th class='text-center' style='width:14%'>".tr('Q.tà', [], ['upper' => true])."</th>
|
||||
<th class='text-center' style='width:16%'>".tr('Prezzo unitario', [], ['upper' => true])."</th>
|
||||
@ -39,7 +40,15 @@ foreach ($righe as $riga) {
|
||||
$v_totale[$r['desc_iva']] = sum($v_totale[$r['desc_iva']], $riga->totale_imponibile);
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<tr>';
|
||||
|
||||
|
||||
echo'
|
||||
<td class=\'text-center\' >
|
||||
'.($r['order']+1).'</td>';
|
||||
|
||||
|
||||
echo '
|
||||
<td>
|
||||
'.nl2br($r['descrizione']);
|
||||
|
||||
@ -82,7 +91,13 @@ foreach ($righe as $riga) {
|
||||
// Aggiunta dei riferimenti ai documenti
|
||||
if (setting('Riferimento dei documenti nelle stampe') && $riga->hasOriginal()) {
|
||||
$ref = $riga->getOriginal()->parent->getReference();
|
||||
|
||||
if (!empty($riga->getOriginal()->parent->numero_cliente)) {
|
||||
$ref .= tr('<br>_DOC_ num. _NUM_ del _DATE_', [
|
||||
'_DOC_' => 'Rif. Vs. ordine cliente',
|
||||
'_NUM_' => $riga->getOriginal()->parent->numero_cliente,
|
||||
'_DATE_' => dateFormat($riga->getOriginal()->parent->data_cliente),
|
||||
]);
|
||||
}
|
||||
if (!empty($ref)) {
|
||||
echo '
|
||||
<br><small>'.$ref.'</small>';
|
||||
|
@ -8,14 +8,14 @@ include_once __DIR__.'/../../core.php';
|
||||
echo '
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th colspan="4" style="font-size:13pt;" class="text-center">'.tr('Rapporto operazioni e interventi', [], ['upper' => true]).'</th>
|
||||
<th colspan="4" style="font-size:13pt;" class="text-center">'.tr('Rapporto attività e interventi', [], ['upper' => true]).'</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="text-left" style="width:30%">'.tr('Intervento num.').': <b>'.$documento['codice'].'</b></td>
|
||||
<td class="text-left" style="width:20%">'.tr('Data').': <b>'.Translator::dateToLocale($documento['data_richiesta']).'</b></td>
|
||||
<td class="text-left" style="width:25%">'.tr('Preventivo num.').': <b>'.(!empty($preventivo) ? $preventivo['numero'] : '').'</b></td>
|
||||
<td class="text-left" style="width:25%">'.tr('Contratto num.').': <b>'.(!empty($contratto) ? $contratto['numero'] : '').'</b></td>
|
||||
<td class="text-left" style="width:30%">'.tr('Intervento n.').': <b>'.$documento['codice'].'</b></td>
|
||||
<td class="text-left" style="width:20%">'.tr('Data richiesta').': <b>'.Translator::dateToLocale($documento['data_richiesta']).'</b></td>
|
||||
<td class="text-left" style="width:25%">'.tr('Preventivo n.').': <b>'.(!empty($preventivo) ? $preventivo['numero'] : '').'</b></td>
|
||||
<td class="text-left" style="width:25%">'.tr('Contratto n.').': <b>'.(!empty($contratto) ? $contratto['numero'] : '').'</b></td>
|
||||
</tr>';
|
||||
|
||||
// Dati cliente
|
||||
@ -300,8 +300,8 @@ foreach ($sessioni as $i => $sessione) {
|
||||
// Spazio aggiuntivo
|
||||
if ($i == 0) {
|
||||
echo '
|
||||
<td class="text-center" style="font-size:8pt;">
|
||||
'.tr('Si dichiara che i lavori sono stati eseguiti ed i materiali installati').'
|
||||
<td class="text-center" style="font-size:6pt;">
|
||||
'.tr('Si dichiara che i lavori sono stati eseguiti ed i materiali installati nel rispetto delle vigenti normative tecniche').'
|
||||
</td>';
|
||||
} else {
|
||||
echo '
|
||||
|
@ -141,7 +141,9 @@ elseif ($_GET['lev'] == '2') {
|
||||
}
|
||||
|
||||
// Mostro il saldo finale del conto di livello 3
|
||||
$body .= " <tr><td class='br bb padded'></td><td class='br bb padded'>".$rs3[$z]['numero'].' '.$rs3[$z]['descrizione']."</td><td class='br bb padded text-right'>".$dare."</td><td class='bb padded text-right'>".$avere."</td></tr>\n";
|
||||
if (sizeof($rs) > 0) {
|
||||
$body .= " <tr><td class='br bb padded'></td><td class='br bb padded'>".$rs3[$z]['numero'].' '.$rs3[$z]['descrizione']."</td><td class='br bb padded text-right'>".$dare."</td><td class='bb padded text-right'>".$avere."</td></tr>\n";
|
||||
}
|
||||
}
|
||||
|
||||
$body .= " </tbody>
|
||||
|
@ -3,7 +3,7 @@
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
// Creazione righe fantasma
|
||||
$autofill = new \Util\Autofill($options['pricing'] ? 5 : 2);
|
||||
$autofill = new \Util\Autofill($options['pricing'] ? 6 : 3);
|
||||
$autofill->setRows(20, 10);
|
||||
|
||||
echo '
|
||||
@ -61,6 +61,7 @@ echo "
|
||||
<table class='table table-striped table-bordered' id='contents'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='text-center'></th>
|
||||
<th class='text-center' style='width:50%'>".tr('Descrizione', [], ['upper' => true])."</th>
|
||||
<th class='text-center' style='width:10%'>".tr('Q.tà', [], ['upper' => true]).'</th>';
|
||||
|
||||
@ -85,7 +86,13 @@ foreach ($righe as $riga) {
|
||||
$autofill->count($r['descrizione']);
|
||||
|
||||
echo '
|
||||
<tr>
|
||||
<tr>';
|
||||
|
||||
echo '<td>';
|
||||
if (!empty($riga->articolo->immagine)) {echo '<img src="files/articoli/'.$riga->articolo->immagine.'" width="95" height="95">';}
|
||||
echo '</td>';
|
||||
|
||||
echo '
|
||||
<td style="vertical-align: middle">
|
||||
'.nl2br($r['descrizione']);
|
||||
|
||||
@ -175,11 +182,11 @@ if (($options['pricing'] && !isset($options['hide_total'])) || $options['show_on
|
||||
// Totale imponibile
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="'.($options['show_only_total'] ? 1 : 3).'" class="text-right border-top">
|
||||
<td colspan="'.($options['show_only_total'] ? 2 : 4).'" class="text-right border-top">
|
||||
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
<th colspan="'.($options['show_only_total'] ? 1 : 2).'" class="text-right">
|
||||
<th colspan="'.($options['show_only_total'] ? 1 : 3).'" class="text-right">
|
||||
<b>'.moneyFormat($show_sconto ? $imponibile : $totale_imponibile, 2).'</b>
|
||||
</th>
|
||||
</tr>';
|
||||
@ -188,11 +195,11 @@ if (($options['pricing'] && !isset($options['hide_total'])) || $options['show_on
|
||||
if ($show_sconto) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="'.($options['show_only_total'] ? 1 : 3).'" class="text-right border-top">
|
||||
<td colspan="'.($options['show_only_total'] ? 2 : 4).'" class="text-right border-top">
|
||||
<b>'.tr('Sconto', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
<th colspan="'.($options['show_only_total'] ? 1 : 2).'" class="text-right">
|
||||
<th colspan="'.($options['show_only_total'] ? 1 : 3).'" class="text-right">
|
||||
<b>'.moneyFormat($sconto, 2).'</b>
|
||||
</th>
|
||||
</tr>';
|
||||
@ -200,11 +207,11 @@ if (($options['pricing'] && !isset($options['hide_total'])) || $options['show_on
|
||||
// Totale imponibile
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="'.($options['show_only_total'] ? 1 : 3).'" class="text-right border-top">
|
||||
<td colspan="'.($options['show_only_total'] ? 2 : 4).'" class="text-right border-top">
|
||||
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
<th colspan="'.($options['show_only_total'] ? 1 : 2).'" class="text-right">
|
||||
<th colspan="'.($options['show_only_total'] ? 1 : 3).'" class="text-right">
|
||||
<b>'.moneyFormat($totale_imponibile, 2).'</b>
|
||||
</th>
|
||||
</tr>';
|
||||
@ -213,11 +220,11 @@ if (($options['pricing'] && !isset($options['hide_total'])) || $options['show_on
|
||||
// IVA
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="'.($options['show_only_total'] ? 1 : 3).'" class="text-right border-top">
|
||||
<td colspan="'.($options['show_only_total'] ? 2 : 4).'" class="text-right border-top">
|
||||
<b>'.tr('Totale IVA', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
|
||||
<th colspan="'.($options['show_only_total'] ? 1 : 2).'" class="text-right">
|
||||
<th colspan="'.($options['show_only_total'] ? 1 : 3).'" class="text-right">
|
||||
<b>'.moneyFormat($totale_iva, 2).'</b>
|
||||
</th>
|
||||
</tr>';
|
||||
@ -225,10 +232,10 @@ if (($options['pricing'] && !isset($options['hide_total'])) || $options['show_on
|
||||
// TOTALE
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="'.($options['show_only_total'] ? 1 : 3).'" class="text-right border-top">
|
||||
<td colspan="'.($options['show_only_total'] ? 2 : 4).'" class="text-right border-top">
|
||||
<b>'.tr('Totale documento', [], ['upper' => true]).':</b>
|
||||
</td>
|
||||
<th colspan="'.($options['show_only_total'] ? 1 : 2).'" class="text-right">
|
||||
<th colspan="'.($options['show_only_total'] ? 1 : 3).'" class="text-right">
|
||||
<b>'.moneyFormat($totale, 2).'</b>
|
||||
</th>
|
||||
</tr>';
|
||||
|
@ -310,7 +310,7 @@ UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM `mg_articoli` WHERE 1=
|
||||
ALTER TABLE `zz_hooks` ADD `processing_at` TIMESTAMP NULL DEFAULT NULL, ADD `processing_token` varchar(255);
|
||||
INSERT INTO `zz_hooks` (`id`, `name`, `class`, `frequency`, `id_module`) VALUES (NULL, 'Backup', 'Modules\\Backups\\BackupHook', '1 day', (SELECT `id` FROM `zz_modules` WHERE `name` = 'Backup'));
|
||||
|
||||
-- Miglioramento gestione email
|
||||
-- Miglioramento gestione email (questo RENAME genera un errore rif. tabella se mysql <= 5.5.55)
|
||||
RENAME TABLE `zz_emails` TO `em_templates`;
|
||||
RENAME TABLE `zz_smtps` TO `em_accounts`;
|
||||
RENAME TABLE `zz_email_print` TO `em_print_template`;
|
||||
|
@ -163,6 +163,7 @@ ALTER TABLE `zz_settings` CHANGE `help` `help` TEXT;
|
||||
|
||||
UPDATE `zz_settings` SET `help` = '<p>Impostare la maschera senza indicare l''anno per evitare il reset del contatore.</p><ul><li><b>####</b>: Numero progressivo del documento, con zeri non significativi per raggiungere il numero desiderato di caratteri</li><li><b>YYYY</b>: Anno corrente a 4 cifre</li><li><b>yy</b>: Anno corrente a 2 cifre</li></ul>' WHERE `zz_settings`.`nome` = 'Formato codice preventivi';
|
||||
|
||||
-- Fix nome hook Aggiornamenti
|
||||
UPDATE `zz_hooks` SET `name` = 'Aggiornamenti' WHERE `class` = 'Modules\\Aggiornamenti\\UpdateHook';
|
||||
|
||||
-- Colonne aggiuntive articoli
|
||||
|
@ -6,6 +6,9 @@ $files = [
|
||||
'templates\fatturato\fatturato_body.html',
|
||||
'templates\fatturato\fatturato.html',
|
||||
'modules\interventi\widgets\interventi.pianificazionedashboard.interventi.php',
|
||||
'modules\contratti\widgets\contratti.pianificazionedashboard.php',
|
||||
'modules\contratti\widgets\contratti.pianificazionedashboard.interventi.php',
|
||||
'modules\contratti\widgets\contratti.ratecontrattuali.php',
|
||||
];
|
||||
|
||||
foreach ($files as $key => $value) {
|
||||
|
@ -9,7 +9,7 @@ UPDATE `zz_settings` SET `sezione` = 'API' WHERE `zz_settings`.`nome` = 'apilaye
|
||||
UPDATE `zz_settings` SET `sezione` = 'API' WHERE `zz_settings`.`nome` = 'Google Maps API key';
|
||||
|
||||
-- Abilita la possibilità di ripristinare backup da archivi esterni al gestionale
|
||||
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `created_at`, `updated_at`, `order`, `help`) VALUES (NULL, 'Permetti il ripristino di backup da file esterni', '1', 'boolean', '0', 'Backup', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 'Abilita la possibilità di ripristinare backup da archivi esterni al gestionale.');
|
||||
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `created_at`, `order`, `help`) VALUES (NULL, 'Permetti il ripristino di backup da file esterni', '1', 'boolean', '0', 'Backup', CURRENT_TIMESTAMP, NULL, 'Abilita la possibilità di ripristinare backup da archivi esterni al gestionale.');
|
||||
|
||||
|
||||
UPDATE `zz_settings` SET `help` = 'Esegue automaticamente un backup completo del gestionale al primo accesso della giornata.' WHERE `zz_settings`.`nome` = 'Backup automatico';
|
||||
@ -40,6 +40,11 @@ ALTER TABLE `in_righe_interventi` ADD `abilita_serial` boolean NOT NULL DEFAULT
|
||||
ALTER TABLE `in_righe_interventi` ADD `idimpianto` int(11);
|
||||
ALTER TABLE `in_righe_interventi` ADD `old_id` int(11);
|
||||
|
||||
-- Agli articoli utilizzati negli interventi che fanno riferimento ad articoli eliminati assegno l'articolo fittizio DELETED
|
||||
INSERT INTO `mg_articoli` (`id`, `codice`, `descrizione`, `um`, `abilita_serial`, `immagine`, `note`, `qta`, `threshold_qta`, `ubicazione`, `prezzo_acquisto`, `prezzo_vendita`, `idiva_vendita`, `gg_garanzia`, `peso_lordo`, `volume`, `componente_filename`, `contenuto`, `attivo`, `created_at`, `id_categoria`, `id_sottocategoria`, `servizio`, `idconto_vendita`, `idconto_acquisto`, `deleted_at`, `barcode`, `id_fornitore`) VALUES (NULL, 'DELETED', 'ARTICOLO RIMOSSO', '', '0', NULL, '', '0', '0', '', '0', '0', '0', '0', '0', '0', '', '', '0', CURRENT_TIMESTAMP, 0, NULL, '1', NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
UPDATE `mg_articoli_interventi` SET `idarticolo` = (SELECT `id` FROM `mg_articoli` WHERE `codice` = 'DELETED' ) WHERE `idarticolo` NOT IN (SELECT `id` FROM `mg_articoli`);
|
||||
|
||||
INSERT INTO `in_righe_interventi` (`old_id`, `idarticolo`, `idintervento`, `is_descrizione`, `is_sconto`, `descrizione`, `prezzo_acquisto`, `prezzo_vendita`, `sconto`, `sconto_unitario`, `tipo_sconto`, `idiva`, `desc_iva`, `iva`, `qta`, `um`, `abilita_serial`, `idimpianto`) SELECT `id`, `idarticolo`, `idintervento`, `is_descrizione`, `is_sconto`, `descrizione`, `prezzo_acquisto`, `prezzo_vendita`, `sconto`, `sconto_unitario`, `tipo_sconto`, `idiva`, `desc_iva`, `iva`, `qta`, `um`, `abilita_serial`, `idimpianto` FROM `mg_articoli_interventi`;
|
||||
|
||||
ALTER TABLE `co_promemoria_righe` ADD `abilita_serial` boolean NOT NULL DEFAULT '0' AFTER `um`, ADD `idimpianto` int(11), ADD `idarticolo` int(11), ADD FOREIGN KEY (`idarticolo`) REFERENCES `mg_articoli`(`id`) ON DELETE SET NULL, CHANGE `um` `um` varchar(25);
|
||||
@ -159,7 +164,7 @@ ALTER TABLE `co_righe_promemoria` ADD `original_id` int(11), ADD `original_type`
|
||||
ALTER TABLE `in_righe_interventi` ADD `original_id` int(11), ADD `original_type` varchar(255);
|
||||
|
||||
-- Aggiunta supporto a prezzi ivati
|
||||
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `created_at`, `updated_at`, `order`, `help`) VALUES (NULL, 'Utilizza prezzi di vendita comprensivi di IVA', '0', 'boolean', '1', 'Fatturazione', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, 'Abilita la gestione con importi ivati per i prezzi di vendita.');
|
||||
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `created_at`, `order`, `help`) VALUES (NULL, 'Utilizza prezzi di vendita comprensivi di IVA', '0', 'boolean', '1', 'Fatturazione', CURRENT_TIMESTAMP, NULL, 'Abilita la gestione con importi ivati per i prezzi di vendita.');
|
||||
|
||||
-- Fix plugin "Pianificazione fatturazione"
|
||||
UPDATE `zz_plugins` SET `options` = 'custom', `script` = '', `directory` = 'pianificazione_fatturazione' WHERE `name` = 'Pianificazione fatturazione';
|
||||
@ -489,9 +494,6 @@ INSERT INTO `zz_api_resources` (`id`, `version`, `type`, `resource`, `class`, `e
|
||||
(NULL, 'v1', 'retrieve', 'rapportino', 'Modules\\Interventi\\API\\v1\\Rapportino', '1'),
|
||||
(NULL, 'v1', 'create', 'rapportino', 'Modules\\Interventi\\API\\v1\\Rapportino', '1');
|
||||
|
||||
-- Aggiunta stato "In attesa di conferma" sugli ordini fornitore
|
||||
INSERT INTO `or_statiordine` (`id`, `descrizione`, `annullato`, `icona`, `completato`) VALUES (NULL, 'In attesa di conferma', '0', 'fa fa-envelope text-primary', '0');
|
||||
|
||||
-- Aggiunta vincolo a pianificazione rate contratti
|
||||
DELETE FROM `co_fatturazione_contratti` WHERE `idcontratto` NOT IN(SELECT `id` FROM `co_contratti`);
|
||||
ALTER TABLE `co_fatturazione_contratti` ADD CONSTRAINT `fk_contratti_fatturazione` FOREIGN KEY (`idcontratto`) REFERENCES `co_contratti`(`id`) ON DELETE CASCADE;
|
||||
@ -503,7 +505,8 @@ ALTER TABLE `co_statipreventivi` ADD `is_revisionabile` BOOLEAN NOT NULL AFTER `
|
||||
UPDATE `co_statipreventivi` SET `is_revisionabile` = 1 WHERE `is_completato` = 0 OR `descrizione` = 'Rifiutato';
|
||||
|
||||
-- Spostamento moduli "Stati preventivi" e "Stati contratti" sotto "Tabelle"
|
||||
UPDATE `zz_modules` SET `parent` = (SELECT `id` FROM (SELECT `id` FROM `zz_modules` WHERE `name` = 'Tabelle') AS `m` ) WHERE `name` IN('Stati dei preventivi', 'Stati dei contratti');
|
||||
UPDATE `zz_modules` `t1` INNER JOIN `zz_modules` `t2` ON (`t1`.`name` = 'Stati dei preventivi' AND `t2`.`name` = 'Tabelle') SET `t1`.`parent` = `t2`.`id`;
|
||||
UPDATE `zz_modules` `t1` INNER JOIN `zz_modules` `t2` ON (`t1`.`name` = 'Stati dei contratti' AND `t2`.`name` = 'Tabelle') SET `t1`.`parent` = `t2`.`id`;
|
||||
|
||||
-- Aggiunta campo per salvare il numero di revisione del preventivo
|
||||
ALTER TABLE `co_preventivi` ADD `numero_revision` INT NOT NULL AFTER `default_revision`;
|
||||
@ -521,8 +524,14 @@ UPDATE `zz_views` SET `query` = 'mg_categorie.nome' WHERE `zz_views`.`name` = 'C
|
||||
UPDATE `zz_views` SET `query` = 'sottocategorie.nome' WHERE `zz_views`.`name` = 'Sottocategoria' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Articoli');
|
||||
UPDATE `zz_views` SET `query` = 'an_anagrafiche.ragione_sociale' WHERE `zz_views`.`name` = 'Fornitore' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Articoli');
|
||||
|
||||
-- Fix id ambigui modulo articoli
|
||||
UPDATE `zz_views` SET `query` = 'mg_articoli.id' WHERE `query` = 'id' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Articoli');
|
||||
UPDATE `zz_views` SET `query` = 'mg_articoli.codice' WHERE `query` = 'codice' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Articoli');
|
||||
UPDATE `zz_views` SET `query` = 'mg_articoli.descrizione' WHERE `query` = 'descrizione' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Articoli');
|
||||
UPDATE `zz_views` SET `query` = 'mg_articoli.note' WHERE `query` = 'note' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Articoli');
|
||||
|
||||
-- Ottimizzazione query attività
|
||||
UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM (`in_interventi` INNER JOIN `an_anagrafiche` ON `in_interventi`.`idanagrafica` = `an_anagrafiche`.`idanagrafica`) LEFT JOIN `in_interventi_tecnici` ON `in_interventi_tecnici`.`idintervento` = `in_interventi`.`id` LEFT JOIN `in_statiintervento` ON `in_interventi`.`idstatointervento`=`in_statiintervento`.`idstatointervento` LEFT JOIN (SELECT an_sedi.id, CONCAT(an_sedi.nomesede,\'<br>\',an_sedi.telefono,\'<br>\',an_sedi.cellulare,\'<br>\',an_sedi.citta,\' - \', an_sedi.indirizzo) AS info FROM an_sedi) AS sede_destinazione ON sede_destinazione.id = in_interventi.idsede_destinazione LEFT JOIN (SELECT co_righe_documenti.idintervento, CONCAT(\'Fatt. \', co_documenti.numero_esterno,\' del \', DATE_FORMAT(co_documenti.data, \'%d/%m/%Y\')) AS info FROM co_documenti INNER JOIN co_righe_documenti ON co_documenti.id = co_righe_documenti.iddocumento) AS fattura ON fattura.idintervento = in_interventi.id WHERE 1=1 |date_period(`orario_inizio`,`data_richiesta`)| GROUP BY `in_interventi`.`id` HAVING 2=2 ORDER BY IFNULL(`orario_fine`, `data_richiesta`) DESC' WHERE `name` = 'Interventi';
|
||||
UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM (`in_interventi` INNER JOIN `an_anagrafiche` ON `in_interventi`.`idanagrafica` = `an_anagrafiche`.`idanagrafica`) LEFT JOIN `in_interventi_tecnici` ON `in_interventi_tecnici`.`idintervento` = `in_interventi`.`id` LEFT JOIN `in_statiintervento` ON `in_interventi`.`idstatointervento`=`in_statiintervento`.`idstatointervento` LEFT JOIN (SELECT an_sedi.id, CONCAT(an_sedi.nomesede,\'<br>\',an_sedi.telefono,\'<br>\',an_sedi.cellulare,\'<br>\',an_sedi.citta,\' - \', an_sedi.indirizzo) AS info FROM an_sedi) AS sede_destinazione ON sede_destinazione.id = in_interventi.idsede_destinazione WHERE 1=1 |date_period(`orario_inizio`,`data_richiesta`)| GROUP BY `in_interventi`.`id` HAVING 2=2 ORDER BY IFNULL(`orario_fine`, `data_richiesta`) DESC' WHERE `name` = 'Interventi';
|
||||
|
||||
UPDATE `zz_views` SET `query` = 'in_statiintervento.descrizione' WHERE `zz_views`.`name` = 'Stato' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi');
|
||||
UPDATE `zz_views` SET `query` = 'in_interventi.descrizione' WHERE `zz_views`.`name` = 'Descrizione' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi');
|
||||
@ -531,10 +540,89 @@ UPDATE `zz_views` SET `query` = 'in_interventi.descrizione' WHERE `zz_views`.`na
|
||||
INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `format`, `default`, `visible`) VALUES
|
||||
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'), 'Sede', 'sede_destinazione.info', 4, 1, 0, 0, 1);
|
||||
|
||||
-- Aggiunta colonna Rif. fattura per attività
|
||||
INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `format`, `default`, `visible`) VALUES
|
||||
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'), 'Rif. fattura', 'fattura.info', 17, 1, 0, 0, 1);
|
||||
|
||||
-- Aggiornamento widget Rate contrattuali
|
||||
UPDATE `zz_widgets` SET `more_link` = './plugins/pianificazione_fatturazione/widgets/rate_contrattuali.php' WHERE `zz_widgets`.`name` = 'Rate contrattuali';
|
||||
|
||||
-- Aggiornamento widget Promemoria contratti da pianificare
|
||||
UPDATE `zz_widgets` SET `name` = 'Promemoria contratti da pianificare' WHERE `zz_widgets`.`name` = 'Interventi da pianificare';
|
||||
UPDATE `zz_widgets` SET `more_link` = './plugins/pianificazione_interventi/widgets/promemoria_da_pianificare.php' WHERE `zz_widgets`.`name` = 'Promemoria contratti da pianificare';
|
||||
|
||||
-- Rimozione completa co_ordiniservizio
|
||||
DROP TABLE IF EXISTS `co_ordiniservizio`;
|
||||
DROP TABLE IF EXISTS `co_ordiniservizio_vociservizio`;
|
||||
DELETE FROM `zz_widgets` WHERE `name` = 'Ordini di servizio da impostare';
|
||||
|
||||
--
|
||||
-- Aggiornamento FE in base alla normativa del 28/02/2020
|
||||
--
|
||||
ALTER TABLE `fe_natura` CHANGE `codice` `codice` VARCHAR(5) NOT NULL;
|
||||
|
||||
-- Nuove nature IVA
|
||||
INSERT INTO `fe_natura` (`codice`, `descrizione`) VALUES
|
||||
('N2.1', 'non soggette ad IVA ai sensi degli artt. Da 7 a 7-septies del DPR 633/72'),
|
||||
('N2.2', 'non soggette - altri casi'),
|
||||
('N3.1', 'non imponibili - esportazioni'),
|
||||
('N3.2', 'non imponibili - cessioni intracomunitarie'),
|
||||
('N3.3', 'non imponibili - cessioni verso San Marino'),
|
||||
('N3.4', 'non imponibili - operazioni assimilate alle cessioni all\'esportazione'),
|
||||
('N3.5', 'non imponibili - a seguito di dichiarazioni d\'intento'),
|
||||
('N3.6', 'non imponibili - altre operazioni che non concorrono alla formazione del plafond'),
|
||||
('N6.1', 'inversione contabile - cessione di rottami e altri materiali di recupero'),
|
||||
('N6.2', 'inversione contabile - cessione di oro e argento pure'),
|
||||
('N6.3', 'inversione contabile - subappalto nel settore edile'),
|
||||
('N6.4', 'inversione contabile - cessione di fabbricati'),
|
||||
('N6.5', 'inversione contabile - cessione di telefoni cellulari'),
|
||||
('N6.6', 'inversione contabile - cessione di prodotti elettronici'),
|
||||
('N6.7', 'inversione contabile - prestazioni comparto edile e settori connessi'),
|
||||
('N6.8', 'inversione contabile - operazioni settore energetico'),
|
||||
('N6.9', 'inversione contabile - altri casi');
|
||||
|
||||
-- Nuove aliquote di default collegate alle nuove nature IVA
|
||||
INSERT INTO `co_iva` (`id`, `descrizione`, `percentuale`, `esente`, `codice_natura_fe`, `esigibilita`, `default`) VALUES
|
||||
(NULL, 'Non soggetta ad IVA ai sensi degli artt. Da 7 a 7-septies del DPR 633/72', '0', '1', 'N2.1', 'I', '1'),
|
||||
(NULL, 'Non soggetta - altri casi', '0', '1', 'N2.2', 'I', '1'),
|
||||
(NULL, 'Non imponibile - esportazioni', '0', '1', 'N3.1', 'I', '1'),
|
||||
(NULL, 'Non imponibile - cessioni intracomunitarie', '0', '1', 'N3.2', 'I', '1'),
|
||||
(NULL, 'Non imponibile - cessioni verso San Marino', '0', '1', 'N3.3', 'I', '1'),
|
||||
(NULL, 'Non imponibile - operazioni assimilate alle cessioni all\'esportazione', '0', '1', 'N3.4', 'I', '1'),
|
||||
(NULL, 'Non imponibile - a seguito di dichiarazioni d\'intento', '0', '1', 'N3.5', 'I', '1'),
|
||||
(NULL, 'Non imponibile - altre operazioni che non concorrono alla formazione del plafond', '0', '1', 'N3.6', 'I', '1'),
|
||||
(NULL, 'Inversione contabile - cessione di rottami e altri materiali di recupero', '0', '1', 'N6.1', 'I', '1'),
|
||||
(NULL, 'Inversione contabile - cessione di oro e argento pure', '0', '1', 'N6.2', 'I', '1'),
|
||||
(NULL, 'Inversione contabile - subappalto nel settore edile', '0', '1', 'N6.3', 'I', '1'),
|
||||
(NULL, 'Inversione contabile - cessione di fabbricati', '0', '1', 'N6.4', 'I', '1'),
|
||||
(NULL, 'Inversione contabile - cessione di telefoni cellulari', '0', '1', 'N6.5', 'I', '1'),
|
||||
(NULL, 'Inversione contabile - cessione di prodotti elettronici', '0', '1', 'N6.6', 'I', '1'),
|
||||
(NULL, 'Inversione contabile - prestazioni comparto edile e settori connessi', '0', '1', 'N6.7', 'I', '1'),
|
||||
(NULL, 'Inversione contabile - operazioni settore energetico', '0', '1', 'N6.8', 'I', '1'),
|
||||
(NULL, 'Inversione contabile - altri casi', '0', '1', 'N6.9', 'I', '1');
|
||||
|
||||
-- Nuovi tipi di documento
|
||||
INSERT INTO `fe_tipi_documento` (`codice`, `descrizione`) VALUES
|
||||
('TD16', 'Integrazione fattura reverse charge interno'),
|
||||
('TD17', 'Integrazione/autofattura per acquisto servizi dall\'estero'),
|
||||
('TD18', 'Integrazione per acquisto di beni intracomunitari'),
|
||||
('TD19', 'Integrazione/autofattura per acquisto di beni ex art.17 c.2 DPR 633/72'),
|
||||
('TD20', 'Autofattura per regolarizzazione e integrazione delle fatture (art.6 c.8 d.lgs. 471/97 o art.46 c.5 D.L. 331/93)'),
|
||||
('TD21', 'Autofattura per splafonamento'),
|
||||
('TD22', 'Estrazione beni da deposito IVA'),
|
||||
('TD23', 'Estrazione beni da deposito IVA con versamento dell\'IVA'),
|
||||
('TD24', 'Fattura differita di cui all\'art.21, comma 4, lett. a)'),
|
||||
('TD25', 'Fattura differita di cui all\'art.21, comma 4, terzo periodo lett. b)'),
|
||||
('TD26', 'Cessione di beni ammortizzabili e per passaggi interni (ex art.36 DPR 633/72)'),
|
||||
('TD27', 'Fattura per autoconsumo o per cessioni gratuite senza rivalsa');
|
||||
|
||||
INSERT INTO `co_tipidocumento` (`id`, `descrizione`, `dir`, `reversed`, `codice_tipo_documento_fe`) VALUES
|
||||
(NULL, 'Integrazione fattura reverse charge interno', 'entrata', '0', 'TD16'),
|
||||
(NULL, 'Integrazione/autofattura per acquisto servizi dall\'estero', 'entrata', '0', 'TD17'),
|
||||
(NULL, 'Integrazione per acquisto di beni intracomunitari', 'entrata', '0', 'TD18'),
|
||||
(NULL, 'Integrazione/autofattura per acquisto di beni ex art.17 c.2 DPR 633/72', 'entrata', '0', 'TD19'),
|
||||
(NULL, 'Autofattura per regolarizzazione e integrazione delle fatture (art.6 c.8 d.lgs. 471/97 o art.46 c.5 D.L. 331/93)', 'entrata', '0', 'TD20'),
|
||||
(NULL, 'Autofattura per splafonamento', 'entrata', '0', 'TD21'),
|
||||
(NULL, 'Estrazione beni da deposito IVA', 'entrata', '0', 'TD22'),
|
||||
(NULL, 'Estrazione beni da deposito IVA con versamento dell\'IVA', 'entrata', '0', 'TD23'),
|
||||
(NULL, 'Cessione di beni ammortizzabili e per passaggi interni (ex art.36 DPR 633/72)', 'entrata', '0', 'TD26'),
|
||||
(NULL, 'Fattura per autoconsumo o per cessioni gratuite senza rivalsa', 'entrata', '0', 'TD27');
|
||||
|
||||
-- Aggiornamento tipo documento FE per fatture differite
|
||||
UPDATE `co_tipidocumento` SET `codice_tipo_documento_fe` = 'TD24' WHERE `descrizione` IN('Fattura differita di acquisto', 'Fattura differita di vendita');
|
||||
|
33
update/2_4_15.sql
Normal file
33
update/2_4_15.sql
Normal file
@ -0,0 +1,33 @@
|
||||
-- Aggiunta del campo per permettere la modifica delle Viste di default
|
||||
INSERT INTO `zz_settings` (`nome`, `valore`, `tipo`, `editable`, `sezione`) VALUES ('Modifica Viste di default', '0', 'boolean', 0, 'Generali');
|
||||
|
||||
-- Retrofix
|
||||
UPDATE `mg_articoli` SET `id_categoria` = NULL WHERE `codice` = 'DELETED';
|
||||
|
||||
-- Ottimizzazione query attività
|
||||
UPDATE `zz_modules` SET `options` = 'SELECT |select| FROM (`in_interventi` INNER JOIN `an_anagrafiche` ON `in_interventi`.`idanagrafica` = `an_anagrafiche`.`idanagrafica`) LEFT JOIN `in_interventi_tecnici` ON `in_interventi_tecnici`.`idintervento` = `in_interventi`.`id` LEFT JOIN `in_statiintervento` ON `in_interventi`.`idstatointervento`=`in_statiintervento`.`idstatointervento` LEFT JOIN (SELECT an_sedi.id, CONCAT(an_sedi.nomesede,\'<br>\',an_sedi.telefono,\'<br>\',an_sedi.cellulare,\'<br>\',an_sedi.citta,\' - \', an_sedi.indirizzo) AS info FROM an_sedi) AS sede_destinazione ON sede_destinazione.id = in_interventi.idsede_destinazione LEFT JOIN (SELECT co_righe_documenti.idintervento, CONCAT(\'Fatt. \', co_documenti.numero_esterno,\' del \', DATE_FORMAT(co_documenti.data, \'%d/%m/%Y\')) AS info FROM co_documenti INNER JOIN co_righe_documenti ON co_documenti.id = co_righe_documenti.iddocumento) AS fattura ON fattura.idintervento = in_interventi.id WHERE 1=1 |date_period(`orario_inizio`,`data_richiesta`)| GROUP BY `in_interventi`.`id` HAVING 2=2 ORDER BY IFNULL(`orario_fine`, `data_richiesta`) DESC' WHERE `name` = 'Interventi';
|
||||
|
||||
-- Aggiunta colonna Rif. fattura per attività
|
||||
INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `format`, `default`, `visible`) VALUES
|
||||
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Interventi'), 'Rif. fattura', 'fattura.info', 17, 1, 0, 0, 1);
|
||||
|
||||
-- Aggiunta indice per idintervento in co_righe_documenti
|
||||
ALTER TABLE `co_righe_documenti` ADD INDEX(`idintervento`);
|
||||
|
||||
-- Ore preavviso rinnovo con decimali per frazioni ore
|
||||
ALTER TABLE `co_contratti` CHANGE `ore_preavviso_rinnovo` `ore_preavviso_rinnovo` DECIMAL(15,6) NULL DEFAULT NULL;
|
||||
|
||||
-- Canale aggiornamenti stable/pre-release
|
||||
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `order`, `help`) VALUES (NULL, 'Abilita canale pre-release per aggiornamenti', '1', 'boolean', '1', 'Generali', NULL, "Consente di recuperare dal canale di pre-release gli aggiornamenti NON stabili del gestionale.");
|
||||
|
||||
-- Per gli articoli con id_categoria e id_sottocategoria a 0 imposto il valore NULL (permesso dalla 2.4.14)
|
||||
UPDATE `mg_articoli` SET `id_categoria` = NULL WHERE `mg_articoli`.`id_categoria` = 0;
|
||||
UPDATE `mg_articoli` SET `id_sottocategoria` = NULL WHERE `mg_articoli`.`id_sottocategoria` = 0;
|
||||
|
||||
-- Allineamento title stampe
|
||||
UPDATE `zz_prints` SET `title` = 'Ddt in uscita (senza prezzi)' WHERE `zz_prints`.`name` = 'Ddt di vendita (senza costi)';
|
||||
UPDATE `zz_prints` SET `title` = 'Ddt in uscita' WHERE `zz_prints`.`name` = 'Ddt di vendita';
|
||||
|
||||
-- Rimozione stampe ordini di servizio a db
|
||||
DELETE FROM `zz_prints` WHERE `zz_prints`.`name` = 'Ordine di servizio (senza costi)';
|
||||
DELETE FROM `zz_prints` WHERE `zz_prints`.`name` = 'Ordine di servizio';
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user