diff --git a/app/Http/Controllers/Pos/ProductController.php b/app/Http/Controllers/Pos/ProductController.php index 1d5fd10..439e0ea 100644 --- a/app/Http/Controllers/Pos/ProductController.php +++ b/app/Http/Controllers/Pos/ProductController.php @@ -5,7 +5,6 @@ namespace App\Http\Controllers\Pos; use App\Http\Controllers\Controller; use App\Http\Controllers\Pos\Concerns\ScopesToAccount; use App\Models\PosCategory; -use App\Models\PosLocation; use App\Models\PosModifierGroup; use App\Models\PosProduct; use App\Models\PosSaleLine; @@ -41,6 +40,7 @@ class ProductController extends Controller } $search = trim((string) $request->query('search', '')); + // Live CRM products only (not services) — same filter as the register. $response = CrmClient::for($this->ownerRef($request))->products([ 'type' => 'product', 'per_page' => 100, @@ -190,11 +190,12 @@ class ProductController extends Controller private function isRestaurant(Request $request): bool { - return PosLocation::owned($this->ownerRef($request)) - ->where('service_style', PosLocation::STYLE_RESTAURANT)->exists(); + // Use the acting branch — not "any restaurant location exists" — so a + // retail register still sees the live CRM product catalog. + return $this->location($request)->isRestaurant(); } - /** Retail: payload for the CRM products API. */ + /** Retail: payload for the CRM products API (always type=product for POS). */ private function crmPayload(Request $request): array { $data = $request->validate([ diff --git a/app/Http/Controllers/Pos/RegisterController.php b/app/Http/Controllers/Pos/RegisterController.php index 9e00af4..2231f67 100644 --- a/app/Http/Controllers/Pos/RegisterController.php +++ b/app/Http/Controllers/Pos/RegisterController.php @@ -84,6 +84,7 @@ class RegisterController extends Controller } try { + // Retail POS sells goods only — CRM services stay in Invoice/CRM, not the till. $rows = (array) (CrmClient::for($owner)->products(['type' => 'product', 'active' => 1, 'per_page' => 500])['data'] ?? []); } catch (\Throwable) { $rows = []; diff --git a/app/Services/Pos/SubscriptionService.php b/app/Services/Pos/SubscriptionService.php index 1dfcee4..a00f885 100644 --- a/app/Services/Pos/SubscriptionService.php +++ b/app/Services/Pos/SubscriptionService.php @@ -76,9 +76,10 @@ class SubscriptionService } try { + // CRM products only (not services). Laravel paginator exposes total at the root. $response = CrmClient::for($ownerRef)->products(['type' => 'product', 'per_page' => 1]); - return (int) ($response['meta']['total'] ?? count((array) ($response['data'] ?? []))); + return (int) ($response['total'] ?? $response['meta']['total'] ?? count((array) ($response['data'] ?? []))); } catch (\Throwable) { return 0; } diff --git a/config/pos.php b/config/pos.php index 964bbad..8daa1af 100644 --- a/config/pos.php +++ b/config/pos.php @@ -12,15 +12,15 @@ return [ 'pro' => [ 'enabled' => filter_var(env('POS_PRO_ENABLED', true), FILTER_VALIDATE_BOOLEAN), - 'price_minor' => (int) env('POS_PRO_PRICE_MINOR', 7900), + 'price_minor' => (int) env('POS_PRO_PRICE_MINOR', 79000), 'currency' => env('POS_PRO_CURRENCY', 'GHS'), 'period_days' => (int) env('POS_PRO_PERIOD_DAYS', 30), 'grace_days' => (int) env('POS_PRO_GRACE_DAYS', 3), ], 'plans' => [ - 'pro' => ['price_minor' => (int) env('POS_PRO_PRICE_MINOR', 7900)], - 'enterprise' => ['price_minor' => (int) env('POS_ENTERPRISE_PRICE_MINOR', 24900)], + 'pro' => ['price_minor' => (int) env('POS_PRO_PRICE_MINOR', 79000)], + 'enterprise' => ['price_minor' => (int) env('POS_ENTERPRISE_PRICE_MINOR', 249000)], ], 'prepaid_months' => [6, 12, 24], @@ -38,7 +38,7 @@ return [ 'upgrade_banner' => [ 'title' => 'Unlock POS Pro or Business', - 'description' => 'Unlimited registers & catalog, stock tracking & ecosystem sync — from GHS 79/mo.', + 'description' => 'Unlimited registers & catalog, stock tracking & ecosystem sync — from GHS 790/mo.', 'route' => 'pos.pro.index', ], ];