Merge pull request #2836 from CihanSenturk/Sales-/-Purchases-price-disable-scenario
Scenario of disable sale/purchase price done
This commit is contained in:
commit
aae36e738b
@ -88,6 +88,11 @@ class Item extends Model
|
||||
return $query->where($billing . '_price', '=', null);
|
||||
}
|
||||
|
||||
public function scopePriceType($query, $price_type)
|
||||
{
|
||||
return $query->whereNotNull($price_type . '_price');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the item id.
|
||||
*
|
||||
|
@ -39,9 +39,10 @@ class ItemButton extends Component
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$items = Item::enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
|
||||
$price_type = $this->getPriceType($this->type, $this->isSale, $this->isPurchase);
|
||||
|
||||
$items = Item::priceType($price_type)->enabled()->orderBy('name')->take(setting('default.select_limit'))->get();
|
||||
|
||||
foreach ($items as $item) {
|
||||
$price = $item->{$price_type . '_price'};
|
||||
|
||||
|
@ -315,7 +315,7 @@ export default {
|
||||
},
|
||||
|
||||
async fetchMatchedItems() {
|
||||
await window.axios.get(url + '/common/items?search="' + this.search + '" enabled:1 limit:10')
|
||||
await window.axios.get(url + '/common/items?search="' + this.search + '" not ' + this.price + ':NULL enabled:1 limit:10')
|
||||
.then(response => {
|
||||
this.item_list = [];
|
||||
let items = response.data.data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user