@davoodmehraban89 / Factor-easy-2 Mirror · read-only
Fork 0

سامانه صدور فاکتور و حسابداری

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 3, 20:45 UTC

docs/invoice-workspace-release-20261007
audit-remediation-wave3-4-20261002 audit-remediation-wave3-verify-20261002 audit-remediation-wave4-20261002 audit-remediation-wave4b-20261002 audit-remediation-wave5a-identity-20261002 audit-remediation-wave5b-offboarding-20261002 audit-remediation-wave5c-authorization-20261002 audit-security-intent-review-20261002 audit/finora-financial-core-20261115 audit/finora-master-prompt-phase0-20261016 audit/finora-stage3-legacy-source-readonly-20261023 audit/full-controls-20261030 audit/owner-live-state-reconcile-20261012 audit/owner-review-20261007 audit/phase1-live-permissions-readonly-20261013 audit/reconcile-live-state-20261006 audit/reconcile-state-20261002 audit/wp0-hardening-baseline-20261102 branding-login-favicon-20261002 c8-workflow-task1 c8-workflow-task2 c8-workflow-task3 chore/wave0-pages-gate-closeout claude-code-plugins-setup design/finora-c01-authoritative-source-draft-20261124 docs-wave4b-verified-20261002 docs/active-company-invoice-release-evidence-20261014 docs/agent-operating-model-20261114 docs/chart-taxpayer-release-evidence-20261004 docs/cloud-only-agent-orchestration-20261115 docs/confirm-finora-product-charter-20261115 docs/continuation-20261030 docs/d4a-verified docs/external-work-review-20261121 docs/finora-audit-continuity-20261014 docs/finora-backup-merge-evidence-20261014 docs/finora-ci-reconciliation-20261122 docs/finora-codex-master-prompt docs/finora-eight-phase-plan-20261011 docs/finora-f002-live-buyer-filter-verified-20261015 docs/finora-license-race-release-evidence-20261014 docs/finora-license-rollout-acceptance-20261015 docs/finora-phase0-repeat-and-pages-nav-verified-20261015 docs/finora-phase0-repeat-evidence-20261015 docs/finora-selectors-release-and-fixture-qa-20261015 docs/finora-stagea-pr240-ci-triage-20261123 docs/finora-test-license-live-pass-20261015 docs/finora-v2-m01-coverage-20261124 docs/handoff-charter-v2-20261124 docs/invoice-product-search-release-20261011 docs/invoice-workspace-release-20261007 docs/phase-status-20261031 docs/phase0-acceptance-release-evidence-20261012 docs/phase0-admin-provision-release-evidence-20261012 docs/phase0-core-bundle-owner-login-open-20261013 docs/phase0-duplicate-js-release-20261016 docs/phase0-f001-auth-rest-shared-timeout-20261013 docs/phase0-f001-owner-login-observed-20261013 docs/phase0-f001-second-device-fail-40s-20261013 docs/phase0-f003-release-verification-20261011 docs/phase0-f004-print-release-evidence-20261012 docs/phase0-f004-watermark-release-evidence-20261012 docs/phase0-f005-large-selector-release-20261012 docs/phase0-f005-release-evidence-20261012 docs/phase0-f006-dark-release-evidence-20261012 docs/phase0-f008-final-pr-closure-evidence-20261012 docs/phase0-f008-reconcile-stale-prs-20261012 docs/phase0-f107-production-evidence-20261012 docs/phase0-kavenegar-otp-preflight-release-20261012 docs/phase0-login-release-evidence-20261012 docs/phase0-login-rest-bootstrap-stage-release-20261012 docs/phase0-owner-app-assets-bundle-release-20261013 docs/phase0-owner-login-csp-release-20261012 docs/phase0-reconcile-postmerge-evidence-20261012 docs/phase0-site-probe-release-evidence-20261012 docs/phase0-startup-release-evidence-20261012 docs/phase3-treasury-release-evidence-20261014 docs/pilot-posted-correction-release-evidence-20261014 docs/pilot-purchase-correction-release-evidence-20261014 docs/print-persian-release-verification-20261011 docs/qa-ci-triage-218-20261122 docs/real-account-qa-20261030 docs/release-state-20261007 docs/seamless-amendment-release-20261014 docs/seamless-document-correction-release-20261014 docs/settings-login-release-20261025 docs/stripe-qa-deployment-evidence-20261011 docs/ux-f2-release-evidence-20261011 docs/ux-f2-release-verification-20261011 docs/wave0-closeout docs/wave2-closeout exec-phase1-architecture exec-phase1-implementation exec-phase1-qa exec-phase1-security-release exec-phase1-ux feat/accounting-document-draft-approval-20261011 feat/accounting-document-release-candidate-20261011 feat/active-company-strict-isolation-20261014 feat/admin-provisioning-reconciled-20261011 feat/admin-secure-user-provisioning-20261011 feat/admin-user-provisioning-merged-20261011 feat/d4a-request-work-queue feat/document-lifecycle-atf-20261118 feat/document-lifecycle-temp-permanent-atef feat/draft-first-attachment-lifecycle-216 feat/finora-offline-encrypted-backup-20261014 feat/finora-phase-a-navigation-20261023 feat/finora-stripe-sandbox-edge-gate feat/immutable-attachment-temporary-vouchers feat/iran-accounting-design-audit feat/journal-document-lifecycle-20261118 feat/journal-rpc-repository-adapter-20261117 feat/office-c7-fulltext-ocr-provenance feat/password-recovery-admin-reset-20261025 feat/pilot-expense-income-inplace-amendment-20261014 feat/pilot-journal-invoice-correction-20261014 feat/pilot-purchase-correction-20261014 feat/pilot-treasury-unallocated-correction-20261014 feat/retain-document-editor-after-save-20261014 feat/seamless-financial-document-correction-20261014 feat/slice-b-tenant-rbac feat/stripe-sandbox-invoice-probe feature/accounting-core-p0 feature/accounting-product-guidance feature/admin-identity-phone-auth feature/commercial-rnd feature/finora-phase1a-supabase-cli-20261016 feature/finora-stage2-manual-canary-20261017 feature/finora-stage3-commercial-payload-20261023 feature/finora-stage3-enforce-invoice-rpc-20261023 feature/finora-stage3-enforce-purchase-red-20261023 feature/invoice-workspace-cleanup feature/phase0-kavenegar-otp-preflight-20261012 feature/ux-commerce-settings-r2 fix-shell-scroll-live-cache-20261002 fix-shell-scrollbar-explicit-ownership-20261002 fix-shell-scrollbar-ownership-20261002 fix-shell-scrollbar-right-edge-20261002 fix/about-bug-report-20261114 fix/active-company-invoice-scope-20261014 fix/active-company-isolation-reconcile-20261014 fix/admin-central-password-reset-20261028 fix/auth-network-diagnostics fix/chart-taxpayer-reference-20261003 fix/combobox-enter-reliability fix/combobox-live-search fix/combobox-production-cache fix/combobox-release-asset-v2 fix/company-edit-action-20261028 fix/company-edit-pilot-delete-20261014 fix/company-form-action-state-20261014 fix/company-form-action-state-rebased-20261014 fix/contact-operational-balance-20261111 fix/dark-theme-contrast fix/financial-lifecycle-recovery-20261124 fix/finora-accounting-test-organization-readiness-20261015 fix/finora-b01-safe-org-switch-20261124 fix/finora-b02-sync-recovery-20261124 fix/finora-b03-conflict-review-20261124 fix/finora-org-license-bootstrap-race-20261014 fix/finora-stage3-posted-source-immutable-20261023 fix/finora-v2-b03-r2-qa-20261124 fix/finora-v2-b03-r3-readonly-20261124 fix/g01-asof-financial-position-20261128 fix/invoice-product-search-rehydrate-20261011 fix/invoice-search-cache-bust fix/issue229-linked-draft-status-20261122 fix/login-assets-retry-20261014 fix/login-inert-startup-20261110 fix/login-member-access-20261101 fix/login-resilience-20261017 fix/login-short-viewport-20261028 fix/login-startup-readiness-20261024 fix/navigation-utilities-placement-20261105 fix/office-c7-source-ref-binding fix/office-c7-source-ref-binding-v2 fix/owner-login-network-20261026 fix/password-recovery-invalid-cancel-20261026 fix/payment-amount-format-20261111 fix/phase0-admin-provision-seat-bootstrap-20261012 fix/phase0-auth-bundled-assets-for-unstable-isp-20261013 fix/phase0-auth-handler-binding-stalled-session-20261012 fix/phase0-login-context-stage-visibility-20261012 fix/phase0-login-single-local-bundle-20261013 fix/phase0-login-site-probe-clarity-20261012 fix/phase0-login-ui-ready-20261012 fix/phase0-modal-dashboard-drill-20261011 fix/phase0-pages-blocking-core-bundles-20261013 fix/phase0-print-no-draft-watermark-20261012 fix/phase0-startup-parallel-asset-load-20261012 fix/phase3-behavioral-verification fix/preserve-pending-edits-20261121 fix/print-persian-digit-consistency-20261011 fix/recovery-login-startup-20261027 fix/report-opening-balance-release-20261130 fix/settings-checkbox-persistence-20261024 fix/taxpayer-arithmetic-20261004 fix/ux-keyboard-search-f2-20261011 fix/wave2-request-input-integrity hardening/c01-source-draft-20261129 hardening/global-draft-conversion-20261113 hardening/wp1-ledger-integrity-20261102 integration/finora-execution-20261124 integration/issue229-ui-qa-20261122 integration/wp1-ledger-core-20261115 integration/wp2-manual-journal-rpc-20261116 main ops-heartbeat-v2-20261002 ops-progress-heartbeat-rule-20261002 ops/wave4-production-20261003 plan/financial-core-phase1-approval-20261016 qa/attachment-allocator-two-session-20261122 qa/draft-first-save-red-evidence-20261122 qa/finora-autopost-retry-identity-red-20261122 qa/finora-identity-rpc-security-tripwire-20261122 qa/finora-issue223-manual-kardex-browser-red-20261123 qa/finora-issue223-stock-real-jwt-20261123 qa/finora-issue238-inventory-count-browser-red-20261123 qa/finora-issue238-save-browser-red-20261122 qa/finora-login-cors-header-preflight-20261025 qa/finora-phase0-saved-session-repeat-20261015 qa/finora-phase5-posted-insert-jwt-red-20261123 qa/finora-stage3-ui-jwt-autopost-20261023 qa/finora-v2-g01-report-reconciliation-20261125 qa/free-supabase-local-wp2-20261116 qa/issue229-approval-boundary-jwt-20261122 qa/issue229-sale-save-linked-draft-red-20261122 qa/phase0-acceptance-start-20261012 qa/phase0-f005-account-project-contract-stress-20261012 qa/phase0-f005-selector-stress-20261012 qa/phase0-f006-dark-contrast-20261012 qa/post-wave4-verification-20261003 qa/posted-source-immutable-jwt-20261122 qa/pr219-wp1-disposable-dburl-proof-20261123 qa/purchase-source-jwt-20261122 qa/real-settings-acceptance-20261025 qa/recovery-mail-acceptance-20261026 qa/source-autopost-jwt-atomicity-20261122 qa/wave0-negative-gate-proof qa/wp2-auth-tenant-e2e-20261117 qa/wp2-authorized-journal-write-20261122 qa/wp2-financial-paths-reconciliation-20261122 qa/wp3-financial-tenant-isolation-20261117 remediation/wave0-liveqa-wave1 remediation/wave2-request-integrity staging/finora-stage22-free-20261022 state-scroll-verified-20261002 state-wave4b-production-20261002 state-wave5a-production-20261002 test/finora-accounting-boot-readiness-20261015 test/finora-f0-02-production-selectors-20261015 test/finora-pages-commerce-event-wiring-20261015 test/finora-pages-invoice-selectors-readonly-20261015 test/finora-stage3-jwt-source-post-20261023 test/phase0-invoice-fixture-bootstrap-20261016 test/phase0-invoice-persistence-20261011 test/phase0-pages-delayed-dispatcher-20261016 ux-scroll-ownership-20261002 work/finora-stage3-enforce-purchase-green-20261023 work/finora-stage3-enforce-sale-green-20261023 work/finora-stage3-payload-green-20261023
html 921 lines 97.4 KB
Raw
1 <!DOCTYPE html>
2 <html lang="fa" dir="rtl">
3 <head>
4 <meta charset="UTF-8" />
5 <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6 <title>نرم‌افزار ERP سازمانی فینورا</title>
7 <link rel="manifest" href="manifest.json?v=20261002-brand-v1" />
8 <link rel="icon" type="image/png" sizes="32x32" href="assets/finora-favicon-32.png?v=20261002-brand-v1" />
9 <link rel="apple-touch-icon" sizes="180x180" href="assets/finora-icon-180.png?v=20261002-brand-v1" />
10 <meta name="application-name" content="نرم‌افزار ERP سازمانی فینورا" />
11 <meta name="description" content="نرم‌افزار ERP سازمانی فینورا؛ مدیریت یکپارچه مالی، بازرگانی، خزانه، انبار، پیمان و عملیات سازمانی" />
12 <meta name="referrer" content="strict-origin-when-cross-origin" />
13 <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; font-src 'self' https://cdn.jsdelivr.net data:; img-src 'self' data: blob:; connect-src 'self' https://hcsixhqbyuhpshfwqpjx.supabase.co; object-src 'none'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests" />
14 <meta name="apple-mobile-web-app-capable" content="yes" />
15 <meta name="theme-color" content="#071a48" />
16 <script src="vendor/supabase.js"></script>
17 <script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>
18 <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/misc/Farsi-Digits/Vazirmatn-FD-font-face.css" />
19 <style>
20 :root{--primary:#2563eb;--primary-hover:#1d4ed8;--bg:#f8fafc;--card-bg:#fff;--text:#0f172a;--text-muted:#64748b;--border:#cbd5e1;--danger:#dc2626;--success:#059669;--warning:#d97706;--sidebar-w:240px;--nav-h:70px}
21 html,body{width:100%;max-width:100%;overflow-x:hidden!important;position:relative}
22 *{box-sizing:border-box;margin:0;padding:0;font-family:'Vazirmatn FD',-apple-system,BlinkMacSystemFont,Tahoma,sans-serif;-webkit-tap-highlight-color:transparent}
23 body{background-color:var(--bg);color:var(--text);font-size:14px}
24 #auth-screen{position:fixed;inset:0;background:radial-gradient(circle at 14% 12%,rgba(71,153,255,.18),transparent 32%),linear-gradient(135deg,#f8fbff 0%,#eef4ff 48%,#e8f1ff 100%);z-index:9999;display:flex;align-items:center;justify-content:center;padding:clamp(14px,3vw,42px);overflow:auto}
25 .auth-shell{width:min(1180px,100%);min-height:min(760px,calc(100vh - 56px));display:grid;grid-template-columns:minmax(420px,.94fr) minmax(480px,1.06fr);background:#fff;border:1px solid rgba(148,163,184,.22);border-radius:32px;overflow:hidden;box-shadow:0 34px 90px rgba(15,42,91,.18),0 8px 28px rgba(37,99,235,.08)}
26 .auth-card{background:linear-gradient(180deg,#fff,#fbfdff);width:100%;padding:clamp(32px,5vw,68px);text-align:right;display:flex;flex-direction:column;justify-content:center}
27 .auth-brand{display:flex;align-items:center;gap:14px;margin-bottom:28px}.auth-brand-logo{width:58px;height:58px;border-radius:16px;box-shadow:0 12px 28px rgba(24,94,214,.22);flex:none}.auth-brand h1{font-size:24px;color:#0b1739;letter-spacing:-.5px}.auth-brand p{font-size:12px;color:#64748b;margin-top:3px}
28 .auth-card .form-group label{color:#334155}.auth-card .form-control{min-height:50px;border-radius:12px;border-color:#dbe4f0;background:#fff;padding:10px 14px}.auth-card .form-control:focus{border-color:#2b75ff;box-shadow:0 0 0 4px rgba(43,117,255,.10)}
29 .auth-google{width:100%;min-height:50px;margin-bottom:16px;background:#fff!important;color:#172033!important;border:1px solid #dbe4f0!important;border-radius:12px!important;box-shadow:0 4px 12px rgba(15,23,42,.04)}.auth-google:hover{background:#f8fafc!important}.auth-google-mark{font-family:Arial,sans-serif;font-weight:800;color:#4285f4;font-size:18px}
30 .auth-divider{display:flex;align-items:center;gap:12px;color:#94a3b8;font-size:11.5px;margin:12px 0 18px}.auth-divider:before,.auth-divider:after{content:"";height:1px;background:#e7edf5;flex:1}
31 .auth-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}.auth-actions .btn{border-radius:12px;min-height:48px}.auth-signup{width:100%;margin-top:10px;border-radius:12px;background:#eef4ff!important;color:#1556c0!important}.auth-note{font-size:11px;color:#7c8aa0;margin-top:14px;line-height:1.9}
32 .auth-visual{position:relative;isolation:isolate;overflow:hidden;background:linear-gradient(145deg,#061335 0%,#071d55 50%,#063ba4 100%);color:#fff;display:flex;align-items:center;justify-content:center;padding:56px}.auth-visual:before{content:"";position:absolute;width:620px;height:620px;border-radius:50%;background:radial-gradient(circle,rgba(0,201,255,.30),rgba(0,91,255,.08) 45%,transparent 68%);left:-220px;bottom:-290px;z-index:-1}.auth-visual:after{content:"";position:absolute;inset:auto -140px -210px 120px;height:430px;background:linear-gradient(135deg,rgba(20,106,255,.46),rgba(0,217,255,.08));transform:rotate(-12deg);border-radius:80px;filter:blur(1px);z-index:-1}
33 .auth-hero{width:min(470px,100%);text-align:center;display:flex;flex-direction:column;align-items:center}.auth-hero-logo{width:96px;height:96px;border-radius:25px;box-shadow:0 22px 48px rgba(0,0,0,.28);margin-bottom:18px}.auth-hero h2{font-family:Arial,sans-serif;font-size:52px;letter-spacing:-1.5px;line-height:1}.auth-hero .erp{font-family:Arial,sans-serif;font-size:13px;letter-spacing:6px;color:#c9dcff;margin-top:8px}.auth-hero .tagline{font-size:14px;color:#d9e7ff;margin-top:22px}
34 .auth-dashboard-art{width:100%;height:260px;margin-top:34px;position:relative;perspective:900px}.auth-glass{position:absolute;border:1px solid rgba(118,210,255,.58);background:linear-gradient(145deg,rgba(65,152,255,.18),rgba(4,36,105,.28));box-shadow:inset 0 0 30px rgba(65,192,255,.08),0 25px 50px rgba(0,0,0,.18);backdrop-filter:blur(7px)}.auth-glass-main{right:9%;left:12%;top:18px;bottom:0;border-radius:22px;transform:rotateY(-8deg)}.auth-glass-side{right:0;width:76px;top:0;bottom:18px;border-radius:18px;display:flex;flex-direction:column;gap:14px;align-items:center;justify-content:center}.auth-glass-side span{width:34px;height:34px;border-radius:10px;background:rgba(88,185,255,.24);display:grid;place-items:center;color:#8be8ff}.auth-chart{position:absolute;left:21%;right:22%;top:80px;height:95px;border-left:1px solid rgba(139,232,255,.24);border-bottom:1px solid rgba(139,232,255,.24)}.auth-chart:after{content:"";position:absolute;inset:12px 6px 8px;background:linear-gradient(135deg,transparent 0 18%,#39c8ff 19% 21%,transparent 22% 37%,#39c8ff 38% 40%,transparent 41% 58%,#39c8ff 59% 61%,transparent 62% 76%,#39c8ff 77% 79%,transparent 80%);filter:drop-shadow(0 0 6px #27bfff)}
35 @media(max-width:900px){.auth-shell{grid-template-columns:1fr;min-height:0;max-width:560px}.auth-visual{display:none}.auth-card{padding:32px 24px}.auth-brand{justify-content:center;text-align:center}.auth-actions{grid-template-columns:1fr}#auth-screen{align-items:flex-start}.auth-card{min-height:calc(100vh - 28px)}}
36 .app-root{display:flex;min-height:100vh;width:100%;max-width:100%;overflow-x:hidden}
37 .sidebar{width:var(--sidebar-w);background:var(--card-bg);border-left:1px solid var(--border);display:flex;flex-direction:column;position:fixed;top:0;bottom:0;right:0;z-index:100}
38 .brand-box{padding:20px;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--border)}
39 .brand-icon{width:40px;height:40px;background:var(--primary);border-radius:10px;display:flex;align-items:center;justify-content:center;color:#fff;font-weight:bold;font-size:14px}
40 .sidebar-menu{list-style:none;padding:16px 8px;flex:1;overflow-y:auto}
41 .sidebar-menu li a{display:flex;align-items:center;gap:12px;padding:12px 16px;color:var(--text);text-decoration:none;border-radius:8px;margin-bottom:4px;font-size:14px;font-weight:500;transition:all .2s;cursor:pointer}
42 .sidebar-menu li a:hover,.sidebar-menu li a.active{background:#eff6ff;color:var(--primary);font-weight:bold}
43 .sidebar-footer{padding:12px;border-top:1px solid var(--border);font-size:12px;color:var(--text-muted);text-align:center;display:flex;flex-direction:column;gap:6px}
44 .main-surface{flex:1;margin-right:var(--sidebar-w);padding:20px;padding-bottom:100px;max-width:calc(100% - var(--sidebar-w));overflow-x:hidden}
45 .mobile-dock{display:none;position:fixed;bottom:0;left:0;right:0;min-height:var(--nav-h);background:rgba(255,255,255,.98);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid #cbd5e1;z-index:200;align-items:stretch;padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -4px 12px rgba(0,0,0,.06);overflow-x:auto;scrollbar-width:none}.mobile-dock::-webkit-scrollbar{display:none}
46 .dock-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:#475569;text-decoration:none;font-size:10.5px;font-weight:600;flex:0 0 76px;min-height:64px;cursor:pointer;white-space:nowrap}
47 .dock-tab.active{color:var(--primary);font-weight:800}
48 .dock-tab svg{width:20px;height:20px;stroke-width:2}
49 .whatsapp-support{position:fixed;bottom:90px;left:20px;z-index:250;display:flex;align-items:center;gap:8px;background:linear-gradient(135deg,#25D366,#128C7E);color:#fff;text-decoration:none;padding:10px 16px 10px 12px;border-radius:50px;box-shadow:0 8px 24px rgba(37,211,102,.4);font-weight:700;font-size:13px;transition:all .25s ease}
50 .whatsapp-support:hover{transform:translateY(-3px);box-shadow:0 12px 28px rgba(37,211,102,.55)}
51 .whatsapp-support svg{width:22px;height:22px;flex-shrink:0}
52 .card{background:var(--card-bg);border:1px solid var(--border);border-radius:12px;padding:18px;margin-bottom:18px;box-shadow:0 1px 3px rgba(0,0,0,.03);width:100%;max-width:100%;overflow:hidden}
53 .grid-kpi{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin-bottom:18px}
54 .kpi-gradient{box-shadow:0 4px 14px rgba(0,0,0,.12);border:none}
55 .quick-actions-row{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:16px}
56 .qa-btn{display:flex;align-items:center;gap:6px;border:none;color:#fff;padding:11px 16px;border-radius:12px;font-size:13px;font-weight:600;cursor:pointer;box-shadow:0 3px 10px rgba(0,0,0,.15);flex:1;min-width:130px;justify-content:center}
57 .qa-btn:hover{filter:brightness(1.08)}
58 .report-bar-wrap{display:flex;align-items:flex-end;gap:6px;height:160px;padding:10px 4px;overflow-x:auto}
59 .report-bar-col{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:38px}
60 .report-bar{width:26px;border-radius:6px 6px 0 0;background:linear-gradient(180deg,#8b5cf6,#6d28d9);transition:height .3s}
61 .report-bar-label{font-size:10px;color:var(--text-muted);white-space:nowrap}
62 .report-bar-value{font-size:10px;font-weight:bold;color:var(--text)}
63 .kpi-unit{background:var(--card-bg);border:1px solid var(--border);border-radius:10px;padding:16px;display:flex;align-items:center;gap:14px}
64 .kpi-icon{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:20px}
65 .kpi-val{font-size:17px;font-weight:bold;margin-top:4px}
66 .kpi-lbl{color:var(--text-muted);font-size:12px;font-weight:500}
67 .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 16px;background:var(--primary);color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:14px;font-weight:600;transition:background .2s;text-decoration:none}
68 .btn:hover{background:var(--primary-hover)}
69 .btn-secondary{background:#e2e8f0;color:var(--text)}
70 .btn-secondary:hover{background:#cbd5e1}
71 .btn-success{background:var(--success)}
72 .btn-danger{background:var(--danger)}
73 .btn-warning{background:var(--warning);color:#fff}
74 .form-group{margin-bottom:14px;width:100%}
75 .form-group label{display:block;margin-bottom:6px;font-size:13px;font-weight:600;color:#334155}
76 .form-control{width:100%;min-height:44px;padding:8px 12px;border:1px solid var(--border);border-radius:8px;font-size:14px;outline:none;background:#fff;transition:border-color .2s;direction:rtl}
77 .form-control:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.15)}
78 .form-control:disabled{background-color:#f1f5f9;color:#94a3b8;cursor:not-allowed}
79 .form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;width:100%}
80 .table-responsive{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--border);border-radius:8px}
81 table{width:100%;border-collapse:collapse;text-align:right;font-size:13px;min-width:500px}
82 th,td{padding:10px 10px;border-bottom:1px solid var(--border)}
83 th{background:#f1f5f9;color:#334155;font-weight:700}
84 #invoice-items-table{direction:rtl;width:100%;table-layout:auto}
85 #invoice-items-table th,#invoice-items-table td{text-align:right}
86 #invoice-items-table th:first-child,#invoice-items-table td:first-child{text-align:center}
87 #invoice-items-table th:last-child,#invoice-items-table td:last-child{text-align:center}
88 .badge{display:inline-block;padding:3px 8px;border-radius:6px;font-size:11px;font-weight:600}
89 .badge-success{background:#d1fae5;color:#065f46}
90 .badge-warning{background:#fef3c7;color:#92400e}
91 .badge-danger{background:#fee2e2;color:#991b1b}
92 .badge-info{background:#e0f2fe;color:#0369a1}
93 .view-pane{display:none}
94 .view-pane.active{display:block}
95 .modal-backdrop{display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(15,23,42,.6);backdrop-filter:blur(4px);z-index:999;align-items:center;justify-content:center;padding:16px}
96 .modal-backdrop.active{display:flex}
97 .modal-card{background:#fff;border-radius:14px;max-width:600px;width:100%;max-height:90vh;overflow-y:auto;padding:20px;box-shadow:0 20px 25px -5px rgba(0,0,0,.1)}
98 .accordion-item{border:1px solid var(--border);border-radius:10px;margin-bottom:12px;overflow:hidden;background:#fff}
99 .accordion-header{padding:14px 18px;background:#f8fafc;font-weight:bold;display:flex;justify-content:space-between;align-items:center;cursor:pointer;user-select:none}
100 .accordion-body{padding:16px;border-top:1px solid var(--border);display:none;background:#fff}
101 .accordion-item.open .accordion-body{display:block}
102 .about-dev-card{background:linear-gradient(135deg,#eff6ff,#f8fafc);border:1.5px solid #bfdbfe;border-radius:12px;padding:16px 18px;margin:14px 0;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
103 .about-dev-avatar{width:52px;height:52px;background:linear-gradient(135deg,var(--primary),#1e40af);color:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:bold;flex-shrink:0}
104 .about-dev-info{flex:1;min-width:180px}
105 .about-dev-info h4{font-size:15px;color:#1e293b;margin-bottom:4px}
106 .about-dev-info p{font-size:12.5px;color:#64748b;margin-bottom:2px}
107 .about-dev-actions{display:flex;gap:8px;flex-wrap:wrap}
108 .about-dev-actions a{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:8px;font-size:12.5px;font-weight:700;text-decoration:none;transition:all .2s}
109 .about-dev-actions .btn-wa{background:linear-gradient(135deg,#25D366,#128C7E);color:#fff}
110 .about-dev-actions .btn-call{background:var(--primary);color:#fff}
111 @media print{
112 @page{size:A4 landscape;margin:8mm 10mm}
113 html,body{background:#fff!important;color:#000!important;margin:0!important;padding:0!important;width:100%!important}
114 .sidebar,.mobile-dock,.no-print,#auth-screen,.modal-backdrop,.whatsapp-support{display:none!important}
115 .view-pane{display:none!important}
116 .main-surface{margin:0!important;padding:0!important;max-width:100%!important;width:100%!important}
117 .main-surface>*:not(#printable-invoice){display:none!important}
118 .card{border:none!important;box-shadow:none!important;padding:0!important;margin:0!important}
119 .invoice-a4-page{width:100%!important;margin:0 auto!important;page-break-after:always!important;break-after:page!important;box-sizing:border-box!important}
120 .invoice-a4-page:last-child{page-break-after:avoid!important;break-after:avoid!important}
121 #printable-invoice{display:block!important}
122 }
123 @media (max-width:768px){
124 .sidebar{display:none}
125 .main-surface{margin-right:0;padding:12px;padding-bottom:calc(var(--nav-h) + 20px);max-width:100%}
126 .mobile-dock{display:flex}
127 .btn{width:100%}
128 .btn-inline{width:auto}
129 .form-row{grid-template-columns:1fr}
130 .whatsapp-support{bottom:84px;left:12px;padding:8px 12px 8px 10px;font-size:11.5px}
131 }
132
133 /* Finora Phase 1 — scalable enterprise shell */
134 :root{--shell-rail:82px;--shell-panel:238px;--shell-top:72px;--shell-line:#e5eaf1;--shell-soft:#f4f8fc;--shell-accent:#078b9b;--shell-accent-soft:#e9f8fa}
135 body{background:#f6f9fc}
136 .app-shell-nav.sidebar{width:var(--shell-rail);border-left:1px solid var(--shell-line);box-shadow:none;background:#fff;z-index:320}
137 .app-shell-nav .brand-box{height:var(--shell-top);padding:9px 6px;display:flex;flex-direction:column;justify-content:center;gap:2px;text-align:center;border-bottom:1px solid var(--shell-line)}
138 .app-shell-nav .brand-icon{display:none}
139 .app-shell-nav .brand-copy h2{font-size:18px;line-height:1.2;color:#10204b;letter-spacing:-.3px}
140 .app-shell-nav .brand-copy small{font-size:10px;color:#1685d1;font-weight:800}
141 .module-rail{display:flex;flex:1;flex-direction:column;gap:4px;padding:8px 6px;overflow-y:auto;scrollbar-width:thin}
142 .module-tab{appearance:none;border:0;background:transparent;color:#334155;border-radius:9px;min-height:55px;padding:6px 3px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;cursor:pointer;font:inherit;transition:.16s ease}
143 .module-tab span{font-family:Arial,sans-serif;font-size:21px;line-height:1}
144 .module-tab b{font-size:10.5px;font-weight:650;white-space:nowrap}
145 .module-tab:hover{background:#f2f7fb;color:#0f6470}
146 .module-tab.active{background:linear-gradient(145deg,#0795a5,#057b8b);color:#fff;box-shadow:0 5px 14px rgba(7,139,155,.18)}
147 .app-shell-nav .sidebar-footer{padding:7px 4px;gap:5px;border-top:1px solid var(--shell-line);font-size:9.5px;overflow:hidden}
148 .shell-logout{border:0;background:transparent;color:#64748b;font:inherit;font-size:10px;cursor:pointer}
149 .module-panel{position:fixed;top:0;bottom:0;right:var(--shell-rail);width:var(--shell-panel);z-index:310;background:#fff;border-left:1px solid var(--shell-line);transition:transform .2s ease,opacity .2s ease}
150 .module-panel-head{height:var(--shell-top);display:flex;align-items:center;justify-content:space-between;padding:13px 16px;border-bottom:1px solid var(--shell-line)}
151 .module-panel-head small{display:block;color:#94a3b8;font-size:10px;margin-bottom:3px}
152 .module-panel-head h3{font-size:16px;color:#0f172a}
153 .module-panel-handle{position:fixed;z-index:325;top:50%;right:calc(var(--shell-rail) + var(--shell-panel) - 1px);transform:translate(50%,-50%);width:24px;height:54px;border:1px solid #cbd5e1;border-radius:10px 0 0 10px;background:#fff;color:#087c8a;box-shadow:0 4px 14px rgba(15,23,42,.12);cursor:pointer;font:700 20px/1 Arial,sans-serif;transition:right .2s ease,background .15s ease}
154 .module-panel-handle:hover{background:#effafb}
155 .module-panel-handle:focus-visible{outline:3px solid rgba(7,139,155,.22);outline-offset:2px}
156 /* Critical desktop scroll ownership lives in HTML too, so a stale cached ui.js cannot restore the old mapping. */
157 @media (min-width:821px){
158 html,body{height:100%;overflow-y:hidden!important}
159 .app-root{height:100vh;min-height:0;overflow:hidden}
160 .module-rail,.module-panel-links,.main-surface{direction:ltr;overscroll-behavior:contain;scrollbar-gutter:stable}
161 .module-rail>*,.module-panel-links>*,.main-surface>*{direction:rtl}
162 .main-surface{height:100vh;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin}
163 }
164 .module-panel-links{height:calc(100vh - var(--shell-top));overflow-y:auto;padding:11px}
165 .module-group{padding:5px 0 11px;border-bottom:1px solid #f0f3f7;margin-bottom:8px}
166 .module-group:last-child{border-bottom:0}
167 .module-group-title{font-size:10.5px;color:#94a3b8;font-weight:700;padding:5px 8px 7px}
168 .module-link{width:100%;border:0;background:transparent;color:#334155;border-radius:8px;min-height:38px;padding:8px 9px;display:flex;align-items:center;gap:9px;text-align:right;font:inherit;font-size:12px;cursor:pointer}
169 .module-link .mi{width:22px;text-align:center;font-family:Arial,sans-serif;color:#64748b;font-size:15px}
170 .module-link:hover{background:#f6f9fc;color:#075f6a}
171 .module-link.active{background:var(--shell-accent-soft);color:#087c8a;font-weight:800;box-shadow:inset -3px 0 #0a9baa}
172 .module-link.active .mi{color:#078b9b}
173 .topbar{position:fixed;z-index:300;top:0;right:calc(var(--shell-rail) + var(--shell-panel));left:0;height:var(--shell-top);display:flex;align-items:center;gap:12px;padding:10px 20px;background:rgba(255,255,255,.96);border-bottom:1px solid var(--shell-line);backdrop-filter:blur(12px)}
174 .topbar-menu{display:none;width:38px;height:38px;border:1px solid var(--shell-line);border-radius:9px;background:#fff;color:#334155;cursor:pointer}
175 .global-search{position:relative;flex:1;max-width:600px;margin-inline:auto;display:flex;align-items:center;gap:7px;height:40px;padding:0 12px;background:#f8fafc;border:1px solid #dce4ee;border-radius:9px}
176 .global-search:focus-within{background:#fff;border-color:#8ecbd3;box-shadow:0 0 0 3px rgba(7,139,155,.08)}
177 .global-search>span{color:#64748b;font-size:18px}
178 .global-search input{width:100%;border:0;outline:0;background:transparent;font:inherit;color:#0f172a;font-size:12px}
179 .command-results{display:none;position:absolute;top:46px;right:0;left:0;background:#fff;border:1px solid var(--shell-line);border-radius:10px;padding:6px;box-shadow:0 16px 35px rgba(15,23,42,.13);max-height:330px;overflow:auto}
180 .command-results.open{display:block}
181 .command-result{padding:9px 10px;border-radius:7px;cursor:pointer;color:#334155;font-size:12px}
182 .command-result:hover{background:#f0f8fa;color:#087c8a}
183 .command-result small{float:left;color:#94a3b8}
184 .topbar-actions{display:flex;gap:7px;align-items:center}
185 .topbar-pill{height:38px;border:1px solid #dce4ee;border-radius:9px;background:#fff;color:#334155;padding:0 11px;font:inherit;font-size:11.5px;font-weight:650;cursor:pointer;white-space:nowrap}
186 .topbar-pill:hover{border-color:#a9cbd0;background:#f7fbfc}
187 .quick-create{position:relative}.quick-create-menu{display:none;position:absolute;top:44px;left:0;width:230px;background:#fff;border:1px solid var(--shell-line);border-radius:10px;padding:7px;box-shadow:0 16px 35px rgba(15,23,42,.14);z-index:420}.quick-create-menu.open{display:block}.quick-create-menu button{width:100%;border:0;background:transparent;border-radius:7px;padding:9px 10px;text-align:right;font:inherit;font-size:11.5px;color:#334155;cursor:pointer}.quick-create-menu button:hover{background:#f0f8fa;color:#087c8a}.quick-create-menu .quick-create-group{padding:5px 8px 4px;color:#94a3b8;font-size:9.5px;font-weight:800}
188 .main-surface{margin-right:calc(var(--shell-rail) + var(--shell-panel));padding:calc(var(--shell-top) + 18px) 22px 90px;max-width:calc(100% - var(--shell-rail) - var(--shell-panel));transition:margin-right .2s ease,max-width .2s ease}
189 .workspace-context{display:flex;align-items:center;gap:9px;margin:0 0 14px;padding:0 2px;color:#64748b;font-size:11px}
190 .workspace-context strong{color:#0f172a;font-size:13px}
191 .workspace-eyebrow{color:#078b9b;font-weight:800}
192 .shell-panel-collapsed .module-panel{transform:translateX(100%);opacity:0;pointer-events:none}
193 .shell-panel-collapsed .module-panel-handle{right:calc(var(--shell-rail) - 1px)}
194 .shell-panel-collapsed .topbar{right:var(--shell-rail)}
195 .shell-panel-collapsed .main-surface{margin-right:var(--shell-rail);max-width:calc(100% - var(--shell-rail))}
196 .grid-kpi .kpi-gradient{background:#fff!important;border:1px solid var(--shell-line)!important;box-shadow:0 2px 7px rgba(15,23,42,.035)!important}
197 .grid-kpi .kpi-gradient .kpi-lbl{color:#475569!important}
198 .grid-kpi .kpi-gradient .kpi-val{color:#10204b!important;font-size:19px}
199 .grid-kpi .kpi-gradient .kpi-icon{background:#f1f7fb!important;color:#087c8a!important}
200 .card,.kpi-unit{border-color:var(--shell-line);box-shadow:0 2px 7px rgba(15,23,42,.035)}
201 .fin-dashboard-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:2px 0 16px}.fin-dashboard-head h1{font-size:25px;color:#10204b;margin:3px 0}.fin-dashboard-head p,.fin-breadcrumb{font-size:11px;color:#64748b}.fin-dashboard-actions{display:flex;gap:8px}
202 .fin-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}.fin-kpi-card{background:#fff;border:1px solid var(--shell-line);border-radius:10px;padding:16px;display:flex;align-items:flex-start;gap:12px;min-height:118px;box-shadow:0 2px 7px rgba(15,23,42,.035)}.fin-kpi-icon{width:42px;height:42px;border-radius:10px;background:#edf7fb;color:#1685d1;display:grid;place-items:center;font-size:21px;flex:0 0 auto}.fin-kpi-card small{display:block;color:#475569;font-size:11.5px;margin-bottom:8px}.fin-kpi-card strong{display:block;color:#10204b;font-size:20px;direction:rtl}.fin-kpi-card em{display:block;color:#94a3b8;font-style:normal;font-size:10px;margin-top:7px}
203 .fin-dashboard-grid{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(280px,.9fr);gap:12px}.fin-card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.fin-card-head h3{font-size:14px;color:#10204b}.fin-card-head small{display:block;color:#94a3b8;font-size:10px;margin-top:3px}.fin-cash-chart{min-height:255px;display:flex;align-items:center;justify-content:center}.fin-cash-chart svg{width:100%;height:245px;overflow:visible}.fin-chart-legend{display:flex;gap:14px;font-size:10px;color:#64748b}.fin-chart-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-left:4px}.fin-status-row{padding:10px 0;border-bottom:1px solid #f0f3f7}.fin-status-row:last-child{border-bottom:0}.fin-status-line{display:flex;justify-content:space-between;gap:8px;font-size:11px;color:#334155;margin-bottom:6px}.fin-status-track{height:7px;background:#edf2f7;border-radius:999px;overflow:hidden}.fin-status-fill{height:100%;background:#0a9baa;border-radius:999px}.fin-dashboard-bottom{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(0,1.7fr);gap:12px;margin-top:12px}.fin-quick-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.fin-quick-grid button{border:1px solid #e5eaf1;background:#fff;border-radius:8px;min-height:72px;padding:8px 4px;font:inherit;font-size:10.5px;color:#334155;cursor:pointer}.fin-quick-grid button:hover{border-color:#9bd0d6;background:#f3fbfc;color:#087c8a}.fin-quick-grid span{display:block;font-size:20px;color:#1685d1;margin-bottom:5px}.fin-text-btn{border:0;background:transparent;color:#1685d1;font:inherit;font-size:11px;cursor:pointer}
204 @media(max-width:1180px){.fin-kpi-grid{grid-template-columns:repeat(2,1fr)}.fin-dashboard-grid,.fin-dashboard-bottom{grid-template-columns:1fr}}@media(max-width:620px){.fin-dashboard-head{align-items:flex-start;flex-direction:column}.fin-kpi-grid{grid-template-columns:1fr 1fr}.fin-kpi-card{padding:11px;min-height:100px}.fin-kpi-card strong{font-size:15px}.fin-quick-grid{grid-template-columns:repeat(2,1fr)}}
205 @media(max-width:1100px){:root{--shell-panel:210px}.topbar{padding-inline:12px}.topbar-pill.fiscal-pill{display:none}}
206 @media(max-width:820px){
207 .app-shell-nav,.module-panel,.module-panel-handle{display:none!important}
208 .topbar,.shell-panel-collapsed .topbar{right:0;height:58px;padding:8px 10px;gap:7px}
209 .topbar-menu{display:none}
210 .topbar-actions .topbar-pill{display:none}
211 .global-search{height:38px;max-width:none}
212 .main-surface,.shell-panel-collapsed .main-surface{margin-right:0;max-width:100%;padding:72px 12px 92px}
213 .workspace-context{overflow:hidden;white-space:nowrap}
214 .mobile-dock{display:flex}
215 .whatsapp-support{bottom:84px}
216 }
217 @media(max-width:520px){.grid-kpi{grid-template-columns:1fr 1fr}.kpi-unit{padding:11px;gap:8px}.grid-kpi .kpi-gradient .kpi-val{font-size:14px}.kpi-icon{width:36px;height:36px}.workspace-context{font-size:10px}}
218 @media print{.topbar,.module-panel,.app-shell-nav,.workspace-context{display:none!important}.main-surface{margin:0!important;max-width:none!important;padding:0!important}}
219 </style>
220 </head>
221 <body>
222
223 <div id="auth-screen">
224 <div class="auth-shell">
225 <div class="auth-card">
226 <div class="auth-brand">
227 <img class="auth-brand-logo" src="assets/finora-icon-180.png?v=20261002-brand-v1" alt="نشان فینورا" />
228 <div><h1>نرم‌افزار ERP سازمانی فینورا</h1><p>ورود یا ثبت‌نام امن در محیط سازمانی</p></div>
229 </div>
230 <div id="auth-form-container">
231 <button class="btn auth-google" onclick="signInWithGoogle()"><span class="auth-google-mark">G</span><span>ادامه با Google</span></button>
232 <div class="auth-divider">یا با ایمیل</div>
233 <div class="form-group"><label>ایمیل</label><input type="email" id="auth-email" class="form-control" placeholder="name@example.com" autocomplete="email" autocapitalize="none" dir="ltr" /></div>
234 <div class="form-group"><label>رمز عبور</label><input type="password" id="auth-password" class="form-control" placeholder="رمز عبور" autocomplete="current-password" dir="ltr" /></div>
235 <div class="auth-actions">
236 <button class="btn btn-primary" onclick="handleLogin()">ورود با رمز</button>
237 <button class="btn btn-secondary" onclick="startEmailOtp(false,false)">ورود با کد ایمیل</button>
238 </div>
239 <button class="btn auth-signup" onclick="startEmailOtp(false,true)">ثبت‌نام با کد ایمیل</button>
240 <p class="auth-note">ورود با کد ایمیل برای حساب موجود است. ایجاد حساب جدید فقط از مسیر «ثبت‌نام با کد ایمیل» انجام می‌شود.</p>
241 </div>
242 <div id="auth-otp-container" style="display:none">
243 <p style="font-size:13px;line-height:1.9;margin-bottom:12px">کد یک‌بارمصرف به <strong dir="ltr" id="auth-otp-email-label"></strong> ارسال شد. پوشه‌ی هرزنامه را هم ببینید.</p>
244 <div class="form-group"><label>کد تأیید</label><input type="text" id="auth-otp" class="form-control" inputmode="numeric" autocomplete="one-time-code" placeholder="------" dir="ltr" /></div>
245 <div class="auth-actions"><button class="btn btn-primary" onclick="verifyEmailOtp()">تأیید کد</button><button class="btn btn-secondary" onclick="startEmailOtp(true)">ارسال دوباره</button></div>
246 <button class="btn btn-secondary" style="width:100%;margin-top:10px" onclick="backToAuthMain()">بازگشت</button>
247 </div>
248 <div id="auth-setpass-container" style="display:none">
249 <p style="font-size:13px;line-height:1.9;margin-bottom:12px">ایمیل شما تأیید شد. برای ورودهای بعدی می‌توانید یک رمز عبور تعیین کنید.</p>
250 <div class="form-group"><label>رمز عبور جدید</label><input type="password" id="auth-newpass" class="form-control" placeholder="حداقل ۸ کاراکتر" autocomplete="new-password" dir="ltr" /></div>
251 <div class="form-group"><label>تکرار رمز عبور</label><input type="password" id="auth-newpass2" class="form-control" placeholder="تکرار رمز" autocomplete="new-password" dir="ltr" /></div>
252 <button class="btn btn-primary" style="width:100%;margin-top:16px" onclick="saveNewPassword()">ذخیره رمز و ورود</button>
253 <button class="btn btn-secondary" style="width:100%;margin-top:10px" onclick="skipSetPassword()">فعلاً بدون رمز ادامه بده</button>
254 </div>
255 </div>
256 <aside class="auth-visual" aria-label="معرفی فینورا">
257 <div class="auth-hero">
258 <img class="auth-hero-logo" src="assets/finora-icon-180.png?v=20261002-brand-v1" alt="" aria-hidden="true" />
259 <h2>Finora</h2><div class="erp">ENTERPRISE ERP</div>
260 <p class="tagline">مدیریت یکپارچه، تصمیم‌گیری هوشمند، رشد پایدار</p>
261 <div class="auth-dashboard-art" aria-hidden="true"><div class="auth-glass auth-glass-main"></div><div class="auth-glass auth-glass-side"><span>⌂</span><span>▥</span><span>♙</span><span>◇</span></div><div class="auth-chart"></div></div>
262 </div>
263 </aside>
264 </div>
265 </div>
266
267 <div id="sync-badge" style="display:none;position:fixed;bottom:80px;left:12px;z-index:9999;color:#fff;padding:6px 12px;border-radius:999px;font-size:12px;box-shadow:0 2px 8px rgba(0,0,0,.25)"></div>
268 <div class="app-root">
269 <aside class="sidebar app-shell-nav no-print" aria-label="ناوبری اصلی">
270 <div class="brand-box">
271 <img class="brand-icon" src="assets/finora-icon-180.png?v=20261002-brand-v1" alt="" aria-hidden="true" />
272 <div class="brand-copy"><h2>فینورا</h2><small>نسخه ۱.۰</small><span class="sr-only">فینورا — نسخه ۱.۰</span></div>
273 </div>
274 <div class="module-rail" id="module-rail">
275 <button class="module-tab active" data-module="dashboard" data-view="view-dashboard" onclick="openModule('dashboard','view-dashboard','overview')" title="داشبورد"><span>⌂</span><b>داشبورد</b></button>
276 <button class="module-tab" data-module="accounting" data-view="view-accounting-foundation" onclick="openModule('accounting','view-accounting-foundation','accounts')" title="حسابداری"><span>▦</span><b>حسابداری</b></button>
277 <button class="module-tab" data-module="commerce" data-view="view-invoices" onclick="openModule('commerce','view-invoices')" title="بازرگانی"><span>⇄</span><b>بازرگانی</b></button>
278 <button class="module-tab" data-module="treasury" data-view="view-payments" onclick="openModule('treasury','view-payments')" title="خزانه‌داری"><span>◈</span><b>خزانه</b></button>
279 <button class="module-tab" data-module="projects" data-view="view-contracting" onclick="openModule('projects','view-contracting')" title="پیمان‌ها"><span>▧</span><b>پیمان‌ها</b></button>
280 <button class="module-tab" data-module="inventory" data-view="view-inventory" onclick="openModule('inventory','view-inventory','stock')" title="انبار"><span>▦</span><b>انبار</b></button>
281 <button class="module-tab" data-module="assets" data-view="view-assets" onclick="openModule('assets','view-assets','asset-register')" title="دارایی ثابت"><span>◆</span><b>دارایی</b></button>
282 <button class="module-tab" data-module="enterprise" data-view="view-enterprise" onclick="openModule('enterprise','view-enterprise','employees')" title="سازمان"><span>♙</span><b>سازمان</b></button>
283 <button class="module-tab" data-module="reports" data-view="view-reports" onclick="openModule('reports','view-reports')" title="گزارش‌ها"><span>▥</span><b>گزارش</b></button>
284 <button class="module-tab" data-module="settings" data-view="view-settings" onclick="openModule('settings','view-settings')" title="تنظیمات"><span>⚙</span><b>تنظیمات</b></button>
285 </div>
286 <div class="sidebar-footer">
287 <span id="logged-user-label">کاربر</span>
288 <button class="shell-logout" onclick="handleLogout()" title="خروج">خروج</button>
289 </div>
290 </aside>
291 <aside class="module-panel no-print" id="module-panel" aria-label="زیرمنوی ماژول">
292 <div class="module-panel-head">
293 <div><small>زیرسیستم</small><h3 id="module-panel-title">داشبورد</h3></div>
294 </div>
295 <div id="module-panel-links" class="module-panel-links"></div>
296 </aside>
297 <button id="module-panel-handle" class="module-panel-handle no-print" type="button" onclick="toggleModulePanel()" aria-label="جمع کردن پنل زیرسیستم" aria-controls="module-panel" aria-expanded="true" title="جمع/باز کردن پنل زیرسیستم">›</button>
298 <header class="topbar no-print">
299 <button class="topbar-menu" onclick="toggleModulePanel()" aria-label="منو">☰</button>
300 <div class="global-search">
301 <span>⌕</span><input id="global-command-search" type="search" placeholder="جست‌وجوی منو؛ مثلاً فروش، چک، گزارش..." autocomplete="off" oninput="renderCommandSearch(this.value)" onkeydown="handleCommandSearchKey(event)" />
302 <div id="command-search-results" class="command-results"></div>
303 </div>
304 <div class="topbar-actions">
305 <button class="topbar-pill fiscal-pill" id="topbar-fiscal-year" onclick="navigateShell('accounting','view-accounting-foundation','fiscal')" title="سال مالی">سال مالی جاری</button>
306 <button class="topbar-pill" id="topbar-company" onclick="navigateShell('settings','view-settings','company')" title="شرکت فعال">شرکت فعال</button>
307 <div class="quick-create">
308 <button class="topbar-pill" id="quick-create-toggle" onclick="toggleQuickCreateMenu(event)" aria-haspopup="true" aria-expanded="false" title="ایجاد سریع">+ ایجاد سریع</button>
309 <div class="quick-create-menu" id="quick-create-menu" role="menu" aria-label="ایجاد سریع">
310 <div class="quick-create-group">اسناد و عملیات</div>
311 <button onclick="navigateShell('commerce','view-invoices');closeQuickCreateMenu()">فاکتور فروش</button>
312 <button onclick="navigateShell('commerce','view-purchases');closeQuickCreateMenu()">فاکتور خرید</button>
313 <button onclick="navigateShell('treasury','view-payments');closeQuickCreateMenu()">دریافت / پرداخت</button>
314 <button onclick="navigateShell('accounting','view-journal','new');closeQuickCreateMenu()">سند حسابداری</button>
315 <div class="quick-create-group">اطلاعات پایه</div>
316 <button onclick="navigateShell('commerce','view-contacts');closeQuickCreateMenu()">طرف حساب</button>
317 <button onclick="navigateShell('commerce','view-products');closeQuickCreateMenu()">کالا / خدمت</button>
318 </div>
319 </div>
320 </div>
321 </header>
322
323 <a class="whatsapp-support no-print" href="https://wa.me/989124376991?text=سلام%20داود%20عزیز،%20درباره%20نرم‌افزار%20فینورا%20سؤال%20داشتم." target="_blank" rel="noopener" title="پشتیبانی واتس‌اپ">
324 <svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.451.03-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>
325 <span>پشتیبانی واتس‌اپ</span>
326 </a>
327
328 <main class="main-surface">
329 <div class="workspace-context no-print"><span class="workspace-eyebrow">مسیر کاری</span><strong id="workspace-title">داشبورد</strong><span id="workspace-context-text">نمای یکپارچه عملیات مالی</span></div>
330
331
332 <section id="view-dashboard" class="view-pane active">
333 <div class="fin-dashboard-head"><div><div class="fin-breadcrumb">داشبورد / نمای مالی</div><h1>داشبورد مالی</h1><p id="dashboard-date-display"></p></div><div class="fin-dashboard-actions no-print"><span id="user-license-status-badge" class="badge badge-warning">در حال بررسی...</span><button class="btn btn-secondary btn-inline" onclick="navigateShell('accounting','view-journal','new')">+ سند حسابداری</button><button class="btn btn-primary btn-inline" onclick="startNewInvoice()">+ فاکتور فروش</button></div></div>
334 <div id="dashboard-license-details"></div>
335 <div class="fin-kpi-grid">
336 <div class="fin-kpi-card"><span class="fin-kpi-icon">◔</span><div><small>جمع دارایی‌ها</small><strong id="kpi-assets-sum">۰</strong><em>بر اساس دفتر قطعی</em></div></div>
337 <div class="fin-kpi-card"><span class="fin-kpi-icon">▰</span><div><small>مانده نقد و بانک</small><strong id="kpi-cash-sum">۰</strong><em>حساب نقش نقد/بانک</em></div></div>
338 <div class="fin-kpi-card"><span class="fin-kpi-icon">◎</span><div><small>دریافتنی‌های جاری</small><strong id="kpi-receivable-sum">۰</strong><em>مانده فاکتورهای نسیه</em></div></div>
339 <div class="fin-kpi-card"><span class="fin-kpi-icon">▣</span><div><small>پرداختنی‌های جاری</small><strong id="kpi-payable-sum">۰</strong><em>مانده خریدهای نسیه</em></div></div>
340 </div>
341 <div class="fin-dashboard-grid">
342 <div class="card fin-chart-card"><div class="fin-card-head"><div><h3>گردش ورود و خروج نقدینگی</h3><small>شش ماه اخیر بر اساس دریافت و پرداخت ثبت‌شده</small></div></div><div id="dashboard-cashflow-chart" class="fin-cash-chart"></div></div>
343 <div class="card fin-status-card"><div class="fin-card-head"><div><h3>وضعیت حساب‌ها</h3><small>ترکیب مانده‌های عملیاتی</small></div></div><div id="dashboard-account-status"></div></div>
344 </div>
345 <div class="fin-dashboard-bottom">
346 <div class="card fin-quick-card"><div class="fin-card-head"><h3>دسترسی سریع</h3></div><div class="fin-quick-grid">
347 <button onclick="navigateShell('accounting','view-accounting-foundation','fiscal')"><span>▣</span>سال مالی</button>
348 <button onclick="navigateShell('accounting','view-accounting-foundation','dimensions')"><span>⌘</span>تفصیلی‌های شناور</button>
349 <button onclick="navigateShell('accounting','view-accounting-foundation','accounts')"><span>▦</span>کدینگ حساب‌ها</button>
350 <button onclick="navigateShell('accounting','view-journal','new')"><span>+</span>سند حسابداری</button>
351 <button onclick="navigateShell('accounting','view-accounting-reports','trial')"><span>▥</span>تراز آزمایشی</button>
352 <button onclick="navigateShell('accounting','view-accounting-reports','ledger')"><span>▤</span>دفاتر حسابداری</button>
353 <button onclick="navigateShell('treasury','view-payments')"><span>↔</span>گردش حساب</button>
354 <button onclick="navigateShell('settings','view-data-center','data-backup')"><span>⇅</span>پشتیبان و داده</button>
355 </div></div>
356 <div class="card fin-recent-card"><div class="fin-card-head"><h3>آخرین اسناد حسابداری</h3><button class="fin-text-btn" onclick="navigateShell('accounting','view-journal','register')">همه اسناد</button></div><div class="table-responsive"><table><thead><tr><th>شماره سند</th><th>تاریخ</th><th>شرح</th><th>جمع بدهکار</th><th>جمع بستانکار</th><th>وضعیت</th></tr></thead><tbody id="dashboard-recent-journals"><tr><td colspan="6" class="af-empty">سندی ثبت نشده است.</td></tr></tbody></table></div></div>
357 </div>
358 </section>
359
360 <section id="view-reports" class="view-pane">
361 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px">
362 <h1 style="font-size:20px;font-weight:bold">📈 گزارشات مالی</h1>
363 <select id="report-year-select" class="form-control" style="max-width:160px" onchange="renderFinancialReports()"></select>
364 </div>
365
366 <div class="grid-kpi">
367 <div class="kpi-unit kpi-gradient" style="background:linear-gradient(135deg,#6366f1,#4338ca)"><div class="kpi-icon" style="background:rgba(255,255,255,.2);color:#fff">💵</div><div><div class="kpi-lbl" style="color:rgba(255,255,255,.85)">مجموع فروش سال</div><div class="kpi-val" style="color:#fff" id="rep-year-total">۰</div></div></div>
368 <div class="kpi-unit kpi-gradient" style="background:linear-gradient(135deg,#ec4899,#be185d)"><div class="kpi-icon" style="background:rgba(255,255,255,.2);color:#fff">📊</div><div><div class="kpi-lbl" style="color:rgba(255,255,255,.85)">میانگین فروش ماهانه</div><div class="kpi-val" style="color:#fff" id="rep-year-avg">۰</div></div></div>
369 <div class="kpi-unit kpi-gradient" style="background:linear-gradient(135deg,#14b8a6,#0f766e)"><div class="kpi-icon" style="background:rgba(255,255,255,.2);color:#fff">🏆</div><div><div class="kpi-lbl" style="color:rgba(255,255,255,.85)">پرفروش‌ترین ماه</div><div class="kpi-val" style="color:#fff" id="rep-best-month">—</div></div></div>
370 <div class="kpi-unit kpi-gradient" style="background:linear-gradient(135deg,#f97316,#c2410c)"><div class="kpi-icon" style="background:rgba(255,255,255,.2);color:#fff">🧾</div><div><div class="kpi-lbl" style="color:rgba(255,255,255,.85)">تعداد فاکتور صادرشده</div><div class="kpi-val" style="color:#fff" id="rep-invoice-count">۰</div></div></div>
371 </div>
372
373 <div class="card">
374 <h3 style="font-size:15px;margin-bottom:6px">روند فروش ماهانه</h3>
375 <div class="report-bar-wrap" id="report-monthly-chart"></div>
376 </div>
377
378 <div class="card">
379 <h3 style="font-size:15px;margin-bottom:12px">مشتریان برتر (بر اساس مبلغ خرید)</h3>
380 <div class="table-responsive">
381 <table>
382 <thead><tr><th>مشتری</th><th>تعداد فاکتور</th><th>جمع خرید (<span class="cur-label">ریال</span>)</th></tr></thead>
383 <tbody id="report-top-customers"><tr><td colspan="3" style="text-align:center;color:var(--text-muted);padding:20px">داده‌ای برای نمایش وجود ندارد.</td></tr></tbody>
384 </table>
385 </div>
386 </div>
387
388 <div class="card">
389 <h3 style="font-size:15px;margin-bottom:12px">تفکیک نوع فاکتور</h3>
390 <div style="display:flex;gap:24px;flex-wrap:wrap">
391 <div>🔴 رسمی: <strong id="rep-formal-count">۰</strong> فقره — <strong id="rep-formal-sum">۰</strong></div>
392 <div>🟢 غیررسمی: <strong id="rep-informal-count">۰</strong> فقره — <strong id="rep-informal-sum">۰</strong></div>
393 </div>
394 </div>
395 <div class="card">
396 <h3 style="font-size:15px;margin-bottom:12px">خلاصه سود و زیان و جریان نقدی</h3>
397 <div class="grid-kpi" style="margin-bottom:12px">
398 <div class="kpi-unit"><div><div class="kpi-lbl">خرید سال</div><div class="kpi-val" id="rep-purchase-total">۰</div></div></div>
399 <div class="kpi-unit"><div><div class="kpi-lbl">هزینه‌ها</div><div class="kpi-val" id="rep-expense-total">۰</div></div></div>
400 <div class="kpi-unit"><div><div class="kpi-lbl">سود تعهدی</div><div class="kpi-val" id="rep-accrual-profit">۰</div></div></div>
401 <div class="kpi-unit"><div><div class="kpi-lbl">خالص جریان نقدی</div><div class="kpi-val" id="rep-cash-net">۰</div></div></div>
402 </div>
403 <div class="table-responsive"><table><thead><tr><th>شاخص</th><th>مبلغ (<span class="cur-label">ریال</span>)</th></tr></thead><tbody id="report-financial-summary"></tbody></table></div>
404 </div>
405 </section>
406
407 <section id="view-accounting-reports" class="view-pane"><div style="margin-bottom:14px"><h1 style="font-size:20px;font-weight:bold">گزارش‌های حرفه‌ای حسابداری</h1><p style="font-size:12px;color:var(--text-muted)">مبنای گزارش: اسناد قطعی دفتر کل؛ فیلترها در فضای گزارش اعمال می‌شوند.</p></div><div id="p6-reporting-root"></div></section>
408
409 <section id="view-invoices" class="view-pane">
410 <div class="card no-print">
411 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px">
412 <h2 style="font-size:17px" id="invoice-form-title">صدور فاکتور جدید</h2>
413 <div style="display:flex;gap:8px;flex-wrap:wrap;align-items:center">
414 <label class="btn btn-secondary btn-inline" style="min-height:34px;padding:4px 10px;font-size:12px">📥 ورود اقلام از اکسل<input type="file" id="excel-import-invoice-items" style="display:none" onchange="importInvoiceItemsFromExcel(event)" accept=".xlsx, .xls" /></label>
415 <button class="btn btn-secondary btn-inline" style="display:none;padding:4px 10px;font-size:12px" id="btn-cancel-edit" onclick="cancelInvoiceEdit()">انصراف از ویرایش</button>
416 </div>
417 </div>
418 <input type="hidden" id="edit-invoice-id" value="" />
419 <div class="form-row" style="background:#f1f5f9;padding:12px;border-radius:10px;margin-bottom:14px">
420 <div class="form-group" style="margin-bottom:0"><label>تاریخ فاکتور</label><input type="text" id="invoice-date-input" class="form-control" /></div>
421 <div class="form-group" style="margin-bottom:0"><label>شماره فاکتور</label><input type="text" id="invoice-number" class="form-control" placeholder="PINV-31" /></div>
422 <div class="form-group" style="margin-bottom:0">
423 <label>قالب و نوع سند</label>
424 <select id="invoice-kind" class="form-control" onchange="handleInvoiceKindChange()">
425 <option value="non_formal">فاکتور غیررسمی</option>
426 <option value="formal">فاکتور رسمی</option>
427 <option value="pre_invoice">پیش‌فاکتور فروش</option>
428 <option value="contract_statement">صورت وضعیت پیمان</option>
429 </select>
430 </div>
431 </div>
432 <div class="form-row">
433 <div class="form-group"><label>فروشنده (سربرگ شرکت)</label><select id="invoice-company-id" class="form-control" onchange="onActiveCompanyFilterChange()"></select></div>
434 <div class="form-group">
435 <label style="display:flex;justify-content:space-between"><span>نام خریدار را وارد یا انتخاب کنید</span><a href="#" style="color:var(--primary);text-decoration:none" onclick="openQuickContactModal();return false">➕ شخص جدید</a></label>
436 <div style="display:flex;gap:8px">
437 <select id="invoice-contact-id" class="form-control" style="flex:1" onchange="handleInvoiceContactChange()"></select>
438 <button class="btn btn-secondary btn-inline" type="button" onclick="openQuickContactModal()" style="padding:0 12px;min-height:42px">➕</button>
439 </div>
440 </div>
441 </div>
442 <div class="form-row"><div class="form-group"><label>نحوه تسویه</label><select id="invoice-payment-method" class="form-control"><option value="cash">نقدی / تسویه‌شده</option><option value="credit">نسیه / ایجاد مطالبات</option></select></div><div class="form-group"><label>انبار خروج کالا</label><select id="invoice-warehouse-id" class="form-control"></select></div></div>
443 <div class="form-row" id="box-invoice-project-row" style="display:none">
444 <div class="form-group"><label>پروژه طرف‌حساب</label><select id="invoice-project-id" class="form-control"></select></div>
445 </div>
446 <div class="form-row" id="box-invoice-contract-number" style="display:none;background:#fef3c7;padding:12px;border-radius:10px;margin-bottom:14px">
447 <div class="form-group" style="margin-bottom:0"><label>شماره پیمان <span style="color:var(--danger)">*</span></label><input type="text" id="invoice-contract-number" class="form-control" placeholder="شماره پیمان الزامی است" /></div>
448 </div>
449 <div style="margin:16px 0">
450 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px">
451 <h4 style="font-size:14px">اقلام کالا یا خدمات</h4>
452 <button class="btn btn-secondary btn-inline" style="font-size:12px;min-height:34px;padding:4px 10px" onclick="openQuickProductModal()">➕ کالای جدید</button>
453 </div>
454 <div class="table-responsive">
455 <table id="invoice-items-table">
456 <thead><tr style="background:#e2e8f0"><th style="width:40px;text-align:center">#</th><th>شرح کالا | خدمات</th><th style="width:90px;text-align:center">واحد</th><th style="width:100px;text-align:center">مقدار</th><th style="width:160px;text-align:left">قیمت واحد (<span class="cur-label">ریال</span>)</th><th style="width:170px;text-align:left">قیمت کل (<span class="cur-label">ریال</span>)</th><th style="width:50px;text-align:center">حذف</th></tr></thead>
457 <tbody id="invoice-items-table-body"></tbody>
458 </table>
459 </div>
460 <button class="btn btn-secondary btn-inline" style="margin-top:10px;width:100%;border:1.5px dashed var(--primary);color:var(--primary);background:#eff6ff" onclick="addInvoiceItemRow()">+ افزودن ردیف</button>
461 </div>
462 <div class="form-row" style="background:#f1f5f9;padding:14px;border-radius:10px;margin-top:12px">
463 <div class="form-group" style="background:#fff;padding:12px;border-radius:8px;border:1px solid var(--border);margin-bottom:0">
464 <label style="font-weight:bold;border-bottom:1px solid #eee;padding-bottom:6px;margin-bottom:8px">مالیات و تخفیف</label>
465 <div id="box-invoice-vat-mode-row" style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px">
466 <span>مالیات ارزش افزوده</span>
467 <select id="invoice-vat-mode" class="form-control" style="width:140px;min-height:36px" onchange="handleVatModeChange()"><option value="none">غیرفعال</option><option value="with_vat">فعال</option></select>
468 </div>
469 <div id="box-invoice-vat-rate" style="display:none;justify-content:space-between;align-items:center;margin-bottom:8px;gap:8px">
470 <select id="invoice-vat-type" class="form-control" style="width:110px;min-height:36px" onchange="handleVatTypeChange()"><option value="percent">درصدی</option><option value="fixed">مبلغ ثابت</option></select>
471 <input type="text" inputmode="decimal" id="invoice-vat-rate-input" class="form-control" style="width:100px;min-height:36px" value="10" oninput="handleMoneyInput(this);recomputeTotals()" />
472 </div>
473 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;gap:8px">
474 <span>تخفیف کلی فاکتور</span>
475 <select id="invoice-discount-type" class="form-control" style="width:110px;min-height:36px" onchange="handleDiscountTypeChange()"><option value="fixed">مبلغ ثابت</option><option value="percent">درصدی</option></select>
476 </div>
477 <div style="display:flex;justify-content:space-between;align-items:center">
478 <span id="label-invoice-discount-value">مبلغ تخفیف (ریال)</span>
479 <input type="text" inputmode="decimal" id="invoice-discount-fixed" class="form-control" style="width:140px;min-height:36px" value="0" oninput="handleMoneyInput(this);recomputeTotals()" />
480 </div>
481 </div>
482 <div class="form-group" style="background:#fff;padding:12px;border-radius:8px;border:1px solid var(--border);margin-bottom:0">
483 <label style="font-weight:bold;border-bottom:1px solid #eee;padding-bottom:6px;margin-bottom:8px">جمع‌بندی نهایی</label>
484 <div style="display:flex;justify-content:space-between;margin-bottom:6px;font-size:13px"><span>جمع کل:</span><span id="summary-subtotal" style="font-weight:bold">۰ ریال</span></div>
485 <div style="display:flex;justify-content:space-between;margin-bottom:6px;font-size:13px"><span>مالیات:</span><span id="summary-vat" style="font-weight:bold">۰ ریال</span></div>
486 <div style="display:flex;justify-content:space-between;margin-bottom:6px;font-size:14px;border-top:1px solid #eee;padding-top:6px"><span style="font-weight:bold;color:var(--primary)">قابل پرداخت:</span><span id="summary-grandtotal" style="font-weight:bold;color:var(--primary)">۰ ریال</span></div>
487 <div style="font-size:11px;color:var(--text-muted);margin-top:4px" id="summary-words">به حروف: صفر ریال</div>
488 </div>
489 </div>
490 <div class="form-row" style="margin-top:14px">
491 <div class="form-group" style="margin-bottom:0"><label>توضیحات فاکتور</label><textarea id="invoice-desc-input" class="form-control" rows="2" placeholder="توضیحات تکمیلی..."></textarea></div>
492 </div>
493 <div id="box-enable-electronic-doc" style="display:none;margin-top:14px;padding:14px;background:#fef3c7;border-radius:10px;border:1.5px solid #fcd34d">
494 <label style="display:flex;align-items:center;gap:10px;cursor:pointer">
495 <input type="checkbox" id="enable-electronic-doc" onchange="toggleElectronicDoc()" style="width:18px;height:18px" />
496 <span style="font-weight:bold;font-size:14px;color:#92400e">📄 صدور سند الکترونیکی سامانه مودیان</span>
497 </label>
498 <div id="edoc-status" style="font-size:12px;color:#475569;margin-top:8px"></div>
499 </div>
500 <div style="display:flex;gap:10px;margin-top:16px;flex-wrap:wrap">
501 <button class="btn btn-success" id="btn-save-invoice" onclick="commitSaveInvoice()">💾 ثبت فاکتور</button>
502 </div>
503 </div>
504
505 <div class="card no-print">
506 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:10px">
507 <h3 style="font-size:15px">دفتر بایگانی فاکتورها</h3>
508 <select id="filter-invoice-company" class="form-control" style="width:200px;min-height:36px" onchange="renderInvoices()"></select>
509 </div>
510 <div class="table-responsive">
511 <table>
512 <thead><tr><th>شماره</th><th>فروشنده</th><th>خریدار</th><th>نوع</th><th>تاریخ</th><th>قابل پرداخت (<span class="cur-label">ریال</span>)</th><th>عملیات</th></tr></thead>
513 <tbody id="invoice-archive-table-body"></tbody>
514 </table>
515 </div>
516 </div>
517 </section>
518
519 <section id="view-products" class="view-pane">
520 <div class="card no-print">
521 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px">
522 <h2 style="font-size:17px">تعریف کالا / خدمت جدید</h2>
523 <div style="display:flex;gap:8px">
524 <label class="btn btn-secondary btn-inline" style="min-height:36px;padding:4px 12px;font-size:13px">📥 ورود از اکسل<input type="file" id="excel-import-products" style="display:none" onchange="importProductsFromExcel(event)" accept=".xlsx, .xls" /></label>
525 <button class="btn btn-secondary btn-inline" style="min-height:36px;padding:4px 12px;font-size:13px" onclick="downloadProductsExcelTemplate()">📄 نمونه اکسل</button>
526 </div>
527 </div>
528 <div class="form-row">
529 <div class="form-group"><label>کد کالا</label><input type="text" id="prod-code-input" class="form-control" placeholder="101" /></div>
530 <div class="form-group"><label>عنوان کالا</label><input type="text" id="prod-name-input" class="form-control" placeholder="هارد سرور..." /></div>
531 <div class="form-group"><label>مشخصه / مدل</label><input type="text" id="prod-spec-input" class="form-control" placeholder="2.5 اینچ SAS" /></div>
532 <div class="form-group"><label>واحد</label><input type="text" id="prod-unit-input" class="form-control" value="عدد" /></div>
533 </div>
534 <div class="form-row">
535 <div class="form-group"><label>نوع</label><select id="prod-type-input" class="form-control"><option value="good">کالا (انبارشونده)</option><option value="service">خدمت (غیرانبارشونده)</option></select></div>
536 <div class="form-group"><label>گروه / دسته</label><input type="text" id="prod-category-input" class="form-control" /></div>
537 <div class="form-group"><label>بارکد</label><input type="text" id="prod-barcode-input" class="form-control" /></div>
538 <div class="form-group"><label>حداقل موجودی</label><input type="text" id="prod-min-stock-input" class="form-control" value="0" /></div>
539 </div>
540 <div class="form-row">
541 <div class="form-group"><label>قیمت خرید (<span class="cur-label">ریال</span>)</label><input type="text" inputmode="decimal" id="prod-buy-input" class="form-control" value="0" oninput="handleMoneyInput(this)" /></div>
542 <div class="form-group"><label>قیمت فروش (<span class="cur-label">ریال</span>)</label><input type="text" inputmode="decimal" id="prod-sale-input" class="form-control" value="0" oninput="handleMoneyInput(this)" /></div>
543 <div class="form-group"><label>شناسه کالا/خدمت داخلی</label><input type="text" id="prod-internal-id-input" class="form-control" placeholder="2330004169617" /><small style="color:var(--text-muted)">در سند الکترونیکی به‌صورت خودکار استفاده می‌شود.</small></div><div class="form-group"><label>شناسه کالا/خدمت سامانه مالیاتی (خارجی)</label><input type="text" id="prod-official-id-input" class="form-control" placeholder="در صورت وجود ثبت کنید" /><small style="color:var(--text-muted)">اگر خالی باشد هنگام صدور سند الکترونیکی دریافت می‌شود.</small></div>
544 </div>
545 <div style="display:flex;gap:8px;flex-wrap:wrap"><button id="product-save-btn" class="btn btn-success" onclick="commitSaveProduct()">➕ ثبت کالا</button><button id="product-edit-cancel-btn" class="btn btn-secondary" style="display:none" onclick="cancelProductEdit()">انصراف از اصلاح</button></div>
546 </div>
547 <div class="card">
548 <h3 style="font-size:15px;margin-bottom:12px">کالاهای ثبت‌شده</h3>
549 <div class="table-responsive">
550 <table><thead><tr><th>کد</th><th>نام</th><th>نوع</th><th>گروه</th><th>واحد</th><th>قیمت فروش (<span class="cur-label">ریال</span>)</th><th>بارکد / شناسه</th><th>عملیات</th></tr></thead><tbody id="products-catalog-table-body"></tbody></table>
551 </div>
552 </div>
553 </section>
554
555 <section id="view-contacts" class="view-pane">
556 <div class="card no-print">
557 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px">
558 <h2 style="font-size:17px">ثبت طرف حساب جدید</h2>
559 <div style="display:flex;gap:8px">
560 <label class="btn btn-secondary btn-inline" style="min-height:36px;padding:4px 12px;font-size:13px">📥 ورود از اکسل<input type="file" id="excel-import-contacts" style="display:none" onchange="importContactsFromExcel(event)" accept=".xlsx, .xls" /></label>
561 <button class="btn btn-secondary btn-inline" style="min-height:36px;padding:4px 12px;font-size:13px" onclick="downloadContactsExcelTemplate()">📄 نمونه اکسل</button>
562 </div>
563 </div>
564 <div class="form-row">
565 <div class="form-group"><label>نوع شخص</label><select id="contact-entity-type" class="form-control" onchange="handleContactEntityChange()"><option value="natural">شخص حقیقی</option><option value="legal">شخص حقوقی</option></select></div>
566 <div class="form-group" id="box-contact-prefix"><label>پیشوند</label><select id="contact-prefix-select" class="form-control"><option value="آقا/خانم">آقا / خانم</option><option value="فروشگاه">فروشگاه</option></select></div>
567 <div class="form-group" style="grid-column:span 2" id="box-contact-name"><label>نام طرف حساب</label><input type="text" id="contact-name-input" class="form-control" placeholder="دانشگاه صنعتی شریف..." /></div>
568 </div>
569 <div class="form-row">
570 <div class="form-group"><label>نقش</label><select id="contact-role-input" class="form-control"><option value="customer">مشتری / خریدار</option><option value="supplier">تأمین‌کننده / فروشنده</option><option value="both">هر دو (خرید و فروش)</option></select></div>
571 <div class="form-group"><label>همراه</label><input type="text" id="contact-mobile-input" class="form-control" /></div>
572 <div class="form-group"><label id="label-contact-national">شناسه ملی</label><input type="text" id="contact-national-input" class="form-control" /></div>
573 <div class="form-group" id="box-contact-economic"><label>کد اقتصادی</label><input type="text" id="contact-economic-input" class="form-control" /></div>
574 </div>
575 <div class="form-row">
576 <div class="form-group" id="box-contact-reg"><label>شماره ثبت</label><input type="text" id="contact-reg-input" class="form-control" /></div>
577 <div class="form-group"><label>کد پستی</label><input type="text" id="contact-postal-input" class="form-control" /></div>
578 <div class="form-group" style="grid-column:span 2"><label>نشانی</label><input type="text" id="contact-address-input" class="form-control" /></div>
579 </div>
580 <div class="form-row">
581 <div class="form-group"><label>حالت پروژه</label><select id="contact-project-mode" class="form-control"><option value="single">بدون پروژه</option><option value="multi">پروژه‌محور (پروژه و زیرپروژه)</option></select></div>
582 </div>
583 <div style="display:flex;gap:8px;flex-wrap:wrap"><button id="contact-save-btn" class="btn btn-success" onclick="commitSaveContact()">➕ ثبت طرف حساب</button><button id="contact-edit-cancel-btn" class="btn btn-secondary" style="display:none" onclick="cancelContactEdit()">انصراف از اصلاح</button></div>
584 </div>
585 <div class="card">
586 <h3 style="font-size:15px;margin-bottom:12px">دفتر اشخاص</h3>
587 <div class="table-responsive">
588 <table><thead><tr><th>نام</th><th>نوع</th><th>شناسه / کد ملی</th><th>کد اقتصادی</th><th>کد پستی</th><th>همراه</th><th>مانده (<span class="cur-label">ریال</span>)</th><th>پروژه‌ها</th><th>عملیات</th></tr></thead><tbody id="contacts-ledger-table-body"></tbody></table>
589 </div>
590 </div>
591 </section>
592
593 <section id="view-cheques" class="view-pane">
594 <div class="card">
595 <h2 style="font-size:17px;margin-bottom:14px">ثبت چک صیادی</h2>
596 <div class="form-row">
597 <div class="form-group"><label>نوع</label><select id="chq-direction-input" class="form-control"><option value="inbound">دریافتی</option><option value="outbound">پرداختی</option></select></div>
598 <div class="form-group"><label>طرف حساب</label><select id="chq-contact-select" class="form-control"></select></div>
599 <div class="form-group"><label>شناسه صیادی</label><input type="text" id="chq-sayad-input" class="form-control" /></div>
600 <div class="form-group"><label>بانک</label><input type="text" id="chq-bank-input" class="form-control" /></div>
601 </div>
602 <div class="form-row">
603 <div class="form-group"><label>مبلغ (<span class="cur-label">ریال</span>)</label><input type="text" inputmode="decimal" id="chq-amount-input" class="form-control" oninput="handleMoneyInput(this)" /></div>
604 <div class="form-group"><label>سررسید</label><input type="text" id="chq-due-input" class="form-control" placeholder="1405/06/30" /></div>
605 <div class="form-group"><label>وضعیت</label><select id="chq-status-input" class="form-control"><option value="registered">در جریان</option><option value="cleared">وصول / پرداخت شده</option><option value="bounced">برگشتی / ناموفق</option><option value="cancelled">باطل شده</option></select></div>
606 </div>
607 <div style="display:flex;gap:8px;flex-wrap:wrap"><button id="cheque-save-btn" class="btn btn-success" onclick="commitSaveCheque()">➕ ثبت چک</button><button id="cheque-edit-cancel-btn" class="btn btn-secondary" style="display:none" onclick="cancelChequeEdit()">انصراف از اصلاح</button></div>
608 </div>
609 <div class="card">
610 <h3 style="font-size:15px;margin-bottom:12px">لیست چک‌ها</h3>
611 <div class="table-responsive"><table><thead><tr><th>نوع</th><th>طرف حساب</th><th>بانک / صیاد</th><th>مبلغ (<span class="cur-label">ریال</span>)</th><th>سررسید</th><th>وضعیت</th><th>عملیات</th></tr></thead><tbody id="cheques-ledger-table-body"></tbody></table></div>
612 </div>
613 </section>
614
615 <section id="view-expenses" class="view-pane">
616 <div class="card">
617 <h2 style="font-size:17px;margin-bottom:14px">ثبت هزینه / درآمد</h2>
618 <div class="form-row">
619 <div class="form-group"><label>نوع</label><select id="trx-kind-input" class="form-control"><option value="expense">هزینه</option><option value="income">درآمد</option></select></div>
620 <div class="form-group"><label>سرفصل</label><select id="trx-category-input" class="form-control"><option value="قبوض">قبوض</option><option value="حقوق">حقوق</option><option value="سایر">سایر</option></select></div>
621 <div class="form-group"><label>طرف حساب (اختیاری)</label><select id="trx-contact-select" class="form-control" onchange="refreshExpenseProjects()"><option value="">بدون طرف حساب</option></select></div>
622 <div class="form-group"><label>پروژه / مرکز هزینه (اختیاری)</label><select id="trx-project-select" class="form-control"><option value="">بدون پروژه</option></select></div>
623 <div class="form-group"><label>مبلغ (<span class="cur-label">ریال</span>)</label><input type="text" inputmode="decimal" id="trx-amount-input" class="form-control" oninput="handleMoneyInput(this)" /></div>
624 <div class="form-group"><label>شرح</label><input type="text" id="trx-desc-input" class="form-control" /></div>
625 </div>
626 <div style="display:flex;gap:8px;flex-wrap:wrap"><button id="expense-save-btn" class="btn btn-success" onclick="commitSaveExpense()">➕ ثبت سند</button><button id="expense-edit-cancel-btn" class="btn btn-secondary" style="display:none" onclick="cancelExpenseEdit()">انصراف از اصلاح</button></div>
627 </div>
628 <div class="card">
629 <h3 style="font-size:15px;margin-bottom:12px">گردش هزینه و درآمد</h3>
630 <div class="table-responsive"><table><thead><tr><th>نوع</th><th>سرفصل</th><th>طرف حساب</th><th>پروژه / مرکز هزینه</th><th>شرح</th><th>مبلغ (<span class="cur-label">ریال</span>)</th><th>عملیات</th></tr></thead><tbody id="expenses-ledger-table-body"></tbody></table></div>
631 </div>
632 </section>
633
634 <section id="view-contracting" class="view-pane"><div id="phase4-root"></div></section>
635 <section id="view-inventory" class="view-pane"><div id="p5-inventory-root"></div></section>
636 <section id="view-assets" class="view-pane"><div id="p5-assets-root"></div></section>
637 <section id="view-currency" class="view-pane"><div id="p5-currency-root"></div></section>
638 <section id="view-data-center" class="view-pane"><div id="p5-data-root"></div></section>
639 <section id="view-integrations" class="view-pane"><div id="p5-integrations-root"></div></section>
640
641 <section id="view-settings" class="view-pane">
642 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px">
643 <h2 style="font-size:17px">⚙️ تنظیمات و شرکت‌ها</h2>
644 <button class="btn btn-danger btn-inline no-print" style="padding:6px 12px;font-size:12px;min-height:32px" onclick="handleLogout()">🚪 خروج از حساب کاربری</button>
645 </div>
646
647 <div class="accordion-item" data-finora-task="account">
648 <div class="accordion-header" onclick="toggleAccordion(this)"><span>🔐 حساب کاربری و رمز عبور</span><span>▼</span></div>
649 <div class="accordion-body">
650 <p style="font-size:13px;color:var(--text-muted);margin-bottom:10px">با تعیین رمز عبور، دفعات بعد می‌توانید علاوه بر ورود با گوگل، مستقیم با ایمیل و رمز عبور هم وارد سامانه شوید.</p>
651 <div class="form-row">
652 <div class="form-group"><label>رمز عبور جدید</label><input type="password" id="acct-newpass" class="form-control" placeholder="حداقل ۸ کاراکتر" /></div>
653 <div class="form-group"><label>تکرار رمز عبور</label><input type="password" id="acct-newpass2" class="form-control" /></div>
654 </div>
655 <button class="btn btn-primary" onclick="changeAccountPassword()">💾 ذخیره رمز عبور</button>
656 </div>
657 </div>
658
659 <div class="accordion-item open" data-finora-task="company">
660 <div class="accordion-header" onclick="toggleAccordion(this)"><span>🏢 اطلاعات فروشگاه و چاپ (مدیریت شرکت‌ها)</span><span>▼</span></div>
661 <div class="accordion-body">
662 <div class="form-row">
663 <div class="form-group"><label>نوع شخص</label><select id="company-entity-type" class="form-control" onchange="handleCompanyEntityTypeChange()"><option value="legal">حقوقی</option><option value="natural">حقیقی / کسب‌وکار فردی</option></select></div>
664 <div class="form-group" id="company-sector-box"><label>ماهیت مالکیت / بخش</label><select id="company-sector" class="form-control"><option value="private">خصوصی</option><option value="cooperative">تعاونی</option><option value="public_non_government">عمومی غیردولتی</option><option value="government">دولتی / حکومتی</option><option value="other">سایر</option></select></div><div class="form-group" id="company-organization-box"><label>جایگاه در گروه شرکت‌ها</label><select id="company-organization-role" class="form-control" onchange="handleCompanyOrganizationRoleChange()"><option value="standalone">شرکت / واحد مستقل</option><option value="holding_parent">شرکت مادر / هلدینگ</option><option value="subsidiary">شرکت تابعه</option></select></div><div class="form-group" id="company-parent-box" style="display:none"><label>شرکت مادر</label><select id="company-parent-id" class="form-control"><option value="">— انتخاب شرکت مادر —</option></select><small style="color:var(--text-muted)">این رابطه فعلاً ساختار سازمانی را ثبت می‌کند؛ تلفیق، حذف معاملات درون‌گروهی و گزارش گروهی ماژول جداگانه خواهند بود.</small></div>
665 <div class="form-group" id="company-legal-form-box"><label>قالب حقوقی ثبت</label><select id="company-legal-form" class="form-control"><option value="private_joint_stock">سهامی خاص</option><option value="public_joint_stock">سهامی عام</option><option value="limited_liability">با مسئولیت محدود</option><option value="general_partnership">تضامنی</option><option value="relative_partnership">نسبی</option><option value="mixed_non_stock">مختلط غیرسهامی</option><option value="mixed_stock">مختلط سهامی</option><option value="cooperative">تعاونی</option><option value="noncommercial_institution">مؤسسه غیرتجاری</option><option value="other">سایر / نامشخص</option></select></div>
666 <div class="form-group"><label>نوع فعالیت عملیاتی</label><select id="company-activity-type" class="form-control"><option value="trading">بازرگانی</option><option value="service">خدماتی</option><option value="manufacturing">تولیدی</option><option value="contracting">پیمانکاری</option><option value="retail">فروشگاهی</option><option value="distribution">پخش</option><option value="nonprofit">غیرانتفاعی</option><option value="professional">خدمات حرفه‌ای</option></select></div>
667 </div>
668 <div class="form-row">
669 <div class="form-group"><label>راه‌اندازی حسابداری</label><select id="company-accounting-template" class="form-control"><option value="recommended">اعمال کدینگ پیشنهادی Finora</option><option value="empty">شروع با کدینگ خالی</option></select></div>
670 <div class="form-group"><label id="company-name-label">نام شرکت / کسب‌وکار</label><input type="text" id="company-name-input" class="form-control" placeholder="آرا سپهر راستین" /></div>
671 <div class="form-group"><label>تلفن</label><input type="text" id="company-phone-input" class="form-control" /></div>
672 </div>
673 <div class="form-row">
674 <div class="form-group"><label id="company-national-label">شناسه ملی</label><input type="text" id="company-national-input" class="form-control" /></div>
675 <div class="form-group"><label>کد اقتصادی</label><input type="text" id="company-economic-input" class="form-control" /></div>
676 <div class="form-group" id="company-registration-box"><label>شماره ثبت</label><input type="text" id="company-reg-input" class="form-control" /></div>
677 <div class="form-group"><label>کد پستی</label><input type="text" id="company-postal-input" class="form-control" /></div>
678 </div>
679 <div class="form-group"><label>نشانی کامل</label><input type="text" id="company-address-input" class="form-control" /></div>
680 <div class="form-group"><label>پاورقی فاکتور</label><textarea id="company-footer-input" class="form-control" rows="2"></textarea></div>
681 <div style="display:flex;gap:8px;flex-wrap:wrap"><button id="company-save-btn" class="btn btn-success" onclick="commitSaveCompany()">➕ ثبت شرکت جدید</button><button id="company-edit-cancel-btn" class="btn btn-secondary" style="display:none" onclick="cancelCompanyEdit()">انصراف از اصلاح</button></div>
682 <div style="margin-top:16px">
683 <h4 style="font-size:14px;margin-bottom:8px">لیست شرکت‌های ثبت‌شده</h4>
684 <div class="table-responsive"><table><thead><tr><th>نام</th><th>شخصیت / قالب</th><th>نوع فعالیت</th><th>شناسه ملی</th><th>کد اقتصادی</th><th>پیش‌فرض</th><th>عملیات</th></tr></thead><tbody id="companies-table-body"></tbody></table></div>
685 </div>
686 </div>
687 </div>
688
689 <div class="accordion-item" data-finora-task="invoice-defaults">
690 <div class="accordion-header" onclick="toggleAccordion(this)"><span>⚙️ مالیات، تخفیف و واحد پول (پیش‌فرض فاکتور جدید)</span><span>▼</span></div>
691 <div class="accordion-body">
692 <div class="form-row">
693 <div class="form-group"><label>قالب پیش‌فرض فاکتور</label><select id="def-invoice-kind" class="form-control"><option value="non_formal">فاکتور غیررسمی</option><option value="formal">فاکتور رسمی</option><option value="pre_invoice">پیش‌فاکتور فروش</option><option value="contract_statement">صورت وضعیت پیمان</option></select></div>
694 <div class="form-group"><label>وضعیت پیش‌فرض ارزش افزوده</label><select id="def-vat-mode" class="form-control"><option value="none">بدون ارزش افزوده</option><option value="with_vat">با ارزش افزوده</option></select></div>
695 <div class="form-group"><label>نرخ ارزش افزوده (درصد)</label><input type="text" inputmode="decimal" id="def-vat-rate" class="form-control" value="10" oninput="handleMoneyInput(this)" /></div>
696 </div>
697 <div class="form-row">
698 <div class="form-group"><label>واحد پول</label><select id="def-currency-mode" class="form-control" onchange="handleCurrencyModeChange()"><option value="rial">ریال</option><option value="toman">تومان</option><option value="custom">سایر (دلخواه)</option></select></div>
699 <div class="form-group" id="box-currency-custom" style="display:none"><label>نام واحد پول دلخواه</label><input type="text" id="def-currency-custom" class="form-control" placeholder="مثلاً: یورو، دلار، درهم..." /></div>
700 </div>
701 <button class="btn btn-primary" onclick="commitSaveDefaultSettings()">ذخیره پیش‌فرض‌ها</button>
702 </div>
703 </div>
704
705 <div class="accordion-item" data-finora-task="legacy-backup">
706 <div class="accordion-header" onclick="toggleAccordion(this)"><span>💾 دیتابیس و پشتیبان‌گیری</span><span>▼</span></div>
707 <div class="accordion-body">
708 <p style="font-size:13px;color:var(--text-muted);margin-bottom:12px">وضعیت دیتابیس: <span class="badge badge-success">تفکیک کاربر فعال</span></p>
709 <div style="display:flex;gap:10px;flex-wrap:wrap">
710 <button class="btn btn-secondary" onclick="exportDataBlob()">📥 دانلود فایل پشتیبان (JSON)</button>
711 <label class="btn btn-secondary" style="margin-bottom:0">📤 بازگردانی فایل<input type="file" id="import-json-file" style="display:none" onchange="importDataBlob(event)" accept=".json" /></label>
712 </div>
713 </div>
714 </div>
715
716 <div class="accordion-item" data-finora-task="about">
717 <div class="accordion-header" onclick="toggleAccordion(this)"><span>ℹ️ درباره نرم‌افزار</span><span>▼</span></div>
718 <div class="accordion-body">
719 <h3 style="font-size:16px;font-weight:bold">فینورا - Finora</h3>
720 <p style="color:var(--text-muted);font-size:13px;margin:6px 0 12px 0">نرم‌افزار ERP سازمانی فینورا</p>
721 <p style="font-size:13px;margin-bottom:8px">نگارش فعال: <strong>نسخه ۱.۰</strong></p>
722 <div class="about-dev-card">
723 <div class="about-dev-avatar">د.م</div>
724 <div class="about-dev-info">
725 <h4>داود مهربان</h4>
726 <p>طراح و توسعه‌دهنده نرم‌افزار</p>
727 <p>📱 <span dir="ltr" style="font-family:Tahoma">0912-437-6991</span></p>
728 </div>
729 <div class="about-dev-actions">
730 <a class="btn-wa" href="https://wa.me/989124376991?text=سلام%20داود%20عزیز،%20درباره%20نرم‌افزار%20فینورا%20سؤال%20داشتم." target="_blank" rel="noopener">
731 <svg viewBox="0 0 24 24" fill="currentColor" width="14" height="14"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.451.03-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/></svg>
732 واتس‌اپ
733 </a>
734 <a class="btn-call" href="tel:+989124376991">📞 تماس</a>
735 </div>
736 </div>
737 <div style="display:flex;gap:10px;margin-top:10px">
738 <button class="btn btn-primary" onclick="alert('آخرین نگارش نصب است.')">بررسی آپدیت</button>
739 <button class="btn btn-secondary" onclick="alert('پشتیبانی فعال است.')">گزارش باگ</button>
740 </div>
741 </div>
742 </div>
743 </section>
744
745 <section id="view-admin" class="view-pane">
746 <div class="card">
747 <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:10px">
748 <div><h2 style="font-size:18px;color:var(--danger)">👑 پنل مدیریت مرکزی کاربران و لایسنس‌ها</h2><p style="color:var(--text-muted);font-size:13px;margin-top:4px">تعریف کاربران، تخصیص طرح‌های لایسنس، تمدید، تغییر مدت و لغو اشتراک.</p></div>
749 <button class="btn btn-primary btn-inline" onclick="refreshAdminPanel()">🔄 تازه‌سازی لیست</button>
750 </div>
751 <div style="background:#eff6ff;border:1px solid #bfdbfe;border-radius:10px;padding:14px;margin-bottom:20px;font-size:13px;line-height:1.9">کاربران خودشان از صفحه ورود ثبت‌نام می‌کنند و ۱۵ روز آزمایشی می‌گیرند. در این پنل فقط لایسنس‌ها (فعال‌سازی، تمدید، تغییر طرح، لغو) مدیریت می‌شود و کنترل نهایی روی سرور انجام می‌شود.</div>
752 <div class="table-responsive">
753 <table><thead><tr><th>کاربر</th><th>وضعیت حساب</th><th>نوع اشتراک</th><th>ظرفیت شرکت</th><th>ظرفیت کاربران</th><th>تاریخ شروع</th><th>تاریخ پایان</th><th>روزهای باقیمانده</th><th>عملیات مدیریت لایسنس</th></tr></thead><tbody id="admin-users-table-body"><tr><td colspan="9" style="text-align:center;padding:20px">در حال بارگذاری کاربران...</td></tr></tbody></table>
754 </div>
755 </div>
756 </section>
757
758 <div id="printable-invoice" style="display:none"></div>
759 </main>
760 </div>
761
762 <div class="modal-backdrop" id="modal-user-onboarding"><div class="modal-card" style="max-width:520px"><h3 style="font-size:18px;margin-bottom:6px">خوش آمدید به فینورا</h3><p style="font-size:12.5px;color:var(--text-muted);line-height:1.9;margin-bottom:14px">برای شخصی‌سازی محیط کاری، نام و نقش حرفه‌ای خودتان را مشخص کنید. این نقش فقط برای تجربه کاربری است و دسترسی «مدیر سیستم» ایجاد نمی‌کند.</p><div class="form-group"><label>نام و نام خانوادگی</label><input id="onboarding-full-name" class="form-control" maxlength="80" placeholder="مثلاً محمد رضایی" autocomplete="name"></div><div class="form-group"><label>در فینورا با چه نقشی کار می‌کنید؟</label><select id="onboarding-professional-role" class="form-control"><option value="business_owner">مالک / مدیر کسب‌وکار</option><option value="financial_manager">مدیر مالی</option><option value="chief_accountant">رئیس حسابداری</option><option value="accountant">حسابدار</option><option value="treasury">خزانه‌دار</option><option value="sales">فروش / بازرگانی</option><option value="warehouse">انباردار</option><option value="auditor">حسابرس / ناظر</option><option value="other">سایر</option></select></div><button class="btn btn-primary" style="width:100%;margin-top:12px" onclick="saveUserOnboarding()">ذخیره و ورود به محیط کار</button></div></div>
763
764 <div class="modal-backdrop" id="modal-quick-contact">
765 <div class="modal-card">
766 <h3 style="font-size:16px;margin-bottom:12px">➕ تعریف سریع خریدار</h3>
767 <div class="form-row">
768 <div class="form-group"><label>نوع</label><select id="quick-c-entity" class="form-control" onchange="handleQuickCEntityChange()"><option value="natural">شخص حقیقی</option><option value="legal">شخص حقوقی</option></select></div>
769 <div class="form-group" id="box-quick-c-prefix"><label>پیشوند</label><select id="quick-c-prefix" class="form-control"><option value="آقا/خانم">آقا / خانم</option><option value="فروشگاه">فروشگاه</option></select></div>
770 <div class="form-group" style="grid-column:span 2" id="box-quick-c-name"><label>نام</label><input type="text" id="quick-c-name" class="form-control" /></div>
771 </div>
772 <div class="form-row">
773 <div class="form-group"><label id="label-quick-c-national">شناسه ملی</label><input type="text" id="quick-c-national" class="form-control" /></div>
774 <div class="form-group" id="box-quick-c-economic"><label>کد اقتصادی</label><input type="text" id="quick-c-economic" class="form-control" /></div>
775 <div class="form-group" id="box-quick-c-reg"><label>شماره ثبت</label><input type="text" id="quick-c-reg" class="form-control" /></div>
776 </div>
777 <div class="form-row">
778 <div class="form-group"><label>کد پستی</label><input type="text" id="quick-c-postal" class="form-control" /></div>
779 <div class="form-group"><label>تلفن</label><input type="text" id="quick-c-mobile" class="form-control" /></div>
780 </div>
781 <div class="form-group"><label>نشانی</label><input type="text" id="quick-c-address" class="form-control" /></div>
782 <div style="display:flex;gap:10px;margin-top:12px">
783 <button class="btn btn-success" onclick="saveQuickContact()">ذخیره و انتخاب</button>
784 <button class="btn btn-secondary" onclick="closeQuickContactModal()">انصراف</button>
785 </div>
786 </div>
787 </div>
788
789 <div class="modal-backdrop" id="modal-quick-product">
790 <div class="modal-card">
791 <h3 style="font-size:16px;margin-bottom:12px">➕ تعریف سریع کالا</h3>
792 <div class="form-row">
793 <div class="form-group"><label>کد</label><input type="text" id="quick-p-code" class="form-control" /></div>
794 <div class="form-group"><label>عنوان</label><input type="text" id="quick-p-name" class="form-control" /></div>
795 <div class="form-group"><label>مشخصه</label><input type="text" id="quick-p-spec" class="form-control" /></div>
796 </div>
797 <div class="form-row">
798 <div class="form-group"><label>واحد</label><input type="text" id="quick-p-unit" class="form-control" value="عدد" /></div>
799 <div class="form-group"><label>قیمت فروش (<span class="cur-label">ریال</span>)</label><input type="text" inputmode="decimal" id="quick-p-price" class="form-control" value="0" oninput="handleMoneyInput(this)" /></div>
800 <div class="form-group"><label>شناسه کالا/خدمت داخلی</label><input type="text" id="quick-p-internal-id" class="form-control" /></div><div class="form-group"><label>شناسه کالا/خدمت سامانه مالیاتی</label><input type="text" id="quick-p-official-id" class="form-control" /></div>
801 </div>
802 <div style="display:flex;gap:10px;margin-top:12px">
803 <button class="btn btn-success" onclick="saveQuickProduct()">ذخیره و افزودن</button>
804 <button class="btn btn-secondary" onclick="closeQuickProductModal()">انصراف</button>
805 </div>
806 </div>
807 </div>
808
809 <div class="modal-backdrop" id="modal-admin-license-edit">
810 <div class="modal-card">
811 <h3 style="font-size:16px;margin-bottom:12px" id="modal-license-user-title">تغییر مدت و لایسنس کاربر</h3>
812 <input type="hidden" id="modal-license-target-username" />
813 <div class="form-group"><label>انتخاب مدت و نوع لایسنس جدید</label><select id="modal-license-duration-select" class="form-control"><option value="monthly">اشتراک ۱ ماهه (۳۰ روز)</option><option value="three_months">اشتراک ۳ ماهه (۹۰ روز)</option><option value="annual">اشتراک ۱ ساله (۳۶۵ روز)</option><option value="lifetime">اشتراک دائمی (Lifetime)</option></select></div><div class="form-row"><div class="form-group"><label>حداکثر تعداد شرکت حقوقی</label><input id="modal-license-company-limit" type="number" min="1" max="1000" value="1" class="form-control"><small id="modal-license-company-limit-hint" style="color:var(--text-muted)">ناحیه/واحد سهمیه شرکت مصرف نمی‌کند.</small></div><div class="form-group"><label>حداکثر کاربران نام‌دار</label><input id="modal-license-user-limit" type="number" min="1" max="100000" value="1" class="form-control"><small id="modal-license-user-limit-hint" style="color:var(--text-muted)">هر عضو فعال یک Seat مصرف می‌کند.</small></div></div>
814 <div style="display:flex;gap:10px;margin-top:16px">
815 <button class="btn btn-success" style="flex:1" onclick="applyLicenseDurationChange()">تایید و اعمال لایسنس</button>
816 <button class="btn btn-secondary" style="flex:1" onclick="closeLicenseEditModal()">انصراف</button>
817 </div>
818 </div>
819 </div>
820
821 <div class="modal-backdrop" id="modal-electronic-doc">
822 <div class="modal-card" style="max-width:850px">
823 <h3 style="font-size:16px;margin-bottom:6px">📄 سند الکترونیکی سامانه مودیان</h3>
824 <p style="font-size:12px;color:var(--text-muted);margin-bottom:14px">اطلاعات این سند فقط برای فاکتور رسمی قابل تکمیل است.</p>
825
826 <h4 style="font-size:14px;margin-bottom:8px;color:#1e3a8a;border-bottom:1px solid #e2e8f0;padding-bottom:6px">الف) سربرگ صورتحساب</h4>
827 <div class="form-row">
828 <div class="form-group"><label>شماره منحصر به فرد مالیاتی</label><input type="text" id="edoc-unique-number" class="form-control" placeholder="A2EAG4050E000000043C9" /></div>
829 <div class="form-group"><label>شماره مالیاتی مندرج در برگه تشخیص</label><input type="text" id="edoc-tax-number" class="form-control" placeholder="0000000043C" /></div>
830 </div>
831 <div class="form-row">
832 <div class="form-group"><label>تاریخ و زمان صدور</label><input type="text" id="edoc-issue-datetime" class="form-control" placeholder="1405/06/17 11:35:00" /></div>
833 <div class="form-group"><label>نوع صورتحساب</label><select id="edoc-kind" class="form-control"><option value="اصل">اصل</option><option value="برگشت">برگشت</option><option value="اصلاحی">اصلاحی</option></select></div>
834 </div>
835 <div class="form-row">
836 <div class="form-group"><label>تاریخ صورتحساب الکترونیکی اصلی</label><input type="text" id="edoc-original-date" class="form-control" placeholder="1405/06/17" /></div>
837 <div class="form-group"><label>شماره صورتحساب الکترونیکی اصلی</label><input type="text" id="edoc-original-number" class="form-control" placeholder="140505" /></div>
838 </div>
839 <div class="form-row">
840 <div class="form-group"><label>الگو / موضوع صورتحساب</label><select id="edoc-pattern" class="form-control" onchange="handleEdocPatternChange()"><option value="کالا">فروش کالا</option><option value="خدمات">خدمات</option><option value="پیمانکاری">قرارداد پیمانکاری</option><option value="هردو">هر دو (کالا و خدمات)</option></select></div>
841 </div>
842
843 <h4 style="font-size:14px;margin:14px 0 8px 0;color:#1e3a8a;border-bottom:1px solid #e2e8f0;padding-bottom:6px">ب) اقلام کالا/خدمت</h4>
844 <div id="edoc-items-container"></div>
845
846 <h4 style="font-size:14px;margin:14px 0 8px 0;color:#1e3a8a;border-bottom:1px solid #e2e8f0;padding-bottom:6px">ج) موارد اختصاصی قرارداد پیمانکاری</h4>
847 <div id="box-edoc-contract" style="display:none">
848 <div class="form-group"><label>شناسه یکتای ثبت قرارداد</label><input type="text" id="edoc-contract-id" class="form-control" placeholder="205108734859" /></div>
849 </div>
850 <div id="edoc-contract-hint" style="font-size:12px;color:var(--text-muted);padding:8px;background:#f8fafc;border-radius:6px">این بخش فقط برای الگوی «قرارداد پیمانکاری» فعال است.</div>
851
852 <div style="display:flex;gap:10px;margin-top:16px">
853 <button class="btn btn-success" onclick="saveElectronicDocToPending()">💾 ذخیره اطلاعات سند</button>
854 <button class="btn btn-secondary" onclick="cancelElectronicDoc()">انصراف</button>
855 </div>
856 </div>
857 </div>
858
859 <nav class="mobile-dock" aria-label="ناوبری موبایل">
860 <div class="dock-tab active" data-view="view-dashboard" onclick="switchView('view-dashboard')"><span>📊</span><span>داشبورد</span></div>
861 <div class="dock-tab" data-view="view-invoices" onclick="switchView('view-invoices')"><span>🧾</span><span>فاکتور</span></div>
862 <div class="dock-tab" data-view="view-purchases" onclick="switchView('view-purchases')"><span>🛒</span><span>خرید</span></div>
863 <div class="dock-tab" data-view="view-payments" onclick="switchView('view-payments')"><span>💳</span><span>دریافت/پرداخت</span></div>
864 <div class="dock-tab" data-view="view-inventory" onclick="switchView('view-inventory')"><span>🏭</span><span>انبار</span></div>
865 <div class="dock-tab" data-view="view-reports" onclick="switchView('view-reports')"><span>📈</span><span>گزارش</span></div>
866 <div class="dock-tab" data-view="view-contacts" onclick="switchView('view-contacts')"><span>👥</span><span>اشخاص</span></div>
867 <div class="dock-tab" data-view="view-products" onclick="switchView('view-products')"><span>📦</span><span>کالا</span></div>
868 <div class="dock-tab" data-view="view-cheques" onclick="switchView('view-cheques')"><span>🏦</span><span>چک</span></div>
869 <div class="dock-tab" data-view="view-expenses" onclick="switchView('view-expenses')"><span>💰</span><span>هزینه/درآمد</span></div>
870 <div class="dock-tab" data-view="view-settings" onclick="switchView('view-settings')"><span>⚙️</span><span>تنظیمات</span></div>
871 </nav>
872
873 <script src="js/core.js?v=20260928-security-v4"></script>
874 <script src="js/admin.js"></script>
875 <script src="js/sync.js?v=20260928-data-v4"></script>
876 <script src="js/ui.js?v=20261002-shell-scroll-ownership-v2"></script>
877 <script src="js/invoices.js?v=20260928-phase3-final"></script>
878 <script src="js/print.js?v=20261003-image-ready"></script>
879 <script src="js/products.js"></script>
880 <script src="js/contacts.js?v=20260928-roles-v3"></script>
881 <script src="js/cheques.js"></script>
882 <script src="js/expenses.js"></script>
883 <script src="js/companies.js?v=20260928-integrity-v4"></script>
884 <script src="js/backup.js?v=20260928-data-v3"></script>
885 <script src="js/words.js"></script>
886 <script src="js/bootstrap.js"></script>
887
888 <style>
889 .form-control, textarea, select { direction: rtl; }
890 </style>
891
892 <script src="js/patches.js"></script>
893 <script src="js/idle-and-reports.js?v=20260928-phase3-v5"></script>
894 <script src="js/money-format.js"></script>
895 <script src="js/projects.js?v=20260928-projects-v7"></script>
896 <script src="js/invoice-excel-import.js"></script>
897 <script src="js/purchases.js?v=20260928-phase3-final"></script>
898 <script src="js/commercial-rnd.js?v=20261007-commerce-r1"></script>
899 <script src="js/operations.js?v=20260928-phase3-final"></script>
900 <script src="js/payments.js?v=20260928-phase3-final"></script>
901 <script src="js/accounting.js?v=20260928-accounting-v3"></script>
902 <style id="phase2-accounting-style">
903 .af-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px}.af-head h1{font-size:20px;color:#0f172a}.af-head p,.af-hint{font-size:12px;color:#64748b;margin-top:5px}.af-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.af-space,.af-list{margin-top:14px}.af-chip{display:inline-flex;align-items:center;gap:6px;background:#eef7f8;color:#0b6874;border:1px solid #cce9ec;border-radius:999px;padding:6px 10px;margin:3px;font-size:11px}.af-chip button{border:0;background:transparent;color:#b91c1c;cursor:pointer;font-size:15px}.af-master-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px;border-bottom:1px solid #edf1f5}.af-master-row:last-child{border-bottom:0}.af-master-row small{display:block;color:#64748b;margin-top:3px}.af-empty{text-align:center;padding:18px;color:#64748b}@media(max-width:820px){.af-grid{grid-template-columns:1fr}}
904 </style>
905 <script src="js/accounting-foundation.js?v=20261007-p0-r1"></script>
906 <script src="js/journal-engine.js?v=20261007-p0-r1"></script>
907 <script src="js/accounting-foundation-ui.js?v=20261003-chart-v4"></script>
908 <script src="js/accounting-foundation-render.js?v=20260928-phase2-v1"></script>
909 <script src="js/journal-ui.js?v=20261007-p0-r1"></script>
910 <script src="js/drilldown.js?v=20260928-drill-v10"></script>
911 <script src="js/phase4-contracting.js?v=20260929-phase4-v1"></script>
912 <script src="js/phase5-domain.js?v=20260929-phase5-v1"></script>
913 <script src="js/phase5-enterprise.js?v=20260929-phase5-v1"></script>
914 <script src="js/phase6-reporting.js?v=20260929-phase6-v1"></script>
915 <script src="js/enterprise-iran.js?v=20260930-iran-erp-v1"></script>
916 <script src="js/enterprise-iran-v2.js?v=20260930-iran-erp-v2"></script>
917 <script src="js/selfcheck.js?v=20260928-release-1-0"></script>
918 <script src="js/ux-hardening-r2.js?v=20261007-ux-r2"></script>
919
920 </body>
921 </html>