Fix dello stile del codice

This commit is contained in:
Thomas Zilio 2019-03-08 15:18:52 +01:00
parent 227d1b9bff
commit 5b1a4996b4
12 changed files with 44 additions and 49 deletions

View File

@ -151,7 +151,7 @@ switch (post('op')) {
preg_match("/(.*?)([\d]*$)/", $serial__end, $m);
$serial_end = intval($m[2]);
$n_serial = abs($serial_end - $serial_start) + 1;
$serial_prefix = rtrim($serial__end,$serial_end);
$serial_prefix = rtrim($serial__end, $serial_end);
$serial_pad_length = strlen($serial__end) - strlen($serial_prefix);
// Altro

View File

@ -48,8 +48,8 @@ switch ($resource) {
'codice' => 'codice',
'descrizione' => 'descrizione',
'um' => 'um',
'categoria' => 'categoria',
'sottocategoria' => 'sottocategoria',
'categoria' => 'categoria',
'sottocategoria' => 'sottocategoria',
'idiva_vendita' => 'idiva_vendita',
'iva_vendita' => 'iva_vendita',
'idconto_vendita' => 'idconto_vendita',

View File

@ -74,19 +74,17 @@ switch (post('op')) {
]);
}
}
// Codice --> ID IVA vendita
// Codice --> ID IVA vendita
if (!empty($data[$key]['idiva_vendita'])) {
$rs_iva = $dbo->select('co_iva', 'id', [
'codice' => $data[$key]['idiva_vendita'],
]);
if (!empty($rs_iva[0]['id'])) {
$data[$key]['idiva_vendita'] = $rs_iva[0]['id'];
};
}
if (!empty($rs_iva[0]['id'])) {
$data[$key]['idiva_vendita'] = $rs_iva[0]['id'];
}
}
// Insert o update
$insert = true;
@ -179,7 +177,7 @@ return [
'idcategoria',
],
],
[
[
'field' => 'idiva_vendita',
'label' => 'Codice IVA vendita',
'names' => [

View File

@ -42,7 +42,6 @@ if (empty($record['is_fiscale'])) {
</button>';
}
?>
<?php
@ -56,13 +55,13 @@ if (!empty($record['is_fiscale'])) {
$da_pagare = isset($rs3[0]) ? $rs3[0]['da_pagare'] : null;
if (($n2 <= 0 && $record['stato'] == 'Emessa') || $differenza != 0) {
?>
?>
<button type="button" class="btn btn-primary <?php echo (!empty(Modules::get('Prima nota'))) ? '' : 'disabled'; ?>" onclick="launch_modal( '<?php echo tr('Aggiungi prima nota'); ?>', '<?php echo $rootdir; ?>/add.php?id_module=<?php echo Modules::get('Prima nota')['id']; ?>&iddocumento=<?php echo $id_record; ?>&dir=<?php echo $dir; ?>', 1 );"><small><i class="fa fa-euro"></i> <?php echo tr('Registrazione contabile pagamento'); ?>...</small></button>
<?php
}
if ($record['stato'] == 'Pagato') {
?>
?>
<button type="button" class="btn btn-primary tip" onclick="if( confirm('<?php echo tr('Se riapri questa fattura verrà azzerato lo scadenzario e la prima nota. Continuare?'); ?>') ){ $.post( '<?php echo $rootdir; ?>/editor.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>', { id_module: '<?php echo $id_module; ?>', id_record: '<?php echo $id_record; ?>', op: 'reopen' }, function(){ location.href='<?php echo $rootdir; ?>/editor.php?id_module=<?php echo $id_module; ?>&id_record=<?php echo $id_record; ?>'; } ); }" title="<?php echo tr('Riporta la fattura in stato bozza e ne elimina i movimenti contabili.'); ?>" ><i class="fa fa-folder-open"></i> <?php echo tr('Riapri fattura'); ?>...</button>
<?php
}

View File

@ -158,8 +158,8 @@ echo '
<i class="fa fa-file"></i> '.tr('Genera').'
</button>
</form>';
$file = $generated ? Models\Upload::where('filename', $fattura_pa->getFilename())->where('id_record', $id_record)->first() : null;
$file = $generated ? Models\Upload::where('filename', $fattura_pa->getFilename())->where('id_record', $id_record)->first() : null;
echo '
@ -168,18 +168,17 @@ echo '
<a href="'.ROOTDIR.'/view.php?file_id='.($file ? $file->id : null).'" class="btn btn-info btn-lg '.($generated ? '' : 'disabled').'" target="_blank" '.($generated ? '' : 'disabled').'>
<i class="fa fa-eye"></i> '.tr('Visualizza').'
</a>';
// Scelgo quando posso inviarla
$send = Interaction::isEnabled() && $generated && in_array($record['codice_stato_fe'], ['GEN', 'ERVAL']);
// Scelgo quando posso inviarla
$send = Interaction::isEnabled() && $generated && in_array($record['codice_stato_fe'], ['GEN', 'ERVAL']);
echo '
<i class="fa fa-arrow-right fa-fw text-muted"></i>
<a href="'.$structure->fileurl('download.php').'?id_record='.$id_record.'" class="btn btn-primary btn-lg '.($generated ? '' : 'disabled').'" target="_blank" '.($generated ? '' : 'disabled').'>
<i class="fa fa-download"></i> '.tr('Scarica').'
</a>';
echo '
<i class="fa fa-arrow-right fa-fw text-muted"></i>

View File

@ -1,4 +1,4 @@
<?php
<?php
include_once __DIR__.'/../../../core.php';
echo "<form action='".$rootdir.'/editor.php?id_module='.$id_module.'&id_record='.$id_record."' method='post'>";

View File

@ -162,10 +162,10 @@ class WidgetManager implements ManagerInterface
<div class="info-box">
<span class="info-box-icon" style="background-color:'.$widget['bgcolor'].'">';
if (!empty($widget['icon'])) {
$result .= '
if (!empty($widget['icon'])) {
$result .= '
<i class="'.$widget['icon'].'"></i>';
}
}
$result .= '
</span>
@ -173,12 +173,12 @@ class WidgetManager implements ManagerInterface
<div class="info-box-content">
<span class="info-box-text">';
if(!empty($widget['php_include'])){
if (!empty($widget['php_include'])) {
$result_ob = '';
ob_start();
include(DOCROOT."/".$widget['php_include']);
include DOCROOT.'/'.$widget['php_include'];
$result_ob = ob_get_contents();
ob_end_clean();

View File

@ -3,9 +3,9 @@
include_once __DIR__.'/../../core.php';
$dir = $_GET['dir'];
if($dir=='entrata'){
if ($dir == 'entrata') {
$tipo = 'vendite';
}else{
} else {
$tipo = 'acquisti';
}
@ -29,13 +29,13 @@ if ('entrata' == $dir) {
echo "<span style='font-size:12pt;'><b>".tr('Registro iva vendita dal _START_ al _END_ _ESERCIZIO_', [
'_START_' => Translator::dateToLocale($date_start),
'_END_' => Translator::dateToLocale($date_end),
'_ESERCIZIO_' => (date('Y', strtotime($date_start))==date('Y', strtotime($date_end))? '- Esercizio '.date('Y', strtotime($date_end)): ''),
'_ESERCIZIO_' => (date('Y', strtotime($date_start)) == date('Y', strtotime($date_end)) ? '- Esercizio '.date('Y', strtotime($date_end)) : ''),
], ['upper' => true]).'</b></span><br><br>';
} elseif ('uscita' == $dir) {
echo "<span style='font-size:12pt;'><b>".tr('Registro iva acquisto dal _START_ al _END_ _ESERCIZIO_', [
'_START_' => Translator::dateToLocale($date_start),
'_END_' => Translator::dateToLocale($date_end),
'_ESERCIZIO_' => (date('Y', strtotime($date_start))==date('Y', strtotime($date_end))? '- Esercizio '.date('Y', strtotime($date_end)): ''),
'_ESERCIZIO_' => (date('Y', strtotime($date_start)) == date('Y', strtotime($date_end)) ? '- Esercizio '.date('Y', strtotime($date_end)) : ''),
], ['upper' => true]).'</b></span><br><br>';
}
@ -62,18 +62,18 @@ for ($i = 0; $i < sizeof($rs); ++$i) {
echo ' <tr>';
if ($rs[$i]['numero'] == $rs[$i - 1]['numero']) {
echo " <td></td>";
echo " <td></td>";
echo " <td></td>";
echo " <td></td>";
echo " <td></td>";
echo " <td></td>";
echo ' <td></td>';
echo ' <td></td>';
echo ' <td></td>';
echo ' <td></td>';
echo ' <td></td>';
echo ' <td></td>';
} else {
echo " <td>".$rs[$i]['numero'].'</td>';
echo " <td>".$rs[$i]['numero_esterno'].'</td>';
echo " <td>".date('d/m/Y', strtotime($rs[$i]['data'])).'</td>';
echo " <td>".$rs[$i]['codice_tipo_documento_fe'].'</td>';
echo " <td>".$rs[$i]['codice_anagrafica']." / ".tr($rs[$i]['ragione_sociale'], [], ['upper' => true]).'</td>';
echo ' <td>'.$rs[$i]['numero'].'</td>';
echo ' <td>'.$rs[$i]['numero_esterno'].'</td>';
echo ' <td>'.date('d/m/Y', strtotime($rs[$i]['data'])).'</td>';
echo ' <td>'.$rs[$i]['codice_tipo_documento_fe'].'</td>';
echo ' <td>'.$rs[$i]['codice_anagrafica'].' / '.tr($rs[$i]['ragione_sociale'], [], ['upper' => true]).'</td>';
echo " <td class='text-right'>".Translator::numberToLocale(get_totale_fattura($rs[$i]['iddocumento'])).' &euro;</td>';
}

View File

@ -1,6 +1,5 @@
<?php
/**
* Inherited Methods.
*

View File

@ -137,7 +137,7 @@ class RowHelper extends \Codeception\Module
$t->fillField('#descrizione_riga', $descrizione);
$t->fillField('#qta', $qta);
$t->fillField("#prezzo", $prezzo);
$t->fillField('#prezzo', $prezzo);
if (!empty($sconto)) {
$t->fillField('#sconto', $sconto);

View File

@ -1,4 +1,6 @@
<?php // @codingStandardsIgnoreFile
<?php
// @codingStandardsIgnoreFile
namespace Helper;
@ -17,10 +19,9 @@ namespace Helper;
* - Run ./vendor/bin/codecept build
*
* @see http://select2.github.io/select2
*
* @author Thomas Zilio
*
* @license MIT
*
*/
class Select2Ajax extends Select2
{

View File

@ -1,6 +1,5 @@
<?php
/**
* Inherited Methods.
*