Fix invoice creation with charges. Fix including discounts in invoices
This commit is contained in:
parent
8a8e299c7b
commit
48a76bacb6
@ -62,8 +62,8 @@ class Charge extends Model
|
|||||||
return sprintf('%s %s',$this->description,$this->getAttribute('attributes') ? join('|',unserialize($this->getAttribute('attributes'))) : '');
|
return sprintf('%s %s',$this->description,$this->getAttribute('attributes') ? join('|',unserialize($this->getAttribute('attributes'))) : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTypeAttribute($value)
|
public function getTypeNameAttribute(): string
|
||||||
{
|
{
|
||||||
return Arr::get(InvoiceItem::type,$value);
|
return Arr::get(InvoiceItem::type,$this->attribute('type'));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -160,7 +160,7 @@ class InvoiceItem extends Model
|
|||||||
*/
|
*/
|
||||||
public function getSubTotalAttribute(): float
|
public function getSubTotalAttribute(): float
|
||||||
{
|
{
|
||||||
return sprintf('%3.2f',$this->quantity * $this->price_base);
|
return sprintf('%3.2f',$this->quantity * $this->price_base - $this->discount_amt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user