Correzioni minori per Banche e stile del codice
This commit is contained in:
parent
364580bc33
commit
5ad314bd43
|
@ -33,7 +33,7 @@ switch (filter('op')) {
|
|||
$iban = filter('iban');
|
||||
$bic = filter('bic');
|
||||
|
||||
$banca = Banca::build($anagrafica, $nome, $iban, $bic);
|
||||
$banca = Banca::build($anagrafica, $nome, $iban);
|
||||
$id_record = $banca->id;
|
||||
|
||||
if (isAjaxRequest()) {
|
||||
|
|
|
@ -21,8 +21,6 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
$id_anagrafica = filter('id_anagrafica');
|
||||
|
||||
$help_codice_bic = tr('Il codice BIC (o SWIFT) è composto da 8 a 11 caratteri (lettere e numeri) ed è suddiviso in:').'<br><br><ul><li>'.tr('AAAA - codice bancario').'</li><li>'.tr('BB - codice ISO della nazione').'</li><li>'.tr('CC - codice città presso la quale è ubicata la banca').'</li><li>'.tr('DD - codice della filiale (opzionale)').'</li></ul>';
|
||||
|
||||
echo '
|
||||
<form action="" method="post" id="add-form">
|
||||
<input type="hidden" name="op" value="add">
|
||||
|
@ -39,12 +37,9 @@ echo '
|
|||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-12">
|
||||
{[ "type": "text", "label": "'.tr('IBAN').'", "name": "iban", "required": "1", "class": "alphanumeric-mask", "maxlength": 32, "value": "$iban$" ]}
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "'.tr('BIC').'", "name": "bic", "required": "1", "class": "alphanumeric-mask", "minlength": 8, "maxlength": 11, "value": "$bic$", "help": "'.$help_codice_bic.'" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PULSANTI -->
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$help_codice_bic = tr('Il codice BIC (o SWIFT) è composto da 8 a 11 caratteri (lettere e numeri) ed è suddiviso in:').'<br><br><ul><li>'.tr('AAAA - codice bancario').'</li><li>'.tr('BB - codice ISO della nazione').'</li><li>'.tr('CC - codice città presso la quale è ubicata la banca').'</li><li>'.tr('DD - codice della filiale (opzionale)').'</li></ul>';
|
||||
|
||||
?><form action="" method="post" id="edit-form">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="op" value="update">
|
||||
|
@ -92,7 +94,7 @@ include_once __DIR__.'/../../core.php';
|
|||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "<?php echo tr('Codice banca nazionale (ABI e BIC)'); ?>", "name": "branch_code", "class": "alphanumeric-mask", "value": "$branch_code$" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Codice banca nazionale (ABI e BIC)'); ?>", "name": "branch_code", "class": "alphanumeric-mask", "value": "$branch_code$", "help": "<?php echo $help_codice_bic; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
|
@ -110,7 +112,7 @@ include_once __DIR__.'/../../core.php';
|
|||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "text", "label": "<?php echo tr('Cifre di verifica nazionale'); ?>", "name": "national_check_digits", "class": "alphanumeric-mask", "value": "$national_check_digits$" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Cifre di verifica nazionale (CIN)'); ?>", "name": "national_check_digits", "class": "alphanumeric-mask", "value": "$national_check_digits$" ]}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -37,11 +37,10 @@ class Banca extends Model
|
|||
*
|
||||
* @param string $nome
|
||||
* @param string $iban
|
||||
* @param string $bic
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public static function build(Anagrafica $anagrafica, $nome, $iban, $bic)
|
||||
public static function build(Anagrafica $anagrafica, $nome, $iban)
|
||||
{
|
||||
$model = new static();
|
||||
|
||||
|
@ -49,7 +48,6 @@ class Banca extends Model
|
|||
$model->anagrafica()->associate($anagrafica);
|
||||
$model->nome = $nome;
|
||||
$model->iban = $iban;
|
||||
$model->bic = $bic;
|
||||
|
||||
// Salvataggio delle informazioni
|
||||
$model->save();
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
echo'
|
||||
echo '
|
||||
<button type="button" class="btn btn-primary" onclick="if( confirm(\'Duplicare questo template?\') ){ $(\'#copia-template\').submit(); }"> <i class="fa fa-copy"></i> '.tr('Duplica template').'</button>';
|
||||
|
||||
// Duplica template
|
||||
|
@ -28,4 +28,3 @@ echo '
|
|||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="op" value="copy">
|
||||
</form>';
|
||||
|
||||
|
|
|
@ -327,7 +327,7 @@ elseif ($record['stato'] == 'Bozza') {
|
|||
<strike>';
|
||||
}
|
||||
|
||||
echo (empty($scadenza->da_pagare) ? '<i class="fa fa-exclamation-triangle"></i>' : '').moneyFormat($scadenza->da_pagare);
|
||||
echo(empty($scadenza->da_pagare) ? '<i class="fa fa-exclamation-triangle"></i>' : '').moneyFormat($scadenza->da_pagare);
|
||||
|
||||
if ($pagamento_iniziato) {
|
||||
echo '
|
||||
|
|
|
@ -551,7 +551,6 @@ class Fattura extends Document
|
|||
$this->attributes['iva_rivalsainps'] = $this->iva_rivalsa_inps;
|
||||
$this->attributes['rivalsainps'] = $this->rivalsa_inps;
|
||||
$this->attributes['ritenutaacconto'] = $this->ritenuta_acconto;
|
||||
|
||||
|
||||
// Generazione numero fattura se non presente (Bozza -> Emessa)
|
||||
if ((($stato_precedente->descrizione == 'Bozza' && $this->stato['descrizione'] == 'Emessa') or (!$is_fiscale)) && empty($this->numero_esterno)) {
|
||||
|
|
|
@ -236,7 +236,7 @@ switch (post('op')) {
|
|||
} catch (InvalidArgumentException $e) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
flash()->info(tr('Interventi eliminati!'));
|
||||
break;
|
||||
}
|
||||
|
@ -247,7 +247,6 @@ if (App::debug()) {
|
|||
];
|
||||
}
|
||||
|
||||
|
||||
$operations['export-bulk'] = [
|
||||
'text' => '<span><i class="fa fa-file-archive-o"></i> '.tr('Esporta stampe'),
|
||||
'data' => [
|
||||
|
|
|
@ -165,7 +165,7 @@ switch ($operazione) {
|
|||
// Creazione fattura
|
||||
if (empty($id_documento)) {
|
||||
$fattura = Fattura::build($contratto->anagrafica, $tipo, $data, $id_segment);
|
||||
}else{
|
||||
} else {
|
||||
$fattura = Fattura::find($id_documento);
|
||||
}
|
||||
$fattura->note = post('note');
|
||||
|
|
|
@ -81,14 +81,14 @@ echo '
|
|||
</div>';
|
||||
|
||||
//gestione replace
|
||||
$descrizione = get_var("Descrizione fattura pianificata");
|
||||
$descrizione = get_var('Descrizione fattura pianificata');
|
||||
$modules = MODULES::get('Contratti')['id'];
|
||||
$variables = include Modules::filepath($modules, 'variables.php');
|
||||
foreach ($variables as $variable => $value) {
|
||||
$descrizione = str_replace("{".$variable."}", $value, $descrizione);
|
||||
$descrizione = str_replace('{'.$variable.'}', $value, $descrizione);
|
||||
}
|
||||
$descrizione = str_replace("{rata}", $numero_rata, $descrizione);
|
||||
$descrizione = str_replace("{zona}", $zona, $descrizione);
|
||||
$descrizione = str_replace('{rata}', $numero_rata, $descrizione);
|
||||
$descrizione = str_replace('{zona}', $zona, $descrizione);
|
||||
|
||||
echo '
|
||||
<div class="row">
|
||||
|
|
|
@ -72,7 +72,7 @@ class DefaultHandler implements HandlerInterface
|
|||
{
|
||||
// Generazione del codice HTML
|
||||
return '
|
||||
<input |attr| autocomplete='.setting("Autocompletamento form").'>';
|
||||
<input |attr| autocomplete='.setting('Autocompletamento form').'>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
|
||||
use Modules\Interventi\Intervento;
|
||||
use Carbon\Carbon;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
|
@ -59,21 +58,20 @@ echo '
|
|||
</tr>
|
||||
</table>';
|
||||
|
||||
|
||||
/*
|
||||
Sedi
|
||||
*/
|
||||
|
||||
$sedi = $dbo->fetchArray("SELECT * FROM an_sedi WHERE idanagrafica=".prepare($anagrafica->idanagrafica));
|
||||
if( !empty($sedi) ){
|
||||
$sedi = $dbo->fetchArray('SELECT * FROM an_sedi WHERE idanagrafica='.prepare($anagrafica->idanagrafica));
|
||||
if (!empty($sedi)) {
|
||||
echo '
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th colspan="4" style="font-size:13pt;" class="text-center">'.tr('Sedi', [], ['upper' => true]).'</th>
|
||||
</tr>';
|
||||
|
||||
for($i=0; count($sedi)>$i; $i++){
|
||||
echo '
|
||||
for ($i = 0; count($sedi) > $i; ++$i) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="4" class="text-left" >'.tr('Nome sede').': <b>'.$sedi[$i]['nomesede'].'</b></td>
|
||||
</tr>
|
||||
|
@ -90,11 +88,11 @@ if( !empty($sedi) ){
|
|||
<td class="text-left" colspan="2">'.tr('cellulare').': <b>'.$sedi[$i]['cellulare'].'</b></td>
|
||||
</tr>';
|
||||
|
||||
if( !empty($sedi[$i+1]) ){
|
||||
echo '
|
||||
if (!empty($sedi[$i + 1])) {
|
||||
echo '
|
||||
<tr><td colspan="4"></td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
</table>';
|
||||
|
@ -104,17 +102,17 @@ if( !empty($sedi) ){
|
|||
Impianti
|
||||
*/
|
||||
|
||||
$impianti = $dbo->fetchArray("SELECT * FROM my_impianti WHERE idanagrafica=".prepare($anagrafica->idanagrafica));
|
||||
$impianti = $dbo->fetchArray('SELECT * FROM my_impianti WHERE idanagrafica='.prepare($anagrafica->idanagrafica));
|
||||
|
||||
if( !empty($impianti) ){
|
||||
if (!empty($impianti)) {
|
||||
echo '
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th colspan="4" style="font-size:13pt;" class="text-center">'.tr('Impianti', [], ['upper' => true]).'</th>
|
||||
</tr>';
|
||||
|
||||
for($i=0; count($impianti)>$i; $i++){
|
||||
echo '
|
||||
for ($i = 0; count($impianti) > $i; ++$i) {
|
||||
echo '
|
||||
<tr>
|
||||
<td colspan="2" class="text-left" >'.tr('Matricola').': <b>'.$impianti[$i]['matricola'].'</b></td>
|
||||
<td colspan="2" class="text-left" >'.tr('Data').': <b>'.Translator::dataToLocale($impianti[$i]['data']).'</b></td>
|
||||
|
@ -126,11 +124,11 @@ if( !empty($impianti) ){
|
|||
<td colspan="4" class="text-left" >'.tr('descrizione').': <b>'.$impianti[$i]['descrizione'].'</b></td>
|
||||
</tr>';
|
||||
|
||||
if( !empty($impianti[$i+1]) ){
|
||||
echo '
|
||||
if (!empty($impianti[$i + 1])) {
|
||||
echo '
|
||||
<tr><td colspan="4"></td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
</table>';
|
||||
|
@ -140,18 +138,18 @@ if( !empty($impianti) ){
|
|||
Attività
|
||||
*/
|
||||
|
||||
$interventi = $dbo->fetchArray("SELECT id, sessione.inizio FROM in_interventi LEFT JOIN (SELECT MIN(orario_inizio) AS inizio, in_interventi_tecnici.idintervento FROM in_interventi_tecnici GROUP BY in_interventi_tecnici.idintervento) AS sessione ON sessione.idintervento=in_interventi.id WHERE idanagrafica=".prepare($anagrafica->idanagrafica));
|
||||
$interventi = $dbo->fetchArray('SELECT id, sessione.inizio FROM in_interventi LEFT JOIN (SELECT MIN(orario_inizio) AS inizio, in_interventi_tecnici.idintervento FROM in_interventi_tecnici GROUP BY in_interventi_tecnici.idintervento) AS sessione ON sessione.idintervento=in_interventi.id WHERE idanagrafica='.prepare($anagrafica->idanagrafica));
|
||||
|
||||
if( !empty($interventi) ){
|
||||
if (!empty($interventi)) {
|
||||
echo '
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th colspan="4" style="font-size:13pt;" class="text-center">'.tr('Attività', [], ['upper' => true]).'</th>
|
||||
</tr>';
|
||||
|
||||
for($i=0; count($interventi)>$i; $i++){
|
||||
$intervento = Intervento::find($interventi[$i]['id']);
|
||||
echo '
|
||||
for ($i = 0; count($interventi) > $i; ++$i) {
|
||||
$intervento = Intervento::find($interventi[$i]['id']);
|
||||
echo '
|
||||
<tr>
|
||||
<td class="text-left">'.tr('Data richiesta').': <b>'.Translator::dateToLocale($intervento->data_richiesta).'</b></td>
|
||||
<td class="text-left" colspan="2" >'.tr('Data scadenza').': <b>'.Translator::dateToLocale($intervento->data_scadenza).'</b></td>
|
||||
|
@ -165,12 +163,12 @@ if( !empty($interventi) ){
|
|||
<td colspan="4" class="text-left" >'.tr('richiesta').': <b>'.$intervento->richiesta.'</b></td>
|
||||
</tr>';
|
||||
|
||||
if( !empty($interventi[$i+1]) ){
|
||||
echo '
|
||||
if (!empty($interventi[$i + 1])) {
|
||||
echo '
|
||||
<tr><td colspan="4"></td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
</table>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,4 +22,4 @@ include_once __DIR__.'/../../core.php';
|
|||
use Modules\Anagrafiche\Anagrafica;
|
||||
|
||||
$anagrafica = Anagrafica::find($id_record);
|
||||
$agente = Anagrafica::find($anagrafica->idagente);
|
||||
$agente = Anagrafica::find($anagrafica->idagente);
|
||||
|
|
|
@ -17,13 +17,11 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Modules\Interventi\Intervento;
|
||||
use Modules\Banche\Banca;
|
||||
use Carbon\Carbon;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$banca = Banca::where('id_anagrafica',$anagrafica->idanagrafica)
|
||||
$banca = Banca::where('id_anagrafica', $anagrafica->idanagrafica)
|
||||
->where('predefined', 1)
|
||||
->first();
|
||||
|
||||
|
@ -64,4 +62,4 @@ echo '
|
|||
<td class="text-left">'.tr('cellulare').': <b>'.$anagrafica['cellulare'].'</b></td>
|
||||
<td class="text-left">'.tr('fax').': <b>'.$anagrafica['fax'].'</b></td>
|
||||
</tr>
|
||||
</table>';
|
||||
</table>';
|
||||
|
|
|
@ -21,4 +21,4 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
use Modules\Anagrafiche\Anagrafica;
|
||||
|
||||
$anagrafica = Anagrafica::find(setting('Azienda predefinita'));
|
||||
$anagrafica = Anagrafica::find(setting('Azienda predefinita'));
|
||||
|
|
Loading…
Reference in New Issue