Keep POS retail catalog product-only and raise Pro pricing.
Deploy Ladill POS / deploy (push) Successful in 46s
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:
@@ -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([
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user