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:
parent
5e6d376332
commit
e215a19641
@ -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;
|
||||||
|
@ -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'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user