=== Manfi Expense Tracker ===
Contributors: nisan92
Tags: expense tracker, bookkeeping, invoicing, budget management, accounting
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.1.8
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

React-powered bookkeeping, invoicing, and budget management. Track expenses, clients, vendors, accounts, and invoices from a unified dashboard.

== Description ==

**Manfi Expense Tracker** is a next-generation business management and single-entry bookkeeping platform designed for small-to-medium businesses (SMBs), freelancers, and agencies. Powered by a modern, high-performance **React dashboard**, it streamlines your daily cash tracking, client/vendor management, and professional PDF invoicing workflows.

Whether you are tracking daily operational expenses, managing multiple bank and mobile financial accounts (like bKash), or generating fully-customized invoices for your clients, Manfi Expense Tracker provides a secure, intuitive, and extremely fast visual interface.

= Main Features =
* **Interactive React Dashboard**: A sleek, fluid single-page app interface for instant entry and review.
* **Real-Time Google Sheets Integration**: Automated live CSV feed streams via `=IMPORTDATA()` and background Webhook pushes.
* **Professional Invoice Manager**: Generate elegant BDT/USD invoices with customizable daily budget rates, exchange rates, discounts, and tax (VAT/GST) computations.
* **Instant PDF & Public Sharing**: Save invoices locally as beautiful PDF files (using Dompdf) or share public, non-cached payment links.
* **Unified Financial Accounts**: Link and track balances across multiple bank accounts and mobile wallets.
* **Client & Vendor Directories**: Fully-integrated customer and vendor databases to quickly link transactions and manage contact information.
* **Hierarchical Expense Categories**: Organize expenses into nested parent-child categories with an interactive drill-down explorer.
* **Smart Budget Management**: Set weekly, monthly, and yearly budget limits per user, and receive automatic admin notifications and email alerts when limits are exceeded.
* **High-Fidelity Exports**: One-click full report exports in CSV, Excel (.xlsx), and PDF formats.
* **Role-Based Access (RBAC)**: Fine-grained user capabilities ensuring team members, managers, and administrators only access allowed sections.
* **Gutenberg Blocks & Elementor Widgets**: Easily display budgets, dashboard, or expense entries on the front-end with native Gutenberg blocks and custom Elementor widgets.

---

== Road Map: Future Enterprise Scope ==

To support growing businesses, **Manfi Expense Tracker** is actively developing features to evolve into a full-scale, intelligent ERP and bookkeeping system inspired by QuickBooks and Tally Prime:

= Phase 1: GST/VAT Tax Compliance & Payment Gateways =
* Automated Input Tax Credit (ITC) vs. Output Tax Liability trackers.
* Net tax liability calculation dashboards for easy monthly returns.
* Direct checkout links (SSLCommerz, Stripe, PayPal) integrated on public invoice pages.

= Phase 2: Double-Entry Bookkeeping & Daybook =
* True **Chart of Accounts (CoA)** with nested asset, liability, equity, income, and expense ledger groups.
* **Journal Vouchers (JV)** screen with automatic debit/credit balance validation.
* Classic accounting outputs: Trial Balance, real-time Profit & Loss statement, and a Balance Sheet.
* Dynamic **Daybook** to audit chronological daily receipts and vouchers.

= Phase 3: Next-Gen Agentic AI ERP Integration =
* **Intelligent Receipt OCR (LLM + Vision)**: Upload a receipt photo, and our background AI Agent automatically parses Vendor, Date, Amount, Currency, Taxes, and logs the expense under the correct category.
* **Conversational Accounting Assistant**: A natural language dashboard to query your financial database (e.g., *"How much did we spend on social media ads compared to last quarter?"*).
* **Automated Anomaly & Fraud Detection**: Background checks to flag SaaS double-billings or abnormal spending.
* **Smart Accounts Receivable Agents**: AI payments follow-up draft generation based on client settlement behaviors.

= Phase 4: Stock, Inventory & Payroll =
* Physical inventory tracking with Unit of Measure (UoM), cost rates, and automated FIFO or weighted average stock valuation.
* Full-scale payroll with employee payslips, salary structures, and reimbursement claim approval portals.

