Compare commits

...

5 Commits

Author SHA1 Message Date
valentina c8f42e38f0 fix: template stampa preventivo con immagini 2024-10-22 12:46:59 +02:00
FabioL 9623e54d87 fix: animazione pagine 2024-10-22 12:06:23 +02:00
valentina 85dda6e1ee fix: template stampa preventivi 2024-10-22 11:48:58 +02:00
valentina 31bc259d0c fix: correzione errore js 2024-10-22 10:40:49 +02:00
valentina 4472a99e87 fix: lettura valori select 2024-10-22 10:40:29 +02:00
6 changed files with 55 additions and 48 deletions

View File

@ -38,8 +38,26 @@
color: #000;
}
.preloader{
background-color: #f4f6f9de ;
#main_loading {
display: block;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.7);
z-index: 9999;
}
#main_loading > img {
position: fixed;
top: 50%;
left: 50%;
width: 60px;
height: 60px;
margin-top: -30px;
margin-left: -30px;
z-index: 9999;
}
html {
@ -214,25 +232,15 @@ a:focus {
}
#mini-loader {
position: fixed;
top: 0;
left: 0;
z-index: 9000;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.15);
}
#mini-loader>div {
#mini-loader > div{
position: fixed;
bottom: 20px;
left: auto;
right: 20px;
width: 100px;
height: 100px;
margin-top: -50px;
margin-left: -50px;
z-index: 9000;
width: 100px;
height: 100px;
background: transparent url(../img/ajax-loader.gif) top left no-repeat;
}
@ -473,7 +481,7 @@ span.form-control {
.select2-search,
.select2-search__field {
width: 100%;
width: 100% !important;
}
.select2-results__option[aria-selected=true] {

View File

@ -18,7 +18,7 @@
// Aggiunta dell'ingranaggio all'unload della pagina
$(window).on("beforeunload", function () {
$("#main_loading").css('height', '100vh').find('img').show().removeClass('animation__shake').addClass('animation__shake');
$("#main_loading").show().find('img').show().removeClass('animation__shake').addClass('animation__shake');
});
// Fix multi-modal
@ -100,6 +100,7 @@ $(document).ready(function () {
alignMaxHeight(".module-header .card");
$("#main_loading").fadeOut()
});
/*

View File

@ -365,7 +365,7 @@ if (Auth::check()) {
echo '
<!-- Loader principale -->
<!-- Preloader -->
<div id="main_loading" class="preloader flex-column justify-content-center align-items-center">
<div id="main_loading" class="flex-column justify-content-center align-items-center">
<img class="animation__shake" src="'.$rootdir.'/assets/dist/img/logo.png" alt="OSM" height="60" width="60">
</div>

View File

@ -495,8 +495,9 @@ echo '
}
let data = anagrafica.getData();
input("idcontratto").getElement()
.selectSetNew(data.id_contratto, data.descrizione_contratto);
if (data) {
input("idcontratto").getElement().selectSetNew(data.id_contratto, data.descrizione_contratto);
}
// Quando modifico orario inizio, allineo anche l\'orario fine
let orario_inizio = input("orario_inizio").getElement();

View File

@ -173,8 +173,7 @@ class SelectHandler implements HandlerInterface
// Leggo ulteriori campi oltre a id e descrizione per inserirli nell'option nella forma "data-nomecampo1", "data-nomecampo2", ecc
unset($element['optgroup']);
$attributes[] = "data-select-attributes='".replace(json_encode($element), ["'" => "\'"])."'";
$attributes[] = "data-select-attributes='".htmlspecialchars(json_encode($element), ENT_QUOTES)."'";
$html .= '
<option value="'.prepareToField($element['id']).'" '.implode(' ', $attributes).(!empty($element['disabled']) ? 'disabled' : '').'>'.$element['text'].'</option>';
}
@ -226,8 +225,7 @@ class SelectHandler implements HandlerInterface
// Leggo ulteriori campi oltre a id e descrizione per inserirli nell'option nella forma "data-nomecampo1", "data-nomecampo2", ecc
unset($element['optgroup']);
$attributes[] = "data-select-attributes='".replace(json_encode($element), ["'" => "\'"])."'";
$attributes[] = "data-select-attributes='".htmlspecialchars(json_encode($element), ENT_QUOTES)."'";
$result .= '
<option value="'.prepareToField($element['id']).'" '.implode(' ', $attributes).'>'.$element['text'].'</option>';
}

View File

@ -205,7 +205,7 @@ foreach ($righe as $key => $riga) {
$subtotale_gruppo = 0;
$iva_gruppo = 0;
$has_gruppo = true;
$colspan_titolo = $options['pricing'] ? 'colspan="5"' : 'colspan="2"';
$colspan_titolo = $options['pricing'] ? 5 : 2;
$descrizione = '<b>'.nl2br((string) $r['descrizione']).'</b>';
} else {
$descrizione = nl2br((string) $r['descrizione']);
@ -236,7 +236,7 @@ foreach ($righe as $key => $riga) {
}
echo '
<td style="vertical-align: middle" '.$colspan_titolo.'>
<td style="vertical-align: middle" colspan="'.$colspan_titolo.'">
'.$descrizione;
if ($riga->isArticolo()) {
@ -320,28 +320,28 @@ foreach ($righe as $key => $riga) {
if ($has_gruppo && ($next->is_titolo || $next == null) && ($options['pricing'] || $options['show-only-total'])) {
echo '
<tr>
<td colspan="'.($options['show-only-total'] ? 2 : 4).'" class="text-right">
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 3 : 2) : (($has_image) ? 6 : 5)).'" class="text-right">
<b>'.tr('Subtotale', [], ['upper' => true]).':</b>
</td>
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)).'" class="text-right">
<td colspan="1" class="text-right">
'.moneyFormat($subtotale_gruppo, $d_totali).'
</td>
</tr>';
if (!$options['no-iva']) {
echo '
<tr>
<td colspan="'.($options['show-only-total'] ? 2 : 5).'" class="text-right">
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 3 : 2) : (($has_image) ? 6 : 5)).'" class="text-right">
<b>'.tr('Iva', [], ['upper' => true]).':</b>
</td>
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 1)).'" class="text-right">
<td colspan="1" class="text-right">
'.moneyFormat($iva_gruppo, $d_totali).'
</td>
</tr>
<tr>
<td colspan="'.($options['show-only-total'] ? 2 : 5).'" class="text-right">
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 3 : 2) : (($has_image) ? 6 : 5)).'" class="text-right">
<b>'.tr('Subtotale ivato', [], ['upper' => true]).':</b>
</td>
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 1)).'" class="text-right">
<td colspan="1" class="text-right">
<b>'.moneyFormat($subtotale_gruppo + $iva_gruppo, $d_totali).'</b>
</td>
</tr>';
@ -372,11 +372,11 @@ if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-on
// Totale imponibile
echo '
<tr>
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 3 : 2) : 4).'" class="text-right text-muted">
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 3 : 2) : (($has_image) ? 6 : 5)).'" class="text-right text-muted">
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td>
<th colspan="'.($options['show-only-total'] ? (($has_image) ? ($options['no-iva'] ? 1 : 2) : 1) : (($has_image) ? 3 : 2)).'" class="text-right">
<th colspan="1" class="text-right">
<b>'.moneyFormat($show_sconto ? $imponibile : $totale_imponibile, $d_totali).'</b>
</th>
</tr>';
@ -385,11 +385,11 @@ if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-on
if ($show_sconto) {
echo '
<tr>
<td colspan="'.($options['show-only-total'] ? 2 : 4).'" class="text-right text-muted">
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 3 : 2) :((($has_image) ? 6 : 5))).'" class="text-right text-muted">
<b>'.tr('Sconto', [], ['upper' => true]).':</b>
</td>
<th colspan="'.($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)).'" class="text-right">
<th colspan="1" class="text-right">
<b>'.moneyFormat($sconto, $d_totali).'</b>
</th>
</tr>';
@ -397,11 +397,11 @@ if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-on
// Totale imponibile
echo '
<tr>
<td colspan="'.($options['show-only-total'] ? 2 : 4).'" class="text-right text-muted">
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 3 : 2) : ((($has_image) ? 6 : 5))).'" class="text-right text-muted">
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
</td>
<th colspan="'.($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)).'" class="text-right">
<th colspan="1" class="text-right">
<b>'.moneyFormat($totale_imponibile, $d_totali).'</b>
</th>
</tr>';
@ -411,11 +411,11 @@ if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-on
if (!$options['no-iva']) {
echo '
<tr>
<td colspan="'.($options['show-only-total'] ? 2 : 4).'" class="text-right text-muted">
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 3 : 2) : (($has_image) ? 6 : 5)).'" class="text-right text-muted">
<b>'.tr('Totale IVA', [], ['upper' => true]).':</b>
</td>
<th colspan="'.($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)).'" class="text-right">
<th colspan="1" class="text-right">
<b>'.moneyFormat($totale_iva, $d_totali).'</b>
</th>
</tr>';
@ -423,11 +423,10 @@ if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-on
// TOTALE
echo '
<tr>
<td colspan="'.($options['show-only-total'] ? 2 : 4).'" class="text-right text-muted">
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 3 : 2) : (($has_image) ? 6 : 5)).'" class="text-right text-muted">
<b>'.tr('Totale documento', [], ['upper' => true]).':</b>
</td>
<th colspan="'.($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)).'" class="text-right">
<th colspan="1" class="text-right">
<b>'.moneyFormat($totale, $d_totali).'</b>
</th>
</tr>';
@ -436,10 +435,10 @@ if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-on
// SCONTO IN FATTURA
echo '
<tr>
<td colspan="'.($options['show-only-total'] ? 2 : 4).'" class="text-right border-top">
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 3 : 2) : ((($has_image) ? 6 : 5))).'" class="text-right border-top">
<b>'.tr('Sconto in fattura', [], ['upper' => true]).':</b>
</td>
<th colspan="'.($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)).'" class="text-right">
<th colspan="1" class="text-right">
<b>'.moneyFormat($sconto_finale, $d_totali).'</b>
</th>
</tr>';
@ -447,10 +446,10 @@ if (($options['pricing'] && !isset($options['hide-total'])) || $options['show-on
// NETTO A PAGARE
echo '
<tr>
<td colspan="'.($options['show-only-total'] ? 2 : 4).'" class="text-right border-top">
<td colspan="'.($options['show-only-total'] ? (($has_image) ? 3 : 2) : ((($has_image) ? 6 : 5))).'" class="text-right border-top">
<b>'.tr('Netto a pagare', [], ['upper' => true]).':</b>
</td>
<th colspan="'.($options['show-only-total'] ? (($has_image) ? 2 : 1) : (($has_image) ? 3 : 2)).'" class="text-right">
<th colspan="1" class="text-right">
<b>'.moneyFormat($netto_a_pagare, $d_totali).'</b>
</th>
</tr>';