1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-10 00:20:51 +01:00

Impostazione preventivo in bozza dopo creazione revisione

This commit is contained in:
Fabio Lovato 2020-04-01 16:37:22 +02:00
parent 5e6d376332
commit e215a19641
2 changed files with 7 additions and 1 deletions

View File

@ -69,7 +69,7 @@ switch (post('op')) {
// Copia del preventivo // Copia del preventivo
$new = $preventivo->replicate(); $new = $preventivo->replicate();
$new->numero = Preventivo::getNextNumero($new->data_bozza); $new->numero = Preventivo::getNextNumero($new->data_bozza);
$new->idstato = 1; $new->stato = 'Bozza';
$new->save(); $new->save();
$new->master_revision = $new->id; $new->master_revision = $new->id;
@ -262,6 +262,7 @@ switch (post('op')) {
// Copia del preventivo // Copia del preventivo
$new = $preventivo->replicate(); $new = $preventivo->replicate();
$new->stato = 'Bozza';
$new->save(); $new->save();
$new->default_revision = 1; $new->default_revision = 1;

View File

@ -264,4 +264,9 @@ class Preventivo extends Document
{ {
return $this->data_bozza; return $this->data_bozza;
} }
public function setStatoAttribute($stato)
{
$this->idstato = Stato::where('descrizione', $stato)->first()['id'];
}
} }