invoice fx
This commit is contained in:
parent
dfd9137205
commit
235e36a76c
|
|
@ -41,14 +41,16 @@ class FilterOptions extends \Webkul\RestApi\Http\Controllers\V1\Shop\ResourceCon
|
|||
|
||||
public function allResources(Request $request)
|
||||
{
|
||||
$query = $this->getRepositoryInstance()->where('attribute_options.attribute_id',$request->get('attribute_id'));
|
||||
|
||||
$query->whereIn('attribute_options.id',function ($q) {
|
||||
$query = $this->getRepositoryInstance()
|
||||
->where('attribute_options.attribute_id',$request->get('attribute_id'))
|
||||
->whereIn('attribute_options.id',function ($q) {
|
||||
$q->distinct()->select('integer_value')
|
||||
->from('product_attribute_values')
|
||||
->whereNotNull('product_attribute_values.integer_value');
|
||||
|
||||
if(request()->has('category')){
|
||||
// $q->join('product_categories','product_attribute_values.product_id','=','product_categories.product_id')
|
||||
// ->where('product_categories.category_id',request()->get('category'));
|
||||
$q->whereIn('product_attribute_values.product_id',function ($q) {
|
||||
$q->select('product_categories.product_id')->from('product_categories')
|
||||
->where('product_categories.category_id',request()->get('category'));
|
||||
|
|
@ -79,7 +81,7 @@ class FilterOptions extends \Webkul\RestApi\Http\Controllers\V1\Shop\ResourceCon
|
|||
|
||||
// Log::info($query->toSql());
|
||||
if (is_null($request->input('pagination')) || $request->input('pagination')) {
|
||||
$results = $query->paginate($request->input('limit') ?? 10);
|
||||
$results = $query->paginate($request->input('limit') ?? 20);
|
||||
} else {
|
||||
$results = $query->get();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,39 @@
|
|||
|
||||
namespace Sarga\Admin\Http\Controllers;
|
||||
|
||||
use Sarga\Shop\Repositories\OrderItemRepository;
|
||||
use Sarga\Shop\Repositories\OrderRepository;
|
||||
use Webkul\Admin\Http\Controllers\Sales\ShipmentController;
|
||||
use Webkul\Sales\Repositories\ShipmentRepository;
|
||||
|
||||
class Shipments extends ShipmentController
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param \Webkul\Sales\Repositories\ShipmentRepository $shipmentRepository
|
||||
* @param \Webkul\Sales\Repositories\OrderRepository $orderRepository
|
||||
* @param \Webkul\Sales\Repositories\OrderitemRepository $orderItemRepository
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
ShipmentRepository $shipmentRepository,
|
||||
OrderRepository $orderRepository,
|
||||
OrderItemRepository $orderItemRepository
|
||||
)
|
||||
{
|
||||
$this->_config = request('_config');
|
||||
$this->shipmentRepository = $shipmentRepository;
|
||||
$this->orderRepository = $orderRepository;
|
||||
$this->orderItemRepository = $orderItemRepository;
|
||||
}
|
||||
public function isInventoryValidate(&$data){
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Sarga\Admin\Http\Controllers\Invoices;
|
||||
use Sarga\Admin\Http\Controllers\Shipments;
|
||||
|
||||
/**
|
||||
* Sales routes.
|
||||
|
|
@ -56,5 +57,24 @@ Route::group(['middleware' => ['web', 'admin'], 'prefix' => config('app.admin_ur
|
|||
|
||||
Route::get('/invoices/{id}/transactions', [Invoices::class, 'invoiceTransactions'])
|
||||
->name('admin.sales.invoices.transactions');
|
||||
|
||||
/**
|
||||
* Shipments routes.
|
||||
*/
|
||||
Route::get('/shipments', [Shipments::class, 'index'])->defaults('_config', [
|
||||
'view' => 'admin::sales.shipments.index',
|
||||
])->name('admin.sales.shipments.index');
|
||||
|
||||
Route::get('/shipments/create/{order_id}', [Shipments::class, 'create'])->defaults('_config', [
|
||||
'view' => 'admin::sales.shipments.create',
|
||||
])->name('admin.sales.shipments.create');
|
||||
|
||||
Route::post('/shipments/create/{order_id}', [Shipments::class, 'store'])->defaults('_config', [
|
||||
'redirect' => 'admin.sales.orders.view',
|
||||
])->name('admin.sales.shipments.store');
|
||||
|
||||
Route::get('/shipments/view/{id}', [Shipments::class, 'view'])->defaults('_config', [
|
||||
'view' => 'admin::sales.shipments.view',
|
||||
])->name('admin.sales.shipments.view');
|
||||
});
|
||||
});
|
||||
|
|
@ -11,13 +11,14 @@ class Order extends \Webkul\Sales\Models\Order implements \Sarga\Shop\Contracts\
|
|||
protected $statusLabel = [
|
||||
self::STATUS_PENDING => 'Pending',
|
||||
self::STATUS_PENDING_PAYMENT => 'Pending Payment',
|
||||
self::STATUS_PURCHASE => 'Accepted',
|
||||
self::STATUS_SHIPPING => 'Shipping',
|
||||
self::STATUS_PROCESSING => 'Arrived',
|
||||
self::STATUS_COMPLETED => 'Completed',
|
||||
self::STATUS_CANCELED => 'Canceled',
|
||||
self::STATUS_CLOSED => 'Closed',
|
||||
self::STATUS_FRAUD => 'Fraud',
|
||||
self::STATUS_PURCHASE => 'Purchasing',
|
||||
self::STATUS_SHIPPING => 'Shipping',
|
||||
|
||||
];
|
||||
|
||||
public function canSendShip(){
|
||||
|
|
|
|||
Loading…
Reference in New Issue