芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/app/Models/InvoiceItems.php
withTrashed(); } public function invoiceItemImage(): HasOne { return $this->hasOne(InvoiceItemImage::class, 'invoice_item_id'); } public function unit(): BelongsTo { return $this->belongsTo(UnitType::class, 'unit_id'); } public function getTaxListAttribute() { $invoiceItem = $this; $taxes = ''; if ($invoiceItem && $invoiceItem->taxes) { $numItems = count(json_decode($invoiceItem->taxes)); if (!is_null($invoiceItem->taxes)) { foreach (json_decode($invoiceItem->taxes) as $index => $tax) { $tax = $this->taxbyid($tax)->first(); $taxes .= $tax->tax_name . ': ' . $tax->rate_percent . '%'; $taxes = ($index + 1 != $numItems) ? $taxes . ', ' : $taxes; } } } return $taxes; } public function invoice(): BelongsTo { return $this->belongsTo(Invoice::class, 'invoice_id'); } }