Rechnungen + Gutschriften

This commit is contained in:
Kevin Adametz 2021-03-31 17:58:25 +02:00
parent 39ef16686a
commit 35ae3da244
33 changed files with 2834 additions and 34 deletions

View file

@ -93,6 +93,10 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereSubtotalShipping($value)
* @property string|null $total_without_credit
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereTotalWithoutCredit($value)
* @property array|null $invoice
* @property \Illuminate\Support\Carbon|null $shipped_at
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereInvoice($value)
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrder whereShippedAt($value)
*/
class ShoppingOrder extends Model
{
@ -127,12 +131,14 @@ class ShoppingOrder extends Model
'wp_notice',
'mode',
'shipped',
'shipped_at',
'tracking'
];
protected $casts = [
'wp_notice' => 'array',
'invoice' => 'array',
'shipped_at' => 'datetime',
];
public static $shippedTypes = [
@ -159,9 +165,6 @@ class ShoppingOrder extends Model
10 => 'danger',
];
public function shopping_user()
{
return $this->belongsTo('App\Models\ShoppingUser','shopping_user_id');
@ -298,9 +301,6 @@ class ShoppingOrder extends Model
return formatNumber($this->attributes['total_shipping']);
}
public function getItemsCount(){
$count = 0;
if($this->shopping_order_items){