close #1845 Fixed: Wrong price when creating bills
This commit is contained in:
parent
8211a6ce43
commit
8cc2aeb9b9
@ -36,7 +36,7 @@ class SelectItemButton extends Component
|
|||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
$items = Item::enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
|
$items = Item::enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
|
||||||
$price_type= $this->getPriceType($this->type, $this->isSale, $this->isPurchase);
|
$price_type = $this->getPriceType($this->type, $this->isSale, $this->isPurchase);
|
||||||
|
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
$price = $item->{$price_type . '_price'};
|
$price = $item->{$price_type . '_price'};
|
||||||
@ -44,7 +44,7 @@ class SelectItemButton extends Component
|
|||||||
$item->price = $price;
|
$item->price = $price;
|
||||||
}
|
}
|
||||||
|
|
||||||
$price = ($this->isPurchase) ? 'purchase_price' : 'sale_price';
|
$price = $price_type . '_price';
|
||||||
|
|
||||||
return view('components.select-item-button', compact('items', 'price'));
|
return view('components.select-item-button', compact('items', 'price'));
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ class SelectItemButton extends Component
|
|||||||
return 'sale';
|
return 'sale';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($is_sale)) {
|
if (!empty($is_purchase)) {
|
||||||
return 'purchase';
|
return 'purchase';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,6 +65,8 @@
|
|||||||
hide-discount="{{ $hideDiscount }}"
|
hide-discount="{{ $hideDiscount }}"
|
||||||
hide-amount="{{ $hideAmount }}"
|
hide-amount="{{ $hideAmount }}"
|
||||||
text-amount="{{ $textAmount }}"
|
text-amount="{{ $textAmount }}"
|
||||||
|
is-sale-price="{{ $isSalePrice }}"
|
||||||
|
is-purchase-price="{{ $isPurchasePrice }}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@if (!$hideFooter)
|
@if (!$hideFooter)
|
||||||
|
@ -42,6 +42,8 @@
|
|||||||
hide-discount="{{ $hideDiscount }}"
|
hide-discount="{{ $hideDiscount }}"
|
||||||
hide-amount="{{ $hideAmount }}"
|
hide-amount="{{ $hideAmount }}"
|
||||||
text-amount="{{ $textAmount }}"
|
text-amount="{{ $textAmount }}"
|
||||||
|
is-sale-price="{{ $isSalePrice }}"
|
||||||
|
is-purchase-price="{{ $isPurchasePrice }}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<x-documents.form.totals
|
<x-documents.form.totals
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
@section('title', trans('general.title.new', ['type' => setting('bill.title', trans_choice('general.bills', 1))]))
|
@section('title', trans('general.title.new', ['type' => setting('bill.title', trans_choice('general.bills', 1))]))
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<x-documents.form.content type="bill" hide-company hide-footer hide-edit-item-columns />
|
<x-documents.form.content type="bill" hide-company hide-footer hide-edit-item-columns is-purchase-price />
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@push('scripts_start')
|
@push('scripts_start')
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
@section('title', trans('general.title.edit', ['type' => trans_choice('general.bills', 1)]))
|
@section('title', trans('general.title.edit', ['type' => trans_choice('general.bills', 1)]))
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<x-documents.form.content type="bill" :document="$bill" hide-company hide-footer hide-edit-item-columns />
|
<x-documents.form.content type="bill" :document="$bill" hide-company hide-footer hide-edit-item-columns is-purchase-price />
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@push('scripts_start')
|
@push('scripts_start')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user