feat: cashier/counter reports, service-order & remission flows, Rached migration utils
- Add "Mis cortes de caja" report for cashiers/counters with sales detail. - Cash register history scoped to own cuts for non-admin roles; new /register/<id>/sales endpoint. - Remove dashboard from cashier menu; add Reports to cashier/counter. - Service orders: assign mechanic, budget field, invoice flag, counter/cashier can add items/remissions, convert to remission. - Remission notes module (UI, CSS, courier, counter remissions). - Customer hard-delete and vehicle/customer linkage in workshop. - POS: always show search results, compact payment grid, credit validation, tier pricing (5%/10%), ticket with customer/folio. - Inventory: CSV template with sku_secondary, alias import. - Rached migration scripts and DB migrations. - Version-bump cached JS/CSS query strings. Excludes local Rached session tokens/captures (rached_*.json / rached_*.txt).
This commit is contained in:
37
scripts/test_counter_dashboard.js
Normal file
37
scripts/test_counter_dashboard.js
Normal file
@@ -0,0 +1,37 @@
|
||||
const { chromium } = require('playwright');
|
||||
|
||||
(async () => {
|
||||
const browser = await chromium.launch({ headless: true });
|
||||
const context = await browser.newContext({ baseURL: 'http://localhost:5001', serviceWorkers: 'block' });
|
||||
const page = await context.newPage();
|
||||
const errors = [];
|
||||
page.on('pageerror', e => errors.push('PAGE: ' + e.message));
|
||||
page.on('console', msg => { if (msg.type() === 'error') errors.push('CONSOLE: ' + msg.text()); });
|
||||
page.on('response', res => { if (res.status() >= 400) errors.push(`HTTP ${res.status()}: ${res.url()}`); });
|
||||
|
||||
await page.goto('/pos/login2?tenant=31');
|
||||
await page.waitForSelector('.user-avatar-btn', { timeout: 10000 });
|
||||
await page.click('.user-avatar-btn[data-id="32"]');
|
||||
for (const digit of '1234') await page.click(`.pin-key[data-digit="${digit}"]`);
|
||||
await page.click('#btn-login');
|
||||
await page.waitForURL('**/pos/workshop', { timeout: 10000 });
|
||||
await page.goto('/pos/catalog');
|
||||
await page.waitForTimeout(1500);
|
||||
const info = await page.evaluate(() => ({
|
||||
title: document.title,
|
||||
bodyClass: document.body.className,
|
||||
scripts: Array.from(document.querySelectorAll('script[src]')).map(s => s.src).filter(s => s.includes('sidebar') || s.includes('app-init'))
|
||||
}));
|
||||
console.log('Page info:', JSON.stringify(info, null, 2));
|
||||
await page.screenshot({ path: '/home/Autopartes/data/rached_import/counter_sidebar_catalog.png', fullPage: true });
|
||||
|
||||
// Try dashboard
|
||||
await page.goto('/pos/dashboard');
|
||||
await page.waitForTimeout(1500);
|
||||
await page.screenshot({ path: '/home/Autopartes/data/rached_import/counter_dashboard_redirect.png', fullPage: true });
|
||||
console.log('URL after dashboard:', page.url());
|
||||
|
||||
console.log('Errors:', errors.length);
|
||||
errors.forEach(e => console.log(' -', e));
|
||||
await browser.close();
|
||||
})();
|
||||
Reference in New Issue
Block a user