mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-09 07:47:46 +01:00
Stile del codice
This commit is contained in:
parent
25edf663f2
commit
c8bdd086c9
@ -57,7 +57,7 @@ if ($options['dir'] == 'entrata') {
|
||||
|
||||
margine = isNaN(margine) || !isFinite(margine) ? 0: margine; // Fix per magine NaN
|
||||
|
||||
div.html("<small>' . tr('Guadagno') . ': " + guadagno.toLocale() + " " + globals.currency + " ' . tr('Margine') . ': " + margine.toLocale() + " %</small>");
|
||||
div.html("<small>'.tr('Guadagno').': " + guadagno.toLocale() + " " + globals.currency + " '.tr('Margine').': " + margine.toLocale() + " %</small>");
|
||||
if (guadagno < 0) {
|
||||
parent.addClass("has-error");
|
||||
div.addClass("text-danger").removeClass("text-success");
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__ . '/../../core.php';
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
use Modules\DDT\DDT;
|
||||
use Modules\Ordini\Ordine;
|
||||
@ -8,7 +8,7 @@ use Modules\Ordini\Ordine;
|
||||
// Informazioni generali sulla riga
|
||||
$source_type = filter('riga_type');
|
||||
$source_id = filter('riga_id');
|
||||
if (empty($source_type) || empty($source_id)){
|
||||
if (empty($source_type) || empty($source_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -31,12 +31,12 @@ echo '
|
||||
</div>';
|
||||
|
||||
$documenti_disponibili = collect();
|
||||
$direzione_richiesta = $source->parent->direzione == 'entrata' ? 'uscita': 'entrata';
|
||||
$direzione_richiesta = $source->parent->direzione == 'entrata' ? 'uscita' : 'entrata';
|
||||
|
||||
// Individuazione DDT disponibili
|
||||
$ddt = DDT::whereHas('stato', function ($query) {
|
||||
$query->where('descrizione', '!=', 'Bozza');
|
||||
})->whereHas('tipo', function ($query) use($direzione_richiesta){
|
||||
})->whereHas('tipo', function ($query) use ($direzione_richiesta) {
|
||||
$query->where('dir', '=', $direzione_richiesta);
|
||||
})->get();
|
||||
foreach ($ddt as $elemento) {
|
||||
@ -50,7 +50,7 @@ foreach ($ddt as $elemento) {
|
||||
// Individuazione ordini disponibili
|
||||
$ordini = Ordine::whereHas('stato', function ($query) {
|
||||
$query->where('descrizione', '!=', 'Bozza');
|
||||
})->whereHas('tipo', function ($query) use($direzione_richiesta){
|
||||
})->whereHas('tipo', function ($query) use ($direzione_richiesta) {
|
||||
$query->where('dir', '=', $direzione_richiesta);
|
||||
})->get();
|
||||
foreach ($ordini as $elemento) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__ . '/../../core.php';
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
// Generazione della tabella per l'aggiunta dei riferimenti
|
||||
$id_documento = filter('id_documento');
|
||||
@ -29,15 +29,15 @@ echo '
|
||||
foreach ($righe as $riga) {
|
||||
$riga_class = get_class($riga);
|
||||
|
||||
$riferimento_locale = $riga_class .'|'.$riga->id;
|
||||
$riferimento_locale = $riga_class.'|'.$riga->id;
|
||||
$presente = in_array($riferimento_locale, $riferimenti);
|
||||
|
||||
echo '
|
||||
echo '
|
||||
<tr data-id="'.$riga->id.'" data-type="'.$riga_class.'">
|
||||
<td>'.$riga->descrizione.'</td>
|
||||
<td>'.numberFormat($riga->qta_rimanente, 'qta').' / '.numberFormat($riga->qta, 'qta').'</td>
|
||||
<td class="text-center">
|
||||
<button type="button" class="btn btn-'.($presente ? 'success' : 'info').' btn-xs" '.($presente ? '':'onclick="salvaRiferimento(this, \''.addslashes($source_type).'\',\''.$source_id.'\')"' ).'>
|
||||
<button type="button" class="btn btn-'.($presente ? 'success' : 'info').' btn-xs" '.($presente ? '' : 'onclick="salvaRiferimento(this, \''.addslashes($source_type).'\',\''.$source_id.'\')"').'>
|
||||
<i class="fa fa-check"></i>
|
||||
</button>
|
||||
</td>
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
include_once __DIR__ . '/../../core.php';
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
// Informazioni generali sulla riga
|
||||
$source_type = $source_type ?: filter('source_type');
|
||||
$source_id = $source_id ?: filter('source_id');
|
||||
if (empty($source_type) || empty($source_id)){
|
||||
if (empty($source_type) || empty($source_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -40,9 +40,9 @@ class Articolo extends Model
|
||||
* Funzione per inserire i movimenti di magazzino.
|
||||
*
|
||||
* @param $qta
|
||||
* @param null $descrizone
|
||||
* @param null $data
|
||||
* @param bool $manuale
|
||||
* @param null $descrizone
|
||||
* @param null $data
|
||||
* @param bool $manuale
|
||||
* @param array $array
|
||||
*
|
||||
* @return bool
|
||||
@ -64,9 +64,9 @@ class Articolo extends Model
|
||||
* Funzione per registrare i movimenti di magazzino.
|
||||
*
|
||||
* @param $qta
|
||||
* @param null $descrizone
|
||||
* @param null $data
|
||||
* @param bool $manuale
|
||||
* @param null $descrizone
|
||||
* @param null $data
|
||||
* @param bool $manuale
|
||||
* @param array $array
|
||||
*
|
||||
* @return bool
|
||||
@ -131,11 +131,11 @@ class Articolo extends Model
|
||||
$module = Modules::get($this->module);
|
||||
$fileinfo = Uploads::fileInfo($this->immagine);
|
||||
|
||||
$directory = '/' . $module->upload_directory . '/';
|
||||
$image = $directory . $this->immagine;
|
||||
$image_thumbnail = $directory . $fileinfo['filename'] . '_thumb600.' . $fileinfo['extension'];
|
||||
$directory = '/'.$module->upload_directory.'/';
|
||||
$image = $directory.$this->immagine;
|
||||
$image_thumbnail = $directory.$fileinfo['filename'].'_thumb600.'.$fileinfo['extension'];
|
||||
|
||||
$url = file_exists(DOCROOT . $image_thumbnail) ? ROOTDIR . $image_thumbnail : ROOTDIR . $image;
|
||||
$url = file_exists(DOCROOT.$image_thumbnail) ? ROOTDIR.$image_thumbnail : ROOTDIR.$image;
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
@ -71,10 +71,10 @@ foreach ($righe as $riga) {
|
||||
// Disponibilità articolo
|
||||
$disponibile = $riga->articolo->qta >= ($riga->qta - $riga->qta_evasa);
|
||||
echo '
|
||||
<td class="text-center '.( $disponibile ? 'bg-success' : 'bg-danger' ).'">';
|
||||
<td class="text-center '.($disponibile ? 'bg-success' : 'bg-danger').'">';
|
||||
|
||||
if ($riga->isArticolo()) {
|
||||
echo ( $disponibile ? '<i class="fa fa-check text-success"></i> ' : '<i class="fa fa-warning text-danger"></i> ').numberFormat($riga->articolo->qta).' '.$riga->um;
|
||||
echo($disponibile ? '<i class="fa fa-check text-success"></i> ' : '<i class="fa fa-warning text-danger"></i> ').numberFormat($riga->articolo->qta).' '.$riga->um;
|
||||
} else {
|
||||
echo '-';
|
||||
}
|
||||
@ -82,7 +82,6 @@ foreach ($righe as $riga) {
|
||||
echo '
|
||||
</td>';
|
||||
|
||||
|
||||
// Aggiunta dei riferimenti ai documenti
|
||||
if ($riga->hasOriginal()) {
|
||||
echo '
|
||||
|
@ -20,7 +20,6 @@ echo '
|
||||
echo '
|
||||
<button type="button" class="btn btn-primary col-md-5" data-toggle="modal" data-title="'.tr('Stampa registro').'..." data-href="'.ROOTDIR.'/modules/stampe_contabili/stampe_contabili.php?dir=entrata&nome_stampa=Registro IVA&id_record='.$id_record.'" ><i class="fa fa-print fa-2x"></i><br>'.tr('Stampa registro').'<br>'.tr('IVA vendite').'</button>';
|
||||
|
||||
|
||||
echo '
|
||||
<button type="button" class="btn btn-primary col-md-5 col-md-push-2" data-toggle="modal" data-title="'.tr('Stampa registro').'..." data-href="'.ROOTDIR.'/modules/stampe_contabili/stampe_contabili.php?dir=uscita&nome_stampa=Registro IVA&id_record='.$id_record.'" ><i class="fa fa-print fa-2x"></i><br>'.tr('Stampa registro').'<br>'.tr('IVA acquisti').'</button>';
|
||||
|
||||
|
@ -9,7 +9,6 @@ $nome_stampa = filter('nome_stampa');
|
||||
// Trovo id_print della stampa
|
||||
$link = Prints::getHref($nome_stampa, $id_record);
|
||||
|
||||
|
||||
echo '
|
||||
<form action="" method="post" onsubmit="if($(this).parsley().validate()) { return stampa_registro_iva(); }" >
|
||||
|
||||
|
@ -38,8 +38,9 @@ switch (filter('op')) {
|
||||
$last_recepit = $result['results'][0];
|
||||
|
||||
// Messaggi relativi
|
||||
if (empty($last_recepit)){
|
||||
if (empty($last_recepit)) {
|
||||
echo json_encode($result);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ if (!$fornitori->isEmpty()) {
|
||||
$anagrafica = $fornitore->anagrafica;
|
||||
|
||||
echo '
|
||||
<tr '.( ($anagrafica->id == $articolo->id_fornitore) ? 'class="success"' : '' ).'>
|
||||
<tr '.(($anagrafica->id == $articolo->id_fornitore) ? 'class="success"' : '').'>
|
||||
<td>
|
||||
'.Modules::link('Anagrafiche', $anagrafica->id, $anagrafica->ragione_sociale).'
|
||||
</td>
|
||||
|
@ -5,7 +5,7 @@ include_once __DIR__.'/../../core.php';
|
||||
$dir = $_GET['dir'];
|
||||
|
||||
$id_sezionale = filter('id_sezionale');
|
||||
$sezionale = $dbo->fetchOne("SELECT name FROM zz_segments WHERE id = ".$id_sezionale)['name'];
|
||||
$sezionale = $dbo->fetchOne('SELECT name FROM zz_segments WHERE id = '.$id_sezionale)['name'];
|
||||
|
||||
$date_start = filter('date_start');
|
||||
$date_end = filter('date_end');
|
||||
|
@ -13,13 +13,13 @@ if ('entrata' == $dir) {
|
||||
$titolo = tr('Registro iva vendita dal _START_ al _END_ _SEZIONALE_', [
|
||||
'_START_' => Translator::dateToLocale($date_start),
|
||||
'_END_' => Translator::dateToLocale($date_end),
|
||||
'_SEZIONALE_' => (!empty($sezionale)) ? ' - '.$sezionale: '' ,
|
||||
'_SEZIONALE_' => (!empty($sezionale)) ? ' - '.$sezionale : '',
|
||||
], ['upper' => true]);
|
||||
} elseif ('uscita' == $dir) {
|
||||
$titolo = tr('Registro iva acquisto dal _START_ al _END_ _SEZIONALE_', [
|
||||
'_START_' => Translator::dateToLocale($date_start),
|
||||
'_END_' => Translator::dateToLocale($date_end),
|
||||
'_SEZIONALE_' => (!empty($sezionale)) ? ' - '.$sezionale: '' ,
|
||||
'_SEZIONALE_' => (!empty($sezionale)) ? ' - '.$sezionale : '',
|
||||
], ['upper' => true]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user