This commit is contained in:
2018-01-31 11:10:17 +01:00
parent f3bf0c9f80
commit 05c165c9ed
27 changed files with 724 additions and 265 deletions
+17
View File
@@ -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;
}
}