| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- class ReceiptRow extends Model
- {
- use HasFactory;
- protected $table = 'receipts_rows';
- protected $fillable = [
- 'receip_id',
- 'causal_id',
- 'when',
- 'amount',
- 'note',
- 'commercial',
- 'aliquota_iva',
- 'imponibile',
- 'imposta',
- 'divisa',
- 'numero_linea',
- 'prezzo_unitario',
- 'quantita'
- ];
- protected $casts = [
- 'when' => 'json',
- 'aliquota_iva' => 'decimal:2',
- 'imponibile' => 'decimal:2',
- 'imposta' => 'decimal:2',
- 'prezzo_unitario' => 'decimal:2',
- 'quantita' => 'decimal:2',
- ];
- public function causal()
- {
- return $this->belongsTo(Causal::class);
- }
- public function receipt()
- {
- return $this->belongsTo(Receipt::class, 'receip_id', 'id');
- }
- }
|