1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-06-05 22:09:38 +02:00

Formattazione codice

This commit is contained in:
Pek5892
2024-01-15 15:30:45 +01:00
parent 453b3603cc
commit b3c6cb7110
346 changed files with 2889 additions and 3287 deletions

View File

@@ -121,7 +121,7 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
echo '<script type="text/javascript"> window.parent.toastr.error("'.tr('Estensione non permessa').'"); </script>'; echo '<script type="text/javascript"> window.parent.toastr.error("'.tr('Estensione non permessa').'"); </script>';
} }
exit(); exit;
} }
// UPLOAD // UPLOAD
@@ -359,7 +359,7 @@ elseif (filter('op') == 'ordina-checks') {
elseif (post('op') == 'send-email') { elseif (post('op') == 'send-email') {
$template = Template::find(post('template')); $template = Template::find(post('template'));
$mail = \Modules\Emails\Mail::build($user, $template, $id_record); $mail = Modules\Emails\Mail::build($user, $template, $id_record);
// Rimozione allegati predefiniti // Rimozione allegati predefiniti
$mail->resetPrints(); $mail->resetPrints();

View File

@@ -31,7 +31,7 @@ if (!empty(filter('order'))) {
} }
array_shift($columns); array_shift($columns);
$total = Util\Query::readQuery($structure); $total = Query::readQuery($structure);
// Ricerca // Ricerca
$search = []; $search = [];
@@ -74,7 +74,7 @@ if (!empty($query)) {
$results['recordsFiltered'] = $data['count']; $results['recordsFiltered'] = $data['count'];
// SOMME // SOMME
$results['summable'] = Util\Query::getSums($structure, $search); $results['summable'] = Query::getSums($structure, $search);
// Allineamento delle righe // Allineamento delle righe
$align = []; $align = [];

View File

@@ -43,7 +43,7 @@ try {
} catch (Exception $e) { } catch (Exception $e) {
// Log dell'errore // Log dell'errore
$logger = logger(); $logger = logger();
$logger->addRecord(\Monolog\Logger::ERROR, $e); $logger->addRecord(Monolog\Logger::ERROR, $e);
$response = Response::error('serverError'); $response = Response::error('serverError');
} }

View File

@@ -30,7 +30,7 @@ if (version_compare(phpversion(), $minimum) < 0) {
<p>Stai utilizzando la versione PHP '.phpversion().', non compatibile con OpenSTAManager.</p> <p>Stai utilizzando la versione PHP '.phpversion().', non compatibile con OpenSTAManager.</p>
<p>Aggiorna PHP alla versione >= '.$minimum.'.</p>'; <p>Aggiorna PHP alla versione >= '.$minimum.'.</p>';
exit(); exit;
} }
// Caricamento delle impostazioni personalizzabili // Caricamento delle impostazioni personalizzabili
@@ -69,7 +69,7 @@ $config = App::getConfig();
if (!empty($config['redirectHTTPS']) && !isHTTPS(true)) { if (!empty($config['redirectHTTPS']) && !isHTTPS(true)) {
header('HTTP/1.1 301 Moved Permanently'); header('HTTP/1.1 301 Moved Permanently');
header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
exit(); exit;
} }
/* GESTIONE DEGLI ERRORI */ /* GESTIONE DEGLI ERRORI */
@@ -181,7 +181,7 @@ if (!$continue && getURLPath() != slashes(base_path().'/index.php') && !Permissi
} }
redirect(base_path().'/index.php'); redirect(base_path().'/index.php');
exit(); exit;
} }
/* INIZIALIZZAZIONE GENERALE */ /* INIZIALIZZAZIONE GENERALE */

View File

@@ -382,7 +382,7 @@ function verificaPrezzoArticolo() {
let table = $(".table-prezzi"); let table = $(".table-prezzi");
if (prezzo_anagrafica) { if (prezzo_anagrafica) {
table.append(`<tr><td class="pr_anagrafica"><small>'.($options['dir'] == 'uscita' ? tr('Prezzo listino') : tr('Netto cliente')).': '.Plugins::link(($options['dir'] == 'uscita' ? 'Listino Fornitori' : 'Netto Clienti'), $result['idarticolo'], tr('Visualizza'), null, '').'</small></td><td align="right" class="pr_anagrafica"><small>` + prezzo_anagrafica.toLocale() + ` ` + globals.currency + `</small></td>`); table.append(`<tr><td class="pr_anagrafica"><small>'.($options['dir'] == 'uscita' ? tr('Prezzo listino') : tr('Netto cliente')).': '.Plugins::link($options['dir'] == 'uscita' ? 'Listino Fornitori' : 'Netto Clienti', $result['idarticolo'], tr('Visualizza'), null, '').'</small></td><td align="right" class="pr_anagrafica"><small>` + prezzo_anagrafica.toLocale() + ` ` + globals.currency + `</small></td>`);
let tr = $(".pr_anagrafica").parent(); let tr = $(".pr_anagrafica").parent();
if (prezzo_unitario == prezzo_anagrafica.toFixed(2)) { if (prezzo_unitario == prezzo_anagrafica.toFixed(2)) {

View File

@@ -73,8 +73,8 @@ if (post('db_host') !== null) {
$privileges = current($result); $privileges = current($result);
if ( if (
string_contains($privileges, ' ON `'.$db_name.'`.*') || string_contains($privileges, ' ON `'.$db_name.'`.*')
string_contains($privileges, ' ON *.*') || string_contains($privileges, ' ON *.*')
) { ) {
$pieces = explode(', ', explode(' ON ', str_replace('GRANT ', '', $privileges))[0]); $pieces = explode(', ', explode(' ON ', str_replace('GRANT ', '', $privileges))[0]);
@@ -110,7 +110,7 @@ if (post('db_host') !== null) {
} }
echo $state; echo $state;
exit(); exit;
} }
// Creazione della configurazione // Creazione della configurazione
@@ -182,7 +182,7 @@ if (post('db_host') !== null) {
// Creazione manifest.json // Creazione manifest.json
include_once App::filepath('include/init', 'manifest.php'); include_once App::filepath('include/init', 'manifest.php');
redirect(base_path().'/index.php'); redirect(base_path().'/index.php');
exit(); exit;
} }
} }
} }
@@ -587,4 +587,4 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) {
include_once App::filepath('include|custom|', 'bottom.php'); include_once App::filepath('include|custom|', 'bottom.php');
exit(); exit;

View File

@@ -116,7 +116,7 @@ if (post('action') == 'init') {
} }
redirect(base_path(), 'js'); redirect(base_path(), 'js');
exit(); exit;
} }
$img = App::getPaths()['img']; $img = App::getPaths()['img'];
@@ -263,4 +263,4 @@ echo '
include_once App::filepath('include|custom|', 'bottom.php'); include_once App::filepath('include|custom|', 'bottom.php');
exit(); exit;

View File

@@ -43,5 +43,5 @@ if ($config['maintenance_ip'] != $_SERVER['REMOTE_ADDR']) {
include_once App::filepath('include|custom|', 'bottom.php'); include_once App::filepath('include|custom|', 'bottom.php');
exit(); exit;
} }

View File

@@ -263,7 +263,7 @@ foreach ($db as $name => $values) {
$description = tr('Valore consigliato: _VALUE_ (Valore attuale: _INC_)', [ $description = tr('Valore consigliato: _VALUE_ (Valore attuale: _INC_)', [
'_VALUE_' => $description, '_VALUE_' => $description,
'_INC_' => \Util\FileSystem::formatBytes($inc), '_INC_' => Util\FileSystem::formatBytes($inc),
]); ]);
} }
@@ -364,7 +364,7 @@ foreach ($config_to_check as $name => $values) {
]); ]);
} }
$status = ($values['operator']((!empty($values['section']) ? ${$values['section']}[$name] : $$name), $values['value_to_check']) ? 1 : 0); $status = ($values['operator'](!empty($values['section']) ? ${$values['section']}[$name] : $$name, $values['value_to_check']) ? 1 : 0);
$config[] = [ $config[] = [
'name' => $name, 'name' => $name,

View File

@@ -109,7 +109,7 @@ if (filter('action') == 'do_update') {
</a>'; </a>';
} }
exit(); exit;
} elseif (Update::isUpdateAvailable()) { } elseif (Update::isUpdateAvailable()) {
// Controllo se l'aggiornamento è in esecuzione // Controllo se l'aggiornamento è in esecuzione
if (Update::isUpdateLocked() && filter('force') === null) { if (Update::isUpdateLocked() && filter('force') === null) {
@@ -131,7 +131,7 @@ if (filter('action') == 'do_update') {
include_once App::filepath('include|custom|', 'bottom.php'); include_once App::filepath('include|custom|', 'bottom.php');
exit(); exit;
} }
$firstuse = !$dbo->isInstalled() ? 'true' : 'false'; $firstuse = !$dbo->isInstalled() ? 'true' : 'false';

View File

@@ -204,7 +204,7 @@ if (Auth::check()) {
search: search, search: search,
translations: translations, translations: translations,
locale: "'.(explode('_', $lang)[0]).'", locale: "'.explode('_', $lang)[0].'",
full_locale: "'.$lang.'", full_locale: "'.$lang.'",
start_date: "'.$_SESSION['period_start'].'", start_date: "'.$_SESSION['period_start'].'",
@@ -274,7 +274,7 @@ if (Auth::check()) {
date_format: "'.formatter()->getDatePattern().'", date_format: "'.formatter()->getDatePattern().'",
time_format: "'.formatter()->getTimePattern().'", time_format: "'.formatter()->getTimePattern().'",
locale: "'.(explode('_', $lang)[0]).'", locale: "'.explode('_', $lang)[0].'",
full_locale: "'.$lang.'", full_locale: "'.$lang.'",
}; };
</script>'; </script>';
@@ -565,7 +565,7 @@ if (Auth::check()) {
<a class="bg-info" data-toggle="tab" href="#tab_checks" id="link-tab_checks"> <a class="bg-info" data-toggle="tab" href="#tab_checks" id="link-tab_checks">
'.tr('Checklist').' '.tr('Checklist').'
'.(($checklists_total->count() > 0) ? '.(($checklists_total->count() > 0) ?
'<span class="badge pull-right">'.$checklists_unchecked->count().tr(' / ').($checklists_total->count()).'</span>' : '').' '<span class="badge pull-right">'.$checklists_unchecked->count().tr(' / ').$checklists_total->count().'</span>' : '').'
</a> </a>
</li>'; </li>';
} }

View File

@@ -53,7 +53,7 @@ switch ($op) {
flash()->error(Auth::getStatus()[$status]['message']); flash()->error(Auth::getStatus()[$status]['message']);
redirect(base_path().'/index.php'); redirect(base_path().'/index.php');
exit(); exit;
} }
break; break;
@@ -62,7 +62,7 @@ switch ($op) {
Auth::logout(); Auth::logout();
redirect(base_path().'/index.php'); redirect(base_path().'/index.php');
exit(); exit;
} }
if (Auth::check() && isset($dbo) && $dbo->isConnected() && $dbo->isInstalled()) { if (Auth::check() && isset($dbo) && $dbo->isConnected() && $dbo->isInstalled()) {
@@ -73,7 +73,7 @@ if (Auth::check() && isset($dbo) && $dbo->isConnected() && $dbo->isInstalled())
} else { } else {
redirect(base_path().'/index.php?op=logout'); redirect(base_path().'/index.php?op=logout');
} }
exit(); exit;
} }
// Modalità manutenzione // Modalità manutenzione

View File

