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