fixed bill creation & deletion
This commit is contained in:
parent
9757b459fd
commit
5b639c73a0
@ -9,6 +9,7 @@ use App\Http\Requests\Expense\Bill as Request;
|
||||
use App\Http\Requests\Expense\BillAddItem as ItemRequest;
|
||||
use App\Imports\Expenses\Bills as Import;
|
||||
use App\Jobs\Expense\CreateBill;
|
||||
use App\Jobs\Expense\DeleteBill;
|
||||
use App\Jobs\Expense\DuplicateBill;
|
||||
use App\Jobs\Expense\UpdateBill;
|
||||
use App\Models\Banking\Account;
|
||||
|
@ -216,10 +216,10 @@ class Bill extends Model
|
||||
$paid = 0;
|
||||
$reconciled = $reconciled_amount = 0;
|
||||
|
||||
if ($this->payments->count()) {
|
||||
if ($this->transactions->count()) {
|
||||
$currencies = Currency::enabled()->pluck('rate', 'code')->toArray();
|
||||
|
||||
foreach ($this->payments as $item) {
|
||||
foreach ($this->transactions as $item) {
|
||||
if ($this->currency_code == $item->currency_code) {
|
||||
$amount = (double) $item->amount;
|
||||
} else {
|
||||
|
@ -18,7 +18,7 @@ class BillItem extends Model
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['company_id', 'bill_id', 'item_id', 'name', 'price', 'total', 'tax'];
|
||||
protected $fillable = ['company_id', 'bill_id', 'item_id', 'name', 'quantity', 'price', 'total', 'tax'];
|
||||
|
||||
/**
|
||||
* Clonable relationships.
|
||||
|
Loading…
x
Reference in New Issue
Block a user