1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-21 14:00:53 +01:00
This commit is contained in:
MatteoPistorello 2023-11-17 17:27:33 +01:00
commit 41cdce5f1b
7 changed files with 16 additions and 8 deletions

View File

@ -28,7 +28,7 @@ $op = filter('op');
switch ($op) { switch ($op) {
case 'login': case 'login':
$username = post('username'); $username = post('username');
$password = post('password'); $password = $_POST['password'];
if ($dbo->isConnected() && $dbo->isInstalled() && auth()->attempt($username, $password)) { if ($dbo->isConnected() && $dbo->isInstalled() && auth()->attempt($username, $password)) {
$_SESSION['keep_alive'] = true; $_SESSION['keep_alive'] = true;

View File

@ -265,7 +265,7 @@ $query .= ' ORDER BY descrizione';
<!-- TODO: da nascondere per le fatture di vendita in quanto questa data sarà sempre uguale alla data di emissione --> <!-- TODO: da nascondere per le fatture di vendita in quanto questa data sarà sempre uguale alla data di emissione -->
<div class="col-md-2" <?php echo ($is_fiscale) ? '' : 'hidden'; ?>> <div class="col-md-2" <?php echo ($is_fiscale) ? '' : 'hidden'; ?>>
{[ "type": "date", "class":"<?php echo (dateFormat($fattura->data_competenza) <= dateFormat($fattura->data)) ? 'unblockable' : ''; ?>", "label": "<?php echo tr('Data competenza'); ?>", "name": "data_competenza", "required": 1, "value": "$data_competenza$", "min-date": "$data$", "help": "<?php echo tr('Data nella quale considerare il movimento contabile, che può essere posticipato rispetto la data della fattura'); ?>" ]} {[ "type": "date", "class":"unblockable", "label": "<?php echo tr('Data competenza'); ?>", "name": "data_competenza", "required": 1, "value": "$data_competenza$", "min-date": "$data$", "help": "<?php echo tr('Data nella quale considerare il movimento contabile, che può essere posticipato rispetto la data della fattura'); ?>" ]}
</div> </div>
<?php <?php

View File

@ -625,6 +625,14 @@ class Fattura extends Document
$this->movimentiContabili()->delete(); $this->movimentiContabili()->delete();
} }
if ($this->changes['data_competenza'] && !in_array($this->stato['descrizione'], ['Bozza', 'Annullata'])) {
$movimenti = Movimento::where('iddocumento', $this->id)->where('primanota', 0)->get();
foreach ($movimenti as $movimento) {
$movimento->data = $this->data_competenza;
$movimento->save();
}
}
// Operazioni sulla dichiarazione d'intento // Operazioni sulla dichiarazione d'intento
if (!empty($dichiarazione_precedente) && $dichiarazione_precedente->id != $this->id_dichiarazione_intento) { if (!empty($dichiarazione_precedente) && $dichiarazione_precedente->id != $this->id_dichiarazione_intento) {
// Correzione dichiarazione precedente // Correzione dichiarazione precedente

View File

@ -53,7 +53,7 @@ switch (filter('op')) {
'server' => post('server'), 'server' => post('server'),
'port' => post('port'), 'port' => post('port'),
'username' => post('username'), 'username' => post('username'),
'password' => post('password'), 'password' => $_POST['password'],
'from_name' => post('from_name'), 'from_name' => post('from_name'),
'from_address' => post('from_address'), 'from_address' => post('from_address'),
'encryption' => post('encryption'), 'encryption' => post('encryption'),

View File

@ -57,7 +57,7 @@ switch (filter('op')) {
case 'update_user': case 'update_user':
$username = filter('username'); $username = filter('username');
$email = filter('email'); $email = filter('email');
$password = filter('password'); $password = $_POST['password'];
$id_utente = filter('id_utente'); $id_utente = filter('id_utente');
if ($dbo->fetchNum('SELECT username FROM zz_users WHERE id != '.prepare($id_utente).' AND username='.prepare($username)) == 0) { if ($dbo->fetchNum('SELECT username FROM zz_users WHERE id != '.prepare($id_utente).' AND username='.prepare($username)) == 0) {
@ -114,7 +114,7 @@ switch (filter('op')) {
// Aggiunta di un nuovo utente // Aggiunta di un nuovo utente
case 'self_update': case 'self_update':
$password = filter('password'); $password = filter('password', null, true);
$utente = Auth::user(); $utente = Auth::user();