File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -357,6 +357,28 @@ public function interventi()
357357 return $ this ->hasMany (Intervento::class, 'idanagrafica ' );
358358 }
359359
360+ public function pianoScontoVendite ()
361+ {
362+ return $ this ->belongsTo (\Modules \PianiSconto \PianoSconto::class, 'id_piano_sconto_vendite ' );
363+ }
364+
365+ public function pianoScontoAcquisti ()
366+ {
367+ return $ this ->belongsTo (\Modules \PianiSconto \PianoSconto::class, 'id_piano_sconto_acquisti ' );
368+ }
369+
370+ /**
371+ * Restituisce il piano di sconto in base alla direzione.
372+ *
373+ * @param string $dir
374+ *
375+ * @return \Modules\PianiSconto\PianoSconto|null
376+ */
377+ public function pianoSconto ($ dir )
378+ {
379+ return ($ dir == 'entrata ' ) ? $ this ->pianoScontoVendite : $ this ->pianoScontoAcquisti ;
380+ }
381+
360382 // Metodi statici
361383
362384 /**
You can’t perform that action at this time.
0 commit comments