Diversen
This commit is contained in:
@@ -22,4 +22,21 @@ class Invoice extends BaseModel {
|
||||
{
|
||||
return $this->belongsTo( 'Vat' );
|
||||
}
|
||||
|
||||
public static function saveInvoice( $invoiceID, $invoice )
|
||||
{
|
||||
$invoice = (array) $invoice;
|
||||
|
||||
if ( $invoiceID == 0 )
|
||||
{
|
||||
$invoice = Invoice::create( $invoice );
|
||||
$invoiceID = $invoice['id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
Invoice::whereId( $invoiceID )->update( $invoice );
|
||||
}
|
||||
|
||||
return $invoiceID;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user