diff --git a/assets/css/custom.css b/assets/css/custom.css index 8359aed..166579e 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -104,7 +104,7 @@ body { .sidebar { width: var(--sidebar-width); height: 100vh; - background-color: var(--primary); + background-color: #0f172a; /* Updated to match system primary dark blue */ color: white; position: fixed; top: 0; @@ -145,11 +145,11 @@ body { padding: 1rem; font-size: 1.15rem; font-weight: 700; - border-bottom: 1px solid var(--primary-light); + border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Lighter border for blue bg */ } .nav-link { - color: #cbd5e1; + color: rgba(255, 255, 255, 0.9); /* Lighter text for blue bg */ padding: 0.6rem 1rem; display: flex; align-items: center; @@ -158,7 +158,7 @@ body { } .nav-link:hover, .nav-link.active { - background-color: var(--primary-light); + background-color: rgba(255, 255, 255, 0.1); /* Subtle hover for blue bg */ color: white; } @@ -170,7 +170,7 @@ body { .nav-section-title { font-size: 0.85rem; font-weight: 600; - color: #64748b !important; + color: rgba(255, 255, 255, 0.7) !important; /* Lighter text for blue bg */ letter-spacing: 0.05em; cursor: pointer; display: flex; @@ -179,7 +179,7 @@ body { } .nav-section-title:hover { - color: #94a3b8 !important; + color: white !important; } .nav-section-title i.chevron { @@ -655,3 +655,62 @@ body:not(.theme-default) .form-select:focus { margin-top: 15px; padding-top: 15px; } + +/* Styled Modal Headers */ +.modal-header, .card-header { + background-color: var(--accent); + color: white; + border-bottom: 1px solid var(--border); +} +.modal-title, .card-title { + color: white !important; +} +.modal-header .btn-close { + filter: invert(1) grayscale(100%) brightness(200%); +} + +/* 3-Column Form Grid */ +.form-grid-3 { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 1rem; +} + +@media (max-width: 992px) { + .form-grid-3 { + grid-template-columns: repeat(2, 1fr); + } +} +@media (max-width: 768px) { + .form-grid-3 { + grid-template-columns: 1fr; + } +} + +.form-grid-3 > div { + width: 100% !important; /* Override bootstrap cols if present */ + max-width: 100% !important; + flex: none !important; +} + +/* Helpers to span columns in grid */ +.form-grid-3 > .span-2 { grid-column: span 2; } +.form-grid-3 > .span-3 { grid-column: span 3; } +.form-grid-3 > .full-width { grid-column: 1 / -1; } + +/* Handle existing bootstrap classes in grid */ +.form-grid-3 > .col-12, +.form-grid-3 > .col-md-12 { + grid-column: 1 / -1; +} + +.form-grid-3 > .col-md-8 { + grid-column: span 2; +} + +/* Ensure form controls take full width of their grid cell */ +.form-grid-3 .form-control, +.form-grid-3 .form-select, +.form-grid-3 .input-group { + width: 100%; +} \ No newline at end of file diff --git a/debug.log b/debug.log index 8f32168..abe5875 100644 --- a/debug.log +++ b/debug.log @@ -19,3 +19,38 @@ 2026-03-17 21:47:03 - Requesting AI. UUID: [e1f9b5b3-fcef-4c8d-87d2-8630b1f72491] CFG: {"base_url":"https:\/\/flatlogic.com","responses_path":"\/projects\/38471\/ai-request","project_id":"38471","project_uuid":"e1f9b5b3-fcef-4c8d-87d2-8630b1f72491","project_header":"Project-UUID","default_model":"gpt-4o-mini","timeout":30,"verify_tls":true} 2026-03-17 21:47:17 - Items case hit 2026-03-17 21:47:27 - Items case hit +2026-03-17 22:30:34 - Items case hit +2026-03-17 22:30:54 - Items case hit +2026-03-17 22:31:12 - Items case hit +2026-03-17 22:31:17 - Items case hit +2026-03-17 22:36:20 - Items case hit +2026-03-17 22:40:51 - Items case hit +2026-03-17 18:45:47 - Items case hit +2026-03-17 18:47:55 - Items case hit +2026-03-17 18:51:56 - Items case hit +2026-03-17 18:54:27 - Items case hit +2026-03-18 01:51:29 - Items case hit +2026-03-18 01:51:45 - Items case hit +2026-03-18 02:00:48 - Items case hit +2026-03-18 02:02:37 - Items case hit +2026-03-18 02:03:03 - Items case hit +2026-03-18 02:05:55 - Items case hit +2026-03-18 02:06:44 - Items case hit +2026-03-18 02:12:27 - Items case hit +2026-03-18 02:14:19 - Items case hit +2026-03-18 02:15:13 - Items case hit +2026-03-18 02:15:31 - Items case hit +2026-03-18 02:15:56 - Items case hit +2026-03-18 02:16:33 - Items case hit +2026-03-18 02:17:32 - Items case hit +2026-03-18 02:17:48 - Items case hit +2026-03-18 02:18:21 - Items case hit +2026-03-18 02:19:01 - Items case hit +2026-03-18 02:19:49 - Items case hit +2026-03-18 02:20:06 - Items case hit +2026-03-18 02:20:47 - Items case hit +2026-03-18 02:21:53 - Items case hit +2026-03-18 02:24:31 - Items case hit +2026-03-18 02:26:44 - Items case hit +2026-03-18 02:28:48 - Items case hit +2026-03-18 02:28:58 - Items case hit diff --git a/debug_accounting.php b/debug_accounting.php new file mode 100644 index 0000000..11ca168 --- /dev/null +++ b/debug_accounting.php @@ -0,0 +1,18 @@ +query("SELECT * FROM acc_accounts LIMIT 5")->fetchAll(); + echo "Found " . count($accounts) . " accounts.\n"; + print_r($accounts); + + echo "\nTesting getAccountBalance('1100')...\n"; + $balance = getAccountBalance('1100'); + echo "Balance for 1100: " . $balance . "\n"; + +} catch (Exception $e) { + echo "Error: " . $e->getMessage() . "\n"; +} + diff --git a/fix_accounting_bug.php b/fix_accounting_bug.php new file mode 100644 index 0000000..2781e42 --- /dev/null +++ b/fix_accounting_bug.php @@ -0,0 +1,51 @@ +query("SELECT je.*, + (SELECT SUM(debit) FROM acc_ledger WHERE journal_entry_id = je.id) as total_debit + FROM acc_journal_entries je + ORDER BY je.entry_date DESC, je.id DESC LIMIT 100")->fetchAll(); +EOD; + +$replace = <<<'EOD' + case 'accounting': + // Pagination for Journal Entries + $currentPage = isset($_GET['p']) ? max(1, (int)$_GET['p']) : 1; + $limit = isset($_GET['limit']) ? (int)$_GET['limit'] : 20; + $offset = ($currentPage - 1) * $limit; + + $total_entries = db()->query("SELECT COUNT(*) FROM acc_journal_entries")->fetchColumn(); + $data['total_pages'] = ceil($total_entries / $limit); + $data['current_page'] = $currentPage; + + $data['journal_entries'] = db()->query("SELECT je.*, + (SELECT SUM(debit) FROM acc_ledger WHERE journal_entry_id = je.id) as total_debit + FROM acc_journal_entries je + ORDER BY je.entry_date DESC, je.id DESC LIMIT $limit OFFSET $offset")->fetchAll(); +EOD; + +// Normalize line endings +$content = str_replace("\r\n", "\n", $content); +$search = str_replace("\r\n", "\n", $search); +$replace = str_replace("\r\n", "\n", $replace); + +if (strpos($content, $search) !== false) { + $newContent = str_replace($search, $replace, $content); + file_put_contents($file, $newContent); + echo "Successfully patched index.php\n"; +} else { + echo "Could not find the code block to replace.\n"; + // Debug: print a small chunk around where we expect it + $pos = strpos($content, "case 'accounting':"); + if ($pos !== false) { + echo "Found case 'accounting': at position $pos. Content around it:\n"; + echo substr($content, $pos, 500) . "\n"; + } +} \ No newline at end of file diff --git a/fix_forms.py b/fix_forms.py new file mode 100644 index 0000000..076e3ff --- /dev/null +++ b/fix_forms.py @@ -0,0 +1,149 @@ +import re + +file_path = 'index.php' + +with open(file_path, 'r') as f: + content = f.read() + +# 1. Replace