سامانه صدور فاکتور و حسابداری
exec-phase1-qa
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
| 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>فینورا | سامانه صدور فاکتور و مدیریت مالی</title> |
| 7 | <link rel="manifest" href="manifest.json" /> |
| 8 | <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'" /> |
| 9 | <meta name="apple-mobile-web-app-capable" content="yes" /> |
| 10 | <meta name="theme-color" content="#2563eb" /> |
| 11 | <script src="vendor/supabase.js"></script> |
| 12 | <script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script> |
| 13 | <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/misc/Farsi-Digits/Vazirmatn-FD-font-face.css" /> |
| 14 | <style> |
| 15 | :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} |
| 16 | html,body{width:100%;max-width:100%;overflow-x:hidden!important;position:relative} |
| 17 | *{box-sizing:border-box;margin:0;padding:0;font-family:'Vazirmatn FD',-apple-system,BlinkMacSystemFont,Tahoma,sans-serif;-webkit-tap-highlight-color:transparent} |
| 18 | body{background-color:var(--bg);color:var(--text);font-size:14px} |
| 19 | #auth-screen{position:fixed;top:0;left:0;right:0;bottom:0;background:linear-gradient(135deg,#1e3a8a,#2563eb);z-index:9999;display:flex;align-items:center;justify-content:center;padding:20px} |
| 20 | .auth-card{background:#fff;border-radius:16px;max-width:420px;width:100%;padding:30px;box-shadow:0 25px 50px -12px rgba(0,0,0,.25);text-align:right} |
| 21 | .app-root{display:flex;min-height:100vh;width:100%;max-width:100%;overflow-x:hidden} |
| 22 | .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} |
| 23 | .brand-box{padding:20px;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--border)} |
| 24 | .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} |
| 25 | .sidebar-menu{list-style:none;padding:16px 8px;flex:1;overflow-y:auto} |
| 26 | .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} |
| 27 | .sidebar-menu li a:hover,.sidebar-menu li a.active{background:#eff6ff;color:var(--primary);font-weight:bold} |
| 28 | .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} |
| 29 | .main-surface{flex:1;margin-right:var(--sidebar-w);padding:20px;padding-bottom:100px;max-width:calc(100% - var(--sidebar-w));overflow-x:hidden} |
| 30 | .mobile-dock{display:none;position:fixed;bottom:0;left:0;right:0;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;justify-content:space-around;align-items:center;padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -4px 12px rgba(0,0,0,.06)} |
| 31 | .dock-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:#475569;text-decoration:none;font-size:10.5px;font-weight:600;flex:1;height:100%;cursor:pointer} |
| 32 | .dock-tab.active{color:var(--primary);font-weight:800} |
| 33 | .dock-tab svg{width:20px;height:20px;stroke-width:2} |
| 34 | .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} |
| 35 | .whatsapp-support:hover{transform:translateY(-3px);box-shadow:0 12px 28px rgba(37,211,102,.55)} |
| 36 | .whatsapp-support svg{width:22px;height:22px;flex-shrink:0} |
| 37 | .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} |
| 38 | .grid-kpi{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin-bottom:18px} |
| 39 | .kpi-gradient{box-shadow:0 4px 14px rgba(0,0,0,.12);border:none} |
| 40 | .quick-actions-row{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:16px} |
| 41 | .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} |
| 42 | .qa-btn:hover{filter:brightness(1.08)} |
| 43 | .report-bar-wrap{display:flex;align-items:flex-end;gap:6px;height:160px;padding:10px 4px;overflow-x:auto} |
| 44 | .report-bar-col{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:38px} |
| 45 | .report-bar{width:26px;border-radius:6px 6px 0 0;background:linear-gradient(180deg,#8b5cf6,#6d28d9);transition:height .3s} |
| 46 | .report-bar-label{font-size:10px;color:var(--text-muted);white-space:nowrap} |
| 47 | .report-bar-value{font-size:10px;font-weight:bold;color:var(--text)} |
| 48 | .kpi-unit{background:var(--card-bg);border:1px solid var(--border);border-radius:10px;padding:16px;display:flex;align-items:center;gap:14px} |
| 49 | .kpi-icon{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:20px} |
| 50 | .kpi-val{font-size:17px;font-weight:bold;margin-top:4px} |
| 51 | .kpi-lbl{color:var(--text-muted);font-size:12px;font-weight:500} |
| 52 | .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} |
| 53 | .btn:hover{background:var(--primary-hover)} |
| 54 | .btn-secondary{background:#e2e8f0;color:var(--text)} |
| 55 | .btn-secondary:hover{background:#cbd5e1} |
| 56 | .btn-success{background:var(--success)} |
| 57 | .btn-danger{background:var(--danger)} |
| 58 | .btn-warning{background:var(--warning);color:#fff} |
| 59 | .form-group{margin-bottom:14px;width:100%} |
| 60 | .form-group label{display:block;margin-bottom:6px;font-size:13px;font-weight:600;color:#334155} |
| 61 | .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} |
| 62 | .form-control:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.15)} |
| 63 | .form-control:disabled{background-color:#f1f5f9;color:#94a3b8;cursor:not-allowed} |
| 64 | .form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;width:100%} |
| 65 | .table-responsive{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border:1px solid var(--border);border-radius:8px} |
| 66 | table{width:100%;border-collapse:collapse;text-align:right;font-size:13px;min-width:500px} |
| 67 | th,td{padding:10px 10px;border-bottom:1px solid var(--border)} |
| 68 | th{background:#f1f5f9;color:#334155;font-weight:700} |
| 69 | #invoice-items-table{direction:rtl;width:100%;table-layout:auto} |
| 70 | #invoice-items-table th,#invoice-items-table td{text-align:right} |
| 71 | #invoice-items-table th:first-child,#invoice-items-table td:first-child{text-align:center} |
| 72 | #invoice-items-table th:last-child,#invoice-items-table td:last-child{text-align:center} |
| 73 | .badge{display:inline-block;padding:3px 8px;border-radius:6px;font-size:11px;font-weight:600} |
| 74 | .badge-success{background:#d1fae5;color:#065f46} |
| 75 | .badge-warning{background:#fef3c7;color:#92400e} |
| 76 | .badge-danger{background:#fee2e2;color:#991b1b} |
| 77 | .badge-info{background:#e0f2fe;color:#0369a1} |
| 78 | .view-pane{display:none} |
| 79 | .view-pane.active{display:block} |
| 80 | .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} |
| 81 | .modal-backdrop.active{display:flex} |
| 82 | .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)} |
| 83 | .accordion-item{border:1px solid var(--border);border-radius:10px;margin-bottom:12px;overflow:hidden;background:#fff} |
| 84 | .accordion-header{padding:14px 18px;background:#f8fafc;font-weight:bold;display:flex;justify-content:space-between;align-items:center;cursor:pointer;user-select:none} |
| 85 | .accordion-body{padding:16px;border-top:1px solid var(--border);display:none;background:#fff} |
| 86 | .accordion-item.open .accordion-body{display:block} |
| 87 | .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} |
| 88 | .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} |
| 89 | .about-dev-info{flex:1;min-width:180px} |
| 90 | .about-dev-info h4{font-size:15px;color:#1e293b;margin-bottom:4px} |
| 91 | .about-dev-info p{font-size:12.5px;color:#64748b;margin-bottom:2px} |
| 92 | .about-dev-actions{display:flex;gap:8px;flex-wrap:wrap} |
| 93 | .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} |
| 94 | .about-dev-actions .btn-wa{background:linear-gradient(135deg,#25D366,#128C7E);color:#fff} |
| 95 | .about-dev-actions .btn-call{background:var(--primary);color:#fff} |
| 96 | @media print{ |
| 97 | @page{size:A4 landscape;margin:8mm 10mm} |
| 98 | html,body{background:#fff!important;color:#000!important;margin:0!important;padding:0!important;width:100%!important} |
| 99 | .sidebar,.mobile-dock,.no-print,#auth-screen,.modal-backdrop,.whatsapp-support{display:none!important} |
| 100 | .view-pane{display:none!important} |
| 101 | .main-surface{margin:0!important;padding:0!important;max-width:100%!important;width:100%!important} |
| 102 | .card{border:none!important;box-shadow:none!important;padding:0!important;margin:0!important} |
| 103 | .invoice-a4-page{width:100%!important;max-width:277mm!important;margin:0 auto!important;padding:0!important;page-break-after:always!important;break-after:page!important;box-sizing:border-box!important} |
| 104 | .invoice-a4-page:last-child{page-break-after:avoid!important;break-after:avoid!important} |
| 105 | #printable-invoice{display:block!important} |
| 106 | } |
| 107 | @media (max-width:768px){ |
| 108 | .sidebar{display:none} |
| 109 | .main-surface{margin-right:0;padding:12px;padding-bottom:calc(var(--nav-h) + 20px);max-width:100%} |
| 110 | .mobile-dock{display:flex} |
| 111 | .btn{width:100%} |
| 112 | .btn-inline{width:auto} |
| 113 | .form-row{grid-template-columns:1fr} |
| 114 | .whatsapp-support{bottom:84px;left:12px;padding:8px 12px 8px 10px;font-size:11.5px} |
| 115 | } |
| 116 | </style> |
| 117 | </head> |
| 118 | <body> |
| 119 | |
| 120 | <div id="auth-screen"> |
| 121 | <div class="auth-card"> |
| 122 | <div style="text-align:center;margin-bottom:20px"> |
| 123 | <div style="width:50px;height:50px;background:var(--primary);color:#fff;font-weight:bold;font-size:18px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;margin-bottom:10px">فینورا</div> |
| 124 | <h2 style="font-size:20px;font-weight:bold;color:var(--text)">سامانه فینورا</h2> |
| 125 | <p style="font-size:12px;color:var(--text-muted);margin-top:4px">ورود یا ثبتنام در سامانه</p> |
| 126 | </div> |
| 127 | <div id="auth-form-container"> |
| 128 | <button class="btn btn-secondary" style="width:100%;margin-bottom:12px" onclick="signInWithGoogle()"><strong>G</strong> ادامه با Google</button> |
| 129 | <div style="text-align:center;font-size:12px;color:var(--text-muted);margin:8px 0">یا با ایمیل</div> |
| 130 | <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> |
| 131 | <div class="form-group"><label>رمز عبور (اگر قبلاً تعیین کردهاید)</label><input type="password" id="auth-password" class="form-control" placeholder="رمز عبور" autocomplete="current-password" dir="ltr" /></div> |
| 132 | <div style="display:flex;gap:10px;margin-top:16px"> |
| 133 | <button class="btn btn-primary" style="flex:1" onclick="handleLogin()">ورود با رمز</button> |
| 134 | <button class="btn btn-secondary" style="flex:1" onclick="startEmailOtp()">ادامه با کد ایمیل</button> |
| 135 | </div> |
| 136 | <p style="font-size:11.5px;color:var(--text-muted);margin-top:12px;line-height:1.8">کاربر جدید هستید یا رمز را فراموش کردهاید؟ «ادامه با کد ایمیل» را بزنید؛ کد یکبارمصرف برای شما ایمیل میشود.</p> |
| 137 | </div> |
| 138 | <div id="auth-otp-container" style="display:none"> |
| 139 | <p style="font-size:13px;line-height:1.9;margin-bottom:12px">کد یکبارمصرف به <strong dir="ltr" id="auth-otp-email-label"></strong> ارسال شد. پوشهی هرزنامه را هم ببینید.</p> |
| 140 | <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> |
| 141 | <div style="display:flex;gap:10px;margin-top:16px"> |
| 142 | <button class="btn btn-primary" style="flex:1" onclick="verifyEmailOtp()">تأیید کد</button> |
| 143 | <button class="btn btn-secondary" style="flex:1" onclick="startEmailOtp(true)">ارسال دوباره</button> |
| 144 | </div> |
| 145 | <button class="btn btn-secondary" style="width:100%;margin-top:10px" onclick="backToAuthMain()">بازگشت</button> |
| 146 | </div> |
| 147 | <div id="auth-setpass-container" style="display:none"> |
| 148 | <p style="font-size:13px;line-height:1.9;margin-bottom:12px">ایمیل شما تأیید شد. برای ورودهای بعدی میتوانید یک رمز عبور تعیین کنید.</p> |
| 149 | <div class="form-group"><label>رمز عبور جدید</label><input type="password" id="auth-newpass" class="form-control" placeholder="حداقل ۸ کاراکتر" autocomplete="new-password" dir="ltr" /></div> |
| 150 | <div class="form-group"><label>تکرار رمز عبور</label><input type="password" id="auth-newpass2" class="form-control" placeholder="تکرار رمز" autocomplete="new-password" dir="ltr" /></div> |
| 151 | <button class="btn btn-primary" style="width:100%;margin-top:16px" onclick="saveNewPassword()">ذخیره رمز و ورود</button> |
| 152 | <button class="btn btn-secondary" style="width:100%;margin-top:10px" onclick="skipSetPassword()">فعلاً بدون رمز ادامه بده</button> |
| 153 | </div> |
| 154 | </div> |
| 155 | </div> |
| 156 | |
| 157 | <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> |
| 158 | <div class="app-root"> |
| 159 | <aside class="sidebar"> |
| 160 | <div class="brand-box"> |
| 161 | <div class="brand-icon">فینورا</div> |
| 162 | <div><h2 style="font-size:15px;font-weight:bold">فینورا</h2><small style="color:var(--text-muted);font-size:11px">نسخه چندکاربره ۶.۰</small></div> |
| 163 | </div> |
| 164 | <ul class="sidebar-menu"> |
| 165 | <li><a href="#" class="nav-link" data-view="view-dashboard" onclick="switchView('view-dashboard');return false">📊 داشبورد تحلیلی</a></li> |
| 166 | <li><a href="#" class="nav-link" data-view="view-reports" onclick="switchView('view-reports');return false">📈 گزارشات مالی</a></li> |
| 167 | <li><a href="#" class="nav-link" data-view="view-invoices" onclick="switchView('view-invoices');return false">🧾 صدور فاکتور و اسناد</a></li> |
| 168 | <li><a href="#" class="nav-link" data-view="view-products" onclick="switchView('view-products');return false">📦 کالاها و خدمات</a></li> |
| 169 | <li><a href="#" class="nav-link" data-view="view-contacts" onclick="switchView('view-contacts');return false">👥 طرفحسابها و معین</a></li> |
| 170 | <li><a href="#" class="nav-link" data-view="view-cheques" onclick="switchView('view-cheques');return false">💳 چکها و صیاد</a></li> |
| 171 | <li><a href="#" class="nav-link" data-view="view-expenses" onclick="switchView('view-expenses');return false">💰 هزینهها و درآمد</a></li> |
| 172 | <li><a href="#" class="nav-link" data-view="view-settings" onclick="switchView('view-settings');return false">⚙️ تنظیمات و شرکتها</a></li> |
| 173 | <li id="menu-admin-panel" style="display:none"><a href="#" class="nav-link" data-view="view-admin" onclick="switchView('view-admin');return false" style="background:#fef2f2;color:#dc2626;font-weight:bold">👑 مدیریت کاربران و لایسنس</a></li> |
| 174 | </ul> |
| 175 | <div class="sidebar-footer"> |
| 176 | <span id="logged-user-label">کاربر</span> |
| 177 | <span style="opacity:.6;font-size:10.5px">فینورا — نسخه ۱.۰</span> |
| 178 | <button class="btn btn-danger btn-inline" style="padding:4px 10px;font-size:11px;min-height:28px;width:100%;margin-top:4px" onclick="handleLogout()">🚪 خروج از حساب کاربری</button> |
| 179 | </div> |
| 180 | </aside> |
| 181 | |
| 182 | <a class="whatsapp-support no-print" href="https://wa.me/989124376991?text=سلام%20داود%20عزیز،%20درباره%20نرمافزار%20فینورا%20سؤال%20داشتم." target="_blank" rel="noopener" title="پشتیبانی واتساپ"> |
| 183 | <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-.458.13-.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> |
| 184 | <span>پشتیبانی واتساپ</span> |
| 185 | </a> |
| 186 | |
| 187 | <main class="main-surface"> |
| 188 | |
| 189 | <section id="view-dashboard" class="view-pane active"> |
| 190 | <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px"> |
| 191 | <div><h1 style="font-size:20px;font-weight:bold">سامانه فینورا</h1><p style="color:var(--text-muted);font-size:13px" id="dashboard-date-display"></p></div> |
| 192 | <div style="display:flex;align-items:center;gap:10px"> |
| 193 | <span id="user-license-status-badge" class="badge badge-warning">در حال بررسی...</span> |
| 194 | <button class="btn btn-inline no-print" onclick="startNewInvoice()">➕ فاکتور جدید</button> |
| 195 | </div> |
| 196 | </div> |
| 197 | <div id="dashboard-license-details"></div> |
| 198 | |
| 199 | <div class="quick-actions-row no-print"> |
| 200 | <button class="qa-btn" style="background:linear-gradient(135deg,#f97316,#ea580c)" onclick="startNewInvoice()"><span>➕</span>فاکتور جدید</button> |
| 201 | <button class="qa-btn" style="background:linear-gradient(135deg,#8b5cf6,#6d28d9)" onclick="switchView('view-contacts')"><span>👤</span>مشتری جدید</button> |
| 202 | <button class="qa-btn" style="background:linear-gradient(135deg,#0ea5e9,#0369a1)" onclick="switchView('view-cheques')"><span>💳</span>ثبت چک</button> |
| 203 | <button class="qa-btn" style="background:linear-gradient(135deg,#10b981,#047857)" onclick="switchView('view-reports')"><span>📈</span>گزارش مالی</button> |
| 204 | </div> |
| 205 | |
| 206 | <div class="grid-kpi"> |
| 207 | <div class="kpi-unit kpi-gradient" style="background:linear-gradient(135deg,#3b82f6,#1d4ed8)"><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)">مجموع فروش ثبتشده (<span class="cur-label">ریال</span>)</div><div class="kpi-val" style="color:#fff" id="kpi-sales-sum">۰ ریال</div></div></div> |
| 208 | <div class="kpi-unit kpi-gradient" style="background:linear-gradient(135deg,#10b981,#059669)"><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="kpi-settled-sum">۰ ریال</div></div></div> |
| 209 | <div class="kpi-unit kpi-gradient" style="background:linear-gradient(135deg,#f59e0b,#d97706)"><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="kpi-debtors-sum">۰ ریال</div></div></div> |
| 210 | <div class="kpi-unit kpi-gradient" style="background:linear-gradient(135deg,#ef4444,#b91c1c)"><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="kpi-cheques-count">۰ فقره</div></div></div> |
| 211 | </div> |
| 212 | |
| 213 | <div class="card"> |
| 214 | <h3 style="font-size:15px;margin-bottom:12px">آخرین فاکتورهای صادر شده</h3> |
| 215 | <div class="table-responsive"> |
| 216 | <table> |
| 217 | <thead><tr><th>شماره</th><th>فروشنده (شرکت)</th><th>خریدار</th><th>نوع فاکتور</th><th>ارزش افزوده</th><th>مبلغ کل (<span class="cur-label">ریال</span>)</th><th>عملیات</th></tr></thead> |
| 218 | <tbody id="dashboard-recent-table"><tr><td colspan="7" style="text-align:center;color:var(--text-muted);padding:20px">هیچ فاکتوری صادر نشده است.</td></tr></tbody> |
| 219 | </table> |
| 220 | </div> |
| 221 | </div> |
| 222 | |
| 223 | <div class="card no-print" style="background:linear-gradient(135deg,#ecfdf5,#f0fdf4);border-color:#bbf7d0"> |
| 224 | <div style="display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:space-between"> |
| 225 | <div style="display:flex;align-items:center;gap:12px"> |
| 226 | <div style="width:44px;height:44px;border-radius:50%;background:linear-gradient(135deg,#25D366,#128C7E);display:flex;align-items:center;justify-content:center;color:#fff"> |
| 227 | <svg viewBox="0 0 24 24" fill="currentColor" width="22" height="22"><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-.458.13-.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> |
| 228 | </div> |
| 229 | <div><h3 style="font-size:15px;color:#166534">پشتیبانی سریع</h3><p style="font-size:12.5px;color:#475569;margin-top:2px">سؤالی دارید؟ از طریق واتساپ با ما در تماس باشید.</p></div> |
| 230 | </div> |
| 231 | <a href="https://wa.me/989124376991?text=سلام%20داود%20عزیز،%20درباره%20نرمافزار%20فینورا%20سؤال%20داشتم." target="_blank" rel="noopener" class="btn btn-inline" style="background:linear-gradient(135deg,#25D366,#128C7E)">💬 گفتگو در واتساپ</a> |
| 232 | </div> |
| 233 | </div> |
| 234 | </section> |
| 235 | |
| 236 | <section id="view-reports" class="view-pane"> |
| 237 | <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px"> |
| 238 | <h1 style="font-size:20px;font-weight:bold">📈 گزارشات مالی</h1> |
| 239 | <select id="report-year-select" class="form-control" style="max-width:160px" onchange="renderFinancialReports()"></select> |
| 240 | </div> |
| 241 | |
| 242 | <div class="grid-kpi"> |
| 243 | <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> |
| 244 | <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> |
| 245 | <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> |
| 246 | <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> |
| 247 | </div> |
| 248 | |
| 249 | <div class="card"> |
| 250 | <h3 style="font-size:15px;margin-bottom:6px">روند فروش ماهانه</h3> |
| 251 | <div class="report-bar-wrap" id="report-monthly-chart"></div> |
| 252 | </div> |
| 253 | |
| 254 | <div class="card"> |
| 255 | <h3 style="font-size:15px;margin-bottom:12px">مشتریان برتر (بر اساس مبلغ خرید)</h3> |
| 256 | <div class="table-responsive"> |
| 257 | <table> |
| 258 | <thead><tr><th>مشتری</th><th>تعداد فاکتور</th><th>جمع خرید (<span class="cur-label">ریال</span>)</th></tr></thead> |
| 259 | <tbody id="report-top-customers"><tr><td colspan="3" style="text-align:center;color:var(--text-muted);padding:20px">دادهای برای نمایش وجود ندارد.</td></tr></tbody> |
| 260 | </table> |
| 261 | </div> |
| 262 | </div> |
| 263 | |
| 264 | <div class="card"> |
| 265 | <h3 style="font-size:15px;margin-bottom:12px">تفکیک نوع فاکتور</h3> |
| 266 | <div style="display:flex;gap:24px;flex-wrap:wrap"> |
| 267 | <div>🔴 رسمی: <strong id="rep-formal-count">۰</strong> فقره — <strong id="rep-formal-sum">۰</strong></div> |
| 268 | <div>🟢 غیررسمی: <strong id="rep-informal-count">۰</strong> فقره — <strong id="rep-informal-sum">۰</strong></div> |
| 269 | </div> |
| 270 | </div> |
| 271 | </section> |
| 272 | |
| 273 | <section id="view-invoices" class="view-pane"> |
| 274 | <div class="card no-print"> |
| 275 | <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px"> |
| 276 | <h2 style="font-size:17px" id="invoice-form-title">صدور فاکتور جدید</h2> |
| 277 | <div style="display:flex;gap:8px;flex-wrap:wrap;align-items:center"> |
| 278 | <button type="button" class="btn btn-primary btn-inline" style="min-height:34px;padding:4px 12px;font-size:12px" onclick="switchView('view-invoices')">🧾 فاکتور فروش</button> |
| 279 | <button type="button" class="btn btn-secondary btn-inline" style="min-height:34px;padding:4px 12px;font-size:12px" onclick="switchView('view-purchases')">🛒 فاکتور خرید</button> |
| 280 | <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> |
| 281 | <button class="btn btn-secondary btn-inline" style="display:none;padding:4px 10px;font-size:12px" id="btn-cancel-edit" onclick="cancelInvoiceEdit()">انصراف از ویرایش</button> |
| 282 | </div> |
| 283 | </div> |
| 284 | <input type="hidden" id="edit-invoice-id" value="" /> |
| 285 | <div class="form-row" style="background:#f1f5f9;padding:12px;border-radius:10px;margin-bottom:14px"> |
| 286 | <div class="form-group" style="margin-bottom:0"><label>تاریخ فاکتور</label><input type="text" id="invoice-date-input" class="form-control" /></div> |
| 287 | <div class="form-group" style="margin-bottom:0"><label>شماره فاکتور</label><input type="text" id="invoice-number" class="form-control" placeholder="PINV-31" /></div> |
| 288 | <div class="form-group" style="margin-bottom:0"> |
| 289 | <label>قالب و نوع سند</label> |
| 290 | <select id="invoice-kind" class="form-control" onchange="handleInvoiceKindChange()"> |
| 291 | <option value="non_formal">فاکتور غیررسمی</option> |
| 292 | <option value="formal">فاکتور رسمی</option> |
| 293 | <option value="pre_invoice">پیشفاکتور فروش</option> |
| 294 | <option value="contract_statement">صورت وضعیت پیمان</option> |
| 295 | </select> |
| 296 | </div> |
| 297 | </div> |
| 298 | <div class="form-row"> |
| 299 | <div class="form-group"><label>فروشنده (سربرگ شرکت)</label><select id="invoice-company-id" class="form-control" onchange="onActiveCompanyFilterChange()"></select></div> |
| 300 | <div class="form-group"> |
| 301 | <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> |
| 302 | <div style="display:flex;gap:8px"> |
| 303 | <select id="invoice-contact-id" class="form-control" style="flex:1" onchange="handleInvoiceContactChange()"></select> |
| 304 | <button class="btn btn-secondary btn-inline" type="button" onclick="openQuickContactModal()" style="padding:0 12px;min-height:42px">➕</button> |
| 305 | </div> |
| 306 | </div> |
| 307 | </div> |
| 308 | <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> |
| 309 | <div class="form-row" id="box-invoice-project-row" style="display:none"> |
| 310 | <div class="form-group"><label>پروژه طرفحساب</label><select id="invoice-project-id" class="form-control"></select></div> |
| 311 | </div> |
| 312 | <div class="form-row" id="box-invoice-contract-number" style="display:none;background:#fef3c7;padding:12px;border-radius:10px;margin-bottom:14px"> |
| 313 | <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> |
| 314 | </div> |
| 315 | <div style="margin:16px 0"> |
| 316 | <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px"> |
| 317 | <h4 style="font-size:14px">اقلام کالا یا خدمات</h4> |
| 318 | <button class="btn btn-secondary btn-inline" style="font-size:12px;min-height:34px;padding:4px 10px" onclick="openQuickProductModal()">➕ کالای جدید</button> |
| 319 | </div> |
| 320 | <div class="table-responsive"> |
| 321 | <table id="invoice-items-table"> |
| 322 | <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> |
| 323 | <tbody id="invoice-items-table-body"></tbody> |
| 324 | </table> |
| 325 | </div> |
| 326 | <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> |
| 327 | </div> |
| 328 | <div class="form-row" style="background:#f1f5f9;padding:14px;border-radius:10px;margin-top:12px"> |
| 329 | <div class="form-group" style="background:#fff;padding:12px;border-radius:8px;border:1px solid var(--border);margin-bottom:0"> |
| 330 | <label style="font-weight:bold;border-bottom:1px solid #eee;padding-bottom:6px;margin-bottom:8px">مالیات و تخفیف</label> |
| 331 | <div id="box-invoice-vat-mode-row" style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px"> |
| 332 | <span>مالیات ارزش افزوده</span> |
| 333 | <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> |
| 334 | </div> |
| 335 | <div id="box-invoice-vat-rate" style="display:none;justify-content:space-between;align-items:center;margin-bottom:8px;gap:8px"> |
| 336 | <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> |
| 337 | <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()" /> |
| 338 | </div> |
| 339 | <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;gap:8px"> |
| 340 | <span>تخفیف کلی فاکتور</span> |
| 341 | <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> |
| 342 | </div> |
| 343 | <div style="display:flex;justify-content:space-between;align-items:center"> |
| 344 | <span id="label-invoice-discount-value">مبلغ تخفیف (ریال)</span> |
| 345 | <input type="text" inputmode="decimal" id="invoice-discount-fixed" class="form-control" style="width:140px;min-height:36px" value="0" oninput="handleMoneyInput(this);recomputeTotals()" /> |
| 346 | </div> |
| 347 | </div> |
| 348 | <div class="form-group" style="background:#fff;padding:12px;border-radius:8px;border:1px solid var(--border);margin-bottom:0"> |
| 349 | <label style="font-weight:bold;border-bottom:1px solid #eee;padding-bottom:6px;margin-bottom:8px">جمعبندی نهایی</label> |
| 350 | <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> |
| 351 | <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> |
| 352 | <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> |
| 353 | <div style="font-size:11px;color:var(--text-muted);margin-top:4px" id="summary-words">به حروف: صفر ریال</div> |
| 354 | </div> |
| 355 | </div> |
| 356 | <div class="form-row" style="margin-top:14px"> |
| 357 | <div class="form-group" style="margin-bottom:0"><label>توضیحات فاکتور</label><textarea id="invoice-desc-input" class="form-control" rows="2" placeholder="توضیحات تکمیلی..."></textarea></div> |
| 358 | </div> |
| 359 | <div id="box-enable-electronic-doc" style="display:none;margin-top:14px;padding:14px;background:#fef3c7;border-radius:10px;border:1.5px solid #fcd34d"> |
| 360 | <label style="display:flex;align-items:center;gap:10px;cursor:pointer"> |
| 361 | <input type="checkbox" id="enable-electronic-doc" onchange="toggleElectronicDoc()" style="width:18px;height:18px" /> |
| 362 | <span style="font-weight:bold;font-size:14px;color:#92400e">📄 صدور سند الکترونیکی سامانه مودیان</span> |
| 363 | </label> |
| 364 | <div id="edoc-status" style="font-size:12px;color:#475569;margin-top:8px"></div> |
| 365 | </div> |
| 366 | <div style="display:flex;gap:10px;margin-top:16px;flex-wrap:wrap"> |
| 367 | <button class="btn btn-success" id="btn-save-invoice" onclick="commitSaveInvoice()">💾 ثبت فاکتور</button> |
| 368 | </div> |
| 369 | </div> |
| 370 | |
| 371 | <div class="card no-print"> |
| 372 | <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:10px"> |
| 373 | <h3 style="font-size:15px">دفتر بایگانی فاکتورها</h3> |
| 374 | <select id="filter-invoice-company" class="form-control" style="width:200px;min-height:36px" onchange="renderInvoices()"></select> |
| 375 | </div> |
| 376 | <div class="table-responsive"> |
| 377 | <table> |
| 378 | <thead><tr><th>شماره</th><th>فروشنده</th><th>خریدار</th><th>نوع</th><th>تاریخ</th><th>قابل پرداخت (<span class="cur-label">ریال</span>)</th><th>عملیات</th></tr></thead> |
| 379 | <tbody id="invoice-archive-table-body"></tbody> |
| 380 | </table> |
| 381 | </div> |
| 382 | </div> |
| 383 | </section> |
| 384 | |
| 385 | <section id="view-products" class="view-pane"> |
| 386 | <div class="card no-print"> |
| 387 | <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px"> |
| 388 | <h2 style="font-size:17px">تعریف کالا / خدمت جدید</h2> |
| 389 | <div style="display:flex;gap:8px"> |
| 390 | <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> |
| 391 | <button class="btn btn-secondary btn-inline" style="min-height:36px;padding:4px 12px;font-size:13px" onclick="downloadProductsExcelTemplate()">📄 نمونه اکسل</button> |
| 392 | </div> |
| 393 | </div> |
| 394 | <div class="form-row"> |
| 395 | <div class="form-group"><label>کد کالا</label><input type="text" id="prod-code-input" class="form-control" placeholder="101" /></div> |
| 396 | <div class="form-group"><label>عنوان کالا</label><input type="text" id="prod-name-input" class="form-control" placeholder="هارد سرور..." /></div> |
| 397 | <div class="form-group"><label>مشخصه / مدل</label><input type="text" id="prod-spec-input" class="form-control" placeholder="2.5 اینچ SAS" /></div> |
| 398 | <div class="form-group"><label>واحد</label><input type="text" id="prod-unit-input" class="form-control" value="عدد" /></div> |
| 399 | </div> |
| 400 | <div class="form-row"> |
| 401 | <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> |
| 402 | <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> |
| 403 | <div class="form-group"><label>شناسه کالا/خدمت داخلی</label><input type="text" id="prod-internal-id-input" class="form-control" placeholder="2330004169617" /></div> |
| 404 | </div> |
| 405 | <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> |
| 406 | </div> |
| 407 | <div class="card"> |
| 408 | <h3 style="font-size:15px;margin-bottom:12px">کالاهای ثبتشده</h3> |
| 409 | <div class="table-responsive"> |
| 410 | <table><thead><tr><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> |
| 411 | </div> |
| 412 | </div> |
| 413 | </section> |
| 414 | |
| 415 | <section id="view-contacts" class="view-pane"> |
| 416 | <div class="card no-print"> |
| 417 | <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px;flex-wrap:wrap;gap:10px"> |
| 418 | <h2 style="font-size:17px">ثبت طرف حساب جدید</h2> |
| 419 | <div style="display:flex;gap:8px"> |
| 420 | <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> |
| 421 | <button class="btn btn-secondary btn-inline" style="min-height:36px;padding:4px 12px;font-size:13px" onclick="downloadContactsExcelTemplate()">📄 نمونه اکسل</button> |
| 422 | </div> |
| 423 | </div> |
| 424 | <div class="form-row"> |
| 425 | <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> |
| 426 | <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> |
| 427 | <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> |
| 428 | </div> |
| 429 | <div class="form-row"> |
| 430 | <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> |
| 431 | <div class="form-group"><label>همراه</label><input type="text" id="contact-mobile-input" class="form-control" /></div> |
| 432 | <div class="form-group"><label id="label-contact-national">شناسه ملی</label><input type="text" id="contact-national-input" class="form-control" /></div> |
| 433 | <div class="form-group" id="box-contact-economic"><label>کد اقتصادی</label><input type="text" id="contact-economic-input" class="form-control" /></div> |
| 434 | </div> |
| 435 | <div class="form-row"> |
| 436 | <div class="form-group" id="box-contact-reg"><label>شماره ثبت</label><input type="text" id="contact-reg-input" class="form-control" /></div> |
| 437 | <div class="form-group"><label>کد پستی</label><input type="text" id="contact-postal-input" class="form-control" /></div> |
| 438 | <div class="form-group" style="grid-column:span 2"><label>نشانی</label><input type="text" id="contact-address-input" class="form-control" /></div> |
| 439 | </div> |
| 440 | <div class="form-row"> |
| 441 | <div class="form-group"><label>حالت پروژه</label><select id="contact-project-mode" class="form-control"><option value="single">بدون پروژه</option><option value="multi">پروژهمحور (پروژه و زیرپروژه)</option></select></div> |
| 442 | </div> |
| 443 | <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> |
| 444 | </div> |
| 445 | <div class="card"> |
| 446 | <h3 style="font-size:15px;margin-bottom:12px">دفتر اشخاص</h3> |
| 447 | <div class="table-responsive"> |
| 448 | <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> |
| 449 | </div> |
| 450 | </div> |
| 451 | </section> |
| 452 | |
| 453 | <section id="view-cheques" class="view-pane"> |
| 454 | <div class="card"> |
| 455 | <h2 style="font-size:17px;margin-bottom:14px">ثبت چک صیادی</h2> |
| 456 | <div class="form-row"> |
| 457 | <div class="form-group"><label>نوع</label><select id="chq-direction-input" class="form-control"><option value="inbound">دریافتی</option><option value="outbound">پرداختی</option></select></div> |
| 458 | <div class="form-group"><label>طرف حساب</label><select id="chq-contact-select" class="form-control"></select></div> |
| 459 | <div class="form-group"><label>شناسه صیادی</label><input type="text" id="chq-sayad-input" class="form-control" /></div> |
| 460 | <div class="form-group"><label>بانک</label><input type="text" id="chq-bank-input" class="form-control" /></div> |
| 461 | </div> |
| 462 | <div class="form-row"> |
| 463 | <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> |
| 464 | <div class="form-group"><label>سررسید</label><input type="text" id="chq-due-input" class="form-control" placeholder="1405/06/30" /></div> |
| 465 | <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> |
| 466 | </div> |
| 467 | <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> |
| 468 | </div> |
| 469 | <div class="card"> |
| 470 | <h3 style="font-size:15px;margin-bottom:12px">لیست چکها</h3> |
| 471 | <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> |
| 472 | </div> |
| 473 | </section> |
| 474 | |
| 475 | <section id="view-expenses" class="view-pane"> |
| 476 | <div class="card"> |
| 477 | <h2 style="font-size:17px;margin-bottom:14px">ثبت هزینه / درآمد</h2> |
| 478 | <div class="form-row"> |
| 479 | <div class="form-group"><label>نوع</label><select id="trx-kind-input" class="form-control"><option value="expense">هزینه</option><option value="income">درآمد</option></select></div> |
| 480 | <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> |
| 481 | <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> |
| 482 | <div class="form-group"><label>شرح</label><input type="text" id="trx-desc-input" class="form-control" /></div> |
| 483 | </div> |
| 484 | <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> |
| 485 | </div> |
| 486 | <div class="card"> |
| 487 | <h3 style="font-size:15px;margin-bottom:12px">گردش هزینه و درآمد</h3> |
| 488 | <div class="table-responsive"><table><thead><tr><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> |
| 489 | </div> |
| 490 | </section> |
| 491 | |
| 492 | <section id="view-settings" class="view-pane"> |
| 493 | <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:14px"> |
| 494 | <h2 style="font-size:17px">⚙️ تنظیمات و شرکتها</h2> |
| 495 | <button class="btn btn-danger btn-inline no-print" style="padding:6px 12px;font-size:12px;min-height:32px" onclick="handleLogout()">🚪 خروج از حساب کاربری</button> |
| 496 | </div> |
| 497 | |
| 498 | <div class="accordion-item"> |
| 499 | <div class="accordion-header" onclick="toggleAccordion(this)"><span>🔐 حساب کاربری و رمز عبور</span><span>▼</span></div> |
| 500 | <div class="accordion-body"> |
| 501 | <p style="font-size:13px;color:var(--text-muted);margin-bottom:10px">با تعیین رمز عبور، دفعات بعد میتوانید علاوه بر ورود با گوگل، مستقیم با ایمیل و رمز عبور هم وارد سامانه شوید.</p> |
| 502 | <div class="form-row"> |
| 503 | <div class="form-group"><label>رمز عبور جدید</label><input type="password" id="acct-newpass" class="form-control" placeholder="حداقل ۸ کاراکتر" /></div> |
| 504 | <div class="form-group"><label>تکرار رمز عبور</label><input type="password" id="acct-newpass2" class="form-control" /></div> |
| 505 | </div> |
| 506 | <button class="btn btn-primary" onclick="changeAccountPassword()">💾 ذخیره رمز عبور</button> |
| 507 | </div> |
| 508 | </div> |
| 509 | |
| 510 | <div class="accordion-item open"> |
| 511 | <div class="accordion-header" onclick="toggleAccordion(this)"><span>🏢 اطلاعات فروشگاه و چاپ (مدیریت شرکتها)</span><span>▼</span></div> |
| 512 | <div class="accordion-body"> |
| 513 | <div class="form-row"> |
| 514 | <div class="form-group"><label>نوع شخص</label><select id="company-entity-type" class="form-control"><option value="legal">حقوقی</option><option value="natural">حقیقی</option></select></div> |
| 515 | <div class="form-group"><label>نام شرکت / فروشگاه</label><input type="text" id="company-name-input" class="form-control" placeholder="آرا سپهر راستین" /></div> |
| 516 | <div class="form-group"><label>تلفن</label><input type="text" id="company-phone-input" class="form-control" /></div> |
| 517 | </div> |
| 518 | <div class="form-row"> |
| 519 | <div class="form-group"><label>شناسه ملی</label><input type="text" id="company-national-input" class="form-control" /></div> |
| 520 | <div class="form-group"><label>کد اقتصادی</label><input type="text" id="company-economic-input" class="form-control" /></div> |
| 521 | <div class="form-group"><label>شماره ثبت</label><input type="text" id="company-reg-input" class="form-control" /></div> |
| 522 | <div class="form-group"><label>کد پستی</label><input type="text" id="company-postal-input" class="form-control" /></div> |
| 523 | </div> |
| 524 | <div class="form-group"><label>نشانی کامل</label><input type="text" id="company-address-input" class="form-control" /></div> |
| 525 | <div class="form-group"><label>پاورقی فاکتور</label><textarea id="company-footer-input" class="form-control" rows="2"></textarea></div> |
| 526 | <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> |
| 527 | <div style="margin-top:16px"> |
| 528 | <h4 style="font-size:14px;margin-bottom:8px">لیست شرکتهای ثبتشده</h4> |
| 529 | <div class="table-responsive"><table><thead><tr><th>نام</th><th>شناسه ملی</th><th>کد اقتصادی</th><th>پیشفرض</th><th>عملیات</th></tr></thead><tbody id="companies-table-body"></tbody></table></div> |
| 530 | </div> |
| 531 | </div> |
| 532 | </div> |
| 533 | |
| 534 | <div class="accordion-item"> |
| 535 | <div class="accordion-header" onclick="toggleAccordion(this)"><span>⚙️ مالیات، تخفیف و واحد پول (پیشفرض فاکتور جدید)</span><span>▼</span></div> |
| 536 | <div class="accordion-body"> |
| 537 | <div class="form-row"> |
| 538 | <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> |
| 539 | <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> |
| 540 | <div class="form-group"><label>نرخ ارزش افزوده (درصد)</label><input type="text" inputmode="decimal" id="def-vat-rate" class="form-control" value="10" oninput="handleMoneyInput(this)" /></div> |
| 541 | </div> |
| 542 | <div class="form-row"> |
| 543 | <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> |
| 544 | <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> |
| 545 | </div> |
| 546 | <button class="btn btn-primary" onclick="commitSaveDefaultSettings()">ذخیره پیشفرضها</button> |
| 547 | </div> |
| 548 | </div> |
| 549 | |
| 550 | <div class="accordion-item"> |
| 551 | <div class="accordion-header" onclick="toggleAccordion(this)"><span>💾 دیتابیس و پشتیبانگیری</span><span>▼</span></div> |
| 552 | <div class="accordion-body"> |
| 553 | <p style="font-size:13px;color:var(--text-muted);margin-bottom:12px">وضعیت دیتابیس: <span class="badge badge-success">تفکیک کاربر فعال</span></p> |
| 554 | <div style="display:flex;gap:10px;flex-wrap:wrap"> |
| 555 | <button class="btn btn-secondary" onclick="exportDataBlob()">📥 دانلود فایل پشتیبان (JSON)</button> |
| 556 | <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> |
| 557 | </div> |
| 558 | </div> |
| 559 | </div> |
| 560 | |
| 561 | <div class="accordion-item"> |
| 562 | <div class="accordion-header" onclick="toggleAccordion(this)"><span>ℹ️ درباره نرمافزار</span><span>▼</span></div> |
| 563 | <div class="accordion-body"> |
| 564 | <h3 style="font-size:16px;font-weight:bold">فینورا - Finora</h3> |
| 565 | <p style="color:var(--text-muted);font-size:13px;margin:6px 0 12px 0">سامانه ابری صدور فاکتور و مدیریت مالی چندکاربره</p> |
| 566 | <p style="font-size:13px;margin-bottom:8px">نگارش فعال: <strong>نسخه ۷.۰</strong></p> |
| 567 | <div class="about-dev-card"> |
| 568 | <div class="about-dev-avatar">د.م</div> |
| 569 | <div class="about-dev-info"> |
| 570 | <h4>داود مهربان</h4> |
| 571 | <p>طراح و توسعهدهنده نرمافزار</p> |
| 572 | <p>📱 <span dir="ltr" style="font-family:Tahoma">0912-437-6991</span></p> |
| 573 | </div> |
| 574 | <div class="about-dev-actions"> |
| 575 | <a class="btn-wa" href="https://wa.me/989124376991?text=سلام%20داود%20عزیز،%20درباره%20نرمافزار%20فینورا%20سؤال%20داشتم." target="_blank" rel="noopener"> |
| 576 | <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-.458.13-.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> |
| 577 | واتساپ |
| 578 | </a> |
| 579 | <a class="btn-call" href="tel:+989124376991">📞 تماس</a> |
| 580 | </div> |
| 581 | </div> |
| 582 | <div style="display:flex;gap:10px;margin-top:10px"> |
| 583 | <button class="btn btn-primary" onclick="alert('آخرین نگارش نصب است.')">بررسی آپدیت</button> |
| 584 | <button class="btn btn-secondary" onclick="alert('پشتیبانی فعال است.')">گزارش باگ</button> |
| 585 | </div> |
| 586 | </div> |
| 587 | </div> |
| 588 | </section> |
| 589 | |
| 590 | <section id="view-admin" class="view-pane"> |
| 591 | <div class="card"> |
| 592 | <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:10px"> |
| 593 | <div><h2 style="font-size:18px;color:var(--danger)">👑 پنل مدیریت مرکزی کاربران و لایسنسها</h2><p style="color:var(--text-muted);font-size:13px;margin-top:4px">تعریف کاربران، تخصیص طرحهای لایسنس، تمدید، تغییر مدت و لغو اشتراک.</p></div> |
| 594 | <button class="btn btn-primary btn-inline" onclick="refreshAdminPanel()">🔄 تازهسازی لیست</button> |
| 595 | </div> |
| 596 | <div style="background:#eff6ff;border:1px solid #bfdbfe;border-radius:10px;padding:14px;margin-bottom:20px;font-size:13px;line-height:1.9">کاربران خودشان از صفحه ورود ثبتنام میکنند و ۱۵ روز آزمایشی میگیرند. در این پنل فقط لایسنسها (فعالسازی، تمدید، تغییر طرح، لغو) مدیریت میشود و کنترل نهایی روی سرور انجام میشود.</div> |
| 597 | <div class="table-responsive"> |
| 598 | <table><thead><tr><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="7" style="text-align:center;padding:20px">در حال بارگذاری کاربران...</td></tr></tbody></table> |
| 599 | </div> |
| 600 | </div> |
| 601 | </section> |
| 602 | |
| 603 | <div id="printable-invoice" style="display:none"></div> |
| 604 | </main> |
| 605 | </div> |
| 606 | |
| 607 | <div class="modal-backdrop" id="modal-quick-contact"> |
| 608 | <div class="modal-card"> |
| 609 | <h3 style="font-size:16px;margin-bottom:12px">➕ تعریف سریع خریدار</h3> |
| 610 | <div class="form-row"> |
| 611 | <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> |
| 612 | <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> |
| 613 | <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> |
| 614 | </div> |
| 615 | <div class="form-row"> |
| 616 | <div class="form-group"><label id="label-quick-c-national">شناسه ملی</label><input type="text" id="quick-c-national" class="form-control" /></div> |
| 617 | <div class="form-group" id="box-quick-c-economic"><label>کد اقتصادی</label><input type="text" id="quick-c-economic" class="form-control" /></div> |
| 618 | <div class="form-group" id="box-quick-c-reg"><label>شماره ثبت</label><input type="text" id="quick-c-reg" class="form-control" /></div> |
| 619 | </div> |
| 620 | <div class="form-row"> |
| 621 | <div class="form-group"><label>کد پستی</label><input type="text" id="quick-c-postal" class="form-control" /></div> |
| 622 | <div class="form-group"><label>تلفن</label><input type="text" id="quick-c-mobile" class="form-control" /></div> |
| 623 | </div> |
| 624 | <div class="form-group"><label>نشانی</label><input type="text" id="quick-c-address" class="form-control" /></div> |
| 625 | <div style="display:flex;gap:10px;margin-top:12px"> |
| 626 | <button class="btn btn-success" onclick="saveQuickContact()">ذخیره و انتخاب</button> |
| 627 | <button class="btn btn-secondary" onclick="closeQuickContactModal()">انصراف</button> |
| 628 | </div> |
| 629 | </div> |
| 630 | </div> |
| 631 | |
| 632 | <div class="modal-backdrop" id="modal-quick-product"> |
| 633 | <div class="modal-card"> |
| 634 | <h3 style="font-size:16px;margin-bottom:12px">➕ تعریف سریع کالا</h3> |
| 635 | <div class="form-row"> |
| 636 | <div class="form-group"><label>کد</label><input type="text" id="quick-p-code" class="form-control" /></div> |
| 637 | <div class="form-group"><label>عنوان</label><input type="text" id="quick-p-name" class="form-control" /></div> |
| 638 | <div class="form-group"><label>مشخصه</label><input type="text" id="quick-p-spec" class="form-control" /></div> |
| 639 | </div> |
| 640 | <div class="form-row"> |
| 641 | <div class="form-group"><label>واحد</label><input type="text" id="quick-p-unit" class="form-control" value="عدد" /></div> |
| 642 | <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> |
| 643 | <div class="form-group"><label>شناسه کالا/خدمت داخلی</label><input type="text" id="quick-p-internal-id" class="form-control" /></div> |
| 644 | </div> |
| 645 | <div style="display:flex;gap:10px;margin-top:12px"> |
| 646 | <button class="btn btn-success" onclick="saveQuickProduct()">ذخیره و افزودن</button> |
| 647 | <button class="btn btn-secondary" onclick="closeQuickProductModal()">انصراف</button> |
| 648 | </div> |
| 649 | </div> |
| 650 | </div> |
| 651 | |
| 652 | <div class="modal-backdrop" id="modal-admin-license-edit"> |
| 653 | <div class="modal-card"> |
| 654 | <h3 style="font-size:16px;margin-bottom:12px" id="modal-license-user-title">تغییر مدت و لایسنس کاربر</h3> |
| 655 | <input type="hidden" id="modal-license-target-username" /> |
| 656 | <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> |
| 657 | <div style="display:flex;gap:10px;margin-top:16px"> |
| 658 | <button class="btn btn-success" style="flex:1" onclick="applyLicenseDurationChange()">تایید و اعمال لایسنس</button> |
| 659 | <button class="btn btn-secondary" style="flex:1" onclick="closeLicenseEditModal()">انصراف</button> |
| 660 | </div> |
| 661 | </div> |
| 662 | </div> |
| 663 | |
| 664 | <div class="modal-backdrop" id="modal-electronic-doc"> |
| 665 | <div class="modal-card" style="max-width:850px"> |
| 666 | <h3 style="font-size:16px;margin-bottom:6px">📄 سند الکترونیکی سامانه مودیان</h3> |
| 667 | <p style="font-size:12px;color:var(--text-muted);margin-bottom:14px">اطلاعات این سند فقط برای فاکتور رسمی قابل تکمیل است.</p> |
| 668 | |
| 669 | <h4 style="font-size:14px;margin-bottom:8px;color:#1e3a8a;border-bottom:1px solid #e2e8f0;padding-bottom:6px">الف) سربرگ صورتحساب</h4> |
| 670 | <div class="form-row"> |
| 671 | <div class="form-group"><label>شماره منحصر به فرد مالیاتی</label><input type="text" id="edoc-unique-number" class="form-control" placeholder="A2EAG4050E000000043C9" /></div> |
| 672 | <div class="form-group"><label>شماره مالیاتی مندرج در برگه تشخیص</label><input type="text" id="edoc-tax-number" class="form-control" placeholder="0000000043C" /></div> |
| 673 | </div> |
| 674 | <div class="form-row"> |
| 675 | <div class="form-group"><label>تاریخ و زمان صدور</label><input type="text" id="edoc-issue-datetime" class="form-control" placeholder="1405/06/17 11:35:00" /></div> |
| 676 | <div class="form-group"><label>نوع صورتحساب</label><select id="edoc-kind" class="form-control"><option value="اصل">اصل</option><option value="برگشت">برگشت</option><option value="اصلاحی">اصلاحی</option></select></div> |
| 677 | </div> |
| 678 | <div class="form-row"> |
| 679 | <div class="form-group"><label>تاریخ صورتحساب الکترونیکی اصلی</label><input type="text" id="edoc-original-date" class="form-control" placeholder="1405/06/17" /></div> |
| 680 | <div class="form-group"><label>شماره صورتحساب الکترونیکی اصلی</label><input type="text" id="edoc-original-number" class="form-control" placeholder="140505" /></div> |
| 681 | </div> |
| 682 | <div class="form-row"> |
| 683 | <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> |
| 684 | </div> |
| 685 | |
| 686 | <h4 style="font-size:14px;margin:14px 0 8px 0;color:#1e3a8a;border-bottom:1px solid #e2e8f0;padding-bottom:6px">ب) اقلام کالا/خدمت</h4> |
| 687 | <div id="edoc-items-container"></div> |
| 688 | |
| 689 | <h4 style="font-size:14px;margin:14px 0 8px 0;color:#1e3a8a;border-bottom:1px solid #e2e8f0;padding-bottom:6px">ج) موارد اختصاصی قرارداد پیمانکاری</h4> |
| 690 | <div id="box-edoc-contract" style="display:none"> |
| 691 | <div class="form-group"><label>شناسه یکتای ثبت قرارداد</label><input type="text" id="edoc-contract-id" class="form-control" placeholder="205108734859" /></div> |
| 692 | </div> |
| 693 | <div id="edoc-contract-hint" style="font-size:12px;color:var(--text-muted);padding:8px;background:#f8fafc;border-radius:6px">این بخش فقط برای الگوی «قرارداد پیمانکاری» فعال است.</div> |
| 694 | |
| 695 | <div style="display:flex;gap:10px;margin-top:16px"> |
| 696 | <button class="btn btn-success" onclick="saveElectronicDocToPending()">💾 ذخیره اطلاعات سند</button> |
| 697 | <button class="btn btn-secondary" onclick="cancelElectronicDoc()">انصراف</button> |
| 698 | </div> |
| 699 | </div> |
| 700 | </div> |
| 701 | |
| 702 | <nav class="mobile-dock"> |
| 703 | <div class="dock-tab active" onclick="switchView('view-dashboard')"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path></svg><span>داشبورد</span></div> |
| 704 | <div class="dock-tab" onclick="switchView('view-invoices')"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg><span>فاکتورها</span></div> |
| 705 | <div class="dock-tab" onclick="switchView('view-products')"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"></path></svg><span>کالاها</span></div> |
| 706 | <div class="dock-tab" onclick="switchView('view-contacts')"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path></svg><span>اشخاص</span></div> |
| 707 | <div class="dock-tab" onclick="switchView('view-cheques')"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"></path></svg><span>چکها</span></div> |
| 708 | <div class="dock-tab" onclick="switchView('view-settings')"><svg fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg><span>تنظیمات</span></div> |
| 709 | </nav> |
| 710 | |
| 711 | <script src="js/core.js?v=20260928-security-v3"></script> |
| 712 | <script src="js/admin.js"></script> |
| 713 | <script src="js/sync.js?v=20260928-data-v3"></script> |
| 714 | <script src="js/ui.js"></script> |
| 715 | <script src="js/invoices.js?v=20260928-review-v6"></script> |
| 716 | <script src="js/print.js?v=20260928-layout-v3"></script> |
| 717 | <script src="js/products.js"></script> |
| 718 | <script src="js/contacts.js?v=20260928-roles-v3"></script> |
| 719 | <script src="js/cheques.js"></script> |
| 720 | <script src="js/expenses.js"></script> |
| 721 | <script src="js/companies.js?v=20260928-integrity-v3"></script> |
| 722 | <script src="js/backup.js?v=20260928-data-v2"></script> |
| 723 | <script src="js/words.js"></script> |
| 724 | <script src="js/bootstrap.js"></script> |
| 725 | |
| 726 | <style> |
| 727 | .form-control, textarea, select { direction: rtl; } |
| 728 | </style> |
| 729 | |
| 730 | <script src="js/patches.js"></script> |
| 731 | <script src="js/idle-and-reports.js?v=20260928-draft-v4"></script> |
| 732 | <script src="js/money-format.js"></script> |
| 733 | <script src="js/projects.js?v=20260928-projects-v3"></script> |
| 734 | <script src="js/invoice-excel-import.js"></script> |
| 735 | <script src="js/purchases.js?v=20260928-purchase-v6"></script> |
| 736 | <script src="js/operations.js?v=20260928-crud-v7"></script> |
| 737 | <script src="js/drilldown.js?v=20260928-drill-v6"></script> |
| 738 | <script src="js/selfcheck.js?v=20260928-review-v1"></script> |
| 739 | |
| 740 | </body> |
| 741 | </html> |