Event and checks referenced a non-existent hesabatdövrü field, so
selecting year + quarter never triggered populate_declaration_tables.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Row 4 sums Məzuniyyət Kompensasiyası per month from Salary Detail.
Row 1 Gəlirlər, cəmi now sums rows 2 + 4.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- bolme2_hisse2 row 2: sum of Əsas əmək haqqı per month from Salary Detail
- bolme2_hisse2 row 1: auto-sum of rows 2-5
- hissə_1 gəlirlərcəmi: switched from gross_pay to Əsas əmək haqqı
- New Monthly Present Report (Present + Half Day attendance)
- bolme2_hisse1 row 2: unique employees with Present/Half Day per month
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New report counts days present (Present + Half Day) per employee.
bolme2_hisse1 row 2 counts unique employees who showed up per month.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prevents migration failure when jey_erp custom fields are not yet
synced (Unknown column 'accounting_method' error).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Count employees per month using date_of_joining + relieving_date logic.
Safety net: status=Left without relieving_date excluded from count.
Updates existing pre-created rows by matching göstəricilər field.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Refactored payroll data fetch into shared fetch_payroll_data() used by
both hissə_1 and hissə_2. hissə_2 shows employees with məzuniyyət
kompensasiyası, with il from date_of_joining year.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fetch absence data (employee name, FIN, SSN, reason, days absent) from
Attendance records and fill hissə_3 alongside hissə_1 on year/quarter change.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reverted child table to original 7 fields (soyadadataadı, fin, gəlirlərcəmi,
vergiməbləği, and 3 insurance fields). Server method now maps report data
to these fields, fetches FIN from Employee doctype, and leaves vergiməbləği
unfilled. Removed unnecessary 23 extra fields.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
frappe.db.get_value rejects Unicode fieldnames (mdssüzrə etc.) even with
backticks. Replace with a whitelisted Python method that uses frappe.get_doc.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add .catch() to frappe.db.get_value call so the form opens without
errors when Company has no mdssüzrə or related fields populated.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Redesign Single Declaration-Elave1_Hisse1 child table with all report columns
(26 fields), add server-side aggregation per employee with insurance formula
(işçi + şirkət) × 3, and client-side triggers on il/hesabatdövrü fields.
Also fix backtick escaping for Unicode field names in frappe.db.get_value.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Issue: Amount columns were showing both won and lost transactions
Fix: Only won=1 transactions now appear in amount columns
Changes:
- Added si.won field to SELECT query
- Amount up to 500: only counts won=1 items
- Amount over 500: only counts won=1 items
- Grand total: still shows all amounts (won + lost)
This ensures gambling report accuracy after won/lost bug fix.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>