سامانه صدور فاکتور و حسابداری
fix(settings): restore saved keyboard preferences after login
davoodmehraban89 committed
Oct 24, 2026 at 07:01 UTC
e653499c0a52bb0dd86ae7bd468f7d0bc3be0ede
5 files changed
+102
-5
PROJECT_STATE.md
+10
@@ -38,3 +38,13 @@
38
### 2026-10-16 Phase 0 post-merge Chromium intermittent fixture (QA-only follow-up; NOT application defect proven)
39
- **Original Phase 0 PR:** #160 merged exact-main `67be4fbfa6161156b10ce6279445266c989e97d3`. PR-head Quality `38867730181` 123/123 Chromium PASS, isolated DB and Security PASS. Protected main Quality `38868319174` attempt 1 **FAIL 122/123** at `scripts/phase0-invoice-persistence.spec.js:52`, `#auth-screen` remained visible for 5 seconds; all three DB jobs and Security `38868319200` succeeded. Same-SHA failed-job rerun attempt 2 was requested; result must be verified separately. Neither result proves actual production financial persistence or login failure.
40
- **Source-reproduced test harness race:** `authenticatedMockBrowser` waits only for `enterApp`, `commitSaveInvoice`, `pullAll` functions before installing a fake authenticated identity; asynchronously loaded `organization-rbac` wrapper can supersede the fake identity. Prior `scripts/accounting-document-workflow.spec.js:36–43` already fixes the identical fixture ordering issue by waiting for `FinoraStartupStatus.extensionsReady`, zero failed extensions, and `authChecked`. Apply the same pre-mock readiness condition **only in this synthetic invoice test**; preserve all UI, Supabase/Auth/RLS, financial accounting and live record behavior. Require Quality 123/123, Security and all three disposable DB on exact repair SHA; then controlled protected merge and same-main checks. Rollback is a test-only revert. All owner-ISP and real invoice E2E remain NOT VERIFIED.
41
+
42
+### 2026-10-24 — Settings checkbox persistence repair (implemented; PR release gate)
43
+- Owner reports that saved «Enter برای ذخیره فرم فعال» and «+ افزودن سه صفر و − افزودن دو صفر در فیلد مبلغ» become unchecked after logout/login; screenshot identifies `hotkey_enter_save` and `hotkey_quick_zeros`. This is a separately authorized bugfix, not Phase B of the navigation/grid roadmap.
44
+- Verified remote `main` remains `bccd474433b4188e43aae345773498ea6fc65209`. Isolated worktree `/workspace/Factor-easy-settings`, branch `fix/settings-checkbox-persistence-20261024`; navigation PR #174 stays separate and unmerged.
45
+- Investigation/verification plan: trace save → existing sync RPC → restored settings → form rehydration; reproduce with synthetic settings and the existing mock-server style, including both checked and explicitly unchecked values, same-session logout/login, reload and preservation of unsaved controls on unrelated refresh. Implement the smallest proven client repair, run the relevant keyboard/Pages regression and full existing Quality/Security checks, then open a scoped PR. No new dependency, financial behavior, schema/RLS/Auth/role/grant change or Supabase production query/write is authorized or needed.
46
+- Hypothesis to verify: the settings card is constructed before authentication, reads default checkbox values once, and `installSettings` later returns early instead of rendering restored cloud preferences. Do not claim a server persistence failure without reproduction evidence.
47
+- **Verified cause:** two synthetic browser/server tests fail on unchanged main with `#finora-hotkey-enter` expected checked / actually unchecked. The first saves both options through the existing `finora_sync_records` path, waits for acknowledgement, uses the real logout/reload flow and `enterApp`/`pullAll`, and confirms both restored datastore fields are `true` before the form assertion fails. The defect is stale pre-login form state, not proven loss of production settings.
48
+- **Repair:** separate one-time settings-card construction from rendering restored preferences. On a new settings record or rebuilt card, render the theme and all four existing checkbox values, preserving explicit `false`; ordinary refresh with the same record leaves unsaved checkbox edits intact. No save handler, keyboard action, Auth, sync, RLS, database or financial behavior changed. UX asset URL is cache-busted to `20261024-settings-hydration-v1`; repair source blob `ecfa7e8eb487c8b4cbd5d025eae1d4edf72b9b6d`.
49
+- **Actually executed locally:** two new tests RED → GREEN; settings/keyboard suites **14/14 PASS**; the same two round-trip/account-switch tests against generated Pages with CSP **2/2 PASS**; complete existing CI browser command **125/125 PASS (2.8m)** (123 baseline + 2 new); all **50** static/behavioral/backup/release-safety commands, Golden and `git diff --check` PASS. Independent whole-diff review reports no critical/important/minor findings. Browser tests use a process-only FONTCONFIG_FILE override for this cloud image's WOFF2 font issue, without repository/CI font changes.
50
+- **Publication and limits:** only `js/ux-hardening-r2.js`, its `index.html` cache URL, the existing UX spec/static cache assertion and this continuity entry changed. Exact remote commit/CI evidence is maintained in this fix branch's PR description; previous main/Phase A CI is not evidence for this fix. No production Supabase read/write, SQL, dependency addition, merge or deployment performed at this checkpoint. Real owner-account persistence/ISP and physical printing remain NOT VERIFIED. Next: verify exact PR-head Quality/Security including existing disposable DB jobs, then review/release this bugfix separately; Phase B is not started or authorized by this request.
index.html
+1
-1
@@ -941,7 +941,7 @@ body{background:#f6f9fc}
941
<script src="js/enterprise-iran.js?v=20260930-iran-erp-v1"></script>
942
<script src="js/enterprise-iran-v2.js?v=20260930-iran-erp-v2"></script>
943
<script src="js/selfcheck.js?v=20260928-release-1-0"></script>
944
-<script src="js/ux-hardening-r2.js?v=20261012-phase0-dark-contrast-v1"></script>
944
+<script src="js/ux-hardening-r2.js?v=20261024-settings-hydration-v1"></script>
945
946
</body>
947
</html>
js/ux-hardening-r2.js
+9
-3
@@ -340,17 +340,23 @@ body.finora-theme-dark .form-group[style*="background"]{
340
}
341
function statsHtml(){const stats=[['کالا/خدمت',ownedRows('products').length],['اشخاص',ownedRows('contacts').length],['فاکتور فروش',ownedRows('invoices').length],['فاکتور خرید',ownedRows('purchases').length],['چک',ownedRows('cheques').length],['حساب',ownedRows('accounts').length],['پروژه',ownedRows('projects').length],['اسناد حسابداری',ownedRows('journalVouchers').length]];return '<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px">'+stats.map(x=>'<div style="border:1px solid var(--border);border-radius:10px;padding:12px"><small>'+x[0]+'</small><div style="font-size:22px;font-weight:800">'+Number(x[1]).toLocaleString('fa-IR')+'</div></div>').join('')+'</div>'}
342
window.finoraRefreshDataStats=function(){const h=$('finora-data-stats');if(h)h.innerHTML=statsHtml()}
343
+ let experienceSettingsRender=null;
344
+ function renderExperienceSettings(){
345
+ const card=$('finora-experience-card');if(!card)return;const s=getMySettings();
346
+ if(experienceSettingsRender?.card===card&&experienceSettingsRender?.record===s)return;
347
+ $('finora-theme-select').value=s.ui_theme||'auto';$('finora-hotkey-ctrls').checked=s.hotkey_ctrl_s!==false;$('finora-hotkey-ctrlenter').checked=s.hotkey_ctrl_enter!==false;$('finora-hotkey-enter').checked=!!s.hotkey_enter_save;$('finora-hotkey-zeros').checked=!!s.hotkey_quick_zeros;
348
+ experienceSettingsRender={card,record:s};
349
+ }
350
function installSettings(){
351
const root=$('view-settings');if(!root||$('finora-experience-card'))return;try{if(typeof FINORA_MODULES!=='undefined'&&!FINORA_MODULES.settings.groups.some(g=>g.title==='تجربه کاربری'))FINORA_MODULES.settings.groups.splice(2,0,{title:'تجربه کاربری',items:[['ظاهر و میانبرها','view-settings','⌨','','experience'],['قالبهای Excel','view-settings','▦','','excel-templates'],['آمار دادهها','view-settings','◎','','data-stats']]})}catch(_){}
345
- const s=getMySettings(),exp=document.createElement('div');exp.id='finora-experience-card';exp.className='accordion-item open';exp.dataset.finoraTask='experience';exp.innerHTML='<div class="accordion-header" onclick="toggleAccordion(this)"><span>⌨ ظاهر و میانبرهای صفحهکلید</span><span>▼</span></div><div class="accordion-body"><div class="form-row"><div class="form-group"><label>تم ظاهری</label><select id="finora-theme-select" class="form-control"><option value="auto">خودکار (روز روشن / شب تاریک)</option><option value="light">روشن</option><option value="dark">تاریک</option></select></div></div><label><input type="checkbox" id="finora-hotkey-ctrls"> Ctrl+S برای ذخیره</label><br><label><input type="checkbox" id="finora-hotkey-ctrlenter"> Ctrl+Enter برای ذخیره</label><br><strong>F2 برای ذخیره یا تأیید فرم فعال</strong> (بدون قطعیکردن خودکار اسناد مالی)<br><label><input type="checkbox" id="finora-hotkey-enter"> Enter برای ذخیره فرم فعال</label><br><label><input type="checkbox" id="finora-hotkey-zeros"> + افزودن سه صفر و − افزودن دو صفر در فیلد مبلغ</label><p class="af-hint">Escape همیشه پنجره باز را میبندد. میانبرهای عددی فقط داخل فیلدهای مبلغ عمل میکنند.</p><button class="btn btn-primary" onclick="finoraSaveExperienceSettings()">ذخیره تنظیمات</button></div>';root.insertBefore(exp,root.firstElementChild?.nextSibling||null);
346
- $('finora-theme-select').value=s.ui_theme||'auto';$('finora-hotkey-ctrls').checked=s.hotkey_ctrl_s!==false;$('finora-hotkey-ctrlenter').checked=s.hotkey_ctrl_enter!==false;$('finora-hotkey-enter').checked=!!s.hotkey_enter_save;$('finora-hotkey-zeros').checked=!!s.hotkey_quick_zeros;
352
+ const exp=document.createElement('div');exp.id='finora-experience-card';exp.className='accordion-item open';exp.dataset.finoraTask='experience';exp.innerHTML='<div class="accordion-header" onclick="toggleAccordion(this)"><span>⌨ ظاهر و میانبرهای صفحهکلید</span><span>▼</span></div><div class="accordion-body"><div class="form-row"><div class="form-group"><label>تم ظاهری</label><select id="finora-theme-select" class="form-control"><option value="auto">خودکار (روز روشن / شب تاریک)</option><option value="light">روشن</option><option value="dark">تاریک</option></select></div></div><label><input type="checkbox" id="finora-hotkey-ctrls"> Ctrl+S برای ذخیره</label><br><label><input type="checkbox" id="finora-hotkey-ctrlenter"> Ctrl+Enter برای ذخیره</label><br><strong>F2 برای ذخیره یا تأیید فرم فعال</strong> (بدون قطعیکردن خودکار اسناد مالی)<br><label><input type="checkbox" id="finora-hotkey-enter"> Enter برای ذخیره فرم فعال</label><br><label><input type="checkbox" id="finora-hotkey-zeros"> + افزودن سه صفر و − افزودن دو صفر در فیلد مبلغ</label><p class="af-hint">Escape همیشه پنجره باز را میبندد. میانبرهای عددی فقط داخل فیلدهای مبلغ عمل میکنند.</p><button class="btn btn-primary" onclick="finoraSaveExperienceSettings()">ذخیره تنظیمات</button></div>';root.insertBefore(exp,root.firstElementChild?.nextSibling||null);
353
const ex=document.createElement('div');ex.className='accordion-item';ex.dataset.finoraTask='excel-templates';ex.innerHTML='<div class="accordion-header" onclick="toggleAccordion(this)"><span>▦ قالبهای Excel و فیلدهای قابل انتخاب</span><span>▼</span></div><div class="accordion-body"><div class="form-group"><label>نوع قالب</label><select id="finora-excel-type" class="form-control" onchange="finoraRenderExcelFields()"><option value="products">کالا و خدمات</option><option value="contacts">اشخاص</option><option value="accounts">کدینگ حسابها</option><option value="saleItems">اقلام فاکتور فروش</option><option value="purchaseItems">اقلام فاکتور خرید</option></select></div><div id="finora-excel-fields"></div><div style="display:flex;gap:8px;flex-wrap:wrap"><button class="btn btn-primary" onclick="finoraSaveExcelFields()">ذخیره فیلدها</button><button class="btn btn-secondary" onclick="finoraDownloadConfiguredTemplate(document.getElementById(\'finora-excel-type\').value)">دانلود قالب نمونه</button><button class="btn btn-secondary" onclick="finoraExportConfiguredData(document.getElementById(\'finora-excel-type\').value)">خروجی دادههای فعلی</button></div></div>';root.appendChild(ex);renderExcelFields();
354
const st=document.createElement('div');st.className='accordion-item';st.dataset.finoraTask='data-stats';st.innerHTML='<div class="accordion-header" onclick="toggleAccordion(this)"><span>◎ آمار دادههای شرکت فعال</span><span>▼</span></div><div class="accordion-body"><div id="finora-data-stats"></div><button class="btn btn-secondary" style="margin-top:10px" onclick="finoraRefreshDataStats()">بهروزرسانی آمار</button></div>';root.appendChild(st);finoraRefreshDataStats();
355
}
356
window.finoraOpenInvoiceType=function(type){if(type==='purchase'){if(typeof navigateShell==='function')navigateShell('commerce','view-purchases');else switchView('view-purchases');return}if(typeof navigateShell==='function')navigateShell('commerce','view-invoices');else switchView('view-invoices');const kind=$('invoice-kind');if(kind){kind.value=type==='pre_invoice'?'pre_invoice':type==='contract_statement'?'contract_statement':'non_formal';if(typeof handleInvoiceKindChange==='function')handleInvoiceKindChange()}}
357
const oldProductTpl=window.downloadProductsExcelTemplate,oldContactTpl=window.downloadContactsExcelTemplate;window.downloadProductsExcelTemplate=()=>finoraDownloadConfiguredTemplate('products');window.downloadContactsExcelTemplate=()=>finoraDownloadConfiguredTemplate('contacts');
358
window.downloadAccountsExcelTemplate=()=>finoraDownloadConfiguredTemplate('accounts');window.downloadInvoiceItemsExcelTemplate=()=>finoraDownloadConfiguredTemplate('saleItems');window.purDownloadExcelTemplate=()=>finoraDownloadConfiguredTemplate('purchaseItems');
353
- function boot(){installSettings();enhanceAll();finoraApplyTheme();finoraRefreshDataStats()}
359
+ function boot(){installSettings();renderExperienceSettings();enhanceAll();finoraApplyTheme();finoraRefreshDataStats()}
360
const oldRefresh=window.refreshAllSurfaces;if(typeof oldRefresh==='function')window.refreshAllSurfaces=function(){const r=oldRefresh.apply(this,arguments);setTimeout(boot,0);return r};
361
document.addEventListener('DOMContentLoaded',()=>setTimeout(boot,0));setInterval(()=>{if((getMySettings()?.ui_theme||'auto')==='auto')finoraApplyTheme()},15*60*1000);
362
})();
scripts/ux-hardening-r2-check.mjs
+1
-1
@@ -8,7 +8,7 @@ const purchases=fs.readFileSync('js/purchases.js','utf8');
8
const commerce=fs.readFileSync('js/commercial-rnd.js','utf8');
9
const print=fs.readFileSync('js/print.js','utf8');
10
const ok=(v,m)=>{if(!v)throw new Error(m)};
11
-ok(index.includes('js/ux-hardening-r2.js?v=20261012-phase0-dark-contrast-v1'),'UX R2 module must be loaded.');
11
+ok(index.includes('js/ux-hardening-r2.js?v=20261024-settings-hydration-v1'),'Settings hydration repair must use its updated cache version.');
12
ok(ux.includes('--card-bg:#122238')&&ux.includes('body.finora-theme-dark .btn-secondary')&&ux.includes('body.finora-theme-dark .module-panel'),'F0-06 dark shell, card and button contrast styles must be loaded.');
13
ok(projects.includes('getMyGlobalProjects')&&projects.includes('attachExistingProject')&&projects.includes('linkedContactIds'),'Counterparty project management must reuse global project master data.');
14
ok(projects.includes('createAndAttachProject')&&projects.includes('openProjectAttachModal'),'Counterparty project UI must support select-existing or create-new in place.');
scripts/ux-hardening-r2.spec.js
+81
@@ -1,5 +1,86 @@
1
const {test,expect}=require('@playwright/test');
2
const path=require('node:path');
3
+const SETTINGS_BASE=process.env.FINORA_TEST_BASE_URL||'http://127.0.0.1:4173/index.html';
4
+const SETTINGS_USER='QA_SETTINGS_ONLY';
5
+function settingsServer(){
6
+ const records=new Map(),copy=value=>JSON.parse(JSON.stringify(value));
7
+ for(const user of [SETTINGS_USER,'QA_SETTINGS_OTHER'])records.set(user,[
8
+ {collection:'companies',id:'QA_CO',data:{name:'شرکت آزمون تنظیمات'}},
9
+ {collection:'settings',id:'main',data:{default_company_id:'QA_CO',invoice_kind:'pre_invoice',currency_mode:'rial',user_display_name:'آزمون تنظیمات',professional_role:'accountant',ui_theme:'light',hotkey_ctrl_s:true,hotkey_ctrl_enter:true,hotkey_enter_save:false,hotkey_quick_zeros:false}}
10
+ ]);
11
+ return {records,copy,writes:0,signouts:0};
12
+}
13
+function savedExperience(server,user=SETTINGS_USER){
14
+ const s=server.records.get(user).find(row=>row.collection==='settings').data;
15
+ return {ui_theme:s.ui_theme,hotkey_ctrl_s:s.hotkey_ctrl_s,hotkey_ctrl_enter:s.hotkey_ctrl_enter,hotkey_enter_save:s.hotkey_enter_save,hotkey_quick_zeros:s.hotkey_quick_zeros};
16
+}
17
+async function installSettingsServer(page,server){
18
+ await page.route(/https:\/\/[^/]*supabase\.co\//,route=>route.abort());
19
+ await page.exposeFunction('qaSettingsRead',user=>server.copy(server.records.get(user)||[]));
20
+ await page.exposeFunction('qaSettingsSignOut',()=>{server.signouts++});
21
+ await page.exposeFunction('qaSettingsWrite',(user,args)=>{
22
+ server.writes++;
23
+ const rows=server.records.get(user)||[];
24
+ for(const row of args.p_upserts||[]){const i=rows.findIndex(r=>r.collection===row.collection&&r.id===row.id);if(i<0)rows.push(server.copy(row));else rows[i]=server.copy(row)}
25
+ server.records.set(user,rows.filter(row=>!(args.p_deletes||[]).some(d=>d.collection===row.collection&&d.id===row.id)));
26
+ return {error:null};
27
+ });
28
+}
29
+async function signInSettings(page,user=SETTINGS_USER){
30
+ await page.waitForFunction(()=>window.FinoraStartupStatus?.extensionsReady===true&&window.FinoraStartupStatus?.failedExtensionCount===0&&window.FinoraStartupStatus?.authChecked===true,null,{timeout:20000});
31
+ await page.evaluate(async id=>{
32
+ window.alert=()=>{};window.confirm=()=>false;maybeMigrateLegacyData=()=>{};
33
+ fetchCurrentUser=async auth=>({id:auth.id,fullName:'آزمون تنظیمات',role:'admin',modules:['full_suite'],subscription:{type:'lifetime',status:'active',endDate:'2099-01-01'}});
34
+ sb.from=()=>({select:()=>({order(){return this},async range(from,to){return {data:(await window.qaSettingsRead(currentUser.id)).slice(from,to+1),error:null}}})});
35
+ sb.rpc=async(name,args)=>{if(name!=='finora_sync_records')throw new Error('Unexpected settings RPC');return window.qaSettingsWrite(currentUser.id,args)};
36
+ sb.auth.signOut=async()=>{await window.qaSettingsSignOut();return {error:null}};
37
+ await enterApp({id});navigateShell('settings','view-settings','experience');
38
+ },user);
39
+ await expect(page.locator('#auth-screen')).toBeHidden();
40
+ await expect(page.locator('#finora-experience-card')).toBeVisible();
41
+}
42
+async function expectExperience(page,expected){
43
+ for(const [id,key] of [['enter','hotkey_enter_save'],['zeros','hotkey_quick_zeros'],['ctrls','hotkey_ctrl_s'],['ctrlenter','hotkey_ctrl_enter']])await expect(page.locator('#finora-hotkey-'+id)).toBeChecked({checked:expected[key]});
44
+ await expect(page.locator('#finora-theme-select')).toHaveValue(expected.ui_theme);
45
+}
46
+
47
+test('saved keyboard preferences survive real sync, logout/login and reload with true and false values',async({page})=>{
48
+ const server=settingsServer();await installSettingsServer(page,server);
49
+ await page.goto(SETTINGS_BASE,{waitUntil:'domcontentloaded'});await signInSettings(page);
50
+ const enabled={ui_theme:'dark',hotkey_ctrl_s:false,hotkey_ctrl_enter:false,hotkey_enter_save:true,hotkey_quick_zeros:true};
51
+ await page.locator('#finora-theme-select').selectOption(enabled.ui_theme);
52
+ await page.locator('#finora-hotkey-ctrls').uncheck();await page.locator('#finora-hotkey-ctrlenter').uncheck();
53
+ await page.locator('#finora-hotkey-enter').check();await page.locator('#finora-hotkey-zeros').check();
54
+ await page.locator('#finora-experience-card button').click();
55
+ await expect.poll(()=>savedExperience(server)).toEqual(enabled);
56
+ await page.waitForFunction(()=>!syncPending&&!syncRunning);
57
+ await Promise.all([page.waitForNavigation({waitUntil:'domcontentloaded'}),page.locator('.shell-logout[title="خروج"]').click()]);
58
+ expect(server.signouts).toBe(1);await signInSettings(page);
59
+ expect(await page.evaluate(()=>({enter:getMySettings().hotkey_enter_save,zeros:getMySettings().hotkey_quick_zeros}))).toEqual({enter:true,zeros:true});
60
+ await expectExperience(page,enabled);
61
+ const disabled={...enabled,ui_theme:'light',hotkey_enter_save:false,hotkey_quick_zeros:false};
62
+ await page.locator('#finora-theme-select').selectOption(disabled.ui_theme);
63
+ await page.locator('#finora-hotkey-enter').uncheck();await page.locator('#finora-hotkey-zeros').uncheck();
64
+ await page.locator('#finora-experience-card button').click();
65
+ await expect.poll(()=>savedExperience(server)).toEqual(disabled);
66
+ await page.waitForFunction(()=>!syncPending&&!syncRunning);
67
+ await page.reload({waitUntil:'domcontentloaded'});await signInSettings(page);await expectExperience(page,disabled);
68
+ expect(server.writes).toBeGreaterThan(0);
69
+ expect(server.records.get(SETTINGS_USER).filter(row=>['invoices','purchases','journalVouchers','journalLines'].includes(row.collection))).toEqual([]);
70
+});
71
+
72
+test('settings hydration follows the restored account without discarding unsaved checkboxes on ordinary refresh',async({page})=>{
73
+ const server=settingsServer(),s=server.records.get(SETTINGS_USER).find(row=>row.collection==='settings').data;
74
+ Object.assign(s,{hotkey_enter_save:true,hotkey_quick_zeros:true});await installSettingsServer(page,server);
75
+ await page.goto(SETTINGS_BASE,{waitUntil:'domcontentloaded'});await signInSettings(page);await expectExperience(page,savedExperience(server));
76
+ await page.locator('#finora-hotkey-enter').uncheck();await page.locator('#finora-hotkey-zeros').uncheck();
77
+ await page.evaluate(()=>new Promise(resolve=>{refreshAllSurfaces();setTimeout(resolve,0)}));
78
+ await expect(page.locator('#finora-hotkey-enter')).not.toBeChecked();await expect(page.locator('#finora-hotkey-zeros')).not.toBeChecked();
79
+ expect(savedExperience(server).hotkey_enter_save).toBe(true);expect(savedExperience(server).hotkey_quick_zeros).toBe(true);
80
+ await signInSettings(page,'QA_SETTINGS_OTHER');await expectExperience(page,savedExperience(server,'QA_SETTINGS_OTHER'));
81
+ await signInSettings(page);await expectExperience(page,savedExperience(server));
82
+});
83
+
84
test('UX R2 adds searchable selectors, keyboard close/zeros and settings controls',async({page})=>{
85
let opts='';for(let i=0;i<10;i++)opts+='<option value="P'+i+'">کالا '+i+'</option>';
86
await page.setContent('<section id="view-settings" class="view-pane"></section><section id="view-invoices" class="view-pane active"><div><select id="big-select">'+opts+'</select></div><input id="money" inputmode="decimal" value="25"></section><section id="view-purchases" class="view-pane"></section><div id="m1" class="modal-backdrop active"><button id="mclose">بستن</button></div>');