mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-18 04:20:50 +01:00
Formattazione codice
This commit is contained in:
parent
eed67da504
commit
09fe13d5d9
@ -496,7 +496,7 @@ if ($structure->permission == 'rw') {
|
|||||||
foreach ($customs as $custom) {
|
foreach ($customs as $custom) {
|
||||||
if (post($custom['name']) !== null) {
|
if (post($custom['name']) !== null) {
|
||||||
$values[$custom['id']] = post($custom['name']);
|
$values[$custom['id']] = post($custom['name']);
|
||||||
}else{
|
} else {
|
||||||
$values[$custom['id']] = '';
|
$values[$custom['id']] = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -618,11 +618,11 @@ switch (post('op')) {
|
|||||||
|
|
||||||
if ($class == 'Modules\Preventivi\Preventivo') {
|
if ($class == 'Modules\Preventivi\Preventivo') {
|
||||||
$intervento->id_preventivo = $documento->id;
|
$intervento->id_preventivo = $documento->id;
|
||||||
$intervento->richiesta = "Attività creata da preventivo num. ".$documento->numero."<br>".$documento->nome;
|
$intervento->richiesta = 'Attività creata da preventivo num. '.$documento->numero.'<br>'.$documento->nome;
|
||||||
}
|
}
|
||||||
if ($class == 'Modules\Ordini\Ordine') {
|
if ($class == 'Modules\Ordini\Ordine') {
|
||||||
$intervento->id_ordine = $documento->id;
|
$intervento->id_ordine = $documento->id;
|
||||||
$intervento->richiesta = "Attività creata da ordine num. ".$documento->numero_esterno;
|
$intervento->richiesta = 'Attività creata da ordine num. '.$documento->numero_esterno;
|
||||||
}
|
}
|
||||||
|
|
||||||
$intervento->save();
|
$intervento->save();
|
||||||
|
@ -435,7 +435,7 @@ echo '
|
|||||||
<tr>
|
<tr>
|
||||||
<td colspan="'.$colspan.'" class="text-right">
|
<td colspan="'.$colspan.'" class="text-right">
|
||||||
'.tr('Ricarico (_PRC_)', [
|
'.tr('Ricarico (_PRC_)', [
|
||||||
'_PRC_' => ($preventivo->ricarico_percentuale != 0 ? numberFormat($preventivo->ricarico_percentuale). '%' : 'N.D.'),
|
'_PRC_' => ($preventivo->ricarico_percentuale != 0 ? numberFormat($preventivo->ricarico_percentuale).'%' : 'N.D.'),
|
||||||
]).':
|
]).':
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
@ -42,5 +42,5 @@ return [
|
|||||||
'id_anagrafica' => $r['idanagrafica'],
|
'id_anagrafica' => $r['idanagrafica'],
|
||||||
'revisione' => $revisione,
|
'revisione' => $revisione,
|
||||||
'nome_referente' => $r['nome_referente'],
|
'nome_referente' => $r['nome_referente'],
|
||||||
'nome_preventivo' => $r['nome_preventivo']
|
'nome_preventivo' => $r['nome_preventivo'],
|
||||||
];
|
];
|
||||||
|
@ -308,7 +308,7 @@ abstract class Article extends Accounting
|
|||||||
->groupBy('idarticolo')
|
->groupBy('idarticolo')
|
||||||
->sum('qta');
|
->sum('qta');
|
||||||
|
|
||||||
$qta_modifica = $this->attributes['qta']-$this->original['qta'];
|
$qta_modifica = $this->attributes['qta'] - $this->original['qta'];
|
||||||
|
|
||||||
//Se la quantità supera la giacenza in sede allora movimento solo quello che resta
|
//Se la quantità supera la giacenza in sede allora movimento solo quello che resta
|
||||||
if (($qta_sede + $qta_finale) < 0 && $qta_sede >= 0) {
|
if (($qta_sede + $qta_finale) < 0 && $qta_sede >= 0) {
|
||||||
@ -334,7 +334,6 @@ abstract class Article extends Accounting
|
|||||||
'reference_id' => $documento->id,
|
'reference_id' => $documento->id,
|
||||||
'idsede' => $id_sede,
|
'idsede' => $id_sede,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function boot()
|
protected static function boot()
|
||||||
|
@ -168,8 +168,6 @@ class HTMLBuilder
|
|||||||
$result = self::replace($result, $depth + 1);
|
$result = self::replace($result, $depth + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$html = str_replace($value, !empty($result) ? $result : $value, $html);
|
$html = str_replace($value, !empty($result) ? $result : $value, $html);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,6 +332,26 @@ class HTMLBuilder
|
|||||||
self::$record = $record;
|
self::$record = $record;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decodifica i tag personalizzati e li converte in un array basato sul formato JSON.
|
||||||
|
*
|
||||||
|
* @param string $string
|
||||||
|
* @param string $type
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function decode($string, $type)
|
||||||
|
{
|
||||||
|
$string = '{'.substr($string, strlen(self::$open[$type]), -strlen(self::$close[$type])).'}';
|
||||||
|
|
||||||
|
// Fix per contenuti con newline integrati
|
||||||
|
$string = str_replace(["\n", "\r"], ['\\n', '\\r'], $string);
|
||||||
|
|
||||||
|
$json = (array) json_decode($string, true);
|
||||||
|
|
||||||
|
return $json;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Genera il codice HTML per i singoli tag di input.
|
* Genera il codice HTML per i singoli tag di input.
|
||||||
*
|
*
|
||||||
@ -368,26 +386,6 @@ class HTMLBuilder
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Decodifica i tag personalizzati e li converte in un array basato sul formato JSON.
|
|
||||||
*
|
|
||||||
* @param string $string
|
|
||||||
* @param string $type
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public static function decode($string, $type)
|
|
||||||
{
|
|
||||||
$string = '{'.substr($string, strlen(self::$open[$type]), -strlen(self::$close[$type])).'}';
|
|
||||||
|
|
||||||
// Fix per contenuti con newline integrati
|
|
||||||
$string = str_replace(["\n", "\r"], ['\\n', '\\r'], $string);
|
|
||||||
|
|
||||||
$json = (array) json_decode($string, true);
|
|
||||||
|
|
||||||
return $json;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Elabora l'array contenente le impostazioni del tag per renderlo fruibile alla conversione in HTML (per i tag di input).
|
* Elabora l'array contenente le impostazioni del tag per renderlo fruibile alla conversione in HTML (per i tag di input).
|
||||||
*
|
*
|
||||||
|
@ -206,7 +206,7 @@ class SelectHandler implements HandlerInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$element['text'] = ($element['text'] == "" || $element['text'] == null ) ? $element['descrizione'] : $element['text'];
|
$element['text'] = ($element['text'] == '' || $element['text'] == null) ? $element['descrizione'] : $element['text'];
|
||||||
|
|
||||||
if ($link == 'stampa') {
|
if ($link == 'stampa') {
|
||||||
$element['title'] = ' ';
|
$element['title'] = ' ';
|
||||||
|
@ -83,9 +83,9 @@ class FieldManager implements ManagerInterface
|
|||||||
$field['value'] = isset($field['value']) ? $field['value'] : '';
|
$field['value'] = isset($field['value']) ? $field['value'] : '';
|
||||||
|
|
||||||
//Gestione valori multipli
|
//Gestione valori multipli
|
||||||
$values = json_decode((string)$field['value'],true);
|
$values = json_decode((string) $field['value'], true);
|
||||||
if( is_array($values) ){
|
if (is_array($values)) {
|
||||||
$field['value'] = implode(",",$values);
|
$field['value'] = implode(',', $values);
|
||||||
}
|
}
|
||||||
|
|
||||||
$replace = [
|
$replace = [
|
||||||
|
@ -22,9 +22,9 @@ include_once __DIR__.'/../../core.php';
|
|||||||
use Modules\Contratti\Contratto;
|
use Modules\Contratti\Contratto;
|
||||||
|
|
||||||
$documento = Contratto::find($id_record);
|
$documento = Contratto::find($id_record);
|
||||||
$d_qta = (integer)setting('Cifre decimali per quantità in stampa');
|
$d_qta = (int) setting('Cifre decimali per quantità in stampa');
|
||||||
$d_importi = (integer)setting('Cifre decimali per importi in stampa');
|
$d_importi = (int) setting('Cifre decimali per importi in stampa');
|
||||||
$d_totali = (integer)setting('Cifre decimali per totali in stampa');
|
$d_totali = (int) setting('Cifre decimali per totali in stampa');
|
||||||
|
|
||||||
$id_cliente = $documento['idanagrafica'];
|
$id_cliente = $documento['idanagrafica'];
|
||||||
|
|
||||||
|
@ -22,9 +22,9 @@ include_once __DIR__.'/../../core.php';
|
|||||||
use Modules\DDT\DDT;
|
use Modules\DDT\DDT;
|
||||||
|
|
||||||
$documento = DDT::find($id_record);
|
$documento = DDT::find($id_record);
|
||||||
$d_qta = (integer)setting('Cifre decimali per quantità in stampa');
|
$d_qta = (int) setting('Cifre decimali per quantità in stampa');
|
||||||
$d_importi = (integer)setting('Cifre decimali per importi in stampa');
|
$d_importi = (int) setting('Cifre decimali per importi in stampa');
|
||||||
$d_totali = (integer)setting('Cifre decimali per totali in stampa');
|
$d_totali = (int) setting('Cifre decimali per totali in stampa');
|
||||||
|
|
||||||
$id_cliente = $documento['idanagrafica'];
|
$id_cliente = $documento['idanagrafica'];
|
||||||
$id_sede = $record['idsede_partenza'];
|
$id_sede = $record['idsede_partenza'];
|
||||||
|
@ -23,9 +23,9 @@ use Modules\Fatture\Fattura;
|
|||||||
|
|
||||||
$documento = Fattura::find($id_record);
|
$documento = Fattura::find($id_record);
|
||||||
$banca = $documento->getBanca();
|
$banca = $documento->getBanca();
|
||||||
$d_qta = (integer)setting('Cifre decimali per quantità in stampa');
|
$d_qta = (int) setting('Cifre decimali per quantità in stampa');
|
||||||
$d_importi = (integer)setting('Cifre decimali per importi in stampa');
|
$d_importi = (int) setting('Cifre decimali per importi in stampa');
|
||||||
$d_totali = (integer)setting('Cifre decimali per totali in stampa');
|
$d_totali = (int) setting('Cifre decimali per totali in stampa');
|
||||||
|
|
||||||
// Lettura info fattura
|
// Lettura info fattura
|
||||||
$record = $dbo->fetchOne('SELECT *,
|
$record = $dbo->fetchOne('SELECT *,
|
||||||
|
@ -21,9 +21,9 @@ use Carbon\Carbon;
|
|||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
$d_qta = (integer)setting('Cifre decimali per quantità in stampa');
|
$d_qta = (int) setting('Cifre decimali per quantità in stampa');
|
||||||
$d_importi = (integer)setting('Cifre decimali per importi in stampa');
|
$d_importi = (int) setting('Cifre decimali per importi in stampa');
|
||||||
$d_totali = (integer)setting('Cifre decimali per totali in stampa');
|
$d_totali = (int) setting('Cifre decimali per totali in stampa');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Dati intervento
|
Dati intervento
|
||||||
|
@ -22,9 +22,9 @@ include_once __DIR__.'/../../core.php';
|
|||||||
use Modules\Ordini\Ordine;
|
use Modules\Ordini\Ordine;
|
||||||
|
|
||||||
$documento = Ordine::find($id_record);
|
$documento = Ordine::find($id_record);
|
||||||
$d_qta = (integer)setting('Cifre decimali per quantità in stampa');
|
$d_qta = (int) setting('Cifre decimali per quantità in stampa');
|
||||||
$d_importi = (integer)setting('Cifre decimali per importi in stampa');
|
$d_importi = (int) setting('Cifre decimali per importi in stampa');
|
||||||
$d_totali = (integer)setting('Cifre decimali per totali in stampa');
|
$d_totali = (int) setting('Cifre decimali per totali in stampa');
|
||||||
|
|
||||||
$id_cliente = $documento['idanagrafica'];
|
$id_cliente = $documento['idanagrafica'];
|
||||||
|
|
||||||
|
@ -23,9 +23,9 @@ use Modules\Ordini\Ordine;
|
|||||||
|
|
||||||
$documento = Ordine::find($id_record);
|
$documento = Ordine::find($id_record);
|
||||||
$records = $documento->interventi;
|
$records = $documento->interventi;
|
||||||
$d_qta = (integer)setting('Cifre decimali per quantità in stampa');
|
$d_qta = (int) setting('Cifre decimali per quantità in stampa');
|
||||||
$d_importi = (integer)setting('Cifre decimali per importi in stampa');
|
$d_importi = (int) setting('Cifre decimali per importi in stampa');
|
||||||
$d_totali = (integer)setting('Cifre decimali per totali in stampa');
|
$d_totali = (int) setting('Cifre decimali per totali in stampa');
|
||||||
|
|
||||||
$id_cliente = $documento['idanagrafica'];
|
$id_cliente = $documento['idanagrafica'];
|
||||||
$id_sede = $documento['idsede'];
|
$id_sede = $documento['idsede'];
|
||||||
|
@ -22,9 +22,9 @@ include_once __DIR__.'/../../core.php';
|
|||||||
use Modules\Preventivi\Preventivo;
|
use Modules\Preventivi\Preventivo;
|
||||||
|
|
||||||
$documento = Preventivo::find($id_record);
|
$documento = Preventivo::find($id_record);
|
||||||
$d_qta = (integer)setting('Cifre decimali per quantità in stampa');
|
$d_qta = (int) setting('Cifre decimali per quantità in stampa');
|
||||||
$d_importi = (integer)setting('Cifre decimali per importi in stampa');
|
$d_importi = (int) setting('Cifre decimali per importi in stampa');
|
||||||
$d_totali = (integer)setting('Cifre decimali per totali in stampa');
|
$d_totali = (int) setting('Cifre decimali per totali in stampa');
|
||||||
|
|
||||||
$id_cliente = $documento['idanagrafica'];
|
$id_cliente = $documento['idanagrafica'];
|
||||||
|
|
||||||
|
@ -23,9 +23,9 @@ $budget = get_imponibile_preventivo($id_record);
|
|||||||
$somma_totale_imponibile = get_totale_interventi_preventivo($id_record);
|
$somma_totale_imponibile = get_totale_interventi_preventivo($id_record);
|
||||||
$rapporto = floatval($budget) - floatval($somma_totale_imponibile) - $documento->provvigione;
|
$rapporto = floatval($budget) - floatval($somma_totale_imponibile) - $documento->provvigione;
|
||||||
|
|
||||||
$d_qta = (integer)setting('Cifre decimali per quantità in stampa');
|
$d_qta = (int) setting('Cifre decimali per quantità in stampa');
|
||||||
$d_totali = (integer)setting('Cifre decimali per importi in stampa');
|
$d_totali = (int) setting('Cifre decimali per importi in stampa');
|
||||||
$d_totali = (integer)setting('Cifre decimali per totali in stampa');
|
$d_totali = (int) setting('Cifre decimali per totali in stampa');
|
||||||
|
|
||||||
if ($pricing && empty($options['dir'])) {
|
if ($pricing && empty($options['dir'])) {
|
||||||
// Totale imponibile
|
// Totale imponibile
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
$d_totali = (integer)setting('Cifre decimali per totali in stampa');
|
$d_totali = (int) setting('Cifre decimali per totali in stampa');
|
||||||
|
|
||||||
$somma_ore = sum($somma_ore);
|
$somma_ore = sum($somma_ore);
|
||||||
$somma_imponibile = sum($somma_imponibile);
|
$somma_imponibile = sum($somma_imponibile);
|
||||||
|
@ -22,8 +22,8 @@ include_once __DIR__.'/../../core.php';
|
|||||||
use Modules\Interventi\Intervento;
|
use Modules\Interventi\Intervento;
|
||||||
use Modules\Iva\Aliquota;
|
use Modules\Iva\Aliquota;
|
||||||
|
|
||||||
$d_qta = (integer)setting('Cifre decimali per quantità in stampa');
|
$d_qta = (int) setting('Cifre decimali per quantità in stampa');
|
||||||
$d_importi = (integer)setting('Cifre decimali per importi in stampa');
|
$d_importi = (int) setting('Cifre decimali per importi in stampa');
|
||||||
|
|
||||||
$intervento = Intervento::find($record['id']);
|
$intervento = Intervento::find($record['id']);
|
||||||
$sessioni = $intervento->sessioni;
|
$sessioni = $intervento->sessioni;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user