Invoice report
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 07/03/2018
|
||||
* Time: 09:24
|
||||
*/
|
||||
|
||||
class Forecast extends BaseModel {
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo( 'Project' );
|
||||
}
|
||||
|
||||
public static function saveForecast( $forecastID, $forecast )
|
||||
{
|
||||
$forecast = (array) $forecast;
|
||||
|
||||
if ( $forecastID == 0 )
|
||||
{
|
||||
$forecast = self::create( $forecast );
|
||||
$forecastID = $forecast['id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
self::whereId( $forecastID )->update( $forecast );
|
||||
}
|
||||
|
||||
return $forecastID;
|
||||
}
|
||||
|
||||
public static function removeForecast( $forecastID )
|
||||
{
|
||||
Forecast::whereId( $forecastID )->delete();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user