1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-16 19:40:44 +01:00

Set sconto percentuale di default per documenti

This commit is contained in:
MatteoPistorello 2023-05-23 16:31:08 +02:00
parent b9009b944c
commit d8820523a0

View File

@ -145,7 +145,7 @@ abstract class Accounting extends Component
*/ */
public function getTipoScontoAttribute() public function getTipoScontoAttribute()
{ {
return $this->sconto_percentuale ? 'PRC' : 'UNT'; return $this->sconto_percentuale ? 'PRC' : ($this->sconto ? 'UNT' : 'PRC');
} }
/** /**
@ -463,7 +463,7 @@ abstract class Accounting extends Component
protected function fixSconto() protected function fixSconto()
{ {
$this->attributes['sconto'] = $this->sconto; $this->attributes['sconto'] = $this->sconto;
$this->attributes['tipo_sconto'] = $this->sconto_percentuale ? 'PRC' : 'UNT'; $this->attributes['tipo_sconto'] = $this->sconto_percentuale ? 'PRC' : ($this->sconto ? 'UNT' : 'PRC');
} }
/** /**