mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-12 01:00:13 +01:00
34 lines
592 B
PHP
34 lines
592 B
PHP
<?php
|
|
|
|
namespace Modules\DDT\Components;
|
|
|
|
use Common\Components\Discount;
|
|
use Modules\DDT\DDT;
|
|
|
|
class Sconto extends Discount
|
|
{
|
|
use RelationTrait;
|
|
|
|
protected $table = 'dt_righe_ddt';
|
|
|
|
/**
|
|
* Crea una nuovo sconto globale collegato alla ddt, oppure restituisce quello esistente.
|
|
*
|
|
* @param DDT $ddt
|
|
*
|
|
* @return self
|
|
*/
|
|
public static function build(DDT $ddt)
|
|
{
|
|
$model = $ddt->scontoGlobale;
|
|
|
|
if ($model == null) {
|
|
$model = parent::build();
|
|
|
|
$model->setDDT($ddt);
|
|
}
|
|
|
|
return $model;
|
|
}
|
|
}
|