mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-17 03:51:06 +01:00
Bugfix FE
This commit is contained in:
parent
eb6f52516e
commit
9c970080a1
@ -254,7 +254,9 @@ if (!$cliente) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
{[ "type": "text", "label": "<?php echo tr('Codice R.E.A.').'<small>('.tr('provincia/C.C.I.A.A.').')</small>'; ?>", "name": "codicerea", "value": "$codicerea$" ]}
|
{[ "type": "text", "label": "<?php echo tr('Codice R.E.A.').'<small>('.tr('provincia/C.C.I.A.A.').')</small>'; ?>", "name": "codicerea", "value": "$codicerea$", "help": "<?php echo tr('Formato: _PATTERN_', [
|
||||||
|
'_PATTERN_' => 'RM-123456'
|
||||||
|
]); ?>" ]}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
|
@ -211,9 +211,11 @@ class FatturaElettronica
|
|||||||
|
|
||||||
// IscrizioneREA
|
// IscrizioneREA
|
||||||
if (!empty($azienda['codicerea'])) {
|
if (!empty($azienda['codicerea'])) {
|
||||||
|
$codice = explode('-', $azienda['codicerea']);
|
||||||
|
|
||||||
$result['IscrizioneREA'] = [
|
$result['IscrizioneREA'] = [
|
||||||
'Ufficio' => strtoupper(substr($azienda['capitale_sociale'], 0, 2)),
|
'Ufficio' => strtoupper($codice[0]),
|
||||||
'NumeroREA' => $azienda['codicerea'],
|
'NumeroREA' => $codice[1],
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!empty($azienda['capitale_sociale'])) {
|
if (!empty($azienda['capitale_sociale'])) {
|
||||||
@ -231,7 +233,7 @@ class FatturaElettronica
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fax
|
// Fax
|
||||||
if (!empty($azienda['email'])) {
|
if (!empty($azienda['fax'])) {
|
||||||
$result['Contatti']['Fax'] = $azienda['fax'];
|
$result['Contatti']['Fax'] = $azienda['fax'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -451,11 +453,29 @@ class FatturaElettronica
|
|||||||
|
|
||||||
$output = $input;
|
$output = $input;
|
||||||
// Operazioni di normalizzazione
|
// Operazioni di normalizzazione
|
||||||
|
// Formattazione decimali
|
||||||
if ($info['type'] == 'decimal') {
|
if ($info['type'] == 'decimal') {
|
||||||
$output = number_format($output, 2, '.', '');
|
$output = number_format($output, 2, '.', '');
|
||||||
} elseif ($info['type'] != 'integer' && isset($size[1])) {
|
}
|
||||||
|
// Formattazione date
|
||||||
|
elseif ($info['type'] == 'date') {
|
||||||
|
$object = DateTime::createFromFormat('Y-m-d H:i:s', $value);
|
||||||
|
if (is_object($object)) {
|
||||||
|
$output = $object->format('Y-m-d');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Formattazione testo
|
||||||
|
elseif ($info['type'] == 'string') {
|
||||||
|
$object = DateTime::createFromFormat('Y-m-d H:i:s', $value);
|
||||||
|
if (is_object($object)) {
|
||||||
|
$output = $object->format('Y-m-d');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Riduzione delle dimensioni
|
||||||
|
if ($info['type'] != 'integer' && isset($size[1])) {
|
||||||
$output = trim($output);
|
$output = trim($output);
|
||||||
S::create($output)->substr(2, $size[1]);
|
$output = S::create($output)->substr(2, $size[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validazione
|
// Validazione
|
||||||
@ -478,7 +498,8 @@ class FatturaElettronica
|
|||||||
|
|
||||||
$this->is_valid &= $validation;
|
$this->is_valid &= $validation;
|
||||||
|
|
||||||
//echo $key.': '.intval($validation).'<br>';
|
// Per debug
|
||||||
|
//flash()->warning($key.': '.intval($validation));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user