mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-01 01:37:59 +01:00
Formattazione codice
This commit is contained in:
parent
96f1a62e0f
commit
7cdfbbff18
@ -278,9 +278,9 @@ $dirs_to_check = [
|
|||||||
|
|
||||||
$directories = [];
|
$directories = [];
|
||||||
foreach ($dirs_to_check as $name => $description) {
|
foreach ($dirs_to_check as $name => $description) {
|
||||||
if ($name == $backup_dir ){
|
if ($name == $backup_dir) {
|
||||||
$status = is_writable($name);
|
$status = is_writable($name);
|
||||||
}else{
|
} else {
|
||||||
$status = is_writable(base_dir().DIRECTORY_SEPARATOR.$name);
|
$status = is_writable(base_dir().DIRECTORY_SEPARATOR.$name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,4 +343,3 @@ function getPrezzoConsigliato($id_anagrafica, $direzione, $id_articolo, $riga =
|
|||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,6 +84,7 @@ class Bollo
|
|||||||
if (!empty($riga)) {
|
if (!empty($riga)) {
|
||||||
$riga->delete();
|
$riga->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ namespace Modules\ListiniCliente\Import;
|
|||||||
use Importer\CSVImporter;
|
use Importer\CSVImporter;
|
||||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||||
use Modules\ListiniCliente\Articolo;
|
use Modules\ListiniCliente\Articolo;
|
||||||
use Modules\ListiniCliente\Listino;
|
|
||||||
/**
|
/**
|
||||||
* Struttura per la gestione delle operazioni di importazione (da CSV) degli Articoli.
|
* Struttura per la gestione delle operazioni di importazione (da CSV) degli Articoli.
|
||||||
*
|
*
|
||||||
@ -53,7 +53,7 @@ class CSV extends CSVImporter
|
|||||||
[
|
[
|
||||||
'field' => 'sconto_percentuale',
|
'field' => 'sconto_percentuale',
|
||||||
'label' => 'Sconto percentuale',
|
'label' => 'Sconto percentuale',
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ if ($diff > 0) {
|
|||||||
$margine = $materiale['ricavo'] - $materiale['costo'];
|
$margine = $materiale['ricavo'] - $materiale['costo'];
|
||||||
$margine_prc = (int) (1 - ($materiale['costo'] / ($materiale['ricavo'] ? $materiale['ricavo'] : 1))) * 100;
|
$margine_prc = (int) (1 - ($materiale['costo'] / ($materiale['ricavo'] ? $materiale['ricavo'] : 1))) * 100;
|
||||||
$ricarico_prc = ($materiale['ricavo'] && $materiale['costo']) ? (int) ((($materiale['ricavo'] / ($materiale['costo'] ? $materiale['costo'] : 1)) - 1) * 100) : 100;
|
$ricarico_prc = ($materiale['ricavo'] && $materiale['costo']) ? (int) ((($materiale['ricavo'] / ($materiale['costo'] ? $materiale['costo'] : 1)) - 1) * 100) : 100;
|
||||||
echo'
|
echo '
|
||||||
<tr>
|
<tr>
|
||||||
<td>'.$key.'</td>
|
<td>'.$key.'</td>
|
||||||
<td class="text-center">'.$materiale['qta'].'</td>
|
<td class="text-center">'.$materiale['qta'].'</td>
|
||||||
|
@ -605,14 +605,14 @@ if (!empty($righe)) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">';
|
<div class="row">';
|
||||||
if (setting('Creazione seriali in import FE') && $serial) {
|
if (setting('Creazione seriali in import FE') && $serial) {
|
||||||
for ($i = 0; $i < $qta; ++$i) {
|
for ($i = 0; $i < $qta; ++$i) {
|
||||||
echo '
|
echo '
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
{[ "type": "text", "label": "'.tr('Serial').'", "name": "serial['.$key.'][]", "value": "'.$serial[$i].'" ]}
|
{[ "type": "text", "label": "'.tr('Serial').'", "name": "serial['.$key.'][]", "value": "'.$serial[$i].'" ]}
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo '
|
echo '
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -98,16 +98,15 @@ class FatturaOrdinaria extends FatturaElettronica
|
|||||||
|
|
||||||
if ($linea['ScontoMaggiorazione']) {
|
if ($linea['ScontoMaggiorazione']) {
|
||||||
$linea['ScontoMaggiorazione'] = $this->forceArray($linea['ScontoMaggiorazione']);
|
$linea['ScontoMaggiorazione'] = $this->forceArray($linea['ScontoMaggiorazione']);
|
||||||
foreach($linea['ScontoMaggiorazione'] as $sm) {
|
foreach ($linea['ScontoMaggiorazione'] as $sm) {
|
||||||
if(isset($sm['Percentuale'])){
|
if (isset($sm['Percentuale'])) {
|
||||||
$sconto = ($importo * $sm['Percentuale'] / 100);
|
$sconto = ($importo * $sm['Percentuale'] / 100);
|
||||||
if ($sm['Tipo'] == 'SC') {
|
if ($sm['Tipo'] == 'SC') {
|
||||||
$importo -= $sconto;
|
$importo -= $sconto;
|
||||||
} else {
|
} else {
|
||||||
$importo += $sconto;
|
$importo += $sconto;
|
||||||
}
|
}
|
||||||
|
} elseif (isset($sm['Importo'])) {
|
||||||
} elseif(isset($sm['Importo'])) {
|
|
||||||
if ($sm['Tipo'] == 'SC') {
|
if ($sm['Tipo'] == 'SC') {
|
||||||
$importo -= $sm['Importo'];
|
$importo -= $sm['Importo'];
|
||||||
} else {
|
} else {
|
||||||
@ -130,7 +129,7 @@ class FatturaOrdinaria extends FatturaElettronica
|
|||||||
|
|
||||||
foreach ($riepiloghi as $riepilogo) {
|
foreach ($riepiloghi as $riepilogo) {
|
||||||
$aliquota_iva = $riepilogo['AliquotaIVA'];
|
$aliquota_iva = $riepilogo['AliquotaIVA'];
|
||||||
$imponibile[$aliquota_iva] += (float)$riepilogo['Arrotondamento'];
|
$imponibile[$aliquota_iva] += (float) $riepilogo['Arrotondamento'];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($imponibile as $aliquota_iva => $importo) {
|
foreach ($imponibile as $aliquota_iva => $importo) {
|
||||||
@ -155,7 +154,7 @@ class FatturaOrdinaria extends FatturaElettronica
|
|||||||
|
|
||||||
foreach ($riepiloghi_raggruppati as $riepilogo) {
|
foreach ($riepiloghi_raggruppati as $riepilogo) {
|
||||||
$valore = 0;
|
$valore = 0;
|
||||||
$diff_iva = round((float)$riepilogo['Imposta'] - $totale_imposta[$riepilogo['AliquotaIVA']], 2);
|
$diff_iva = round((float) $riepilogo['Imposta'] - $totale_imposta[$riepilogo['AliquotaIVA']], 2);
|
||||||
|
|
||||||
if ($diff_iva) {
|
if ($diff_iva) {
|
||||||
$valore = $diff_iva * 100 / $riepilogo['AliquotaIVA'];
|
$valore = $diff_iva * 100 / $riepilogo['AliquotaIVA'];
|
||||||
@ -452,7 +451,7 @@ class FatturaOrdinaria extends FatturaElettronica
|
|||||||
}
|
}
|
||||||
|
|
||||||
$diff_iva = round($riep_imp - $fattura->iva, 2);
|
$diff_iva = round($riep_imp - $fattura->iva, 2);
|
||||||
$diff = round(abs($fattura->totale_imponibile) - abs($totale_righe + $tot_arr ), 2);
|
$diff = round(abs($fattura->totale_imponibile) - abs($totale_righe + $tot_arr), 2);
|
||||||
$diff_tot = round($fattura->totale_imponibile + $fattura->rivalsa_inps - $totale_imp + $tot_arr, 2);
|
$diff_tot = round($fattura->totale_imponibile + $fattura->rivalsa_inps - $totale_imp + $tot_arr, 2);
|
||||||
|
|
||||||
$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');
|
||||||
@ -603,7 +602,7 @@ class FatturaOrdinaria extends FatturaElettronica
|
|||||||
$percentuale_importo = round($totale_previsto / $totale * 100, 2);
|
$percentuale_importo = round($totale_previsto / $totale * 100, 2);
|
||||||
$percentuale_importo = min($percentuale_importo, 100); // Nota: Fix per la percentuale che superava il 100% nel caso di importi con Rivalsa compresa
|
$percentuale_importo = min($percentuale_importo, 100); // Nota: Fix per la percentuale che superava il 100% nel caso di importi con Rivalsa compresa
|
||||||
|
|
||||||
$ritenuta_acconto = $database->fetchOne("SELECT * FROM `co_ritenutaacconto` WHERE `percentuale` = ".prepare($percentuale)." AND `percentuale_imponibile` = ".prepare($percentuale_importo));
|
$ritenuta_acconto = $database->fetchOne('SELECT * FROM `co_ritenutaacconto` WHERE `percentuale` = '.prepare($percentuale).' AND `percentuale_imponibile` = '.prepare($percentuale_importo));
|
||||||
|
|
||||||
if (empty($ritenuta_acconto)) {
|
if (empty($ritenuta_acconto)) {
|
||||||
$descrizione = tr('Ritenuta _PRC_% sul _TOT_%', [
|
$descrizione = tr('Ritenuta _PRC_% sul _TOT_%', [
|
||||||
@ -611,12 +610,13 @@ class FatturaOrdinaria extends FatturaElettronica
|
|||||||
'_TOT_' => numberFormat($percentuale_importo),
|
'_TOT_' => numberFormat($percentuale_importo),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$database->query("INSERT INTO `co_ritenutaacconto` (`descrizione`, `percentuale`, `percentuale_imponibile`) VALUES (".prepare($descrizione).", ".prepare($percentuale).", ".prepare($percentuale_importo).")");
|
$database->query('INSERT INTO `co_ritenutaacconto` (`descrizione`, `percentuale`, `percentuale_imponibile`) VALUES ('.prepare($descrizione).', '.prepare($percentuale).', '.prepare($percentuale_importo).')');
|
||||||
$ritenuta_acconto = $database->fetchOne("SELECT * FROM `co_ritenutaacconto` WHERE `percentuale` = ".prepare($percentuale)." AND `percentuale_imponibile` = ".prepare($percentuale_importo));
|
$ritenuta_acconto = $database->fetchOne('SELECT * FROM `co_ritenutaacconto` WHERE `percentuale` = '.prepare($percentuale).' AND `percentuale_imponibile` = '.prepare($percentuale_importo));
|
||||||
}
|
}
|
||||||
|
|
||||||
$id_ritenuta_acconto = $ritenuta_acconto['id'];
|
$id_ritenuta_acconto = $ritenuta_acconto['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'id_ritenuta_acconto' => $id_ritenuta_acconto,
|
'id_ritenuta_acconto' => $id_ritenuta_acconto,
|
||||||
'id_rivalsa' => $id_rivalsa,
|
'id_rivalsa' => $id_rivalsa,
|
||||||
|
@ -99,7 +99,7 @@ echo '
|
|||||||
</div>
|
</div>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
$espandi_dettagli = setting('Espandi automaticamente la sezione "Dettagli aggiuntivi"');
|
$espandi_dettagli = setting('Espandi automaticamente la sezione "Dettagli aggiuntivi"');
|
||||||
echo '
|
echo '
|
||||||
<!-- DATI AGGIUNTIVI -->
|
<!-- DATI AGGIUNTIVI -->
|
||||||
<div class="box box-info collapsable '.(empty($espandi_dettagli) ? 'collapsed-box' : '').'">
|
<div class="box box-info collapsable '.(empty($espandi_dettagli) ? 'collapsed-box' : '').'">
|
||||||
|
@ -79,15 +79,15 @@ echo "
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
<th class='text-center'>".tr('Descrizione', [], ['upper' => true])."</th>
|
<th class='text-center'>".tr('Descrizione', [], ['upper' => true]).'</th>
|
||||||
";
|
';
|
||||||
|
|
||||||
if ($documento->direzione == 'uscita') {
|
if ($documento->direzione == 'uscita') {
|
||||||
echo "
|
echo "
|
||||||
<th class='text-center' style='width:11%'>".tr('Codice', [], ['upper' => true])."</th>
|
<th class='text-center' style='width:11%'>".tr('Codice', [], ['upper' => true])."</th>
|
||||||
<th class='text-center' style='width:11%'>".tr('Codice fornitore', [], ['upper' => true]).'</th>';
|
<th class='text-center' style='width:11%'>".tr('Codice fornitore', [], ['upper' => true]).'</th>';
|
||||||
}
|
}
|
||||||
echo"
|
echo "
|
||||||
<th class='text-center' style='width:9%'>".tr('Q.tà', [], ['upper' => true]).'</th>';
|
<th class='text-center' style='width:9%'>".tr('Q.tà', [], ['upper' => true]).'</th>';
|
||||||
|
|
||||||
if ($options['pricing']) {
|
if ($options['pricing']) {
|
||||||
@ -147,7 +147,7 @@ foreach ($righe as $riga) {
|
|||||||
echo '
|
echo '
|
||||||
<td></td>';
|
<td></td>';
|
||||||
}
|
}
|
||||||
echo'
|
echo '
|
||||||
<td>
|
<td>
|
||||||
'.nl2br($text);
|
'.nl2br($text);
|
||||||
}
|
}
|
||||||
@ -156,7 +156,6 @@ foreach ($righe as $riga) {
|
|||||||
$autofill->count($r['descrizione']);
|
$autofill->count($r['descrizione']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$source_type = get_class($riga);
|
$source_type = get_class($riga);
|
||||||
if (!setting('Visualizza riferimento su ogni riga in stampa')) {
|
if (!setting('Visualizza riferimento su ogni riga in stampa')) {
|
||||||
echo $num.'</td>';
|
echo $num.'</td>';
|
||||||
@ -171,7 +170,7 @@ foreach ($righe as $riga) {
|
|||||||
<td></td>';
|
<td></td>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo'
|
echo '
|
||||||
<td>'.$r['descrizione'];
|
<td>'.$r['descrizione'];
|
||||||
} else {
|
} else {
|
||||||
echo $num.'
|
echo $num.'
|
||||||
@ -179,7 +178,6 @@ foreach ($righe as $riga) {
|
|||||||
<td>'.nl2br($r['descrizione']);
|
<td>'.nl2br($r['descrizione']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($documento->direzione == 'uscita') {
|
if ($documento->direzione == 'uscita') {
|
||||||
echo '
|
echo '
|
||||||
<td class="text-center" style="vertical-align: middle">
|
<td class="text-center" style="vertical-align: middle">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user