2018-05-04 17:57:46 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
include_once __DIR__.'/../../core.php';
|
|
|
|
|
2018-06-23 18:35:08 +02:00
|
|
|
?><form action="" method="post" id="add-form">
|
2018-05-04 17:57:46 +02:00
|
|
|
<input type="hidden" name="op" value="add">
|
|
|
|
<input type="hidden" name="backto" value="record-edit">
|
|
|
|
|
|
|
|
<div class="row">
|
2019-04-11 16:04:08 +02:00
|
|
|
<div class="col-md-5">
|
|
|
|
{[ "type": "text", "label": "<?php echo tr('Nome'); ?>", "name": "nome", "required": 1 ]}
|
|
|
|
</div>
|
|
|
|
<div class="col-md-7">
|
|
|
|
{[ "type": "text", "label": "<?php echo tr('Causale'); ?>", "name": "descrizione", "required": 1 ]}
|
2018-05-04 17:57:46 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
// Salvo l'elenco conti in un array (per non fare il ciclo ad ogni riga)
|
|
|
|
|
|
|
|
/*
|
|
|
|
Form di aggiunta riga movimento
|
|
|
|
*/
|
|
|
|
echo '
|
|
|
|
<table class="table table-striped table-condensed table-hover table-bordered"
|
|
|
|
<tr>
|
|
|
|
<th>'.tr('Conto').'</th>
|
|
|
|
</tr>';
|
|
|
|
|
|
|
|
for ($i = 0; $i < 10; ++$i) {
|
2018-06-23 18:35:08 +02:00
|
|
|
$required = ($i <= 1) ? 1 : 0;
|
|
|
|
|
|
|
|
// Conto
|
2018-05-04 17:57:46 +02:00
|
|
|
echo '
|
|
|
|
<tr>
|
|
|
|
<td>
|
2018-06-23 18:35:08 +02:00
|
|
|
{[ "type": "select", "name": "idconto['.$i.']", "ajax-source": "conti", "required": "'.$required.'" ]}
|
|
|
|
</td>
|
2018-05-04 17:57:46 +02:00
|
|
|
</tr>';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '
|
|
|
|
</table>';
|
2019-04-11 16:04:08 +02:00
|
|
|
|
2019-04-12 01:11:32 +02:00
|
|
|
// Variabili utilizzabili
|
|
|
|
$variables = include Modules::filepath(Modules::get('Fatture di vendita')['id'], 'variables.php');
|
2019-04-11 16:04:08 +02:00
|
|
|
|
2019-04-12 01:11:32 +02:00
|
|
|
echo '
|
2019-04-11 16:04:08 +02:00
|
|
|
<!-- Istruzioni per il contenuto -->
|
|
|
|
<div class="box box-info">
|
|
|
|
<div class="box-body">';
|
|
|
|
|
2019-04-12 01:11:32 +02:00
|
|
|
if (!empty($variables)) {
|
|
|
|
echo '
|
2019-04-11 16:04:08 +02:00
|
|
|
<p>'.tr("Puoi utilizzare le seguenti sequenze di testo all'interno del campo causale, verranno sostituite in fase generazione prima nota dalla fattura.").':</p>
|
|
|
|
<ul>';
|
|
|
|
|
2019-04-12 01:11:32 +02:00
|
|
|
foreach ($variables as $variable => $value) {
|
|
|
|
echo '
|
2019-04-11 16:04:08 +02:00
|
|
|
<li><code>{'.$variable.'}</code></li>';
|
2019-04-12 01:11:32 +02:00
|
|
|
}
|
2019-04-11 16:04:08 +02:00
|
|
|
|
2019-04-12 01:11:32 +02:00
|
|
|
echo '
|
2019-04-11 16:04:08 +02:00
|
|
|
</ul>';
|
2019-04-12 01:11:32 +02:00
|
|
|
} else {
|
|
|
|
echo '
|
2019-04-11 16:04:08 +02:00
|
|
|
<p><i class="fa fa-warning"></i> '.tr('Non sono state definite variabili da utilizzare nel template').'.</p>';
|
2019-04-12 01:11:32 +02:00
|
|
|
}
|
2019-04-11 16:04:08 +02:00
|
|
|
|
2019-04-12 01:11:32 +02:00
|
|
|
echo '
|
2019-04-11 16:04:08 +02:00
|
|
|
</div>
|
|
|
|
</div>';
|
|
|
|
?>
|
2018-05-04 17:57:46 +02:00
|
|
|
|
|
|
|
<!-- PULSANTI -->
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-12 text-right">
|
|
|
|
<button type="submit" class="btn btn-primary"><i class="fa fa-plus"></i> <?php echo tr('Aggiungi'); ?></button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|