diff --git a/app/Console/Commands/ResetCommand.php b/app/Console/Commands/ResetCommand.php index 8a506b438..e21e489d8 100755 --- a/app/Console/Commands/ResetCommand.php +++ b/app/Console/Commands/ResetCommand.php @@ -60,13 +60,6 @@ public function __construct( */ public function handle() { - if ( $this->option( 'user' ) === 'default' ) { - $user = Role::namespace( 'admin' )->users->first(); - Auth::loginUsingId( $user->id ); - } else { - Auth::loginUsingId( $this->option( 'user' ) ); - } - switch( $this->option( 'mode' ) ) { case 'soft': return $this->softReset(); @@ -76,12 +69,23 @@ public function handle() break; case 'grocery': $this->softReset(); + $this->initializeRole(); $this->demoService->run(); $this->info( __( 'The demo has been enabled.' ) ); break; } } + private function initializeRole() + { + if ( $this->option( 'user' ) === 'default' ) { + $user = Role::namespace( 'admin' )->users->first(); + Auth::loginUsingId( $user->id ); + } else { + Auth::loginUsingId( $this->option( 'user' ) ); + } + } + /** * Proceed hard reset * @return void diff --git a/app/Http/Controllers/Dashboard/CategoryController.php b/app/Http/Controllers/Dashboard/CategoryController.php index d9891d11b..2b571c91d 100755 --- a/app/Http/Controllers/Dashboard/CategoryController.php +++ b/app/Http/Controllers/Dashboard/CategoryController.php @@ -223,7 +223,14 @@ public function getCategories( $id = '0' ) ->with( 'galleries' ) ->searchable() ->trackingDisabled() - ->get(), + ->get() + ->map( function( $product ) { + if ( $product->unit_quantities()->count() === 1 ) { + $product->load( 'unit_quantities.unit' ); + } + + return $product; + }), 'categories' => $category ->subCategories() ->displayOnPOS() diff --git a/app/Services/MenuService.php b/app/Services/MenuService.php index f27e8e986..be78d8217 100755 --- a/app/Services/MenuService.php +++ b/app/Services/MenuService.php @@ -350,6 +350,7 @@ public function buildMenus() 'nexopos.reports.yearly', 'nexopos.reports.customers', 'nexopos.reports.inventory', + 'nexopos.reports.payment-types', ], 'childrens' => [ 'sales' => [ diff --git a/resources/ts/pages/dashboard/pos/ns-pos-grid.vue b/resources/ts/pages/dashboard/pos/ns-pos-grid.vue index 216f12068..9b55657e2 100755 --- a/resources/ts/pages/dashboard/pos/ns-pos-grid.vue +++ b/resources/ts/pages/dashboard/pos/ns-pos-grid.vue @@ -69,8 +69,9 @@ diff --git a/resources/ts/popups/ns-pos-units.vue b/resources/ts/popups/ns-pos-units.vue index 505828ab4..e096671fb 100755 --- a/resources/ts/popups/ns-pos-units.vue +++ b/resources/ts/popups/ns-pos-units.vue @@ -1,20 +1,22 @@