@@ -95,12 +95,6 @@ function calcola_sconto($data)
/** /**
* Individua il valore della colonna order per i nuovi elementi di una tabella. * Individua il valore della colonna order per i nuovi elementi di una tabella.
*
* @param $table
* @param $field
* @param $id
*
* @return mixed
*/ */
function orderValue($table, $field, $id) function orderValue($table, $field, $id)
{ {
@@ -109,10 +103,6 @@ function orderValue($table, $field, $id)
/** /**
* Ricalcola il riordinamento righe di una tabella. * Ricalcola il riordinamento righe di una tabella.
*
* @param $table
*
* @return mixed
*/ */
function reorderRows($table, $field, $id) function reorderRows($table, $field, $id)
{ {
@@ -172,14 +162,13 @@ function provvigioneInfo(Accounting $riga, $mostra_provigione = true)
/** /**
* Genera i riferimenti ai documenti del gestionale, attraverso l'interfaccia Common\ReferenceInterface. * Genera i riferimenti ai documenti del gestionale, attraverso l'interfaccia Common\ReferenceInterface.
* *
* @param $document
* @param string $text Formato "Contenuto descrittivo _DOCUMENT_" * @param string $text Formato "Contenuto descrittivo _DOCUMENT_"
* *
* @return string * @return string
*/ */
function reference($document, $text = null) function reference($document, $text = null)
{ {
if (!empty($document) && !($document instanceof \Common\ReferenceInterface)) { if (!empty($document) && !($document instanceof Common\ReferenceInterface)) {
return null; return null;
} }
@@ -208,8 +197,6 @@ function reference($document, $text = null)
* Funzione che gestisce il parsing di uno sconto combinato e la relativa trasformazione in sconto fisso. * Funzione che gestisce il parsing di uno sconto combinato e la relativa trasformazione in sconto fisso.
* Esempio: (40 + 10) % = 44 %. * Esempio: (40 + 10) % = 44 %.
* *
* @param $combinato
*
* @return float|int * @return float|int
*/ */
function parseScontoCombinato($combinato) function parseScontoCombinato($combinato)
@@ -234,8 +221,6 @@ function parseScontoCombinato($combinato)
/** /**
* Visualizza le informazioni del segmento. * Visualizza le informazioni del segmento.
* *
* @param $id_module
*
* @return float|int * @return float|int
*/ */
function getSegmentPredefined($id_module) function getSegmentPredefined($id_module)
@@ -248,11 +233,6 @@ function getSegmentPredefined($id_module)
/** /**
* Funzione che visualizza i prezzi degli articoli nei listini. * Funzione che visualizza i prezzi degli articoli nei listini.
* *
* @param $id_anagrafica
* @param $direzione
* @param $id_articolo
* @param $riga
*
* @return array * @return array
*/ */
function getPrezzoConsigliato($id_anagrafica, $direzione, $id_articolo, $riga = null) function getPrezzoConsigliato($id_anagrafica, $direzione, $id_articolo, $riga = null)

View File

@@ -40,13 +40,9 @@ function get_next_code($str, $qty = 1, $mask = '')
* Se descrizione = 1 e il tipo è 'query=' mi restituisce il valore del campo descrizione della query. * Se descrizione = 1 e il tipo è 'query=' mi restituisce il valore del campo descrizione della query.
* *
* @deprecated 2.4.2 * @deprecated 2.4.2
* *
* @param string $name
* @param string $sezione * @param string $sezione
* @param string $descrizione * @param string $descrizione
*
* @return mixed
*/ */
function get_var($nome, $sezione = null, $descrizione = false, $again = false) function get_var($nome, $sezione = null, $descrizione = false, $again = false)
{ {
@@ -163,7 +159,7 @@ function datediff($interval, $datefrom, $dateto, $using_timestamps = false)
break; break;
case 'm': // Number of full months case 'm': // Number of full months
$months_difference = floor($difference / 2678400); $months_difference = floor($difference / 2678400);
while (mktime(date('H', $datefrom), date('i', $datefrom), date('s', $datefrom), date('n', $datefrom) + ($months_difference), date('j', $dateto), date('Y', $datefrom)) < $dateto) { while (mktime(date('H', $datefrom), date('i', $datefrom), date('s', $datefrom), date('n', $datefrom) + $months_difference, date('j', $dateto), date('Y', $datefrom)) < $dateto) {
++$months_difference; ++$months_difference;
} }
--$months_difference; --$months_difference;
@@ -207,12 +203,6 @@ function datediff($interval, $datefrom, $dateto, $using_timestamps = false)
} }
/** /**
* @param $field
* @param $id_riga
* @param $old_qta
* @param $new_qta
* @param $dir
*
* @throws Exception * @throws Exception
* *
* @return bool * @return bool
@@ -274,8 +264,6 @@ function seriali_non_rimuovibili($field, $id_riga, $dir)
/** /**
* Restistuisce le informazioni sull'eventuale riferimento ai documenti. * Restistuisce le informazioni sull'eventuale riferimento ai documenti.
* *
* @param $info
* @param $dir
* @param array $ignore * @param array $ignore
* *
* @deprecated * @deprecated

View File

@@ -54,8 +54,6 @@ function redirect($url, $type = 'php')
* Verifica e corregge il nome di un file. * Verifica e corregge il nome di un file.
* *
* @param string $filename * @param string $filename
*
* @return mixed
*/ */
function sanitizeFilename($filename) function sanitizeFilename($filename)
{ {
@@ -96,14 +94,13 @@ function delete($files)
*/ */
function directory($path) function directory($path)
{ {
return Util\FileSystem::directory($path); return FileSystem::directory($path);
} }
/** /**
* Copy a file, or recursively copy a folder and its contents. * Copy a file, or recursively copy a folder and its contents.
* *
* @param array|string $source Source path * @param array|string $source Source path
* @param string $dest Destination path
* @param array|string $ignores Paths to ingore * @param array|string $ignores Paths to ingore
* *
* @return bool Returns TRUE on success, FALSE on failure * @return bool Returns TRUE on success, FALSE on failure
@@ -300,7 +297,7 @@ function slashes($string)
*/ */
function isAjaxRequest() function isAjaxRequest()
{ {
return \Whoops\Util\Misc::isAjaxRequest() && filter('ajax') !== null; return Whoops\Util\Misc::isAjaxRequest() && filter('ajax') !== null;
} }
/** /**
@@ -327,7 +324,7 @@ function redirectOperation($id_module, $id_record)
redirect(base_path().'/controller.php?id_module='.$id_module.$hash); redirect(base_path().'/controller.php?id_module='.$id_module.$hash);
} }
exit(); exit;
} }
} }

View File

@@ -27,11 +27,11 @@ use HTMLBuilder\HTMLBuilder;
/** /**
* Restituisce l'oggetto dedicato alla gestione della connessione con il database. * Restituisce l'oggetto dedicato alla gestione della connessione con il database.
* *
* @return \Database * @return Database
*/ */
function database() function database()
{ {
return \Database::getConnection(); return Database::getConnection();
} }
/** /**
@@ -41,8 +41,6 @@ function database()
* @param string $parameter * @param string $parameter
* *
* @since 2.3 * @since 2.3
*
* @return mixed
*/ */
function prepare($parameter) function prepare($parameter)
{ {
@@ -62,7 +60,7 @@ function prepare($parameter)
*/ */
function filter($param, $method = null, $raw = false) function filter($param, $method = null, $raw = false)
{ {
return \Filter::getValue($param, $method, $raw); return Filter::getValue($param, $method, $raw);
} }
/** /**
@@ -77,7 +75,7 @@ function filter($param, $method = null, $raw = false)
*/ */
function post($param, $raw = false) function post($param, $raw = false)
{ {
return \Filter::getValue($param, 'post', $raw); return Filter::getValue($param, 'post', $raw);
} }
/** /**
@@ -92,7 +90,7 @@ function post($param, $raw = false)
*/ */
function get($param, $raw = false) function get($param, $raw = false)
{ {
return \Filter::getValue($param, 'get', $raw); return Filter::getValue($param, 'get', $raw);
} }
/** /**
@@ -107,7 +105,7 @@ function get($param, $raw = false)
*/ */
function setting($name, $again = false) function setting($name, $again = false)
{ {
return \Settings::getValue($name); return Settings::getValue($name);
} }
/** /**
@@ -115,7 +113,7 @@ function setting($name, $again = false)
* *
* @since 2.4.2 * @since 2.4.2
* *
* @return \Util\Messages * @return Util\Messages
*/ */
function flash() function flash()
{ {
@@ -127,11 +125,11 @@ function flash()
* *
* @since 2.4.2 * @since 2.4.2
* *
* @return \Auth * @return Auth
*/ */
function auth() function auth()
{ {
return \Auth::getInstance(); return Auth::getInstance();
} }
/** /**
@@ -139,11 +137,11 @@ function auth()
* *
* @since 2.4.2 * @since 2.4.2
* *
* @return \Translator * @return Translator
*/ */
function trans() function trans()
{ {
return \Translator::getInstance(); return Translator::getInstance();
} }
/** /**
@@ -151,11 +149,11 @@ function trans()
* *
* @since 2.4.2 * @since 2.4.2
* *
* @return \Intl\Formatter * @return Intl\Formatter
*/ */
function formatter() function formatter()
{ {
return \Translator::getFormatter(); return Translator::getFormatter();
} }
/** /**
@@ -171,7 +169,7 @@ function formatter()
*/ */
function tr($string, $parameters = [], $operations = []) function tr($string, $parameters = [], $operations = [])
{ {
return \Translator::translate($string, $parameters, $operations); return Translator::translate($string, $parameters, $operations);
} }
// Retrocompatibilità (con la funzione gettext) // Retrocompatibilità (con la funzione gettext)
@@ -187,7 +185,7 @@ if (!function_exists('_')) {
* *
* @since 2.4.2 * @since 2.4.2
* *
* @return \Monolog\Logger * @return Monolog\Logger
*/ */
function logger() function logger()
{ {
@@ -213,7 +211,8 @@ function numberFormat($number, $decimals = null)
* Restituisce il timestamp indicato formattato secondo la configurazione del sistema. * Restituisce il timestamp indicato formattato secondo la configurazione del sistema.
* *
* @param string $timestamp * @param string $timestamp
+ * * + *
*
* @return string * @return string
* *
* @since 2.4.8 * @since 2.4.8
@@ -260,14 +259,12 @@ function timeFormat($time)
*/ */
function currency() function currency()
{ {
return \Translator::getCurrency(); return Translator::getCurrency();
} }
/** /**
* Restituisce il numero indicato formattato come una valuta secondo la configurazione del sistema. * Restituisce il numero indicato formattato come una valuta secondo la configurazione del sistema.
* *
* @param string $time
*
* @return string * @return string
* *
* @since 2.4.9 * @since 2.4.9

View File

@@ -48,8 +48,6 @@ if (!function_exists('array_clean')) {
/** /**
* Pulisce i contenuti vuoti di un array. * Pulisce i contenuti vuoti di un array.
* *
* @param $array
*
* @since 2.3.2 * @since 2.3.2
* *
* @return array * @return array
@@ -68,8 +66,6 @@ if (!function_exists('array_deep_clean')) {
/** /**
* Pulisce i contenuti vuoti di un array. * Pulisce i contenuti vuoti di un array.
* *
* @param $array
*
* @since 2.4.11 * @since 2.4.11
* *
* @return array * @return array
@@ -240,7 +236,7 @@ if (!function_exists('random_string')) {
// Don't allow duplicate letters to be disabled if the length is // Don't allow duplicate letters to be disabled if the length is
// longer than the available characters // longer than the available characters
if ($no_duplicate_chars && strlen($pool) < $length) { if ($no_duplicate_chars && strlen($pool) < $length) {
throw new \LengthException('$length exceeds the size of the pool and $no_duplicate_chars is enabled'); throw new LengthException('$length exceeds the size of the pool and $no_duplicate_chars is enabled');
} }
// Convert the pool of characters into an array of characters and // Convert the pool of characters into an array of characters and
@@ -286,7 +282,7 @@ if (!function_exists('secure_random_string')) {
$bytes = openssl_random_pseudo_bytes($length * 2); $bytes = openssl_random_pseudo_bytes($length * 2);
if ($bytes === false) { if ($bytes === false) {
throw new \LengthException('$length is not accurate, unable to generate random string'); throw new LengthException('$length is not accurate, unable to generate random string');
} }
return substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $length); return substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $length);
@@ -304,9 +300,6 @@ if (!function_exists('download')) {
* *
* @param string $filename The name of the filename to display to * @param string $filename The name of the filename to display to
* browsers * browsers
* @param string $content The content to output for the download.
* If you don't specify this, just the
* headers will be sent
* *
* @since 2.3 * @since 2.3
* *
@@ -427,7 +420,7 @@ if (!function_exists('color_darken')) {
} }
$rgb = ''; $rgb = '';
for ($x = 0; $x < 3; ++$x) { for ($x = 0; $x < 3; ++$x) {
$c = hexdec(substr($color, (2 * $x), 2)) - $dif; $c = hexdec(substr($color, 2 * $x, 2)) - $dif;
$c = ($c < 0) ? 0 : dechex($c); $c = ($c < 0) ? 0 : dechex($c);
$rgb .= (strlen($c) < 2) ? '0'.$c : $c; $rgb .= (strlen($c) < 2) ? '0'.$c : $c;
} }
@@ -543,9 +536,6 @@ if (!function_exists('temp_file')) {
/** /**
* Crea un file temporaneo e lo imposta per la rimozione alla fine dell'esecuzione. * Crea un file temporaneo e lo imposta per la rimozione alla fine dell'esecuzione.
* *
* @param $name
* @param $content
*
* @return string * @return string
*/ */
function temp_file($name = null, $content = null) function temp_file($name = null, $content = null)

View File

@@ -21,15 +21,13 @@ namespace Modules\Aggiornamenti;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use Hooks\CachedManager; use Hooks\CachedManager;
use Modules;
use Update;
/** /**
* Hook dedicato all'individuazione di nuove versioni del gestionale, pubblicate sulla repository ufficiale di GitHub. * Hook dedicato all'individuazione di nuove versioni del gestionale, pubblicate sulla repository ufficiale di GitHub.
*/ */
class UpdateHook extends CachedManager class UpdateHook extends CachedManager
{ {
protected static $client = null; protected static $client;
public function getCacheName() public function getCacheName()
{ {
@@ -44,11 +42,11 @@ class UpdateHook extends CachedManager
public function response() public function response()
{ {
$update = $this->getCache()->content[0]; $update = $this->getCache()->content[0];
if ($update == Update::getVersion() || empty(setting('Attiva aggiornamenti'))) { if ($update == \Update::getVersion() || empty(setting('Attiva aggiornamenti'))) {
$update = null; $update = null;
} }
$module = Modules::get('Aggiornamenti'); $module = \Modules::get('Aggiornamenti');
$link = base_path().'/controller.php?id_module='.$module->id; $link = base_path().'/controller.php?id_module='.$module->id;
$message = tr("E' disponibile la versione _VERSION_ del gestionale", [ $message = tr("E' disponibile la versione _VERSION_ del gestionale", [
@@ -75,7 +73,7 @@ class UpdateHook extends CachedManager
if (!$api['prerelease'] or setting('Abilita canale pre-release per aggiornamenti')) { if (!$api['prerelease'] or setting('Abilita canale pre-release per aggiornamenti')) {
$version[0] = ltrim($api['tag_name'], 'v'); $version[0] = ltrim($api['tag_name'], 'v');
$version[1] = !empty($api['prerelease']) ? 'beta' : 'stabile'; $version[1] = !empty($api['prerelease']) ? 'beta' : 'stabile';
$current = Update::getVersion(); $current = \Update::getVersion();
if (version_compare($current, $version[0]) < 0) { if (version_compare($current, $version[0]) < 0) {
return $version; return $version;

View File

@@ -121,7 +121,7 @@ echo '
{[ "type": "text", "label": "'.tr('PEC').'", "name": "pec", "class": "email-mask", "placeholder":"pec@dominio.ext", "icon-before": "<i class=\'fa fa-envelope-o\'></i>" ]} {[ "type": "text", "label": "'.tr('PEC').'", "name": "pec", "class": "email-mask", "placeholder":"pec@dominio.ext", "icon-before": "<i class=\'fa fa-envelope-o\'></i>" ]}
</div>'; </div>';
$help_codice_destinatario = tr("Per impostare il codice specificare prima '<b>Tipologia</b>' e '<b>Nazione</b>' dell'anagrafica").':<br><br><ul><li>'.tr('Ente pubblico (B2G/PA) - Codice Univoco Ufficio (www.indicepa.gov.it), 6 caratteri').'</li><li>'.tr('Azienda (B2B) - Codice Destinatario, 7 caratteri').'</li><li>'.tr('Privato (B2C) - viene utilizzato il Codice Fiscale').'</li>'.'</ul>Se non si conosce il codice destinatario lasciare vuoto il campo. Verrà applicato in automatico quello previsto di default dal sistema (\'0000000\', \'999999\', \'XXXXXXX\').'; $help_codice_destinatario = tr("Per impostare il codice specificare prima '<b>Tipologia</b>' e '<b>Nazione</b>' dell'anagrafica").':<br><br><ul><li>'.tr('Ente pubblico (B2G/PA) - Codice Univoco Ufficio (www.indicepa.gov.it), 6 caratteri').'</li><li>'.tr('Azienda (B2B) - Codice Destinatario, 7 caratteri').'</li><li>'.tr('Privato (B2C) - viene utilizzato il Codice Fiscale').'</li></ul>Se non si conosce il codice destinatario lasciare vuoto il campo. Verrà applicato in automatico quello previsto di default dal sistema (\'0000000\', \'999999\', \'XXXXXXX\').';
echo ' echo '
<div class="col-md-4"> <div class="col-md-4">

View File

@@ -30,7 +30,6 @@ use Modules\Ordini\Ordine;
use Modules\Preventivi\Preventivo; use Modules\Preventivi\Preventivo;
use Modules\TipiIntervento\Tipo as TipoSessione; use Modules\TipiIntervento\Tipo as TipoSessione;
use Plugins\DichiarazioniIntento\Dichiarazione; use Plugins\DichiarazioniIntento\Dichiarazione;
use Settings;
use Traits\RecordTrait; use Traits\RecordTrait;
use Util\Generator; use Util\Generator;
@@ -100,7 +99,7 @@ class Anagrafica extends Model
public static function fixAzienda(Anagrafica $anagrafica) public static function fixAzienda(Anagrafica $anagrafica)
{ {
Settings::setValue('Azienda predefinita', $anagrafica->id); \Settings::setValue('Azienda predefinita', $anagrafica->id);
} }
public static function fixCliente(Anagrafica $anagrafica) public static function fixCliente(Anagrafica $anagrafica)

View File

@@ -297,7 +297,7 @@ switch (post('op')) {
// Combinazione di seriali // Combinazione di seriali
$serials = []; $serials = [];
for ($s = 0; $s < $totale; ++$s) { for ($s = 0; $s < $totale; ++$s) {
$serial = $prefix.(str_pad($numero_start + $s, $pad_length, '0', STR_PAD_LEFT)); $serial = $prefix.str_pad($numero_start + $s, $pad_length, '0', STR_PAD_LEFT);
$serials[] = $serial; $serials[] = $serial;
} }

View File

@@ -155,7 +155,7 @@ switch (post('op')) {
} }
redirect(base_path().'/pdfgen.php?id_print='.$id_print.'&id_record='.Articolo::where('codice', '!=', '')->first()->id); redirect(base_path().'/pdfgen.php?id_print='.$id_print.'&id_record='.Articolo::where('codice', '!=', '')->first()->id);
exit(); exit;
case 'change-qta': case 'change-qta':
$descrizione = post('descrizione'); $descrizione = post('descrizione');
@@ -219,7 +219,7 @@ switch (post('op')) {
$database->commitTransaction(); $database->commitTransaction();
redirect(base_path().'/editor.php?id_module='.Modules::get('Preventivi')['id'].'&id_record='.$id_preventivo); redirect(base_path().'/editor.php?id_module='.Modules::get('Preventivi')['id'].'&id_record='.$id_preventivo);
exit(); exit;
case 'export-csv': case 'export-csv':
$file = temp_file(); $file = temp_file();

View File

@@ -181,7 +181,7 @@ if (empty(get('modal'))) {
$id = $data[0]['idordine']; $id = $data[0]['idordine'];
} }
$totali[] = [($data[0]['prezzo_unitario'] - $data[0]['sconto_unitario']), $data[0]['iva_unitaria']]; $totali[] = [$data[0]['prezzo_unitario'] - $data[0]['sconto_unitario'], $data[0]['iva_unitaria']];
$numero = !empty($data[0]['numero_esterno']) ? $data[0]['numero_esterno'] : $data[0]['numero']; $numero = !empty($data[0]['numero_esterno']) ? $data[0]['numero_esterno'] : $data[0]['numero'];
@@ -300,7 +300,7 @@ if (empty(get('modal'))) {
$id = $data[0]['idvendita']; $id = $data[0]['idvendita'];
} }
$totali[] = [($data[0]['prezzo_unitario'] - $data[0]['sconto_unitario']), $data[0]['iva_unitaria']]; $totali[] = [$data[0]['prezzo_unitario'] - $data[0]['sconto_unitario'], $data[0]['iva_unitaria']];
$numero = !empty($data[0]['numero_esterno']) ? $data[0]['numero_esterno'] : $data[0]['numero']; $numero = !empty($data[0]['numero_esterno']) ? $data[0]['numero_esterno'] : $data[0]['numero'];

View File

@@ -22,14 +22,12 @@ namespace Modules\Articoli;
use Common\SimpleModelTrait; use Common\SimpleModelTrait;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
use Modules;
use Modules\AttributiCombinazioni\ValoreAttributo; use Modules\AttributiCombinazioni\ValoreAttributo;
use Modules\CombinazioniArticoli\Combinazione; use Modules\CombinazioniArticoli\Combinazione;
use Modules\Interventi\Components\Articolo as ArticoloIntervento; use Modules\Interventi\Components\Articolo as ArticoloIntervento;
use Modules\Iva\Aliquota; use Modules\Iva\Aliquota;
use Plugins\ListinoFornitori\DettaglioFornitore; use Plugins\ListinoFornitori\DettaglioFornitore;
use Traits\RecordTrait; use Traits\RecordTrait;
use Uploads;
class Articolo extends Model class Articolo extends Model
{ {
@@ -64,7 +62,6 @@ class Articolo extends Model
/** /**
* Funzione per registrare un movimento del magazzino in relazione all'articolo corrente, modificando di conseguenza la quantità dell'articolo stesso. * Funzione per registrare un movimento del magazzino in relazione all'articolo corrente, modificando di conseguenza la quantità dell'articolo stesso.
* *
* @param $qta
* @param string $descrizone * @param string $descrizone
* @param string $data * @param string $data
* @param bool $manuale * @param bool $manuale
@@ -89,7 +86,6 @@ class Articolo extends Model
/** /**
* Funzione per registrare un movimento del magazzino in relazione all'articolo corrente, senza movimentare la quantità dell'articolo stesso. * Funzione per registrare un movimento del magazzino in relazione all'articolo corrente, senza movimentare la quantità dell'articolo stesso.
* *
* @param $qta
* @param string $descrizone * @param string $descrizone
* @param string $data * @param string $data
* @param bool $manuale * @param bool $manuale
@@ -124,9 +120,6 @@ class Articolo extends Model
/** /**
* Imposta il prezzo di vendita sulla base dell'impstazione per l'utilizzo dei prezzi comprensivi di IVA. * Imposta il prezzo di vendita sulla base dell'impstazione per l'utilizzo dei prezzi comprensivi di IVA.
*
* @param $prezzo_vendita
* @param $id_iva
*/ */
public function setPrezzoVendita($prezzo_vendita, $id_iva) public function setPrezzoVendita($prezzo_vendita, $id_iva)
{ {
@@ -147,9 +140,6 @@ class Articolo extends Model
/** /**
* Imposta il prezzo di vendita sulla base dell'impstazione per l'utilizzo dei prezzi comprensivi di IVA. * Imposta il prezzo di vendita sulla base dell'impstazione per l'utilizzo dei prezzi comprensivi di IVA.
*
* @param $prezzo_vendita
* @param $id_iva
*/ */
public function setMinimoVendita($prezzo_minimo, $id_iva) public function setMinimoVendita($prezzo_minimo, $id_iva)
{ {
@@ -168,8 +158,6 @@ class Articolo extends Model
/** /**
* Imposta il prezzo di acquisto e aggiorna il prezzo di vendita in base al coefficiente. * Imposta il prezzo di acquisto e aggiorna il prezzo di vendita in base al coefficiente.
*
* @param $value
*/ */
public function setPrezzoAcquistoAttribute($value) public function setPrezzoAcquistoAttribute($value)
{ {
@@ -217,8 +205,8 @@ class Articolo extends Model
return null; return null;
} }
$module = Modules::get($this->module); $module = \Modules::get($this->module);
$fileinfo = Uploads::fileInfo($this->immagine); $fileinfo = \Uploads::fileInfo($this->immagine);
$directory = '/'.$module->upload_directory.'/'; $directory = '/'.$module->upload_directory.'/';
$image = $directory.$this->immagine; $image = $directory.$this->immagine;

View File

@@ -22,7 +22,6 @@ namespace Modules\Articoli\Import;
use Carbon\Carbon; use Carbon\Carbon;
use Importer\CSVImporter; use Importer\CSVImporter;
use Models\Upload; use Models\Upload;
use Modules;
use Modules\Anagrafiche\Anagrafica; use Modules\Anagrafiche\Anagrafica;
use Modules\Anagrafiche\Sede; use Modules\Anagrafiche\Sede;
use Modules\Anagrafiche\Tipo; use Modules\Anagrafiche\Tipo;
@@ -31,7 +30,6 @@ use Modules\Articoli\Categoria;
use Modules\Iva\Aliquota; use Modules\Iva\Aliquota;
use Plugins\ListinoClienti\DettaglioPrezzo; use Plugins\ListinoClienti\DettaglioPrezzo;
use Plugins\ListinoFornitori\DettaglioFornitore; use Plugins\ListinoFornitori\DettaglioFornitore;
use Uploads;
/** /**
* Struttura per la gestione delle operazioni di importazione (da CSV) degli Articoli. * Struttura per la gestione delle operazioni di importazione (da CSV) degli Articoli.
@@ -331,7 +329,7 @@ class CSV extends CSVImporter
$articolo->attivo = 1; $articolo->attivo = 1;
// Esportazione della quantità indicata // Esportazione della quantità indicata
$nuova_qta = (float) ($record['qta']); $nuova_qta = (float) $record['qta'];
$nome_sede = $record['nome_sede']; $nome_sede = $record['nome_sede'];
if (!empty($dettagli['id_fornitore']) || !empty($dettagli['anagrafica_listino'] || !empty($dettagli['partita_iva']))) { if (!empty($dettagli['id_fornitore']) || !empty($dettagli['anagrafica_listino'] || !empty($dettagli['partita_iva']))) {
@@ -367,8 +365,8 @@ class CSV extends CSVImporter
if (!empty($file_content)) { if (!empty($file_content)) {
if ($record['import_immagine'] == 2 || $record['import_immagine'] == 4) { if ($record['import_immagine'] == 2 || $record['import_immagine'] == 4) {
Uploads::deleteLinked([ \Uploads::deleteLinked([
'id_module' => Modules::get('Articoli')['id'], 'id_module' => \Modules::get('Articoli')['id'],
'id_record' => $articolo->id, 'id_record' => $articolo->id,
]); ]);
@@ -381,11 +379,11 @@ class CSV extends CSVImporter
$name = 'immagine_'.$articolo->id.'.'.Upload::getExtensionFromMimeType($file_content); $name = 'immagine_'.$articolo->id.'.'.Upload::getExtensionFromMimeType($file_content);
$upload = Uploads::upload($file_content, [ $upload = \Uploads::upload($file_content, [
'name' => 'Immagine', 'name' => 'Immagine',
'category' => 'Immagini', 'category' => 'Immagini',
'original_name' => $name, 'original_name' => $name,
'id_module' => Modules::get('Articoli')['id'], 'id_module' => \Modules::get('Articoli')['id'],
'id_record' => $articolo->id, 'id_record' => $articolo->id,
], [ ], [
'thumbnails' => true, 'thumbnails' => true,

View File

@@ -149,7 +149,6 @@ class Movimento extends Model
/** /**
* Restituisce una descrizione standard applicabile a un movimento sulla base della relativa quantità e alla direzione. * Restituisce una descrizione standard applicabile a un movimento sulla base della relativa quantità e alla direzione.
* *
* @param $qta
* @param string $direzione * @param string $direzione
* *
* @return string * @return string

View File

@@ -63,7 +63,7 @@ switch (filter('op')) {
} else { } else {
flash()->error(tr('Errore durante la creazione del backup!').' '.str_replace('_DIR_', '"'.$backup_dir.'"', tr('Verifica che la cartella _DIR_ abbia i permessi di scrittura!'))); flash()->error(tr('Errore durante la creazione del backup!').' '.str_replace('_DIR_', '"'.$backup_dir.'"', tr('Verifica che la cartella _DIR_ abbia i permessi di scrittura!')));
} }
} catch (\Exception $e) { } catch (Exception $e) {
flash()->error(tr('Errore durante la creazione del backup!').' '.$e->getMessage()); flash()->error(tr('Errore durante la creazione del backup!').' '.$e->getMessage());
} }

View File

@@ -29,13 +29,13 @@ class BackupTask extends Manager
{ {
public function needsExecution() public function needsExecution()
{ {
return setting('Backup automatico') && !Backup::isDailyComplete(); return setting('Backup automatico') && !\Backup::isDailyComplete();
} }
public function execute() public function execute()
{ {
if (setting('Backup automatico') && !Backup::isDailyComplete()) { if (setting('Backup automatico') && !\Backup::isDailyComplete()) {
Backup::daily(); \Backup::daily();
} }
} }
} }

View File

@@ -2,8 +2,6 @@
namespace Modules\Banche; namespace Modules\Banche;
use UnexpectedValueException;
/** /**
* Format: * Format:
* b = National bank code (Codice ABI) * b = National bank code (Codice ABI)
@@ -418,7 +416,7 @@ class IBAN
$matches = array_filter($matches, 'is_string', ARRAY_FILTER_USE_KEY); $matches = array_filter($matches, 'is_string', ARRAY_FILTER_USE_KEY);
foreach ($matches as $key => $value) { foreach ($matches as $key => $value) {
if (!isset($value[0])) { if (!isset($value[0])) {
throw new UnexpectedValueException('Invalid '.$key.' for format '.$regex); throw new \UnexpectedValueException('Invalid '.$key.' for format '.$regex);
} }
$this->{$key} = $value[0]; $this->{$key} = $value[0];

View File

@@ -44,7 +44,7 @@ switch (filter('op')) {
if ($id_original != null) { if ($id_original != null) {
$database->commitTransaction(); $database->commitTransaction();
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record)); redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
exit(); exit;
} }
break; break;
@@ -90,7 +90,7 @@ switch (filter('op')) {
// Redirect alla categoria se si sta aggiungendo una sottocategoria // Redirect alla categoria se si sta aggiungendo una sottocategoria
$database->commitTransaction(); $database->commitTransaction();
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record)); redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
exit(); exit;
} }
break; break;

View File

@@ -48,7 +48,7 @@ switch (filter('op')) {
if ($id_original != null) { if ($id_original != null) {
$database->commitTransaction(); $database->commitTransaction();
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record)); redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
exit(); exit;
} }
break; break;
@@ -94,7 +94,7 @@ switch (filter('op')) {
// Redirect alla categoria se si sta aggiungendo una sottocategoria // Redirect alla categoria se si sta aggiungendo una sottocategoria
$database->commitTransaction(); $database->commitTransaction();
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record)); redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.($id_original ?: $id_record));
exit(); exit;
} }
break; break;

View File

@@ -23,7 +23,7 @@ if (!function_exists('renderChecklist')) {
global $structure; global $structure;
$user = auth()->getUser(); $user = auth()->getUser();
$enabled = $check->assignedUsers ? ($check->assignedUsers->pluck('id')->search($user->id) !== false || ($user->idgruppo) == 1) : true; $enabled = $check->assignedUsers ? ($check->assignedUsers->pluck('id')->search($user->id) !== false || $user->idgruppo == 1) : true;
$margin = ($level * 20); $margin = ($level * 20);

View File

@@ -76,8 +76,6 @@ class Combinazione extends Model
/** /**
* Metodo per generare dinamicamente una variante dell'articolo per la combinazione corrente. * Metodo per generare dinamicamente una variante dell'articolo per la combinazione corrente.
*
* @param $valori_attributi
*/ */
public function generaVariante($valori_attributi, $id_articolo = null) public function generaVariante($valori_attributi, $id_articolo = null)
{ {
@@ -190,8 +188,6 @@ class Combinazione extends Model
/** /**
* Funzione per sincronizzare i campi condivisi dagli Articoli di tipo Variante. * Funzione per sincronizzare i campi condivisi dagli Articoli di tipo Variante.
*
* @param $values
*/ */
protected function sincronizzaCampi($values) protected function sincronizzaCampi($values)
{ {

View File

@@ -478,7 +478,7 @@ switch (post('op')) {
$id_documento = post('id_documento'); $id_documento = post('id_documento');
// Individuazione del documento originale // Individuazione del documento originale
if (!is_subclass_of($class, \Common\Document::class)) { if (!is_subclass_of($class, Common\Document::class)) {
return; return;
} }
$documento = $class::find($id_documento); $documento = $class::find($id_documento);
@@ -637,7 +637,7 @@ switch (post('op')) {
$numero_totale = 0; $numero_totale = 0;
foreach ($righe as $riga) { foreach ($righe as $riga) {
if (($riga['id']) != null) { if ($riga['id'] != null) {
$articolo = Articolo::find($riga['id']); $articolo = Articolo::find($riga['id']);
} }

View File

@@ -151,7 +151,7 @@ switch (filter('op')) {
'id' => 'A_'.$modulo_preventivi->id.'_'.$preventivo['id'], 'id' => 'A_'.$modulo_preventivi->id.'_'.$preventivo['id'],
'idintervento' => $preventivo['id'], 'idintervento' => $preventivo['id'],
'idtecnico' => '', 'idtecnico' => '',
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '<i class="fa fa-pencil" aria-hidden="true"></i>').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>'.tr('Accettazione prev.').' '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'], 'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '<i class="fa fa-pencil" aria-hidden="true"></i>').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div><b>'.tr('Accettazione prev.').' '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
'start' => $preventivo['data_accettazione'], 'start' => $preventivo['data_accettazione'],
// 'end' => $preventivo['data_accettazione'], // 'end' => $preventivo['data_accettazione'],
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'], 'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
@@ -169,7 +169,7 @@ switch (filter('op')) {
'id' => 'B_'.$modulo_preventivi->id.'_'.$preventivo['id'], 'id' => 'B_'.$modulo_preventivi->id.'_'.$preventivo['id'],
'idintervento' => $preventivo['id'], 'idintervento' => $preventivo['id'],
'idtecnico' => '', 'idtecnico' => '',
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '<i class="fa fa-pencil" aria-hidden="true"></i>').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>'.tr('Conclusione prev.').' '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'], 'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '<i class="fa fa-pencil" aria-hidden="true"></i>').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div><b>'.tr('Conclusione prev.').' '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
'start' => $preventivo['data_conclusione'], 'start' => $preventivo['data_conclusione'],
// 'end' => $preventivo['data_conclusione'], // 'end' => $preventivo['data_conclusione'],
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'], 'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],

View File

@@ -282,7 +282,7 @@ switch (filter('op')) {
$id_documento = post('id_documento'); $id_documento = post('id_documento');
// Individuazione del documento originale // Individuazione del documento originale
if (!is_subclass_of($class, \Common\Document::class)) { if (!is_subclass_of($class, Common\Document::class)) {
return; return;
} }
$documento = $class::find($id_documento); $documento = $class::find($id_documento);
@@ -653,7 +653,7 @@ switch (filter('op')) {
$numero_totale = 0; $numero_totale = 0;
foreach ($righe as $riga) { foreach ($righe as $riga) {
if (($riga['id']) != null) { if ($riga['id'] != null) {
$articolo = Articolo::find($riga['id']); $articolo = Articolo::find($riga['id']);
} }

View File

@@ -441,7 +441,7 @@ if ($dir == 'entrata') {
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
{[ "type": "number", "label": "'.('Sconto in fattura').'", "name": "sconto_finale", "value": "'.($ddt->sconto_finale_percentuale ?: $ddt->sconto_finale).'", "icon-after": "choice|untprc|'.(empty($ddt->sconto_finale) ? 'PRC' : 'UNT').'", "help": "'.tr('Sconto in fattura, utilizzabile per applicare sconti sul netto a pagare del documento').'." ]} {[ "type": "number", "label": "Sconto in fattura", "name": "sconto_finale", "value": "'.($ddt->sconto_finale_percentuale ?: $ddt->sconto_finale).'", "icon-after": "choice|untprc|'.(empty($ddt->sconto_finale) ? 'PRC' : 'UNT').'", "help": "'.tr('Sconto in fattura, utilizzabile per applicare sconti sul netto a pagare del documento').'." ]}
</div> </div>
</div>'; </div>';
} }

View File

@@ -19,7 +19,6 @@
namespace Modules\DDT; namespace Modules\DDT;
use Auth;
use Common\Components\Component; use Common\Components\Component;
use Common\Document; use Common\Document;
use Modules\Anagrafiche\Anagrafica; use Modules\Anagrafiche\Anagrafica;
@@ -59,7 +58,7 @@ class DDT extends Document
{ {
$model = new static(); $model = new static();
$user = Auth::user(); $user = \Auth::user();
$stato_documento = Stato::where('descrizione', 'Bozza')->first(); $stato_documento = Stato::where('descrizione', 'Bozza')->first();

View File

@@ -32,7 +32,7 @@ class Mail extends Model
protected $table = 'em_emails'; protected $table = 'em_emails';
protected $options = null; protected $options;
public static function build(User $user, $template = null, $id_record = null, $account = null) public static function build(User $user, $template = null, $id_record = null, $account = null)
{ {
@@ -75,7 +75,6 @@ class Mail extends Model
/** /**
* Aggiunge una stampa alla notifica. * Aggiunge una stampa alla notifica.
* *
* @param string|int $print
* @param string $name * @param string $name
*/ */
public function addPrint($print_id, $name = null) public function addPrint($print_id, $name = null)

View File

@@ -111,7 +111,7 @@ switch ($op) {
WHERE WHERE
co_statidocumento.descrizione = "Emessa" AND co_tipidocumento.dir="entrata" AND co_documenti.id_segment='.$fattura->id_segment); co_statidocumento.descrizione = "Emessa" AND co_tipidocumento.dir="entrata" AND co_documenti.id_segment='.$fattura->id_segment);
if ((setting('Data emissione fattura automatica') == 1) && ($dir == 'entrata') && ($stato->descrizione == 'Emessa') && (Carbon::parse($data)->lessThan(Carbon::parse($data_fattura_precedente['datamax']))) && (!empty($data_fattura_precedente['datamax']))) { if ((setting('Data emissione fattura automatica') == 1) && ($dir == 'entrata') && ($stato->descrizione == 'Emessa') && Carbon::parse($data)->lessThan(Carbon::parse($data_fattura_precedente['datamax'])) && (!empty($data_fattura_precedente['datamax']))) {
$fattura->data = $data_fattura_precedente['datamax']; $fattura->data = $data_fattura_precedente['datamax'];
$fattura->data_competenza = $data_fattura_precedente['datamax']; $fattura->data_competenza = $data_fattura_precedente['datamax'];
flash()->info(tr('Data di emissione aggiornata, come da impostazione!')); flash()->info(tr('Data di emissione aggiornata, come da impostazione!'));
@@ -733,7 +733,7 @@ switch ($op) {
$id_documento = post('id_documento'); $id_documento = post('id_documento');
// Individuazione del documento originale // Individuazione del documento originale
if (!is_subclass_of($class, \Common\Document::class)) { if (!is_subclass_of($class, Common\Document::class)) {
return; return;
} }
$documento = $class::find($id_documento); $documento = $class::find($id_documento);
@@ -1066,7 +1066,7 @@ switch ($op) {
$numero_totale = 0; $numero_totale = 0;
foreach ($righe as $riga) { foreach ($righe as $riga) {
if (($riga['id']) != null) { if ($riga['id'] != null) {
$articolo = Articolo::find($riga['id']); $articolo = Articolo::find($riga['id']);
} }

View File

@@ -78,7 +78,7 @@ $rs = $dbo->fetchArray('SELECT
AND in_interventi.id NOT IN (SELECT idintervento FROM co_righe_documenti WHERE idintervento IS NOT NULL) AND in_interventi.id NOT IN (SELECT idintervento FROM co_righe_documenti WHERE idintervento IS NOT NULL)
AND NOT in_interventi.id IN (SELECT idintervento FROM co_promemoria WHERE idintervento IS NOT NULL) '.$where); AND NOT in_interventi.id IN (SELECT idintervento FROM co_promemoria WHERE idintervento IS NOT NULL) '.$where);
foreach ($rs as $key => $value) { foreach ($rs as $key => $value) {
$intervento = \Modules\Interventi\Intervento::find($value['id']); $intervento = Modules\Interventi\Intervento::find($value['id']);
$prezzo = $intervento->totale; $prezzo = $intervento->totale;
$rs[$key]['prezzo'] = Translator::numberToLocale($prezzo); $rs[$key]['prezzo'] = Translator::numberToLocale($prezzo);

View File

@@ -486,7 +486,7 @@ switch (post('op')) {
WHERE WHERE
co_statidocumento.descrizione = "Emessa" AND co_tipidocumento.dir="entrata" AND co_documenti.id_segment='.$fattura->id_segment); co_statidocumento.descrizione = "Emessa" AND co_tipidocumento.dir="entrata" AND co_documenti.id_segment='.$fattura->id_segment);
if ((setting('Data emissione fattura automatica') == 1) && ($dir == 'entrata') && (Carbon::parse($data)->lessThan(Carbon::parse($data_fattura_precedente['datamax']))) && (!empty($data_fattura_precedente['datamax']))) { if ((setting('Data emissione fattura automatica') == 1) && ($dir == 'entrata') && Carbon::parse($data)->lessThan(Carbon::parse($data_fattura_precedente['datamax'])) && (!empty($data_fattura_precedente['datamax']))) {
$fattura->data = $data_fattura_precedente['datamax']; $fattura->data = $data_fattura_precedente['datamax'];
$fattura->data_competenza = $data_fattura_precedente['datamax']; $fattura->data_competenza = $data_fattura_precedente['datamax'];
} }

View File

@@ -63,7 +63,7 @@ if (empty($record['is_fiscale'])) {
{[ "type": "date", "label": "'.tr('Data').'", "name": "data", "required": 1, "value": "-now-" ]}'; {[ "type": "date", "label": "'.tr('Data').'", "name": "data", "required": 1, "value": "-now-" ]}';
echo ' echo '
<button type="button" class="btn btn-warning ask" data-msg="'.tr('Vuoi trasformare questa fattura pro-forma in una di tipo fiscale?').'<br>'.prepareToField(\HTMLBuilder\HTMLBuilder::replace($msg)).'" data-op="transform" data-button="'.tr('Trasforma').'" data-class="btn btn-lg btn-warning" data-backto="record-edit"> <button type="button" class="btn btn-warning ask" data-msg="'.tr('Vuoi trasformare questa fattura pro-forma in una di tipo fiscale?').'<br>'.prepareToField(HTMLBuilder\HTMLBuilder::replace($msg)).'" data-op="transform" data-button="'.tr('Trasforma').'" data-class="btn btn-lg btn-warning" data-backto="record-edit">
<i class="fa fa-upload"></i> '.tr('Trasforma in fattura fiscale').' <i class="fa fa-upload"></i> '.tr('Trasforma in fattura fiscale').'
</button>'; </button>';
} }

View File

@@ -131,7 +131,7 @@ if (!empty($note_accredito)) {
]); ]);
echo ' echo '
<br>'.Modules::link(($dir == 'entrata' ? 'Fatture di vendita' : 'Fatture di acquisto'), $nota['id'], $text, $text); <br>'.Modules::link($dir == 'entrata' ? 'Fatture di vendita' : 'Fatture di acquisto', $nota['id'], $text, $text);
} }
echo ' echo '
</div>'; </div>';

View File

@@ -187,7 +187,7 @@ if (!function_exists('aggiungi_movimento')) {
{ {
$dbo = database(); $dbo = database();
$fattura = Modules\Fatture\Fattura::find($iddocumento); $fattura = Fattura::find($iddocumento);
$is_nota = $fattura->isNota(); $is_nota = $fattura->isNota();
// Totale marca da bollo, inps, ritenuta, idagente // Totale marca da bollo, inps, ritenuta, idagente

View File

@@ -177,8 +177,8 @@ foreach ($righe as $riga) {
if (!empty($riga->note)) { if (!empty($riga->note)) {
if (strlen($riga->note) > 50) { if (strlen($riga->note) > 50) {
$prima_parte = substr($riga->note, 0, ((strpos($riga->note, ' ', 50) < 60) && (strpos($riga->note, ' ', 50) != 0) ? strpos($riga->note, ' ', 50) : 50)); $prima_parte = substr($riga->note, 0, (strpos($riga->note, ' ', 50) < 60) && (strpos($riga->note, ' ', 50) != 0) ? strpos($riga->note, ' ', 50) : 50);
$seconda_parte = substr($riga->note, ((strpos($riga->note, ' ', 50) < 60) && (strpos($riga->note, ' ', 50) != 0) ? strpos($riga->note, ' ', 50) : 50)); $seconda_parte = substr($riga->note, (strpos($riga->note, ' ', 50) < 60) && (strpos($riga->note, ' ', 50) != 0) ? strpos($riga->note, ' ', 50) : 50);
$stringa_modificata = '<small class="label label-default">'.$prima_parte.'</small> $stringa_modificata = '<small class="label label-default">'.$prima_parte.'</small>
<span id="read-more-target-'.$riga->id.'" class="read-more-target"><small class="label label-default">'.$seconda_parte.'</small></span><a href="#read-more-target-'.$riga->id.'" class="read-more-trigger">...</a>'; <span id="read-more-target-'.$riga->id.'" class="read-more-target"><small class="label label-default">'.$seconda_parte.'</small></span><a href="#read-more-target-'.$riga->id.'" class="read-more-trigger">...</a>';
} else { } else {

View File

@@ -19,12 +19,10 @@
namespace Modules\Fatture; namespace Modules\Fatture;
use Auth;
use Carbon\Carbon; use Carbon\Carbon;
use Common\Components\Component; use Common\Components\Component;
use Common\Document; use Common\Document;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use InvalidArgumentException;
use Models\Upload; use Models\Upload;
use Modules\Anagrafiche\Anagrafica; use Modules\Anagrafiche\Anagrafica;
use Modules\Banche\Banca; use Modules\Banche\Banca;
@@ -39,7 +37,6 @@ use Plugins\DichiarazioniIntento\Dichiarazione;
use Plugins\ExportFE\FatturaElettronica; use Plugins\ExportFE\FatturaElettronica;
use Traits\RecordTrait; use Traits\RecordTrait;
use Traits\ReferenceTrait; use Traits\ReferenceTrait;
use Translator;
use Util\Generator; use Util\Generator;
class Fattura extends Document class Fattura extends Document
@@ -95,7 +92,7 @@ class Fattura extends Document
{ {
$model = new static(); $model = new static();
$user = Auth::user(); $user = \Auth::user();
$database = database(); $database = database();
// Individuazione dello stato predefinito per il documento // Individuazione dello stato predefinito per il documento
@@ -210,8 +207,8 @@ class Fattura extends Document
// Registrazione dell'operazione nelle note // Registrazione dell'operazione nelle note
$notes[] = tr("Operazione non imponibile come da vostra dichiarazione d'intento nr _PROT_ del _PROT_DATE_ emessa in data _RELEASE_DATE_", [ $notes[] = tr("Operazione non imponibile come da vostra dichiarazione d'intento nr _PROT_ del _PROT_DATE_ emessa in data _RELEASE_DATE_", [
'_PROT_' => $dichiarazione->numero_protocollo, '_PROT_' => $dichiarazione->numero_protocollo,
'_PROT_DATE_' => Translator::dateToLocale($dichiarazione->data_protocollo), '_PROT_DATE_' => \Translator::dateToLocale($dichiarazione->data_protocollo),
'_RELEASE_DATE_' => Translator::dateToLocale($dichiarazione->data_emissione), '_RELEASE_DATE_' => \Translator::dateToLocale($dichiarazione->data_emissione),
]).'.'; ]).'.';
} }
@@ -490,7 +487,7 @@ class Fattura extends Document
$file = $this->uploads()->where('name', '=', 'Fattura Elettronica')->first(); $file = $this->uploads()->where('name', '=', 'Fattura Elettronica')->first();
if (empty($file)) { if (empty($file)) {
throw new InvalidArgumentException('Fattura Elettronica non trovata'); throw new \InvalidArgumentException('Fattura Elettronica non trovata');
} }
return $file->getContent(); return $file->getContent();
@@ -786,9 +783,9 @@ class Fattura extends Document
/** /**
* Scope per l'inclusione delle sole fatture con valore contabile. * Scope per l'inclusione delle sole fatture con valore contabile.
* *
* @param \Illuminate\Database\Eloquent\Builder $query * @param Builder $query
* *
* @return \Illuminate\Database\Eloquent\Builder * @return Builder
*/ */
public function scopeContabile($query) public function scopeContabile($query)
{ {
@@ -849,9 +846,9 @@ class Fattura extends Document
/** /**
* Scope per l'inclusione delle fatture di vendita. * Scope per l'inclusione delle fatture di vendita.
* *
* @param \Illuminate\Database\Eloquent\Builder $query * @param Builder $query
* *
* @return \Illuminate\Database\Eloquent\Builder * @return Builder
*/ */
public function scopeVendita($query) public function scopeVendita($query)
{ {
@@ -863,9 +860,9 @@ class Fattura extends Document
/** /**
* Scope per l'inclusione delle fatture di acquisto. * Scope per l'inclusione delle fatture di acquisto.
* *
* @param \Illuminate\Database\Eloquent\Builder $query * @param Builder $query
* *
* @return \Illuminate\Database\Eloquent\Builder * @return Builder
*/ */
public function scopeAcquisto($query) public function scopeAcquisto($query)
{ {

View File

@@ -31,7 +31,7 @@ use Modules\PrimaNota\Movimento;
class Movimenti class Movimenti
{ {
protected $fattura; protected $fattura;
protected $mastrino = null; protected $mastrino;
public function __construct(Fattura $fattura) public function __construct(Fattura $fattura)
{ {

View File

@@ -21,12 +21,10 @@ namespace Modules\Impianti\Import;
use Importer\CSVImporter; use Importer\CSVImporter;
use Models\Upload; use Models\Upload;
use Modules;
use Modules\Anagrafiche\Anagrafica; use Modules\Anagrafiche\Anagrafica;
use Modules\Anagrafiche\Sede; use Modules\Anagrafiche\Sede;
use Modules\Impianti\Categoria; use Modules\Impianti\Categoria;
use Modules\Impianti\Impianto; use Modules\Impianti\Impianto;
use Uploads;
/** /**
* Struttura per la gestione delle operazioni di importazione (da CSV) degli Impianti. * Struttura per la gestione delle operazioni di importazione (da CSV) degli Impianti.
@@ -164,8 +162,8 @@ class CSV extends CSVImporter
if (!empty($file_content)) { if (!empty($file_content)) {
if ($record['import_immagine'] == 2 || $record['import_immagine'] == 4) { if ($record['import_immagine'] == 2 || $record['import_immagine'] == 4) {
Uploads::deleteLinked([ \Uploads::deleteLinked([
'id_module' => Modules::get('Impianti')['id'], 'id_module' => \Modules::get('Impianti')['id'],
'id_record' => $impianto->id, 'id_record' => $impianto->id,
]); ]);
@@ -178,11 +176,11 @@ class CSV extends CSVImporter
$name = 'immagine_'.$impianto->id.'.'.Upload::getExtensionFromMimeType($file_content); $name = 'immagine_'.$impianto->id.'.'.Upload::getExtensionFromMimeType($file_content);
$upload = Uploads::upload($file_content, [ $upload = \Uploads::upload($file_content, [
'name' => 'Immagine', 'name' => 'Immagine',
'category' => 'Immagini', 'category' => 'Immagini',
'original_name' => $name, 'original_name' => $name,
'id_module' => Modules::get('Impianti')['id'], 'id_module' => \Modules::get('Impianti')['id'],
'id_record' => $impianto->id, 'id_record' => $impianto->id,
], [ ], [
'thumbnails' => true, 'thumbnails' => true,

View File

@@ -362,11 +362,11 @@ switch (post('op')) {
$orario_inizio = date('Y-m-d', strtotime($data_ricorrenza)).' '.date('H:i:s', strtotime($sessione->orario_inizio)); $orario_inizio = date('Y-m-d', strtotime($data_ricorrenza)).' '.date('H:i:s', strtotime($sessione->orario_inizio));
} else { } else {
$diff = strtotime($sessione->orario_inizio) - strtotime($inizio_old); $diff = strtotime($sessione->orario_inizio) - strtotime($inizio_old);
$orario_inizio = date('Y-m-d H:i:s', (strtotime($new_sessione->orario_inizio) + $diff)); $orario_inizio = date('Y-m-d H:i:s', strtotime($new_sessione->orario_inizio) + $diff);
} }
$diff_fine = strtotime($sessione->orario_fine) - strtotime($sessione->orario_inizio); $diff_fine = strtotime($sessione->orario_fine) - strtotime($sessione->orario_inizio);
$orario_fine = date('Y-m-d H:i:s', (strtotime($orario_inizio) + $diff_fine)); $orario_fine = date('Y-m-d H:i:s', strtotime($orario_inizio) + $diff_fine);
$new_sessione = $sessione->replicate(); $new_sessione = $sessione->replicate();
$new_sessione->idintervento = $new->id; $new_sessione->idintervento = $new->id;
@@ -590,7 +590,7 @@ switch (post('op')) {
$id_documento = post('id_documento'); $id_documento = post('id_documento');
// Individuazione del documento originale // Individuazione del documento originale
if (!is_subclass_of($class, \Common\Document::class)) { if (!is_subclass_of($class, Common\Document::class)) {
return; return;
} }
$documento = $class::find($id_documento); $documento = $class::find($id_documento);
@@ -1026,11 +1026,11 @@ switch (post('op')) {
$orario_inizio = date('Y-m-d', strtotime($data_richiesta)).' '.date('H:i:s', strtotime($sessione->orario_inizio)); $orario_inizio = date('Y-m-d', strtotime($data_richiesta)).' '.date('H:i:s', strtotime($sessione->orario_inizio));
} else { } else {
$diff = strtotime($sessione->orario_inizio) - strtotime($inizio_old); $diff = strtotime($sessione->orario_inizio) - strtotime($inizio_old);
$orario_inizio = date('Y-m-d H:i:s', (strtotime($new_sessione->orario_inizio) + $diff)); $orario_inizio = date('Y-m-d H:i:s', strtotime($new_sessione->orario_inizio) + $diff);
} }
$diff_fine = strtotime($sessione->orario_fine) - strtotime($sessione->orario_inizio); $diff_fine = strtotime($sessione->orario_fine) - strtotime($sessione->orario_inizio);
$orario_fine = date('Y-m-d H:i:s', (strtotime($orario_inizio) + $diff_fine)); $orario_fine = date('Y-m-d H:i:s', strtotime($orario_inizio) + $diff_fine);
$new_sessione = $sessione->replicate(); $new_sessione = $sessione->replicate();
$new_sessione->idintervento = $new->id; $new_sessione->idintervento = $new->id;
@@ -1181,7 +1181,7 @@ switch (post('op')) {
$numero_totale = 0; $numero_totale = 0;
foreach ($righe as $riga) { foreach ($righe as $riga) {
if (($riga['id']) != null) { if ($riga['id'] != null) {
$articolo = Articolo::find($riga['id']); $articolo = Articolo::find($riga['id']);
} }

View File

@@ -229,11 +229,11 @@ switch (post('op')) {
$orario_inizio = date('Y-m-d', strtotime($data_richiesta)).' '.date('H:i:s', strtotime($sessione->orario_inizio)); $orario_inizio = date('Y-m-d', strtotime($data_richiesta)).' '.date('H:i:s', strtotime($sessione->orario_inizio));
} else { } else {
$diff = strtotime($sessione->orario_inizio) - strtotime($inizio_old); $diff = strtotime($sessione->orario_inizio) - strtotime($inizio_old);
$orario_inizio = date('Y-m-d H:i:s', (strtotime($sessione->orario_inizio) + $diff)); $orario_inizio = date('Y-m-d H:i:s', strtotime($sessione->orario_inizio) + $diff);
} }
$diff_fine = strtotime($sessione->orario_fine) - strtotime($sessione->orario_inizio); $diff_fine = strtotime($sessione->orario_fine) - strtotime($sessione->orario_inizio);
$orario_fine = date('Y-m-d H:i:s', (strtotime($orario_inizio) + $diff_fine)); $orario_fine = date('Y-m-d H:i:s', strtotime($orario_inizio) + $diff_fine);
$new_sessione = $sessione->replicate(); $new_sessione = $sessione->replicate();
$new_sessione->idintervento = $new->id; $new_sessione->idintervento = $new->id;
@@ -301,7 +301,7 @@ switch (post('op')) {
$id_print = Prints::getPrints()['Riepilogo interventi']; $id_print = Prints::getPrints()['Riepilogo interventi'];
redirect(base_path().'/pdfgen.php?id_print='.$id_print.'&tipo='.post('tipo')); redirect(base_path().'/pdfgen.php?id_print='.$id_print.'&tipo='.post('tipo'));
exit(); exit;
case 'send-mail': case 'send-mail':
$template = Template::find(post('id_template')); $template = Template::find(post('id_template'));

View File

@@ -28,7 +28,7 @@ $module_anagrafiche = Modules::get('Anagrafiche');
// Verifica aggiuntive sulla sequenzialità dei numeri // Verifica aggiuntive sulla sequenzialità dei numeri
$numero_previsto = verifica_numero_intervento($intervento); $numero_previsto = verifica_numero_intervento($intervento);
if (!empty($numero_previsto) && intval((setting('Verifica numero intervento')))) { if (!empty($numero_previsto) && intval(setting('Verifica numero intervento'))) {
echo ' echo '
<div class="alert alert-warning alert-dismissable"> <div class="alert alert-warning alert-dismissable">
<i class="fa fa-warning"></i> '.tr("E' assente una attività con numero _NUM_ in data precedente o corrispondente al _DATE_: potrebbero esserci alcuni errori di continuità con la numerazione delle attività", [ <i class="fa fa-warning"></i> '.tr("E' assente una attività con numero _NUM_ in data precedente o corrispondente al _DATE_: potrebbero esserci alcuni errori di continuità con la numerazione delle attività", [

View File

@@ -26,7 +26,7 @@ if (get('anteprima') !== null) {
if (empty($rs)) { if (empty($rs)) {
echo tr('Intervento inesistente!'); echo tr('Intervento inesistente!');
exit(); exit;
} }
// Gestione della stampa // Gestione della stampa

View File

@@ -23,7 +23,6 @@ use API\Interfaces\CreateInterface;
use API\Interfaces\RetrieveInterface; use API\Interfaces\RetrieveInterface;
use API\Interfaces\UpdateInterface; use API\Interfaces\UpdateInterface;
use API\Resource; use API\Resource;
use Auth;
use Modules\Anagrafiche\Anagrafica; use Modules\Anagrafiche\Anagrafica;
use Modules\Interventi\Intervento; use Modules\Interventi\Intervento;
use Modules\Interventi\Stato; use Modules\Interventi\Stato;
@@ -34,7 +33,7 @@ class Interventi extends Resource implements RetrieveInterface, CreateInterface,
public function retrieve($request) public function retrieve($request)
{ {
// Periodo per selezionare interventi // Periodo per selezionare interventi
$user = Auth::user(); $user = \Auth::user();
$table = 'in_interventi'; $table = 'in_interventi';

View File

@@ -23,8 +23,6 @@ use API\Interfaces\RetrieveInterface;
use API\Interfaces\UpdateInterface; use API\Interfaces\UpdateInterface;
use API\Resource; use API\Resource;
use Carbon\Carbon; use Carbon\Carbon;
use DateTime;
use iCalEasyReader;
class Sync extends Resource implements RetrieveInterface, UpdateInterface class Sync extends Resource implements RetrieveInterface, UpdateInterface
{ {
@@ -97,7 +95,7 @@ class Sync extends Resource implements RetrieveInterface, UpdateInterface
$response = API\Response::getRequest(true); $response = API\Response::getRequest(true);
$ical = new iCalEasyReader(); $ical = new \iCalEasyReader();
$events = $ical->load($response); $events = $ical->load($response);
foreach ($events['VEVENT'] as $event) { foreach ($events['VEVENT'] as $event) {
@@ -111,10 +109,10 @@ class Sync extends Resource implements RetrieveInterface, UpdateInterface
} }
// Timestamp di inizio // Timestamp di inizio
$orario_inizio = DateTime::createFromFormat('Ymd\\THi', $event['DTSTART'])->format(Intl\Formatter::getStandardFormats()['timestamp']); $orario_inizio = \DateTime::createFromFormat('Ymd\\THi', $event['DTSTART'])->format(Intl\Formatter::getStandardFormats()['timestamp']);
// Timestamp di fine // Timestamp di fine
$orario_fine = DateTime::createFromFormat('Ymd\\THi', $event['DTEND'])->format(Intl\Formatter::getStandardFormats()['timestamp']); $orario_fine = \DateTime::createFromFormat('Ymd\\THi', $event['DTEND'])->format(Intl\Formatter::getStandardFormats()['timestamp']);
// Descrizione // Descrizione
$richiesta = $event['DESCRIPTION']; $richiesta = $event['DESCRIPTION'];

View File

@@ -20,9 +20,7 @@
namespace Modules\Interventi\Components; namespace Modules\Interventi\Components;
use Common\SimpleModelTrait; use Common\SimpleModelTrait;
use DateTime;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use InvalidArgumentException;
use Modules\Anagrafiche\Anagrafica; use Modules\Anagrafiche\Anagrafica;
use Modules\Interventi\Intervento; use Modules\Interventi\Intervento;
/* /*
@@ -40,7 +38,7 @@ class Sessione extends Model
protected $table = 'in_interventi_tecnici'; protected $table = 'in_interventi_tecnici';
protected $aliquota_iva = null; protected $aliquota_iva;
/** /**
* Crea un nuova sessione collegata ad un intervento. * Crea un nuova sessione collegata ad un intervento.
@@ -53,7 +51,7 @@ class Sessione extends Model
public static function build(Intervento $intervento, Anagrafica $anagrafica, $inizio, $fine) public static function build(Intervento $intervento, Anagrafica $anagrafica, $inizio, $fine)
{ {
if (!$anagrafica->isTipo('Tecnico')) { if (!$anagrafica->isTipo('Tecnico')) {
throw new InvalidArgumentException('Anagrafica di tipo diverso da Tecnico'); throw new \InvalidArgumentException('Anagrafica di tipo diverso da Tecnico');
} }
$model = new static(); $model = new static();
@@ -131,8 +129,8 @@ class Sessione extends Model
public function getOreCalcolateAttribute() public function getOreCalcolateAttribute()
{ {
$inizio = new DateTime($this->orario_inizio); $inizio = new \DateTime($this->orario_inizio);
$diff = $inizio->diff(new DateTime($this->orario_fine)); $diff = $inizio->diff(new \DateTime($this->orario_fine));
$ore = $diff->i / 60 + $diff->h + ($diff->days * 24); $ore = $diff->i / 60 + $diff->h + ($diff->days * 24);
@@ -405,7 +403,7 @@ class Sessione extends Model
*/ */
public function getMarginePercentualeAttribute() public function getMarginePercentualeAttribute()
{ {
return (1 - ($this->spesa / ($this->totale_imponibile))) * 100; return (1 - ($this->spesa / $this->totale_imponibile)) * 100;
} }
/** /**
@@ -425,7 +423,7 @@ class Sessione extends Model
public function getIvaAttribute() public function getIvaAttribute()
{ {
return ($this->totale_imponibile) * $this->aliquota->percentuale / 100; return $this->totale_imponibile * $this->aliquota->percentuale / 100;
} }
public function getIvaDetraibileAttribute() public function getIvaDetraibileAttribute()

View File

@@ -81,7 +81,7 @@ foreach ($raggruppamenti as $mese => $raggruppamento) {
<td><a target="_blank" >'.Modules::link(Modules::get('Anagrafiche')['id'], $r['idanagrafica'], $dbo->fetchOne('SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica='.prepare($r['idanagrafica']))['ragione_sociale']).'<br><small>Presso: '; <td><a target="_blank" >'.Modules::link(Modules::get('Anagrafiche')['id'], $r['idanagrafica'], $dbo->fetchOne('SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica='.prepare($r['idanagrafica']))['ragione_sociale']).'<br><small>Presso: ';
// Sede promemoria // Sede promemoria
if ($r['idsede'] == '-1') { if ($r['idsede'] == '-1') {
echo '- '.('Nessuna').' -'; echo '- Nessuna -';
} elseif (empty($r['idsede'])) { } elseif (empty($r['idsede'])) {
echo tr('Sede legale'); echo tr('Sede legale');
} else { } else {

View File

@@ -42,7 +42,7 @@ if (!empty($rs)) {
<td><a target="_blank" >'.Modules::link(Modules::get('Anagrafiche')['id'], $r['idanagrafica'], $dbo->fetchOne('SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica='.prepare($r['idanagrafica']))['ragione_sociale']).'<br><small>Presso: '; <td><a target="_blank" >'.Modules::link(Modules::get('Anagrafiche')['id'], $r['idanagrafica'], $dbo->fetchOne('SELECT ragione_sociale FROM an_anagrafiche WHERE idanagrafica='.prepare($r['idanagrafica']))['ragione_sociale']).'<br><small>Presso: ';
// Sede promemoria // Sede promemoria
if ($r['idsede'] == '-1') { if ($r['idsede'] == '-1') {
echo '- '.('Nessuna').' -'; echo '- Nessuna -';
} elseif (empty($r['idsede'])) { } elseif (empty($r['idsede'])) {
echo tr('Sede legale'); echo tr('Sede legale');
} else { } else {

View File

@@ -27,7 +27,7 @@ class Destinatario extends Model
use SimpleModelTrait; use SimpleModelTrait;
protected $table = 'em_list_receiver'; protected $table = 'em_list_receiver';
protected $origine = null; protected $origine;
public static function build(Lista $lista, $origine) public static function build(Lista $lista, $origine)
{ {

View File

@@ -55,8 +55,6 @@ class Articolo extends Model
/** /**
* Imposta il prezzo di vendita sulla base dell'impstazione per l'utilizzo dei prezzi comprensivi di IVA. * Imposta il prezzo di vendita sulla base dell'impstazione per l'utilizzo dei prezzi comprensivi di IVA.
*
* @param $prezzo_unitario
*/ */
public function setPrezzoUnitario($prezzo_unitario) public function setPrezzoUnitario($prezzo_unitario)
{ {

View File

@@ -70,7 +70,7 @@ use Util\Query;
$provincia = $records[$i]['provincia_anagrafica']; $provincia = $records[$i]['provincia_anagrafica'];
} }
if (($lat != '0.00000000' && $lng != '0.00000000')) { if ($lat != '0.00000000' && $lng != '0.00000000') {
$descrizione = ''; $descrizione = '';
$descrizione .= '<i class="fa fa-user"></i> <b>Ragione sociale</b>: <a href="'.$rootdir.'/editor.php?id_module='.Modules::get('Anagrafiche')['id'].'&id_record='.$records[$i]['id'].'" target="_blank" > '.$records[$i]['ragione_sociale'].' <i class="fa fa-external-link"></i> </a>'."\n<br>"; $descrizione .= '<i class="fa fa-user"></i> <b>Ragione sociale</b>: <a href="'.$rootdir.'/editor.php?id_module='.Modules::get('Anagrafiche')['id'].'&id_record='.$records[$i]['id'].'" target="_blank" > '.$records[$i]['ragione_sociale'].' <i class="fa fa-external-link"></i> </a>'."\n<br>";

View File

@@ -33,15 +33,15 @@ if (!empty($search)) {
$destinatari = $riferimento->destinatari() $destinatari = $riferimento->destinatari()
->where(function ($query) use ($results) { ->where(function ($query) use ($results) {
$query->where('record_type', '=', Anagrafica::class) $query->where('record_type', '=', Anagrafica::class)
->whereIn('record_id', (!empty($results['anagrafica']) ? $results['anagrafica']->toArray() : [])); ->whereIn('record_id', !empty($results['anagrafica']) ? $results['anagrafica']->toArray() : []);
}) })
->orWhere(function ($query) use ($results) { ->orWhere(function ($query) use ($results) {
$query->where('record_type', '=', Sede::class) $query->where('record_type', '=', Sede::class)
->whereIn('record_id', (!empty($results['sede']) ? $results['sede']->toArray() : [])); ->whereIn('record_id', !empty($results['sede']) ? $results['sede']->toArray() : []);
}) })
->orWhere(function ($query) use ($results) { ->orWhere(function ($query) use ($results) {
$query->where('record_type', '=', Referente::class) $query->where('record_type', '=', Referente::class)
->whereIn('record_id', (!empty($results['referente']) ? $results['referente']->toArray() : [])); ->whereIn('record_id', !empty($results['referente']) ? $results['referente']->toArray() : []);
}); });
} }
// Elenco di tutti i destinatari // Elenco di tutti i destinatari

View File

@@ -27,7 +27,7 @@ class Destinatario extends Model
use SimpleModelTrait; use SimpleModelTrait;
protected $table = 'em_newsletter_receiver'; protected $table = 'em_newsletter_receiver';
protected $origine = null; protected $origine;
public static function build(Newsletter $newsletter, $origine) public static function build(Newsletter $newsletter, $origine)
{ {

View File

@@ -407,7 +407,7 @@ switch (post('op')) {
$id_documento = post('id_documento'); $id_documento = post('id_documento');
// Individuazione del documento originale // Individuazione del documento originale
if (!is_subclass_of($class, \Common\Document::class)) { if (!is_subclass_of($class, Common\Document::class)) {
return; return;
} }
$documento = $class::find($id_documento); $documento = $class::find($id_documento);
@@ -699,7 +699,7 @@ switch (post('op')) {
$numero_totale = 0; $numero_totale = 0;
foreach ($righe as $riga) { foreach ($righe as $riga) {
if (($riga['id']) != null) { if ($riga['id'] != null) {
$articolo = Articolo::find($riga['id']); $articolo = Articolo::find($riga['id']);
} }

View File

@@ -75,7 +75,7 @@ class Pagamento extends Model
// Opzione ultimo del mese più X giorni // Opzione ultimo del mese più X giorni
$giorni = -$rata['giorno'] - 1; $giorni = -$rata['giorno'] - 1;
if ($giorni > 0) { if ($giorni > 0) {
$date->modify('+'.($giorni).' day'); $date->modify('+'.$giorni.' day');
} else { } else {
$date->modify('last day of this month'); $date->modify('last day of this month');
} }

View File

@@ -505,7 +505,7 @@ switch (post('op')) {
$numero_totale = 0; $numero_totale = 0;
foreach ($righe as $riga) { foreach ($righe as $riga) {
if (($riga['id']) != null) { if ($riga['id'] != null) {
$articolo = Articolo::find($riga['id']); $articolo = Articolo::find($riga['id']);
} }

View File

@@ -442,7 +442,7 @@ $count = $dbo->fetchNum($query);
<!-- PULSANTI --> <!-- PULSANTI -->
<div class="col-md-4"> <div class="col-md-4">
<p style="margin-top:-5px;" >&nbsp;</p> <p style="margin-top:-5px;" >&nbsp;</p>
<button type="button" class="btn btn-primary" onclick="if($(\'#aggiungi-intervento\').parsley().validate() && confirm(\''.tr('Aggiungere questo intervento al preventivo?').'\') ){ $(\'#aggiungi-intervento\').submit(); }" '.((($record['is_pianificabile']) && !$block_edit) ? '' : 'disabled').'> <button type="button" class="btn btn-primary" onclick="if($(\'#aggiungi-intervento\').parsley().validate() && confirm(\''.tr('Aggiungere questo intervento al preventivo?').'\') ){ $(\'#aggiungi-intervento\').submit(); }" '.(($record['is_pianificabile'] && !$block_edit) ? '' : 'disabled').'>
<i class="fa fa-plus"></i> '.tr('Aggiungi').' <i class="fa fa-plus"></i> '.tr('Aggiungi').'
</button> </button>
</div> </div>

View File

@@ -61,8 +61,6 @@ class Mastrino extends Model
/** /**
* Rimuove tutti i movimenti collegati al mastrino. * Rimuove tutti i movimenti collegati al mastrino.
*
* @return mixed
*/ */
public function cleanup() public function cleanup()
{ {

View File

@@ -21,12 +21,9 @@ namespace Modules\Scadenzario;
use Models\OperationLog; use Models\OperationLog;
use Models\User; use Models\User;
use Modules;
use Modules\Emails\Mail; use Modules\Emails\Mail;
use Modules\Emails\Template; use Modules\Emails\Template;
use Prints;
use Tasks\Manager; use Tasks\Manager;
use Uploads;
/** /**
* Task dedicato alla gestione del backup giornaliero automatico, se abilitato da Impostazioni. * Task dedicato alla gestione del backup giornaliero automatico, se abilitato da Impostazioni.
@@ -74,17 +71,17 @@ class SollecitoTask extends Manager
$id_documento = $documento->id; $id_documento = $documento->id;
$id_anagrafica = $documento->idanagrafica; $id_anagrafica = $documento->idanagrafica;
$id_module = Modules::get('Scadenzario')->id; $id_module = \Modules::get('Scadenzario')->id;
$fattura_allegata = database()->selectOne('zz_files', 'id', ['id_module' => $id_module, 'id_record' => $id, 'original' => 'Fattura di vendita.pdf'])['id']; $fattura_allegata = database()->selectOne('zz_files', 'id', ['id_module' => $id_module, 'id_record' => $id, 'original' => 'Fattura di vendita.pdf'])['id'];
// Allego stampa della fattura se non presente // Allego stampa della fattura se non presente
if (empty($fattura_allegata)) { if (empty($fattura_allegata)) {
$print_predefined = database()->selectOne('zz_prints', '*', ['predefined' => 1, 'id_module' => Modules::get('Fatture di vendita')['id']]); $print_predefined = database()->selectOne('zz_prints', '*', ['predefined' => 1, 'id_module' => \Modules::get('Fatture di vendita')['id']]);
$print = Prints::render($print_predefined['id'], $id_documento, null, true); $print = \Prints::render($print_predefined['id'], $id_documento, null, true);
$name = 'Fattura di vendita'; $name = 'Fattura di vendita';
$upload = Uploads::upload($print['pdf'], [ $upload = \Uploads::upload($print['pdf'], [
'name' => $name, 'name' => $name,
'original_name' => $name.'.pdf', 'original_name' => $name.'.pdf',
'category' => 'Generale', 'category' => 'Generale',

View File

@@ -19,15 +19,12 @@
namespace Modules\Statistiche; namespace Modules\Statistiche;
use ArrayObject;
use DateTime;
class Stats class Stats
{ {
public static function monthly($original, $start, $end) public static function monthly($original, $start, $end)
{ {
// Copia dei dati // Copia dei dati
$array = new ArrayObject($original); $array = new \ArrayObject($original);
$data = $array->getArrayCopy(); $data = $array->getArrayCopy();
// Ordinamento // Ordinamento
@@ -36,8 +33,8 @@ class Stats
$data); $data);
// Differenza delle date in mesi // Differenza delle date in mesi
$d1 = new DateTime($start); $d1 = new \DateTime($start);
$d2 = new DateTime($end); $d2 = new \DateTime($end);
$count = $d1->diff($d2)->m + ($d1->diff($d2)->y * 12) + 1; $count = $d1->diff($d2)->m + ($d1->diff($d2)->y * 12) + 1;
$year = $d1->format('Y'); $year = $d1->format('Y');

View File

@@ -21,7 +21,6 @@ namespace Modules\StatoServizi\API\v1;
use API\Interfaces\RetrieveInterface; use API\Interfaces\RetrieveInterface;
use API\Resource; use API\Resource;
use App;
use Util\FileSystem; use Util\FileSystem;
class FolderSize extends Resource implements RetrieveInterface class FolderSize extends Resource implements RetrieveInterface
@@ -31,7 +30,7 @@ class FolderSize extends Resource implements RetrieveInterface
$dirs = $request['dirs']; $dirs = $request['dirs'];
if (empty($dirs)) { if (empty($dirs)) {
$backup_dir = App::getConfig()['backup_dir']; $backup_dir = \App::getConfig()['backup_dir'];
$dirs = [ $dirs = [
$backup_dir => tr('Backup'), $backup_dir => tr('Backup'),

View File

@@ -37,7 +37,8 @@ include_once __DIR__.'/../../core.php';
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
{[ "type": "checkbox", "label": "<?php echo tr('Tipo documento predefinito'); ?>", "name": "predefined", "value": "<?php echo intval($record['predefined']); ?>", "help":"<?php echo tr('Impostare questo tipo di documento predefinto per le fatture di '); echo ($record['dir'] == 'entrata') ? tr('Vendita') : tr('Acquisto'); ?>." ]} {[ "type": "checkbox", "label": "<?php echo tr('Tipo documento predefinito'); ?>", "name": "predefined", "value": "<?php echo intval($record['predefined']); ?>", "help":"<?php echo tr('Impostare questo tipo di documento predefinto per le fatture di ');
echo ($record['dir'] == 'entrata') ? tr('Vendita') : tr('Acquisto'); ?>." ]}
</div> </div>
<div class="col-md-3"> <div class="col-md-3">

View File

@@ -35,7 +35,6 @@ class Tipo extends Model
* *
* @param string $codice * @param string $codice
* @param string $descrizione * @param string $descrizione
* @param string $tempo_standard
* *
* @return self * @return self
*/ */
@@ -78,7 +77,7 @@ class Tipo extends Model
*/ */
public function setTempoStandardAttribute($value) public function setTempoStandardAttribute($value)
{ {
$result = round(($value / 2.5), 1) * 2.5; $result = round($value / 2.5, 1) * 2.5;
$this->attributes['tempo_standard'] = $result; $this->attributes['tempo_standard'] = $result;
} }

View File

@@ -73,7 +73,7 @@ switch (filter('op')) {
$utente->password = $password; $utente->password = $password;
} }
} else { } else {
$gruppo = \Models\Group::find($id_record); $gruppo = Models\Group::find($id_record);
$utente = User::build($gruppo, $username, $email, $password); $utente = User::build($gruppo, $username, $email, $password);
} }

View File

@@ -22,8 +22,6 @@ namespace Modules\Utenti\API\v1;
use API\Interfaces\CreateInterface; use API\Interfaces\CreateInterface;
use API\Resource; use API\Resource;
use API\Response; use API\Response;
use Auth;
use Update;
class Login extends Resource implements CreateInterface class Login extends Resource implements CreateInterface
{ {
@@ -46,15 +44,15 @@ class Login extends Resource implements CreateInterface
$response['google_maps_token'] = setting('Google Maps API key'); $response['google_maps_token'] = setting('Google Maps API key');
$response['prezzi_al_tecnico'] = setting('Mostra i prezzi al tecnico'); $response['prezzi_al_tecnico'] = setting('Mostra i prezzi al tecnico');
$response['version'] = Update::getVersion(); $response['version'] = \Update::getVersion();
} else { } else {
$response = [ $response = [
'status' => Response::getStatus()['unauthorized']['code'], 'status' => Response::getStatus()['unauthorized']['code'],
]; ];
// Se è in corso un brute-force, aggiunge il timeout // Se è in corso un brute-force, aggiunge il timeout
if (Auth::isBrute()) { if (\Auth::isBrute()) {
$response['timeout'] = Auth::getBruteTimeout(); $response['timeout'] = \Auth::getBruteTimeout();
} }
} }

View File

@@ -17,7 +17,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
$record = \Models\User::find($id_record); $record = Models\User::find($id_record);
$reset_token = $record->reset_token; $reset_token = $record->reset_token;

View File

@@ -101,8 +101,8 @@ if (!empty($options) && $options != 'custom' && $options != 'menu') {
echo ' echo '
<div class="nav-tabs-custom"> <div class="nav-tabs-custom">
<ul class="nav nav-tabs nav-justified"> <ul class="nav nav-tabs nav-justified">
<li class="active"><a data-toggle="tab" href="#fields">'.tr('Campi').' <span class="badge">'.($dbo->fetchNum('SELECT * FROM zz_views WHERE id_module='.prepare($record['id']).' ORDER BY `order` ASC')).'</a></li> <li class="active"><a data-toggle="tab" href="#fields">'.tr('Campi').' <span class="badge">'.$dbo->fetchNum('SELECT * FROM zz_views WHERE id_module='.prepare($record['id']).' ORDER BY `order` ASC').'</a></li>
<li><a data-toggle="tab" href="#filters">'.tr('Filtri').' <span class="badge">'.($dbo->fetchNum('SELECT * FROM zz_group_module WHERE idmodule='.prepare($record['id']).' ORDER BY `id` ASC')).'</span></a></li> <li><a data-toggle="tab" href="#filters">'.tr('Filtri').' <span class="badge">'.$dbo->fetchNum('SELECT * FROM zz_group_module WHERE idmodule='.prepare($record['id']).' ORDER BY `id` ASC').'</span></a></li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">

View File

@@ -56,7 +56,7 @@ if (empty($redirect)) {
if (empty($_GET['error'])) { if (empty($_GET['error'])) {
redirect($redirect); redirect($redirect);
exit(); exit;
} else { } else {
echo strip_tags($_GET['error']).'<br>'.strip_tags($_GET['error_description']).' echo strip_tags($_GET['error']).'<br>'.strip_tags($_GET['error_description']).'
<br><br> <br><br>

View File

@@ -46,8 +46,6 @@ class Componente extends Model
/** /**
* Crea un nuovo Componente per Impianti. * Crea un nuovo Componente per Impianti.
* *
* @param $data_registrazione
*
* @return self * @return self
*/ */
public static function build(Impianto $impianto, Articolo $articolo, $data_registrazione) public static function build(Impianto $impianto, Articolo $articolo, $data_registrazione)

View File

@@ -40,12 +40,6 @@ class Dichiarazione extends Model
/** /**
* Crea una nuova dichiarazione d'intento. * Crea una nuova dichiarazione d'intento.
* *
* @param $data
* @param $numero_protocollo
* @param $numero_progressivo
* @param $data_inizio
* @param $data_fine
*
* @return self * @return self
*/ */
public static function build(Anagrafica $anagrafica, $data, $numero_protocollo, $numero_progressivo, $data_inizio, $data_fine) public static function build(Anagrafica $anagrafica, $data, $numero_protocollo, $numero_progressivo, $data_inizio, $data_fine)

View File

@@ -28,9 +28,6 @@ use Modules\Banche\Banca;
use Modules\Fatture\Fattura; use Modules\Fatture\Fattura;
use Modules\Fatture\Gestori\Bollo; use Modules\Fatture\Gestori\Bollo;
use Modules\Iva\Aliquota; use Modules\Iva\Aliquota;
use Prints;
use Translator;
use UnexpectedValueException;
use Uploads; use Uploads;
/** /**
@@ -47,10 +44,10 @@ class FatturaElettronica
protected $cliente = []; protected $cliente = [];
/** @var Modules\Fatture\Fattura Informazioni sul documento */ /** @var Modules\Fatture\Fattura Informazioni sul documento */
protected $documento = null; protected $documento;
/** @var Validator Oggetto dedicato alla validazione dell'XML */ /** @var Validator Oggetto dedicato alla validazione dell'XML */
protected $validator = null; protected $validator;
/** @var array Contratti collegati al documento */ /** @var array Contratti collegati al documento */
protected $contratti = []; protected $contratti = [];
@@ -60,7 +57,7 @@ class FatturaElettronica
protected $righe = []; protected $righe = [];
/** @var array XML della fattura */ /** @var array XML della fattura */
protected $xml = null; protected $xml;
public function __construct($id_documento) public function __construct($id_documento)
{ {
@@ -70,7 +67,7 @@ class FatturaElettronica
// Controllo sulla possibilità di creare la fattura elettronica // Controllo sulla possibilità di creare la fattura elettronica
// Posso fatturare ai privati utilizzando il codice fiscale // Posso fatturare ai privati utilizzando il codice fiscale
if ($this->documento->stato->descrizione == 'Bozza') { if ($this->documento->stato->descrizione == 'Bozza') {
throw new UnexpectedValueException(); throw new \UnexpectedValueException();
} }
} }
@@ -257,8 +254,6 @@ class FatturaElettronica
/** /**
* Ottiene il codice destinatario a partire dal database ufficiale indicepa www.indicepa.gov.it. * Ottiene il codice destinatario a partire dal database ufficiale indicepa www.indicepa.gov.it.
* *
* @param $codice_fiscale
*
* @throws \GuzzleHttp\Exception\GuzzleException * @throws \GuzzleHttp\Exception\GuzzleException
* *
* @return string|null * @return string|null
@@ -288,7 +283,7 @@ class FatturaElettronica
public static function getDirectory() public static function getDirectory()
{ {
return Uploads::getDirectory(Modules::get('Fatture di vendita')['id']); return \Uploads::getDirectory(\Modules::get('Fatture di vendita')['id']);
} }
/** /**
@@ -313,7 +308,7 @@ class FatturaElettronica
} }
// Registrazione come allegato // Registrazione come allegato
Uploads::upload($this->toXML(), array_merge($data, [ \Uploads::upload($this->toXML(), array_merge($data, [
'name' => $name, 'name' => $name,
'original_name' => $filename, 'original_name' => $filename,
])); ]));
@@ -337,7 +332,7 @@ class FatturaElettronica
$previous = $this->getFilename(); $previous = $this->getFilename();
$data = $this->getUploadData(); $data = $this->getUploadData();
Uploads::delete($previous, $data); \Uploads::delete($previous, $data);
} }
/** /**
@@ -435,7 +430,7 @@ class FatturaElettronica
} }
if (!empty($missing)) { if (!empty($missing)) {
$link = Modules::link('Fatture di vendita', $fattura->id); $link = \Modules::link('Fatture di vendita', $fattura->id);
$errors[] = [ $errors[] = [
'link' => $link, 'link' => $link,
'name' => tr('Fattura'), 'name' => tr('Fattura'),
@@ -460,7 +455,7 @@ class FatturaElettronica
} }
if (!empty($missing)) { if (!empty($missing)) {
$link = Modules::link('IVA', $data['id']); $link = \Modules::link('IVA', $data['id']);
$errors[] = [ $errors[] = [
'link' => $link, 'link' => $link,
'name' => tr('IVA _DESC_', [ 'name' => tr('IVA _DESC_', [
@@ -487,7 +482,7 @@ class FatturaElettronica
} }
if (!empty($missing)) { if (!empty($missing)) {
$link = Modules::link('Pagamenti', $data['id']); $link = \Modules::link('Pagamenti', $data['id']);
$errors[] = [ $errors[] = [
'link' => $link, 'link' => $link,
'name' => tr('Pagamento'), 'name' => tr('Pagamento'),
@@ -516,7 +511,7 @@ class FatturaElettronica
} }
if (!empty($missing)) { if (!empty($missing)) {
$link = Modules::link('Anagrafiche', $data['id']); $link = \Modules::link('Anagrafiche', $data['id']);
$errors[] = [ $errors[] = [
'link' => $link, 'link' => $link,
'name' => tr('Anagrafica Azienda'), 'name' => tr('Anagrafica Azienda'),
@@ -556,7 +551,7 @@ class FatturaElettronica
} }
if (!empty($missing)) { if (!empty($missing)) {
$link = Modules::link('Anagrafiche', $data['id']); $link = \Modules::link('Anagrafiche', $data['id']);
$errors[] = [ $errors[] = [
'link' => $link, 'link' => $link,
'name' => tr('Anagrafica Cliente'), 'name' => tr('Anagrafica Cliente'),
@@ -583,7 +578,7 @@ class FatturaElettronica
} }
if (!empty($missing)) { if (!empty($missing)) {
$link = Modules::link('Anagrafiche', $data['id']); $link = \Modules::link('Anagrafiche', $data['id']);
$errors[] = [ $errors[] = [
'link' => $link, 'link' => $link,
'name' => tr('Anagrafica Vettore'), 'name' => tr('Anagrafica Vettore'),
@@ -1366,8 +1361,6 @@ class FatturaElettronica
/** /**
* Restituisce l'array responsabile per la generazione del tag DatiBeniServizi. * Restituisce l'array responsabile per la generazione del tag DatiBeniServizi.
* *
* @param $fattura
*
* @throws \Exception * @throws \Exception
* *
* @return array * @return array
@@ -1492,7 +1485,7 @@ class FatturaElettronica
if (!empty($riga['ritenuta_contributi'])) { if (!empty($riga['ritenuta_contributi'])) {
$dettaglio[]['AltriDatiGestionali'] = [ $dettaglio[]['AltriDatiGestionali'] = [
'TipoDato' => 'CASSA-PREV', 'TipoDato' => 'CASSA-PREV',
'RiferimentoTesto' => setting('Tipo Cassa Previdenziale').' - '.$ritenuta_contributi->descrizione.' ('.Translator::numberToLocale($ritenuta_contributi->percentuale).'%)', 'RiferimentoTesto' => setting('Tipo Cassa Previdenziale').' - '.$ritenuta_contributi->descrizione.' ('.\Translator::numberToLocale($ritenuta_contributi->percentuale).'%)',
'RiferimentoNumero' => $riga->ritenuta_contributi, 'RiferimentoNumero' => $riga->ritenuta_contributi,
]; ];
} }
@@ -1707,11 +1700,11 @@ class FatturaElettronica
$attachments = []; $attachments = [];
// Informazioni sul modulo // Informazioni sul modulo
$id_module = Modules::get('Fatture di vendita')['id']; $id_module = \Modules::get('Fatture di vendita')['id'];
$directory = Uploads::getDirectory($id_module); $directory = \Uploads::getDirectory($id_module);
// Allegati // Allegati
$allegati = Uploads::get([ $allegati = \Uploads::get([
'id_module' => $id_module, 'id_module' => $id_module,
'id_record' => $documento['id'], 'id_record' => $documento['id'],
]); ]);
@@ -1723,7 +1716,7 @@ class FatturaElettronica
$attachments[] = [ $attachments[] = [
'NomeAttachment' => $allegato['name'], 'NomeAttachment' => $allegato['name'],
'FormatoAttachment' => Uploads::fileInfo($file)['extension'], 'FormatoAttachment' => \Uploads::fileInfo($file)['extension'],
'Attachment' => base64_encode(file_get_contents($file)), 'Attachment' => base64_encode(file_get_contents($file)),
]; ];
} }
@@ -1746,14 +1739,14 @@ class FatturaElettronica
$data = $fattura->getUploadData(); $data = $fattura->getUploadData();
// Generazione stampa // Generazione stampa
$print = Prints::getModulePredefinedPrint($id_module); $print = \Prints::getModulePredefinedPrint($id_module);
$info = Prints::render($print['id'], $documento['id'], null, true); $info = \Prints::render($print['id'], $documento['id'], null, true);
// Salvataggio stampa come allegato // Salvataggio stampa come allegato
$name = 'Stampa allegata'; $name = 'Stampa allegata';
$is_presente = database()->fetchNum('SELECT id FROM zz_files WHERE id_module = '.prepare($id_module).' AND id_record = '.prepare($documento['id']).' AND name = '.prepare($name)); $is_presente = database()->fetchNum('SELECT id FROM zz_files WHERE id_module = '.prepare($id_module).' AND id_record = '.prepare($documento['id']).' AND name = '.prepare($name));
if (empty($is_presente)) { if (empty($is_presente)) {
Uploads::upload($info['pdf'], array_merge($data, [ \Uploads::upload($info['pdf'], array_merge($data, [
'name' => $name, 'name' => $name,
'original_name' => $info['path'], 'original_name' => $info['path'],
])); ]));
@@ -1854,7 +1847,7 @@ class FatturaElettronica
{ {
return [ return [
'category' => tr('Fattura Elettronica'), 'category' => tr('Fattura Elettronica'),
'id_module' => Modules::get('Fatture di vendita')['id'], 'id_module' => \Modules::get('Fatture di vendita')['id'],
'id_record' => $this->getDocumento()['id'], 'id_record' => $this->getDocumento()['id'],
]; ];
} }

View File

@@ -21,7 +21,6 @@ namespace Plugins\ExportFE;
use API\Services; use API\Services;
use Modules\Fatture\Fattura; use Modules\Fatture\Fattura;
use UnexpectedValueException;
/** /**
* Classe per la gestione delle API esterne per l'invio delle Fatture Elettroniche e la ricerca di ricevute collegate. * Classe per la gestione delle API esterne per l'invio delle Fatture Elettroniche e la ricerca di ricevute collegate.
@@ -65,7 +64,7 @@ class Interaction extends Services
'code' => $body['status'], 'code' => $body['status'],
'message' => $body['message'], 'message' => $body['message'],
]; ];
} catch (UnexpectedValueException $e) { } catch (\UnexpectedValueException $e) {
} }
return [ return [
@@ -89,7 +88,7 @@ class Interaction extends Services
'code' => $body['status'], 'code' => $body['status'],
'results' => $body['results'], 'results' => $body['results'],
]; ];
} catch (UnexpectedValueException $e) { } catch (\UnexpectedValueException $e) {
} }
return [ return [

View File

@@ -19,7 +19,6 @@
namespace Plugins\ExportFE; namespace Plugins\ExportFE;
use DateTime;
use Respect\Validation\Validator as v; use Respect\Validation\Validator as v;
use Stringy\Stringy as S; use Stringy\Stringy as S;
@@ -540,10 +539,10 @@ class Validator
]; ];
/** @var array Irregolarità nella fattura XML */ /** @var array Irregolarità nella fattura XML */
protected $errors = null; protected $errors;
/** @var string XML da validare */ /** @var string XML da validare */
protected $xml = null; protected $xml;
public function __construct($xml) public function __construct($xml)
{ {
@@ -586,10 +585,7 @@ class Validator
* Prepara i contenuti per la generazione dell'XML della fattura. * Prepara i contenuti per la generazione dell'XML della fattura.
* Effettua inoltre dei controlli interni di validità sui campi previsti dallo standard. * Effettua inoltre dei controlli interni di validità sui campi previsti dallo standard.
* *
* @param mixed $input
* @param string $key * @param string $key
*
* @return mixed
*/ */
public function prepareForXML($input, $key = null) public function prepareForXML($input, $key = null)
{ {
@@ -623,7 +619,7 @@ class Validator
// Formattazione date // Formattazione date
elseif ($info['type'] == 'date') { elseif ($info['type'] == 'date') {
$object = DateTime::createFromFormat('Y-m-d H:i:s', $output); $object = \DateTime::createFromFormat('Y-m-d H:i:s', $output);
if (is_object($object)) { if (is_object($object)) {
$output = $object->format('Y-m-d'); $output = $object->format('Y-m-d');
} }

View File

@@ -52,7 +52,7 @@ switch (filter('op')) {
echo json_encode([ echo json_encode([
'id' => 1, 'id' => 1,
]); ]);
exit(); exit;
} else { } else {
$content = file_get_contents($temp_name); $content = file_get_contents($temp_name);
@@ -349,7 +349,7 @@ switch (filter('op')) {
'numero' => $dato['IdDocumento'], 'numero' => $dato['IdDocumento'],
'anno' => (new Carbon($dato['Data']))->format('Y'), 'anno' => (new Carbon($dato['Data']))->format('Y'),
]; ];
} catch (\Exception $e) { } catch (Exception $e) {
$dati_ordini[(int) $dato['RiferimentoNumeroLinea']] = [ $dati_ordini[(int) $dato['RiferimentoNumeroLinea']] = [
'numero' => $dato['IdDocumento'], 'numero' => $dato['IdDocumento'],
]; ];

View File

@@ -19,7 +19,6 @@
namespace Plugins\ImportFE; namespace Plugins\ImportFE;
use Modules;
use Modules\Anagrafiche\Anagrafica; use Modules\Anagrafiche\Anagrafica;
use Modules\Anagrafiche\Nazione; use Modules\Anagrafiche\Nazione;
use Modules\Anagrafiche\Tipo as TipoAnagrafica; use Modules\Anagrafiche\Tipo as TipoAnagrafica;
@@ -27,8 +26,6 @@ use Modules\Banche\Banca;
use Modules\Fatture\Fattura; use Modules\Fatture\Fattura;
use Modules\Fatture\Stato as StatoFattura; use Modules\Fatture\Stato as StatoFattura;
use Modules\Fatture\Tipo as TipoFattura; use Modules\Fatture\Tipo as TipoFattura;
use UnexpectedValueException;
use Uploads;
use Util\XML; use Util\XML;
/** /**
@@ -38,16 +35,16 @@ use Util\XML;
*/ */
class FatturaElettronica class FatturaElettronica
{ {
protected static $directory = null; protected static $directory;
/** @var array Percorso del file XML */ /** @var array Percorso del file XML */
protected $file = null; protected $file;
/** @var array XML della fattura */ /** @var array XML della fattura */
protected $xml = null; protected $xml;
/** @var Fattura Fattura collegata */ /** @var Fattura Fattura collegata */
protected $fattura = null; protected $fattura;
public function __construct($name) public function __construct($name)
{ {
@@ -78,14 +75,14 @@ class FatturaElettronica
])->first(); ])->first();
if (!empty($fattura) && $fattura->tipo->dir == 'uscita') { if (!empty($fattura) && $fattura->tipo->dir == 'uscita') {
throw new UnexpectedValueException(); throw new \UnexpectedValueException();
} }
} }
public static function getImportDirectory() public static function getImportDirectory()
{ {
if (!isset(self::$directory)) { if (!isset(self::$directory)) {
$module = Modules::get('Fatture di acquisto'); $module = \Modules::get('Fatture di acquisto');
$plugins = $module->plugins; $plugins = $module->plugins;
if (!empty($plugins)) { if (!empty($plugins)) {
@@ -117,7 +114,7 @@ class FatturaElettronica
new static($name); new static($name);
return true; return true;
} catch (UnexpectedValueException $e) { } catch (\UnexpectedValueException $e) {
$file = static::getImportDirectory().'/'.$name; $file = static::getImportDirectory().'/'.$name;
delete($file); delete($file);
@@ -134,7 +131,7 @@ class FatturaElettronica
if ($tipo == 'TD06') { if ($tipo == 'TD06') {
$manager = new Parcella($name); $manager = new Parcella($name);
} }
} catch (UnexpectedValueException $e) { } catch (\UnexpectedValueException $e) {
$manager = new FatturaSemplificata($name); $manager = new FatturaSemplificata($name);
} }
@@ -169,7 +166,7 @@ class FatturaElettronica
{ {
$allegati = $this->getAllegati(); $allegati = $this->getAllegati();
$module = Modules::get('Fatture di acquisto'); $module = \Modules::get('Fatture di acquisto');
$info = [ $info = [
'category' => tr('Fattura Elettronica'), 'category' => tr('Fattura Elettronica'),
@@ -187,16 +184,16 @@ class FatturaElettronica
$original = $allegato['NomeAttachment'].$extension; $original = $allegato['NomeAttachment'].$extension;
try { try {
Uploads::upload($content, array_merge($info, [ \Uploads::upload($content, array_merge($info, [
'name' => $allegato['NomeAttachment'], 'name' => $allegato['NomeAttachment'],
'original_name' => $original, 'original_name' => $original,
])); ]));
} catch (UnexpectedValueException $e) { } catch (\UnexpectedValueException $e) {
} }
} }
// Registrazione XML come allegato // Registrazione XML come allegato
Uploads::upload($this->file, array_merge($info, [ \Uploads::upload($this->file, array_merge($info, [
'name' => tr('Fattura Elettronica'), 'name' => tr('Fattura Elettronica'),
'original_name' => basename($this->file), 'original_name' => basename($this->file),
])); ]));

View File

@@ -28,7 +28,6 @@ use Modules\Fatture\Components\Descrizione;
use Modules\Fatture\Components\Riga; use Modules\Fatture\Components\Riga;
use Modules\Fatture\Fattura; use Modules\Fatture\Fattura;
use Plugins\ListinoClienti\DettaglioPrezzo; use Plugins\ListinoClienti\DettaglioPrezzo;
use UnexpectedValueException;
use Util\XML; use Util\XML;
/** /**
@@ -43,7 +42,7 @@ class FatturaOrdinaria extends FatturaElettronica
parent::__construct($name); parent::__construct($name);
if ($this->getHeader()['DatiTrasmissione']['FormatoTrasmissione'] == 'FSM10') { if ($this->getHeader()['DatiTrasmissione']['FormatoTrasmissione'] == 'FSM10') {
throw new UnexpectedValueException(); throw new \UnexpectedValueException();
} }
} }
@@ -456,7 +455,7 @@ class FatturaOrdinaria extends FatturaElettronica
$iva_arrotondamento = database()->fetchOne('SELECT * FROM co_iva WHERE percentuale=0 AND deleted_at IS NULL'); $iva_arrotondamento = database()->fetchOne('SELECT * FROM co_iva WHERE percentuale=0 AND deleted_at IS NULL');
if (($diff != 0 && $diff != $diff_tot) || (($diff_tot != $diff) && !$diff_iva) || ($diff_iva)) { if (($diff != 0 && $diff != $diff_tot) || (($diff_tot != $diff) && !$diff_iva) || $diff_iva) {
if ($diff != 0 && $diff != $diff_tot) { if ($diff != 0 && $diff != $diff_tot) {
$diff *= 100 / (100 + $iva_arrotondamento['percentuale']); $diff *= 100 / (100 + $iva_arrotondamento['percentuale']);
} elseif (($diff == $diff_tot) && !$diff_iva) { } elseif (($diff == $diff_tot) && !$diff_iva) {

View File

@@ -22,7 +22,6 @@ namespace Plugins\ImportFE;
use Modules\Articoli\Articolo as ArticoloOriginale; use Modules\Articoli\Articolo as ArticoloOriginale;
use Modules\Fatture\Components\Articolo; use Modules\Fatture\Components\Articolo;
use Modules\Fatture\Components\Riga; use Modules\Fatture\Components\Riga;
use UnexpectedValueException;
use Util\XML; use Util\XML;
/** /**
@@ -37,7 +36,7 @@ class FatturaSemplificata extends FatturaElettronica
parent::__construct($name); parent::__construct($name);
if ($this->getHeader()['DatiTrasmissione']['FormatoTrasmissione'] != 'FSM10') { if ($this->getHeader()['DatiTrasmissione']['FormatoTrasmissione'] != 'FSM10') {
throw new UnexpectedValueException(); throw new \UnexpectedValueException();
} }
} }

View File

@@ -20,7 +20,6 @@
namespace Plugins\ImportFE; namespace Plugins\ImportFE;
use Hooks\CachedManager; use Hooks\CachedManager;
use Modules;
/** /**
* Hook dedicato all'importazione automatica delle Fatture Elettroniche di acquisto rilevate dal sistema automatico di gestione. * Hook dedicato all'importazione automatica delle Fatture Elettroniche di acquisto rilevate dal sistema automatico di gestione.
@@ -44,7 +43,7 @@ class InvoiceHook extends CachedManager
$count = count($results); $count = count($results);
$notify = false; $notify = false;
$module = Modules::get('Fatture di acquisto'); $module = \Modules::get('Fatture di acquisto');
$plugins = $module->plugins; $plugins = $module->plugins;
if (!empty($plugins)) { if (!empty($plugins)) {

View File

@@ -56,8 +56,6 @@ class DettaglioPrezzo extends Model
/** /**
* Imposta il prezzo di vendita sulla base dell'impstazione per l'utilizzo dei prezzi comprensivi di IVA. * Imposta il prezzo di vendita sulla base dell'impstazione per l'utilizzo dei prezzi comprensivi di IVA.
*
* @param $prezzo_unitario
*/ */
public function setPrezzoUnitario($prezzo_unitario) public function setPrezzoUnitario($prezzo_unitario)
{ {

View File

@@ -128,9 +128,9 @@ switch ($operazione) {
$riga->descrizione = $descrizione; $riga->descrizione = $descrizione;
$riga->setPrezzoUnitario($prezzo_unitario, $r->idiva); $riga->setPrezzoUnitario($prezzo_unitario, $r->idiva);
$riga->setSconto(($r->tipo_sconto == 'PRC' ? $r->sconto_percentuale : $r->sconto_unitario), $r->tipo_sconto); $riga->setSconto($r->tipo_sconto == 'PRC' ? $r->sconto_percentuale : $r->sconto_unitario, $r->tipo_sconto);
$riga->qta = $qta_riga; $riga->qta = $qta_riga;
$riga->setProvvigione(($r->provvigione_percentuale ? $r->provvigione_percentuale : $r->provvigione_unitaria), $r->tipo_provvigione); $riga->setProvvigione($r->provvigione_percentuale ? $r->provvigione_percentuale : $r->provvigione_unitaria, $r->tipo_provvigione);
$riga->idpianificazione = $pianificazioni[$rata]; $riga->idpianificazione = $pianificazioni[$rata];
$riga->save(); $riga->save();
@@ -200,7 +200,7 @@ switch ($operazione) {
flash()->info(tr('Rata fatturata correttamente!')); flash()->info(tr('Rata fatturata correttamente!'));
database()->commitTransaction(); database()->commitTransaction();
redirect(base_path().'/controller.php?id_module='.Modules::get('Fatture di vendita')['id'].'&id_record='.$fattura->id); redirect(base_path().'/controller.php?id_module='.Modules::get('Fatture di vendita')['id'].'&id_record='.$fattura->id);
exit(); exit;
case 'add_fattura_multipla': case 'add_fattura_multipla':
$rate = post('rata'); $rate = post('rata');
@@ -255,5 +255,5 @@ switch ($operazione) {
flash()->info(tr('Rate fatturate correttamente!')); flash()->info(tr('Rate fatturate correttamente!'));
database()->commitTransaction(); database()->commitTransaction();
redirect(base_path().'/controller.php?id_module='.Modules::get('Fatture di vendita')['id']); redirect(base_path().'/controller.php?id_module='.Modules::get('Fatture di vendita')['id']);
exit(); exit;
} }

View File

@@ -130,7 +130,7 @@ foreach ($righe as $riga) {
{[ "type": "textarea", "label": "'.tr('Descrizione').'", "name": "descrizione['.$riga->id.']", "value": "'.$descrizione.'", "extra": "rows=6" ]} {[ "type": "textarea", "label": "'.tr('Descrizione').'", "name": "descrizione['.$riga->id.']", "value": "'.$descrizione.'", "extra": "rows=6" ]}
{[ "type": "number", "label": "'.tr('Q.tà per fattura').'", "class":"qta_fattura", "name": "qta['.$riga->id.']", "required": 1, "value": "1", "decimals": "qta", "min-value": "1", "icon-after":"'.tr('su _TOT_ totali', [ {[ "type": "number", "label": "'.tr('Q.tà per fattura').'", "class":"qta_fattura", "name": "qta['.$riga->id.']", "required": 1, "value": "1", "decimals": "qta", "min-value": "1", "icon-after":"'.tr('su _TOT_ totali', [
'_TOT_' => Translator::numberToLocale(($riga->qta - $riga->qta_evasa)), '_TOT_' => Translator::numberToLocale($riga->qta - $riga->qta_evasa),
]).'", "options":"'.str_replace('"', '\"', $options).'" ]} ]).'", "options":"'.str_replace('"', '\"', $options).'" ]}
</div> </div>
<div class="col-md-3" id="totali_'.$riga->id.'"> <div class="col-md-3" id="totali_'.$riga->id.'">
@@ -140,7 +140,7 @@ foreach ($righe as $riga) {
echo ' <div class="label label-warning alert_rate hide"> echo ' <div class="label label-warning alert_rate hide">
<i class="fa fa-warning"></i> <span>'.tr('Attenzione, sono previste _RATE_ rate su _TOT_ quantità totali', [ <i class="fa fa-warning"></i> <span>'.tr('Attenzione, sono previste _RATE_ rate su _TOT_ quantità totali', [
'_RATE_' => '<span class="num_rate"></span>', '_RATE_' => '<span class="num_rate"></span>',
'_TOT_' => '<span class="qta_disponibili">'.Translator::numberToLocale(($riga->qta - $riga->qta_evasa)).'</span>', '_TOT_' => '<span class="qta_disponibili">'.Translator::numberToLocale($riga->qta - $riga->qta_evasa).'</span>',
]).'</span>. ]).'</span>.
</div><hr>'; </div><hr>';
} }

View File

@@ -39,8 +39,6 @@ class Pianificazione extends Document
/** /**
* Crea un nuovo promemoria. * Crea un nuovo promemoria.
* *
* @param string $data_richiesta
*
* @return self * @return self
*/ */
public static function build(Contratto $contratto, $data_scadenza) public static function build(Contratto $contratto, $data_scadenza)

View File

@@ -98,7 +98,7 @@ if (!$elenco_promemoria->isEmpty()) {
$disabled = 'disabled'; $disabled = 'disabled';
$title = 'Per eliminare il promemoria, eliminare prima l\'intervento associato.'; $title = 'Per eliminare il promemoria, eliminare prima l\'intervento associato.';
} else { } else {
$info_intervento = '- '.('Nessuno').' -'; $info_intervento = '- Nessuno -';
$disabled = ''; $disabled = '';
$title = 'Elimina promemoria...'; $title = 'Elimina promemoria...';
} }
@@ -106,7 +106,7 @@ if (!$elenco_promemoria->isEmpty()) {
// Informazioni sugli impianti // Informazioni sugli impianti
$info_impianti = ''; $info_impianti = '';
if (!empty($promemoria['idimpianti'])) { if (!empty($promemoria['idimpianti'])) {
$impianti = $dbo->fetchArray('SELECT id, matricola, nome FROM my_impianti WHERE id IN ('.($promemoria['idimpianti']).')'); $impianti = $dbo->fetchArray('SELECT id, matricola, nome FROM my_impianti WHERE id IN ('.$promemoria['idimpianti'].')');
foreach ($impianti as $impianto) { foreach ($impianti as $impianto) {
$info_impianti .= Modules::link('MyImpianti', $impianto['id'], tr('_NOME_ (_MATRICOLA_)', [ $info_impianti .= Modules::link('MyImpianti', $impianto['id'], tr('_NOME_ (_MATRICOLA_)', [

View File

@@ -91,7 +91,7 @@ foreach ($raggruppamenti as $mese => $raggruppamento) {
// Sede promemoria // Sede promemoria
if ($promemoria->idsede == '-1') { if ($promemoria->idsede == '-1') {
echo '- '.('Nessuna').' -'; echo '- Nessuna -';
} elseif (empty($promemoria->idsede)) { } elseif (empty($promemoria->idsede)) {
echo tr('Sede legale'); echo tr('Sede legale');
} else { } else {

View File

@@ -2,9 +2,6 @@
namespace Plugins\PresentazioniBancarie\Cbi; namespace Plugins\PresentazioniBancarie\Cbi;
use DOMDocument;
use DOMXPath;
class CbiSepa class CbiSepa
{ {
/** /**
@@ -84,11 +81,11 @@ class CbiSepa
$CtrlSum = 0.00; $CtrlSum = 0.00;
$NbOfTxs = 1; $NbOfTxs = 1;
$domDoc = new DOMDocument(); $domDoc = new \DOMDocument();
$domDoc->preserveWhiteSpace = false; $domDoc->preserveWhiteSpace = false;
$domDoc->formatOutput = true; $domDoc->formatOutput = true;
$domDoc->loadXML($content); $domDoc->loadXML($content);
$xpath = new DOMXPath($domDoc); $xpath = new \DOMXPath($domDoc);
$rootNamespace = $domDoc->lookupNamespaceUri($domDoc->namespaceURI); $rootNamespace = $domDoc->lookupNamespaceUri($domDoc->namespaceURI);
$xpath->registerNamespace('x', $rootNamespace); $xpath->registerNamespace('x', $rootNamespace);
$results = $xpath->query('//x:GrpHdr/x:MsgId')->item(0); $results = $xpath->query('//x:GrpHdr/x:MsgId')->item(0);

View File

@@ -20,7 +20,7 @@ namespace Plugins\PresentazioniBancarie\Cbi\Records;
* @property string codice_cliente_debitore Codice con il quale il debitore è conosciuto dal creditore. * @property string codice_cliente_debitore Codice con il quale il debitore è conosciuto dal creditore.
* @property string flag_tipo_debitore Nel caso il debitore sia una Banca deve assumere il valore "B" (il codice ABI è indicato in pos. 70-74). * @property string flag_tipo_debitore Nel caso il debitore sia una Banca deve assumere il valore "B" (il codice ABI è indicato in pos. 70-74).
* @property string codice_divisa Questo campo deve coincidere con quello * @property string codice_divisa Questo campo deve coincidere con quello
omonimo del record di testa. * omonimo del record di testa.
*/ */
class Record14 extends BaseRecord class Record14 extends BaseRecord
{ {

View File

@@ -2,7 +2,6 @@
namespace Plugins\PresentazioniBancarie\Cbi; namespace Plugins\PresentazioniBancarie\Cbi;
use InvalidArgumentException;
use Plugins\PresentazioniBancarie\Cbi\Records\Record14; use Plugins\PresentazioniBancarie\Cbi\Records\Record14;
use Plugins\PresentazioniBancarie\Cbi\Records\Record20; use Plugins\PresentazioniBancarie\Cbi\Records\Record20;
use Plugins\PresentazioniBancarie\Cbi\Records\Record30; use Plugins\PresentazioniBancarie\Cbi\Records\Record30;
@@ -199,7 +198,7 @@ class RiBa
// Eccezione in caso di assenza di ricevute interne // Eccezione in caso di assenza di ricevute interne
if (empty($formato_ricevute)) { if (empty($formato_ricevute)) {
throw new InvalidArgumentException(); throw new \InvalidArgumentException();
} }
$cbi = new RibaAbiCbi(); $cbi = new RibaAbiCbi();

View File

@@ -3,10 +3,8 @@
namespace Plugins\PresentazioniBancarie; namespace Plugins\PresentazioniBancarie;
use Carbon\Carbon; use Carbon\Carbon;
use DateTime;
use Digitick\Sepa\PaymentInformation; use Digitick\Sepa\PaymentInformation;
use Digitick\Sepa\TransferFile\Factory\TransferFileFacadeFactory; use Digitick\Sepa\TransferFile\Factory\TransferFileFacadeFactory;
use Exception;
use Modules\Anagrafiche\Anagrafica; use Modules\Anagrafiche\Anagrafica;
use Modules\Banche\Banca; use Modules\Banche\Banca;
use Modules\Scadenzario\Scadenza; use Modules\Scadenzario\Scadenza;
@@ -205,7 +203,7 @@ class Gestore
return false; return false;
} }
public function aggiungiRiBa(int $identifier, Anagrafica $controparte, Banca $banca_controparte, string $descrizione, int $totale, DateTime $data_prevista) public function aggiungiRiBa(int $identifier, Anagrafica $controparte, Banca $banca_controparte, string $descrizione, int $totale, \DateTime $data_prevista)
{ {
$data_scadenza = $data_prevista->format('dmy'); $data_scadenza = $data_prevista->format('dmy');
@@ -258,7 +256,7 @@ class Gestore
return true; return true;
} }
public function aggiungiBonifico(int $identifier, Anagrafica $controparte, Banca $banca_controparte, string $descrizione, float $totale, DateTime $data_prevista, $ctgypurp) public function aggiungiBonifico(int $identifier, Anagrafica $controparte, Banca $banca_controparte, string $descrizione, float $totale, \DateTime $data_prevista, $ctgypurp)
{ {
$data_scadenza = $data_prevista->format('dmy'); $data_scadenza = $data_prevista->format('dmy');
@@ -325,7 +323,7 @@ class Gestore
return true; return true;
} }
public function aggiungiCreditoDiretto(int $identifier, Anagrafica $controparte, Banca $banca_controparte, string $descrizione, $totale, DateTime $data_prevista, $ctgypurp) public function aggiungiCreditoDiretto(int $identifier, Anagrafica $controparte, Banca $banca_controparte, string $descrizione, $totale, \DateTime $data_prevista, $ctgypurp)
{ {
$id = 'pagamento_'.$identifier; $id = 'pagamento_'.$identifier;
@@ -351,7 +349,7 @@ class Gestore
return true; return true;
} }
public function aggiungiDebitoDirettoSEPA(int $identifier, Anagrafica $controparte, Banca $banca_controparte, string $descrizione, $totale, DateTime $data_prevista) public function aggiungiDebitoDirettoSEPA(int $identifier, Anagrafica $controparte, Banca $banca_controparte, string $descrizione, $totale, \DateTime $data_prevista)
{ {
$id = 'pagamento_'.$identifier; $id = 'pagamento_'.$identifier;
@@ -381,7 +379,7 @@ class Gestore
return true; return true;
} }
public function aggiungiDebitoDiretto(int $identifier, Anagrafica $controparte, Banca $banca_controparte, string $descrizione, $totale, DateTime $data_prevista, $method, $codice_sequenza) public function aggiungiDebitoDiretto(int $identifier, Anagrafica $controparte, Banca $banca_controparte, string $descrizione, $totale, \DateTime $data_prevista, $method, $codice_sequenza)
{ {
$paymentInformation = new PaymentInformationCBI(); $paymentInformation = new PaymentInformationCBI();
$paymentInformation $paymentInformation
@@ -392,7 +390,7 @@ class Gestore
->setRequestedExecutionDate($data_prevista->format('Y-m-d')) ->setRequestedExecutionDate($data_prevista->format('Y-m-d'))
->setLocalMethod($method) ->setLocalMethod($method)
->setServiceLevel('SEPA') ->setServiceLevel('SEPA')
->setSeqType(($codice_sequenza != '' ? $codice_sequenza : 'RCUR')); ->setSeqType($codice_sequenza != '' ? $codice_sequenza : 'RCUR');
$mandato = $this->getMandato($banca_controparte); $mandato = $this->getMandato($banca_controparte);
$payment = new PaymentCBI(); $payment = new PaymentCBI();
@@ -481,7 +479,7 @@ class Gestore
// Salvataggio del file // Salvataggio del file
file_put_contents(base_dir().'/'.$file, $content); file_put_contents(base_dir().'/'.$file, $content);
} catch (Exception $e) { } catch (\Exception $e) {
} }
// File per il pagamento delle vendite Bonifico // File per il pagamento delle vendite Bonifico
@@ -495,7 +493,7 @@ class Gestore
// Salvataggio del file // Salvataggio del file
file_put_contents(base_dir().'/'.$file, $content); file_put_contents(base_dir().'/'.$file, $content);
} catch (Exception $e) { } catch (\Exception $e) {
} }
// File per il pagamento degli acquisti SEPA // File per il pagamento degli acquisti SEPA
@@ -509,7 +507,7 @@ class Gestore
// Salvataggio del file // Salvataggio del file
file_put_contents(base_dir().'/'.$file, $xml); file_put_contents(base_dir().'/'.$file, $xml);
} catch (Exception $e) { } catch (\Exception $e) {
} }
// File per il pagamento delle vendite SEPA CBI // File per il pagamento delle vendite SEPA CBI
@@ -532,7 +530,7 @@ class Gestore
// Salvataggio del file // Salvataggio del file
file_put_contents(base_dir().'/'.$file, $xml); file_put_contents(base_dir().'/'.$file, $xml);
} catch (Exception $e) { } catch (\Exception $e) {
} }
return $files; return $files;

View File

@@ -21,9 +21,7 @@ namespace Plugins\ReceiptFE;
use Carbon\Carbon; use Carbon\Carbon;
use Hooks\Manager; use Hooks\Manager;
use Modules;
use Modules\Fatture\Fattura; use Modules\Fatture\Fattura;
use Plugins;
/** /**
* Hook specializzato per il conteggio e la segnalazione di Fatture senza ricevute oppure con ricevuta in stato di errore. * Hook specializzato per il conteggio e la segnalazione di Fatture senza ricevute oppure con ricevuta in stato di errore.
@@ -67,8 +65,8 @@ class NotificheRicevuteHook extends Manager
]); ]);
} }
$module = Modules::get('Fatture di vendita'); $module = \Modules::get('Fatture di vendita');
$plugin = Plugins::get('Ricevute FE'); $plugin = \Plugins::get('Ricevute FE');
return [ return [
'icon' => 'fa fa-ticket text-yellow', 'icon' => 'fa fa-ticket text-yellow',

View File

@@ -21,7 +21,6 @@ namespace Plugins\ReceiptFE;
use Hooks\Manager; use Hooks\Manager;
use Models\Cache; use Models\Cache;
use Modules;
/** /**
* Hook per l'importazione e il conteggio delle ricevute rilevate come da importare. * Hook per l'importazione e il conteggio delle ricevute rilevate come da importare.
@@ -111,7 +110,7 @@ class ReceiptHook extends Manager
$notify = $total_number != 0; $notify = $total_number != 0;
$color = $total_number == $completed_number ? 'success' : 'yellow'; $color = $total_number == $completed_number ? 'success' : 'yellow';
$module = Modules::get('Fatture di vendita'); $module = \Modules::get('Fatture di vendita');
return [ return [
'icon' => 'fa fa-ticket text-'.$color, 'icon' => 'fa fa-ticket text-'.$color,

Some files were not shown because too many files have changed in this diff Show More