Fix dello stile del codice
This commit is contained in:
parent
03ff6969e3
commit
db7f060e7c
|
@ -246,7 +246,7 @@ if (!empty($record['idconto_fornitore'])) {
|
|||
|
||||
echo '
|
||||
<p>'.tr('Piano dei conti collegato: _NAME_', [
|
||||
'_NAME_' => $conto['numero'].'.'.$conto['numero_conto'].' '.$conto['descrizione']
|
||||
'_NAME_' => $conto['numero'].'.'.$conto['numero_conto'].' '.$conto['descrizione'],
|
||||
]).Modules::link('Piano dei conti', null, '').'</p>';
|
||||
} ?>
|
||||
|
||||
|
@ -312,7 +312,7 @@ if (!empty($record['idconto_cliente'])) {
|
|||
|
||||
echo '
|
||||
<p>'.tr('Piano dei conti collegato: _NAME_', [
|
||||
'_NAME_' => $conto['numero'].'.'.$conto['numero_conto'].' '.$conto['descrizione']
|
||||
'_NAME_' => $conto['numero'].'.'.$conto['numero_conto'].' '.$conto['descrizione'],
|
||||
]).Modules::link('Piano dei conti', null, '').'</p>';
|
||||
} ?>
|
||||
|
||||
|
|
|
@ -57,5 +57,4 @@ switch (filter('op')) {
|
|||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ switch (get('op')) {
|
|||
}
|
||||
|
||||
echo '
|
||||
<div class="fc-event '.$class.'" data-id="'.$r['id'].'" data-idcontratto="'.$r['idcontratto'].'" data-ref="'.$r['ref'].'">'.( ($r['ref']=='intervento') ? '<i class=\'fa fa-wrench pull-right\'></i>':'<i class=\'fa fa-file-text-o pull-right\'></i>').'
|
||||
<div class="fc-event '.$class.'" data-id="'.$r['id'].'" data-idcontratto="'.$r['idcontratto'].'" data-ref="'.$r['ref'].'">'.(($r['ref'] == 'intervento') ? '<i class=\'fa fa-wrench pull-right\'></i>' : '<i class=\'fa fa-file-text-o pull-right\'></i>').'
|
||||
<b>'.$r['ragione_sociale'].'</b><br>'.Translator::dateToLocale($r['data_richiesta']).' ('.$r['tipointervento'].')'.(!empty($r['richiesta']) ? ' - '.$r['richiesta'] : '').'
|
||||
</div>';
|
||||
}
|
||||
|
|
|
@ -337,9 +337,9 @@ if (!empty($rsp)) {
|
|||
array_unique($mesi_interventi);
|
||||
|
||||
// Ordino l'array per anno
|
||||
foreach($mesi_interventi as $key => &$data) {
|
||||
ksort($data);
|
||||
}
|
||||
foreach ($mesi_interventi as $key => &$data) {
|
||||
ksort($data);
|
||||
}
|
||||
|
||||
echo '<select class="superselect" id="select-intreventi-pianificare">';
|
||||
|
||||
|
|
|
@ -1166,7 +1166,7 @@ switch (post('op')) {
|
|||
$id_segment = post('id_segment');
|
||||
$data = post('data');
|
||||
|
||||
$anagrafica = $fattura->anagrafica()->first();
|
||||
$anagrafica = $fattura->anagrafica;
|
||||
$tipo = Tipo::where('descrizione', 'Nota di credito')->where('dir', 'entrata')->first();
|
||||
|
||||
$nota = Fattura::make($anagrafica, $tipo, $data, $id_segment);
|
||||
|
@ -1260,7 +1260,7 @@ if (get('op') == 'nota_addebito') {
|
|||
$id_segment = $record['id_segment'];
|
||||
}
|
||||
|
||||
$anagrafica = $fattura->anagrafica()->first();
|
||||
$anagrafica = $fattura->anagrafica;
|
||||
$tipo = Tipo::where('descrizione', 'Nota di debito')->where('dir', 'entrata')->first();
|
||||
$data = $fattura->data;
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@ class Articolo extends Article
|
|||
return;
|
||||
}
|
||||
|
||||
$fattura = $this->fattura()->first();
|
||||
$tipo = $fattura->tipo()->first();
|
||||
$fattura = $this->fattura;
|
||||
$tipo = $fattura->tipo;
|
||||
|
||||
$numero = $fattura->numero_esterno ?: $fattura->numero;
|
||||
$data = $fattura->data;
|
||||
|
@ -52,14 +52,14 @@ class Articolo extends Article
|
|||
'_NUM_' => $numero,
|
||||
]);
|
||||
|
||||
$this->articolo()->first()->movimenta(-$qta, $movimento, $data, false, [
|
||||
$this->articolo->movimenta(-$qta, $movimento, $data, false, [
|
||||
'iddocumento' => $fattura->id,
|
||||
]);
|
||||
}
|
||||
|
||||
public function getDirection()
|
||||
{
|
||||
return $this->fattura()->first()->tipo()->first()->dir;
|
||||
return $this->fattura->tipo->dir;
|
||||
}
|
||||
|
||||
public function fattura()
|
||||
|
|
|
@ -102,8 +102,7 @@ class Fattura extends Model
|
|||
|
||||
// Calcolo dei numeri fattura
|
||||
if ($value != $previous) {
|
||||
$direzione = $this->tipo()->dir;
|
||||
$direzione = (empty($direzione)) ? filter('dir'): $direzione;
|
||||
$direzione = $this->tipo->dir;
|
||||
$data = $this->data;
|
||||
|
||||
$this->numero = static::getNumero($data, $direzione, $value);
|
||||
|
@ -125,15 +124,14 @@ class Fattura extends Model
|
|||
$database = database();
|
||||
|
||||
//$maschera = $direzione == 'uscita' ? static::getMaschera($id_segment) : '#';
|
||||
// Recupero maschera per questo segmento
|
||||
$maschera = static::getMaschera($id_segment);
|
||||
|
||||
|
||||
$ultima_fattura = $database->fetchOne('SELECT numero FROM co_documenti WHERE YEAR(data) = :year AND id_segment = :id_segment '.(($direzione=='uscita') ? 'ORDER BY numero DESC' : static::getMascheraOrder($maschera)), [
|
||||
// Recupero maschera per questo segmento
|
||||
$maschera = static::getMaschera($id_segment);
|
||||
|
||||
$ultima_fattura = $database->fetchOne('SELECT numero FROM co_documenti WHERE YEAR(data) = :year AND id_segment = :id_segment '.(($direzione == 'uscita') ? 'ORDER BY numero DESC' : static::getMascheraOrder($maschera)), [
|
||||
':year' => date('Y', strtotime($data)),
|
||||
':id_segment' => $id_segment,
|
||||
]);
|
||||
|
||||
|
||||
$numero = Generator::generate($maschera, $ultima_fattura['numero']);
|
||||
|
||||
return $numero;
|
||||
|
@ -150,10 +148,10 @@ class Fattura extends Model
|
|||
*/
|
||||
public static function getNumeroSecondario($data, $direzione, $id_segment)
|
||||
{
|
||||
if ($direzione == 'uscita') {
|
||||
if ($direzione == 'uscita') {
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
$database = database();
|
||||
|
||||
// Recupero maschera per questo segmento
|
||||
|
@ -165,8 +163,8 @@ class Fattura extends Model
|
|||
]);
|
||||
|
||||
$numero_esterno = Generator::generate($maschera, $ultima_fattura['numero_esterno']);
|
||||
|
||||
return $numero_esterno;
|
||||
|
||||
return $numero_esterno;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -328,7 +326,7 @@ class Fattura extends Model
|
|||
*/
|
||||
public function isNotaDiAccredito()
|
||||
{
|
||||
return $this->getTipo()['reversed'] == 1;
|
||||
return $this->tipo->reversed == 1;
|
||||
}
|
||||
|
||||
public function updateSconto()
|
||||
|
|
|
@ -64,7 +64,6 @@ $idcontratto = filter('idcontratto');
|
|||
$idcontratto_riga = filter('idcontratto_riga');
|
||||
$idordineservizio = filter('idordineservizio');
|
||||
|
||||
|
||||
if (!empty($idcontratto) && !empty($idordineservizio)) {
|
||||
$rs = $dbo->fetchArray('SELECT *, (SELECT idzona FROM an_anagrafiche WHERE idanagrafica = co_contratti.idanagrafica) AS idzona FROM co_contratti WHERE id='.prepare($idcontratto));
|
||||
$idanagrafica = $rs[0]['idanagrafica'];
|
||||
|
|
|
@ -35,7 +35,7 @@ class Articolo extends Article
|
|||
|
||||
public function movimenta($qta)
|
||||
{
|
||||
$articolo = $this->articolo()->first();
|
||||
$articolo = $this->articolo;
|
||||
|
||||
// Movimento l'articolo
|
||||
if (!empty($this->idautomezzo)) {
|
||||
|
@ -56,7 +56,7 @@ class Articolo extends Article
|
|||
'idintervento' => $this->idintervento,
|
||||
]);
|
||||
} else {
|
||||
$intervento = $this->intervento()->first();
|
||||
$intervento = $this->intervento;
|
||||
|
||||
$numero = $intervento->codice;
|
||||
$data = database()->fetchOne('SELECT MAX(orario_fine) AS data FROM in_interventi_tecnici WHERE idintervento = :id_intervento', [
|
||||
|
|
|
@ -51,7 +51,7 @@ switch (filter('op')) {
|
|||
|
||||
case 'add':
|
||||
$descrizione = filter('descrizione');
|
||||
$codice_modalita_pagamento_fe = filter('codice_modalita_pagamento_fe');
|
||||
$codice_modalita_pagamento_fe = filter('codice_modalita_pagamento_fe');
|
||||
|
||||
if (isset($descrizione)) {
|
||||
$dbo->query('INSERT INTO `co_pagamenti` (`descrizione`, codice_modalita_pagamento_fe ) VALUES ('.prepare($descrizione).', '.prepare($codice_modalita_pagamento_fe).' )');
|
||||
|
|
|
@ -47,7 +47,7 @@ for ($x = 0; $x < $n1; ++$x) {
|
|||
echo " </div>\n";
|
||||
|
||||
// Livello 3
|
||||
$query3 = "SELECT `co_pianodeiconti3`.*, `clienti`.`idanagrafica` AS id_cliente, `fornitori`.`idanagrafica` AS id_fornitore FROM `co_pianodeiconti3` LEFT OUTER JOIN `an_anagrafiche` `clienti` ON `clienti`.`idconto_cliente` = `co_pianodeiconti3`.`id` LEFT OUTER JOIN `an_anagrafiche` `fornitori` ON `fornitori`.`idconto_fornitore` = `co_pianodeiconti3`.`id` WHERE `idpianodeiconti2` = ".prepare($rs2[$y]['id'])." ORDER BY numero ASC";
|
||||
$query3 = 'SELECT `co_pianodeiconti3`.*, `clienti`.`idanagrafica` AS id_cliente, `fornitori`.`idanagrafica` AS id_fornitore FROM `co_pianodeiconti3` LEFT OUTER JOIN `an_anagrafiche` `clienti` ON `clienti`.`idconto_cliente` = `co_pianodeiconti3`.`id` LEFT OUTER JOIN `an_anagrafiche` `fornitori` ON `fornitori`.`idconto_fornitore` = `co_pianodeiconti3`.`id` WHERE `idpianodeiconti2` = '.prepare($rs2[$y]['id']).' ORDER BY numero ASC';
|
||||
$rs3 = $dbo->fetchArray($query3);
|
||||
$n3 = sizeof($rs3);
|
||||
|
||||
|
@ -102,7 +102,6 @@ for ($x = 0; $x < $n1; ++$x) {
|
|||
'.$tools.' '.$rs2[$y]['numero'].'.'.$rs3[$z]['numero'].' '.$rs3[$z]['descrizione'].' '.(isset($id_anagrafica) ? Modules::link('Anagrafiche', $id_anagrafica, 'Anagrafica', null) : '').'
|
||||
</span>';
|
||||
|
||||
|
||||
echo ' <div id="conto_'.$rs3[$z]['id']."\" style=\"display:none;\">\n";
|
||||
|
||||
if (sizeof($rs) > 0) {
|
||||
|
|
|
@ -43,7 +43,7 @@ switch (post('op')) {
|
|||
|
||||
$dbo->query('INSERT INTO co_preventivi(idanagrafica, nome, numero, idagente, idstato, idtipointervento, data_bozza, data_conclusione, idiva, idpagamento) VALUES ('.prepare($idanagrafica).', '.prepare($nome).', '.prepare($numero).', '.prepare($idagente).", (SELECT `id` FROM `co_statipreventivi` WHERE `descrizione`='Bozza'), ".prepare($idtipointervento).', NOW(), DATE_ADD(NOW(), INTERVAL +1 MONTH), '.prepare($idiva).', '.prepare($idpagamento).')');
|
||||
$id_record = $dbo->lastInsertedID();
|
||||
|
||||
|
||||
//Aggiungo master_revision e default_revision
|
||||
$dbo->query('UPDATE co_preventivi SET master_revision='.prepare($id_record).', default_revision=1 WHERE id='.$id_record);
|
||||
|
||||
|
@ -196,7 +196,7 @@ switch (post('op')) {
|
|||
// eliminazione preventivo
|
||||
case 'delete':
|
||||
$rs_revisioni = $dbo->fetchArray('SELECT master_revision FROM co_preventivi WHERE id='.prepare($id_record));
|
||||
|
||||
|
||||
//Cancello preventivo e revisioni
|
||||
$dbo->query('DELETE FROM co_preventivi WHERE master_revision='.prepare($rs_revisioni[0]['master_revision']));
|
||||
|
||||
|
@ -305,15 +305,15 @@ switch (post('op')) {
|
|||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'add_revision':
|
||||
|
||||
|
||||
//Copio il preventivo
|
||||
$rs_preventivo = $dbo->fetchArray("SELECT * FROM co_preventivi WHERE id='".$id_record."'");
|
||||
|
||||
|
||||
//Tolgo il flag default_revision da tutte le revisioni e dal record_principale
|
||||
$dbo->query("UPDATE co_preventivi SET default_revision=0 WHERE master_revision=".prepare($rs_preventivo[0]['master_revision']));
|
||||
|
||||
$dbo->query('UPDATE co_preventivi SET default_revision=0 WHERE master_revision='.prepare($rs_preventivo[0]['master_revision']));
|
||||
|
||||
$preventivo = [
|
||||
'numero' => $rs_preventivo[0]['numero'],
|
||||
'nome' => $rs_preventivo[0]['nome'],
|
||||
|
@ -344,13 +344,13 @@ switch (post('op')) {
|
|||
'master_revision' => $rs_preventivo[0]['master_revision'],
|
||||
'default_revision' => '1',
|
||||
];
|
||||
|
||||
|
||||
$dbo->insert('co_preventivi', $preventivo);
|
||||
$id_record_new = $dbo->lastInsertedID();
|
||||
|
||||
$rs_righe_preventivo = $dbo->fetchArray("SELECT * FROM co_righe_preventivi WHERE idpreventivo=".prepare($id_record));
|
||||
|
||||
for($i=0;$i<sizeof($rs_righe_preventivo);$i++){
|
||||
|
||||
$rs_righe_preventivo = $dbo->fetchArray('SELECT * FROM co_righe_preventivi WHERE idpreventivo='.prepare($id_record));
|
||||
|
||||
for ($i = 0; $i < sizeof($rs_righe_preventivo); ++$i) {
|
||||
$righe_preventivo = [
|
||||
'data_evasione' => $rs_righe_preventivo[$i]['data_evasione'],
|
||||
'idpreventivo' => $id_record_new,
|
||||
|
@ -372,9 +372,9 @@ switch (post('op')) {
|
|||
];
|
||||
$dbo->insert('co_righe_preventivi', $righe_preventivo);
|
||||
}
|
||||
|
||||
|
||||
$id_record = $id_record_new;
|
||||
|
||||
|
||||
flash()->info(tr('Aggiunta nuova revisione!'));
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ if (!in_array($record['stato'], ['Bozza', 'Rifiutato', 'In attesa di conferma'])
|
|||
|
||||
</ul>
|
||||
</div>';
|
||||
}else{
|
||||
} else {
|
||||
echo '
|
||||
<form action="" method="post" id="form_crearevisione">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
|
@ -28,4 +28,3 @@ if (!in_array($record['stato'], ['Bozza', 'Rifiutato', 'In attesa di conferma'])
|
|||
<button type="button" class="btn btn-warning" onclick="if(confirm(\'Vuoi creare un nuova revisione?\')){$(\'#form_crearevisione\').submit();}"><i class="fa fa-copy"></i> Crea nuova revisione...</button>
|
||||
</form>';
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,6 @@ $totale_pagato = 0;
|
|||
$rs = $dbo->fetchArray('SELECT * FROM co_scadenziario WHERE iddocumento = (SELECT iddocumento FROM co_scadenziario s WHERE id='.prepare($id_record).') ORDER BY scadenza ASC');
|
||||
|
||||
for ($i = 0; $i < count($rs); ++$i) {
|
||||
|
||||
if ($rs[$i]['da_pagare'] == $rs[$i]['pagato']) {
|
||||
$class = 'success';
|
||||
} elseif (abs($rs[$i]['pagato']) == 0) {
|
||||
|
@ -105,7 +104,6 @@ for ($i = 0; $i < count($rs); ++$i) {
|
|||
{[ "type": "number", "name": "pagato['.$rs[$i]['id'].']", "value": "'.Translator::numberToLocale($rs[$i]['pagato'], 4).'", "decimals":"4" ]}
|
||||
</td>
|
||||
</tr>';
|
||||
|
||||
}
|
||||
$totale_da_pagare = sum(array_column($rs, 'da_pagare'));
|
||||
$totale_pagato = sum(array_column($rs, 'pagato'));
|
||||
|
|
|
@ -76,8 +76,8 @@ if (!empty($missing)) {
|
|||
|
||||
echo '
|
||||
<p>'.tr("Per effettuare la generazione dell'XML della fattura elettronica clicca sul pulsante _BTN_", [
|
||||
'_BTN_' => '<b>Genera</b>'
|
||||
]).'. '.tr("Successivamente sarà possibile procedere alla visualizzazione e al download della fattura generata attraverso i pulsanti dedicati").'.</p>';
|
||||
'_BTN_' => '<b>Genera</b>',
|
||||
]).'. '.tr('Successivamente sarà possibile procedere alla visualizzazione e al download della fattura generata attraverso i pulsanti dedicati').'.</p>';
|
||||
|
||||
echo '
|
||||
<div class="text-center">
|
||||
|
|
|
@ -47,7 +47,7 @@ echo '
|
|||
<h4>'.tr('Pagamento').'</h4>
|
||||
|
||||
<p>'.tr('La fattura importata presenta _NUM_ rate di pagamento con le seguenti scadenze', [
|
||||
'_NUM_' => count($metodi)
|
||||
'_NUM_' => count($metodi),
|
||||
]).':</p>
|
||||
<ul>';
|
||||
|
||||
|
|
|
@ -4,23 +4,23 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
$operazione = filter('op');
|
||||
|
||||
switch ($operazione) {
|
||||
switch ($operazione) {
|
||||
case 'edit_revision':
|
||||
|
||||
|
||||
$master_revision = post('master_revision');
|
||||
$id_record = post('idrevisione');
|
||||
//Tolgo il flag default_revision da tutte le revisioni e dal record_principale
|
||||
$dbo->query("UPDATE co_preventivi SET default_revision=0 WHERE master_revision=".prepare($master_revision));
|
||||
$dbo->query("UPDATE co_preventivi SET default_revision=1 WHERE id=".prepare($id_record));
|
||||
|
||||
$dbo->query('UPDATE co_preventivi SET default_revision=0 WHERE master_revision='.prepare($master_revision));
|
||||
$dbo->query('UPDATE co_preventivi SET default_revision=1 WHERE id='.prepare($id_record));
|
||||
|
||||
flash()->info(tr('Revisione aggiornata!'));
|
||||
break;
|
||||
|
||||
|
||||
case 'delete_revision':
|
||||
|
||||
|
||||
$idrevisione = post('idrevisione');
|
||||
$dbo->query("DELETE FROM co_preventivi WHERE id=".prepare($idrevisione));
|
||||
|
||||
$dbo->query('DELETE FROM co_preventivi WHERE id='.prepare($idrevisione));
|
||||
|
||||
flash()->info(tr('Revisione eliminata!'));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
echo "<form action='".$rootdir."/editor.php?id_module=".$id_module."&id_record=".$id_record."' method='post'>";
|
||||
echo "<form action='".$rootdir.'/editor.php?id_module='.$id_module.'&id_record='.$id_record."' method='post'>";
|
||||
echo " <input type='hidden' name='backto' value='record-edit'>";
|
||||
echo " <input type='hidden' name='op' value='edit_revision'>";
|
||||
echo " <input type='hidden' name='id_plugin' value='".$id_plugin."'>";
|
||||
echo " <input type='hidden' name='id_record' value='".$id_record."'>";
|
||||
|
||||
$rs_master_revision = $dbo->fetchArray("SELECT master_revision FROM co_preventivi WHERE id=".prepare($id_record));
|
||||
$rs_master_revision = $dbo->fetchArray('SELECT master_revision FROM co_preventivi WHERE id='.prepare($id_record));
|
||||
|
||||
echo " <input type='hidden' name='master_revision' value='".$rs_master_revision[0]['master_revision']."'>";
|
||||
|
||||
$rs_revisioni = $dbo->fetchArray("SELECT * FROM co_preventivi WHERE master_revision=".prepare($rs_master_revision[0]['master_revision'])." OR id=".prepare($rs_master_revision[0]['master_revision'])." ORDER BY created_at");
|
||||
$rs_revisioni = $dbo->fetchArray('SELECT * FROM co_preventivi WHERE master_revision='.prepare($rs_master_revision[0]['master_revision']).' OR id='.prepare($rs_master_revision[0]['master_revision']).' ORDER BY created_at');
|
||||
|
||||
echo " <div class='row'>";
|
||||
echo " <div class='col-md-12'>";
|
||||
|
@ -23,40 +23,47 @@ echo " <tr>
|
|||
<th>Descrizione</th>
|
||||
<th style='width:50px;'></th>
|
||||
</tr>";
|
||||
for($i=0;$i<sizeof($rs_revisioni);$i++){
|
||||
if($rs_revisioni[$i]['master_revision']==$rs_revisioni[$i]['id'] || $rs_revisioni[$i]['default_revision']==1){$disabled='disabled';}else{$disabled='';}
|
||||
if($rs_revisioni[$i]['default_revision']){$cheched='checked';}else{$cheched='';}
|
||||
for ($i = 0; $i < sizeof($rs_revisioni); ++$i) {
|
||||
if ($rs_revisioni[$i]['master_revision'] == $rs_revisioni[$i]['id'] || $rs_revisioni[$i]['default_revision'] == 1) {
|
||||
$disabled = 'disabled';
|
||||
} else {
|
||||
$disabled = '';
|
||||
}
|
||||
if ($rs_revisioni[$i]['default_revision']) {
|
||||
$cheched = 'checked';
|
||||
} else {
|
||||
$cheched = '';
|
||||
}
|
||||
echo " <tr>
|
||||
<td class='text-center'>
|
||||
<input type='radio' class='revision_changer' name='idrevisione' value='".$rs_revisioni[$i]['id']."' ".$cheched.">
|
||||
<input type='radio' class='revision_changer' name='idrevisione' value='".$rs_revisioni[$i]['id']."' ".$cheched.'>
|
||||
</td>
|
||||
<td>
|
||||
Revisione ".($i+1)." creata il ".Translator::dateToLocale($rs_revisioni[$i]['created_at'])." alle ".date('H:i', strtotime($rs_revisioni[$i]['created_at']))."
|
||||
Revisione '.($i + 1).' creata il '.Translator::dateToLocale($rs_revisioni[$i]['created_at']).' alle '.date('H:i', strtotime($rs_revisioni[$i]['created_at']))."
|
||||
</td>
|
||||
<td class='text-center'>";
|
||||
?>
|
||||
<button type='button' class='btn btn-danger <?=$disabled?>' onclick='if(confirm("Vuoi cancellare questa revisione?")){$("#idrevisione").val("<?=$rs_revisioni[$i]['id']?>");$("#form_deleterevision").submit();}' <?=$disabled?>><i class='fa fa-trash'></i></button>
|
||||
<td class='text-center'>"; ?>
|
||||
<button type='button' class='btn btn-danger <?php echo $disabled; ?>' onclick='if(confirm("Vuoi cancellare questa revisione?")){$("#idrevisione").val("<?php echo $rs_revisioni[$i]['id']; ?>");$("#form_deleterevision").submit();}' <?php echo $disabled; ?>><i class='fa fa-trash'></i></button>
|
||||
<?php
|
||||
echo "
|
||||
echo '
|
||||
</td>
|
||||
</tr>";
|
||||
</tr>';
|
||||
}
|
||||
echo " </table>";
|
||||
echo ' </table>';
|
||||
|
||||
echo " </div>";
|
||||
echo " </div>";
|
||||
echo ' </div>';
|
||||
echo ' </div>';
|
||||
echo " <div class='row'>";
|
||||
echo " <div class='col-md-12 text-center'>";
|
||||
echo " <button type='submit' class='btn btn-primary'><i class='fa fa-refresh'></i> Cambia revisione...</button>";
|
||||
echo " </div>";
|
||||
echo " </div>";
|
||||
echo "</form>";
|
||||
echo ' </div>';
|
||||
echo ' </div>';
|
||||
echo '</form>';
|
||||
|
||||
echo "<form action='".$rootdir."/editor.php?id_module=".$id_module."&id_record=".$id_record."' method='post' id='form_deleterevision'>";
|
||||
echo "<form action='".$rootdir.'/editor.php?id_module='.$id_module.'&id_record='.$id_record."' method='post' id='form_deleterevision'>";
|
||||
echo " <input type='hidden' name='backto' value='record-edit'>";
|
||||
echo " <input type='hidden' name='op' value='delete_revision'>";
|
||||
echo " <input type='hidden' name='id_plugin' value='".$id_plugin."'>";
|
||||
echo " <input type='hidden' name='id_record' value='".$id_record."'>";
|
||||
echo " <input type='hidden' name='idrevisione' id='idrevisione' value=''>";
|
||||
echo "</form>";
|
||||
echo '</form>';
|
||||
?>
|
|
@ -18,7 +18,7 @@ class Clause extends Model
|
|||
|
||||
public function module()
|
||||
{
|
||||
return $this->belongsTo(Module::class, 'idmodule')->first();
|
||||
return $this->belongsTo(Module::class, 'idmodule');
|
||||
}
|
||||
|
||||
public function getClauseAttribute($value)
|
||||
|
|
|
@ -12,6 +12,6 @@ class Log extends Model
|
|||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'id_utente')->first();
|
||||
return $this->belongsTo(User::class, 'id_utente');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,11 +86,11 @@ class Plugin extends Model
|
|||
|
||||
public function originalModule()
|
||||
{
|
||||
return $this->belongsTo(Module::class, 'idmodule_from')->first();
|
||||
return $this->belongsTo(Module::class, 'idmodule_from');
|
||||
}
|
||||
|
||||
public function module()
|
||||
{
|
||||
return $this->belongsTo(Module::class, 'idmodule_to')->first();
|
||||
return $this->belongsTo(Module::class, 'idmodule_to');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ class AcceptanceTester extends \Codeception\Actor
|
|||
* Define custom actions here
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Clicca sul pulsante e attende la conclusione del caricamento.
|
||||
*
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
namespace Helper;
|
||||
|
||||
use Facebook\WebDriver\WebDriverBy;
|
||||
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $t
|
||||
|
||||
|
|
|
@ -10,18 +10,17 @@ class RowHelper extends \Codeception\Module
|
|||
protected $finalPattern = "//div[@class='panel-heading' and contains(string(), 'Righe')]/parent::*//table//tr[contains(string(), '|name|')]//td[2]";
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
* Undocumented function.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
* @param [type] $descrizione
|
||||
* @param [type] $qta
|
||||
* @param [type] $prezzo
|
||||
* @param integer $sconto
|
||||
* @param string $tipo_sconto
|
||||
* @param [type] $id_iva
|
||||
* @param [type] $id_rivalsa_inps
|
||||
* @param [type] $id_ritenuta_acconto
|
||||
* @return void
|
||||
* @param [type] $descrizione
|
||||
* @param [type] $qta
|
||||
* @param [type] $prezzo
|
||||
* @param int $sconto
|
||||
* @param string $tipo_sconto
|
||||
* @param [type] $id_iva
|
||||
* @param [type] $id_rivalsa_inps
|
||||
* @param [type] $id_ritenuta_acconto
|
||||
*/
|
||||
public function addRow(AcceptanceTester $t, $descrizione, $qta, $prezzo, $sconto = 0, $tipo_sconto = 'UNT', $id_iva = null, $id_rivalsa_inps = null, $id_ritenuta_acconto = null)
|
||||
{
|
||||
|
@ -60,10 +59,9 @@ class RowHelper extends \Codeception\Module
|
|||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
* Undocumented function.
|
||||
*
|
||||
* @param string $pattern
|
||||
* @return void
|
||||
*/
|
||||
protected function setFinalPattern($pattern)
|
||||
{
|
||||
|
@ -71,10 +69,9 @@ class RowHelper extends \Codeception\Module
|
|||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
* Undocumented function.
|
||||
*
|
||||
* @param string $type
|
||||
* @return void
|
||||
*/
|
||||
protected function getFinalValue($type)
|
||||
{
|
||||
|
@ -82,10 +79,9 @@ class RowHelper extends \Codeception\Module
|
|||
}
|
||||
|
||||
/**
|
||||
* Undocumented function
|
||||
* Undocumented function.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
* @return void
|
||||
*/
|
||||
public function testImporti(AcceptanceTester $t)
|
||||
{
|
||||
|
@ -96,17 +92,17 @@ class RowHelper extends \Codeception\Module
|
|||
$this->addRow($t, 'Riga 5', 1, 104.90);
|
||||
$this->addRow($t, 'Riga 6', 1, 2);
|
||||
|
||||
$t->see("212,34", $this->getFinalValue('Imponibile'));
|
||||
$t->see("46,71", $this->getFinalValue('IVA'));
|
||||
$t->see("259,05", $this->getFinalValue('Totale'));
|
||||
$t->see('212,34', $this->getFinalValue('Imponibile'));
|
||||
$t->see('46,71', $this->getFinalValue('IVA'));
|
||||
$t->see('259,05', $this->getFinalValue('Totale'));
|
||||
|
||||
$this->addRow($t, 'Riga 7 con sconto in euro', 15, 12, 2);
|
||||
$this->addRow($t, 'Riga 8 con sconto percentuale', 15, 10, 20, 'PRC');
|
||||
|
||||
$t->see("542,34", $this->getFinalValue('Imponibile'));
|
||||
$t->see("60,00", $this->getFinalValue('Sconto'));
|
||||
$t->see("482,34", $this->getFinalValue('Imponibile scontato'));
|
||||
$t->see("106,11", $this->getFinalValue('IVA'));
|
||||
$t->see("588,45", $this->getFinalValue('Totale'));
|
||||
$t->see('542,34', $this->getFinalValue('Imponibile'));
|
||||
$t->see('60,00', $this->getFinalValue('Sconto'));
|
||||
$t->see('482,34', $this->getFinalValue('Imponibile scontato'));
|
||||
$t->see('106,11', $this->getFinalValue('IVA'));
|
||||
$t->see('588,45', $this->getFinalValue('Totale'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,50 +55,50 @@ class AnagraficheCest
|
|||
}
|
||||
|
||||
/**
|
||||
* Crea una nuova anagrafica di tipo Cliente.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
* Crea una nuova anagrafica di tipo Cliente.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
public function testAnagraficaCliente(AcceptanceTester $t)
|
||||
{
|
||||
$this->addAnag($t, 'Cliente', 1, '05024030289');
|
||||
}
|
||||
|
||||
/**
|
||||
* Crea una nuova anagrafica di tipo Tecnico.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
* Crea una nuova anagrafica di tipo Tecnico.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
public function testAnagraficaTecnico(AcceptanceTester $t)
|
||||
{
|
||||
$this->addAnag($t, 'Tecnico', 2, '05024030289');
|
||||
}
|
||||
|
||||
/**
|
||||
* Crea una nuova anagrafica di tipo Fornitore.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
* Crea una nuova anagrafica di tipo Fornitore.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
public function testAnagraficaFornitore(AcceptanceTester $t)
|
||||
{
|
||||
$this->addAnag($t, 'Fornitore', 4, '05024030289');
|
||||
}
|
||||
|
||||
/**
|
||||
* Crea una nuova anagrafica di tipo Vettore.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
* Crea una nuova anagrafica di tipo Vettore.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
public function testAnagraficaVettore(AcceptanceTester $t)
|
||||
{
|
||||
$this->addAnag($t, 'Vettore', 5, '05024030289');
|
||||
}
|
||||
|
||||
/**
|
||||
* Crea una nuova anagrafica di tipo Agente.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
* Crea una nuova anagrafica di tipo Agente.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
public function testAnagraficaAgente(AcceptanceTester $t)
|
||||
{
|
||||
$this->addAnag($t, 'Agente', 6, '05024030289');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
use \Helper\Common\RowHelper;
|
||||
use Helper\Common\RowHelper;
|
||||
|
||||
class FattureCest
|
||||
{
|
||||
|
@ -65,10 +65,10 @@ class FattureCest
|
|||
}
|
||||
|
||||
/**
|
||||
* Crea una nuova fattura di vendita.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
* Crea una nuova fattura di vendita.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
public function testFatturaDiVendita(AcceptanceTester $t)
|
||||
{
|
||||
$this->addFattura($t, true, 2, 2);
|
||||
|
@ -77,10 +77,10 @@ class FattureCest
|
|||
}
|
||||
|
||||
/**
|
||||
* Crea una nuova fattura di acquisto.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
* Crea una nuova fattura di acquisto.
|
||||
*
|
||||
* @param AcceptanceTester $t
|
||||
*/
|
||||
public function testFatturaDiAcquisto(AcceptanceTester $t)
|
||||
{
|
||||
$this->addFattura($t, false, 1, 3);
|
||||
|
|
Loading…
Reference in New Issue