1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-22 13:26:38 +01:00

Conto predefinito banche solo da 'Stato patrimoniale' -> 'Cassa e banche'

This commit is contained in:
Luca 2018-04-03 15:15:15 +02:00
parent 5e0d9867a7
commit 1a9ae02523
4 changed files with 31 additions and 10 deletions

View File

@ -21,6 +21,25 @@ foreach ($variables as $key => $value) {
$body = str_replace(array_keys($replaces), array_values($replaces), $body);
$subject = str_replace(array_keys($replaces), array_values($replaces), $subject);
//Campi mancanti
$rs2 = $dbo->fetchArray('SELECT from_address, server, port FROM zz_smtp WHERE id='.prepare($template['id_smtp']));
$campi_mancanti = [];
if ($rs2[0]['from_address'] == '') {
array_push($campi_mancanti, 'Mittente');
}
if ($rs2[0]['server'] == '') {
array_push($campi_mancanti, 'Server SMTP');
}
if ($rs2[0]['port'] == '') {
array_push($campi_mancanti, 'Porta');
}
if (sizeof($campi_mancanti) > 0) {
echo "<div class='alert alert-warning'><i class='fa fa-warning'></i> Prima di procedere all'invio completa: <b>".implode(', ', $campi_mancanti).'</b><br/>
'.Modules::link('Gestione email', $template['id_smtp'], tr('Vai alla scheda account email'), null).'</div>';
}
// Form
echo '
<form action="" method="post" id="email-form">

View File

@ -35,7 +35,11 @@ switch (filter('op')) {
if (isset($nome)) {
$dbo->query('INSERT INTO `co_banche` (`nome`) VALUES ('.prepare($nome).')');
$id_record = $dbo->lastInsertedID();
if (isAjaxRequest()) {
echo json_encode(['id' => $id_record, 'text' => $nome]);
}
$_SESSION['infos'][] = tr('Aggiunta nuova _TYPE_', [
'_TYPE_' => 'banca',
]);
@ -44,10 +48,6 @@ switch (filter('op')) {
}
if (isAjaxRequest()) {
echo json_encode(['id' => $id_record, 'text' => $nome]);
}
break;
case 'delete':

View File

@ -24,7 +24,7 @@ include_once __DIR__.'/../../core.php';
{[ "type": "text", "label": "<?php echo tr('Filiale'); ?>", "name": "filiale", "value": "$filiale$" ]}
</div>
<div class="col-md-4">
{[ "type": "select", "label": "<?php echo tr('Conto predefinito'); ?>", "name": "id_pianodeiconti3", "value": "$id_pianodeiconti3$", "ajax-source": "conti" ]}
{[ "type": "select", "label": "<?php echo tr('Conto predefinito'); ?>", "name": "id_pianodeiconti3", "value": "$id_pianodeiconti3$", "values": "query=SELECT id, descrizione FROM co_pianodeiconti3 WHERE idpianodeiconti2 = 1" ]}
</div>
</div>

View File

@ -37,13 +37,15 @@ switch (post('op')) {
$dbo->query($query);
$id_record = $dbo->lastInsertedID();
if (isAjaxRequest()) {
echo json_encode(['id' => $id_record, 'text' => $nome.' - '.$descrizione]);
}
$_SESSION['infos'][] = tr('Aggiunta una nuova zona!');
}
if (isAjaxRequest()) {
echo json_encode(['id' => $id_record, 'text' => $nome.' - '.$descrizione]);
}
break;