Keep POS retail catalog product-only and raise Pro pricing.
Deploy Ladill POS / deploy (push) Successful in 46s

Retail still reads live CRM products only (not services), products mode follows the acting branch, and suite Pro/Business defaults match the tenfold price update.
This commit is contained in:
isaacclad
2026-07-15 13:54:53 +00:00
parent 7c20cf705a
commit e2b608a506
4 changed files with 12 additions and 9 deletions
@@ -5,7 +5,6 @@ namespace App\Http\Controllers\Pos;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Controllers\Pos\Concerns\ScopesToAccount; use App\Http\Controllers\Pos\Concerns\ScopesToAccount;
use App\Models\PosCategory; use App\Models\PosCategory;
use App\Models\PosLocation;
use App\Models\PosModifierGroup; use App\Models\PosModifierGroup;
use App\Models\PosProduct; use App\Models\PosProduct;
use App\Models\PosSaleLine; use App\Models\PosSaleLine;
@@ -41,6 +40,7 @@ class ProductController extends Controller
} }
$search = trim((string) $request->query('search', '')); $search = trim((string) $request->query('search', ''));
// Live CRM products only (not services) — same filter as the register.
$response = CrmClient::for($this->ownerRef($request))->products([ $response = CrmClient::for($this->ownerRef($request))->products([
'type' => 'product', 'type' => 'product',
'per_page' => 100, 'per_page' => 100,
@@ -190,11 +190,12 @@ class ProductController extends Controller
private function isRestaurant(Request $request): bool private function isRestaurant(Request $request): bool
{ {
return PosLocation::owned($this->ownerRef($request)) // Use the acting branch — not "any restaurant location exists" — so a
->where('service_style', PosLocation::STYLE_RESTAURANT)->exists(); // 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 private function crmPayload(Request $request): array
{ {
$data = $request->validate([ $data = $request->validate([
@@ -84,6 +84,7 @@ class RegisterController extends Controller
} }
try { 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'] ?? []); $rows = (array) (CrmClient::for($owner)->products(['type' => 'product', 'active' => 1, 'per_page' => 500])['data'] ?? []);
} catch (\Throwable) { } catch (\Throwable) {
$rows = []; $rows = [];
+2 -1
View File
@@ -76,9 +76,10 @@ class SubscriptionService
} }
try { try {
// CRM products only (not services). Laravel paginator exposes total at the root.
$response = CrmClient::for($ownerRef)->products(['type' => 'product', 'per_page' => 1]); $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) { } catch (\Throwable) {
return 0; return 0;
} }
+4 -4
View File
@@ -12,15 +12,15 @@ return [
'pro' => [ 'pro' => [
'enabled' => filter_var(env('POS_PRO_ENABLED', true), FILTER_VALIDATE_BOOLEAN), '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'), 'currency' => env('POS_PRO_CURRENCY', 'GHS'),
'period_days' => (int) env('POS_PRO_PERIOD_DAYS', 30), 'period_days' => (int) env('POS_PRO_PERIOD_DAYS', 30),
'grace_days' => (int) env('POS_PRO_GRACE_DAYS', 3), 'grace_days' => (int) env('POS_PRO_GRACE_DAYS', 3),
], ],
'plans' => [ 'plans' => [
'pro' => ['price_minor' => (int) env('POS_PRO_PRICE_MINOR', 7900)], 'pro' => ['price_minor' => (int) env('POS_PRO_PRICE_MINOR', 79000)],
'enterprise' => ['price_minor' => (int) env('POS_ENTERPRISE_PRICE_MINOR', 24900)], 'enterprise' => ['price_minor' => (int) env('POS_ENTERPRISE_PRICE_MINOR', 249000)],
], ],
'prepaid_months' => [6, 12, 24], 'prepaid_months' => [6, 12, 24],
@@ -38,7 +38,7 @@ return [
'upgrade_banner' => [ 'upgrade_banner' => [
'title' => 'Unlock POS Pro or Business', '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', 'route' => 'pos.pro.index',
], ],
]; ];