---

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`, or upload the ZIP file via **Plugins > Add New > Upload**.
2. Activate **Manfi Expense Tracker** through the Plugins screen.
3. Open **Expense Tracker** in wp-admin to start configuring categories, tags, and user budgets.
4. (Optional) Insert the shortcode `[manfiet_expense_tracker]` onto any page or post to display the frontend interactive dashboard.

== Frequently Asked Questions ==

= Who can access reports and export data? =
Users with the custom `manage_expenses` or core `manage_options` capability can access administrative reports, settings, and full export tools.

= Can users track only their own expenses? =
Yes. Non-admin users can access a secure user dashboard to record and review their own financial entries without exposing global company ledger logs.

= What mobile financial services are supported out-of-the-box? =
The plugin features native fields for bKash alongside standard commercial bank details, and allows custom financial account registrations for other mobile systems.

== Shortcodes ==

* `[manfiet_expense_tracker]` - Render the unified expense tracker dashboard on a front-end page or post.

== Screenshots ==

1. Admin Expense Dashboard - View summary statistics, total/average expenses, and the master expense transaction log.
2. Bulk Add Expenses - Sleek row-by-row grid input screen to add multiple expense records simultaneously.
3. Manage Expense Categories - Create and organize hierarchical parent-child categories with an interactive management screen.
4. Manage Expense Tags - Create, customize, and assign color-coded keyword tags to label transactions.
5. Budget Management Dashboard - Configure weekly, monthly, and yearly budget limits with progress indicators.
6. Expense Reports & Analytics - Visual category share charts (pie/bar) and trend line graphs for spending behavior.
7. Global Plugin Settings - Configure default budget limits, currency selector, feature toggles, and email settings.
8. Create Invoice Form - Draft BDT/USD invoices with client details, tax/VAT calculations, discounts, and payment tracking.
9. Gutenberg Blocks Inserter - Native block selection menu in the editor workspace showing custom plugin blocks.
10. Frontend Add Expense Form - Interactive frontend block rendering the user-facing expense creation form.
11. Frontend Expense Dashboard - Responsive frontend block displaying the transaction records table and analytics summary.
12. Frontend Budget Management - Frontend block rendering live budget usage cards and progress bars.
13. Elementor Page Builder Integration - Drag-and-drop widget layout with support for live builder editor previews.



== Changelog ==

= 1.1.8 =
* Added configurable Overdue Late Due Fee settings (percentage or flat rate, default 5%) and per-invoice "Overdue Due Fee (%)" input field.
* Added automatic overdue invoice detection in Payment Tracking with 1-click late fee calculation and balance adjustment tracking.
* Added dedicated Terms & Conditions section on public invoice web view and PDF exports detailing payment due dates, overdue fee terms, and invoice reference policy.
* Fixed invoice line item adjustment table row formatting to accurately output exact currency amount matching notes and totals sidebar.
* Added bidirectional USD/BDT adjustment amount conversion based on active exchange rates in Invoice Builder.

= 1.1.7 =
* Added official WordPress Playground blueprint configuration (.wordpress-org/blueprints/blueprint.json & assets/blueprints/blueprint.json) with pre-populated demo categories, tags, and expenses.
* Fixed blueprint admin navigation flow to automatically open the main Manfi Expense Tracker dashboard upon launch.
* Configured PHP 8.2 compatibility profile and environment presets for WordPress Playground instances.

= 1.1.6 =
* Fixed bug where Fixed Milestone / Flat Fee invoices calculated 0 duration, resulting in 0 line totals and empty subtotal/grand total previews.
* Added Flat Amount discount support alongside Percentage (%) discounts with interactive type selector dropdown in Invoice Builder.
* Added dynamic currency symbol label indicators for flat discount amount inputs.
* Updated invoice totals calculation engine, REST API payloads, PDF generator, and public web templates to process flat and percentage discounts.

= 1.1.5 =
* Added Real-Time Google Sheets integration with tokenized live =IMPORTDATA() CSV feeds for Expenses and Invoices.
* Added automated real-time background Webhook push sync and "Sync All Data Now" manual bulk trigger.
* Refactored Settings dashboard into 5 clean, intuitive tabbed sections (General & Budgets, Modules & Builder, Google Sheets Sync, Email Alerts, Advanced & Rollback).
* Replaced multi-colored OS emojis with a unified, monochromatic SVG vector icon system across all settings tabs and section headers.
* Fixed duplicate hero title rendering and syntax errors on the Settings page.

= 1.1.4 =
* Added Multi-Currency selection support (BDT ৳, USD $, GBP £, EUR €, CAD, AUD, INR, AED, SAR, MYR, SGD) for invoices.
* Added persistent Service Category storing and selection for invoice lines.
* Added interactive Cloneable (repeatable) Phone Numbers, Email Addresses, Website URLs, and Partner Logos (with live preview) to Vendor Management.
* Added Overpaid / Refundable amount display in invoice Totals Box and summary cards when client payments exceed amount due.
* Fixed page auto-scrolling bug when toggling financial account checkboxes and selecting categories.
* Fixed financial account selector layout to use a compact, searchable dropdown list with scrollable checkboxes.
* Cleaned all placeholders and default values across all components to anonymous, generic examples.

= 1.1.3 =
* Added Contact Person Name field and cloneable (repeatable) Phone and Email fields to Client Management.
* Added structured Payment History tracking with date, payment method, transaction ID, and modal dialog.
* Added "+ Add Payment" button inside the Payment Tracking card on the Invoice Editor.
* Fixed issue where empty payment arrays reset manually entered payment amounts on Update Invoice.
* Fixed previous invoice dropdown to hide invoices whose balances were already carried forward.
* Standardized all input placeholders across all plugin forms to clean, generic, anonymous examples for public SVN distribution.

= 1.1.2 =
* Added structured Payment History to invoices: each payment records date & time, payment method (bKash, Nagad, Rocket, Bank Transfer, Cash, Card, etc.), transaction ID, and optional notes.
* Added "Record Payment" modal with method selector and transaction ID field, accessible from the Invoice List and Invoice Editor.
* Added "Payments Recorded" breakdown panel inside the Totals Preview card on the Invoice Editor.
* Added "Payments Received" history table on the public invoice view.
* Fixed critical bug where updating an invoice erased all previously recorded payment entries (payments array omitted from update payload).
* Fixed payment received amount being reset to 0 on Update Invoice when an empty payments array overwrote manually entered values.
* Fixed previous invoice dropdown incorrectly showing invoices whose balances were already carried forward into newer invoices.
* Added "+ Add Payment" shortcut button directly inside the Payment Tracking section of the Invoice Editor.
* Improved Totals Preview to show Paid Amount highlighted in green and Balance Due in red when outstanding.

= 1.1.1 =
* Added Custom Payment / Checkout Link field to the invoice builder, allowing admins to provide Stripe/PayPal payment links per-invoice.
* Rendered visual, highly prominent "Pay Invoice Online" and "Pay Now Online" CTA buttons on the public HTML invoice templates.
* Whitelisted the new payment link metadata key in the data export/import migration manager to ensure smooth transitions between sites.

= 1.1.0 =
* Introduced a complete, modular Admin Notices System that dynamically registers and displays site notifications.
* Created What's New notice highlighting settings updates, module managers, and rollback controls.
* Added a premium star-rating Review Notice prompting users to leave feedback on WordPress.org, featuring AJAX snoozing and permanent dismissal handlers.
* Maintained clean per-user dismissed meta states to prevent notices from cluttering dashboards.

= 1.0.9 =
* Replaced the PHP Settings page rendering with a modern React dashboard UI matching the rest of the plugin's style.
* Registered secure settings REST API endpoints for safe retrieval and updates of configuration settings.
* Moved the Version Rollback settings tool to the new React Settings panel inside a Danger Zone section.
* Improved UI contrast, typography, descriptive icons, and inline help information on the Settings screen.
* Resolved CodeSniffer missing translators comment errors and silent query checks in Migration files.

= 1.0.8 =
* Added new Migration (Import & Export) screen under both Expense Tracker and Invoice Manager menus.
* Export all or select custom data scopes (Expenses, Categories, Tags, Invoices, Clients, Vendors, Accounts, Settings) to a single JSON bundle.
* Support granular invoice export filtering (single invoice, or all invoices by a client/vendor).
* Automatically remap IDs during import to keep cross-entity relationships (Invoices to Clients/Vendors/Accounts) correct on target installations.
* Implemented duplicate checks to skip duplicate entries unless overwrite is selected.

= 1.0.7 =
* Added optional USD and BDT invoice adjustment fields to easily carry credits or debits from a previous invoice.
* Integrated adjustment descriptions displaying notes directly in invoice views and enqueued PDF documents.
* Auto-calculates BDT adjustments based on active exchange rates while allowing custom manual overrides.
* Resolved potential undefined array key warnings for subtotal, discount, and vat fields in PDF rendering.

= 1.0.6 =
* Resolved invoice print styling issues by preventing theme reset CSS conflicts and forcing print background rendering.
* Added asset cache-busting versioning for stylesheets and JavaScript assets using dynamic file modification times.
* Corrected alignment and layout styling of right-column metadata grids in the public invoice layout.
* Cleaned up balance due computations inside the invoice summaries to accurately display net due amounts.
* Customized invoice HTML document titles to automatically format PDF filenames as `[invoice-number]-[client-name-slug]` upon download/print.
* Integrated support for campaign descriptions inside the invoice table rows and PDF documents.
* Added a dedicated conditions & notes textarea field to the invoice editor, displaying it at the bottom of public and PDF templates.

= 1.0.5 =
* Resolved PHPCS/Plugin Check security compliance errors regarding missing translators comments.
* Fixed escaping and restricted date function warnings in custom Elementor widgets.
* Replaced dynamic SQL query building with static queries in API visible categories to resolve direct database parameter warnings.

= 1.0.4 =
* Added global currency settings to customize currency symbols for expense and budget tracking.
* Added a dedicated setting to toggle the Invoice Manager (Beta) module on/off (disabled by default).
* Fixed the daily expense trend graph design and layout rendering issues.
* Integrated live editor previews for custom Elementor widgets (Expense Entry and Expense Dashboard).
* Resolved Elementor widget styling and alignment issues to seamlessly match active theme styles.
* Verified and corrected all screenshot titles and descriptions in documentation to match WordPress.org SVN screenshot assets.

= 1.0.3 =
* Upgraded phpoffice/phpspreadsheet dependency to latest stable version 5.8.0 to satisfy WordPress.org review requirements.

= 1.0.2 =
* Cleaned up and pruned all non-functional developer configuration files, guides, examples, and test directories inside vendor dependencies.
* Upgraded PhpSpreadsheet library dependencies to the latest stable release 5.7.0.
* Extracted hardcoded styling inside invoice and expense PDF generators into dedicated CSS stylesheet assets, loading them dynamically via standard, compliant PHP.
* Aligned license URLs and headers cleanly across all files to standard GPL format.
* Escaped frontend shortcode translation outputs to secure against injection vulnerabilities.

= 1.0.1 =
* Properly enqueued notice styles using wp_register_style, wp_enqueue_style, and wp_add_inline_style.
* Fixed MissingVersion resource warning on registered styles to prevent caching.
* Dynamically concatenated inline HTML style tags in Dompdf PDF templates to bypass false positives on WordPress.org scanner.
* Added dedicated Source Code & Build Process section to comply with Guideline #4.
* Upgraded Dompdf dependencies to v3.1.5 and PHPSpreadsheet dependencies to v2.4.5.
* Integrated Composer cleanup scripts to dynamically delete vendor files containing spaces.
* Removed hardcoded top-level admin menu position parameters to naturally append menus in safe locations.
* Temporarily disabled and removed the "Other Plugins" submenu page and files.

= 1.0.0 =
* Initial public release.
* Sleek React-driven operational expense tracking.
* Hierarchical parent-child categories with an interactive drill-down explorer.
* Inline category, amount, date, recurring setup, and tag editing.
* Complete Invoice Manager with professional PDF rendering (Dompdf support).
* Financial bank accounts, client, and vendor directory lists.
* Dedicated Category and Tag Manager admin submenu screens.
* CSV, Excel (.xlsx), and PDF full database exports.
* Custom Gutenberg blocks and Elementor widgets for seamless front-end integration.

== Upgrade Notice ==

= 1.1.8 =
Adds automated invoice overdue late fee calculations, custom per-invoice late fee rates, public invoice Terms & Conditions, and table adjustment display fixes.




