Commit Graph

78 Commits

Author SHA1 Message Date
Darko Gjorgjijoski
119a1712b0 Port expense report grouped itemized view + i18n + return types from master
Ports the net behaviour from three master commits into v3.0 as a single change, because v3.0 has already diverged structurally (controller moved from V1/Admin/Report to Company/Report, blade has its own CSS rework using the bundled fonts partial, and v3.0's App\Facades\Pdf replaces Barryvdh\DomPDF\Facade\Pdf). The three source commits are: 834b53ea (grouped itemized expenses), e22050bc (DomPDF facade + Pint — adapted to v3.0's App\Facades\Pdf), 0e9f18d4 (expenses.uncategorized + pdf_expense_group_total_label i18n keys + View|Response return type).

Controller: replaces the expenseCategories aggregate fetch with an itemized Expense query ordered by date, groups by category name with expenses.uncategorized fallback, and shares an expenseGroups collection of {name, expenses, total} plus the overall totalExpense. Adds expense_category_id to applyFilters. Updates the docblock return type from JsonResponse to View|Response. Keeps v3.0's App\Facades\Pdf.

Blade: replaces the single expenseCategories aggregate table with a per-group itemized table (date / note / amount columns + per-group total line using the new pdf_expense_group_total_label i18n key). Adds the item-table-* CSS classes and removes the old expense-total-table bottom block.

lang/en.json: adds expenses.uncategorized = "Uncategorized" and pdf_expense_group_total_label = "Group total:".
2026-04-07 17:28:34 +02:00
Darko Gjorgjijoski
04952d91ed Add Hebrew/Arabic/Devanagari/Sarabun font packages and unify Noto Sans into the package array
Closes the audit gaps from the original font system commit. The bundled NotoSans only covered Latin/Greek/Cyrillic but the descriptions claimed Arabic, Thai and Hindi too — that was false. DejaVu Sans, the prior dompdf default, did cover Hebrew, Arabic, Armenian and Georgian, so swapping it for NotoSans had silently regressed those scripts. The Thai conditional include was also dropped from every PDF template in that commit, leaving th locales rendering boxes despite THSarabunNew still sitting in resources/static/fonts/.

Adds four on-demand Font Packages — Noto Sans Hebrew, Noto Naskh Arabic (covering Arabic, Persian, Urdu, Sorani Kurdish), Noto Sans Devanagari (Hindi, Marathi, Sanskrit, Nepali) and Sarabun (Thai) — sourced from openmaptiles/fonts and google/fonts as static TTF. Static is mandatory because dompdf's PHP-Font-Lib does not parse variable fonts. Sarabun replaces THSarabunNew as the Thai face: same designer, OFL-licensed, maintained on a stable upstream URL, and surfaces through the same install flow as every other non-Latin script. The bundled THSarabunNew TTF files and the dead app/pdf/locale/th.blade.php legacy partial are removed as part of the migration.

Unifies the bundled Noto Sans into FONT_PACKAGES as a noto-sans entry with bundled => true and files served from resources/static/fonts/ instead of storage/fonts/. FontService::isInstalled, downloadPackage, getInstalledFontFaces and getPackageStatuses honor the flag through a new packageDir() helper. The hardcoded @font-face block in the PDF partial is gone — fonts.blade.php collapses to a single getInstalledFontFaces() call so the package array is the only source of truth for every face, bundled or on-demand. Admin → Font Packages now lists Noto Sans at the top with a primary-colored Bundled pill (new settings.fonts.bundled string) alongside the existing Installed badge / Install button states.

Also fixes the misleading settings.fonts.description and settings.fonts.bundled_info copy to actually describe what ships out of the box vs. what's optional, and rebuilds the en locale chunk.
2026-04-07 11:50:34 +02:00
Darko Gjorgjijoski
ba5c6c39ba Add multilingual PDF font system with Noto Sans and on-demand CJK packages
Bundle Noto Sans (Regular/Bold/Italic/BoldItalic) under resources/static/fonts/ as the default PDF face — it covers Latin, Cyrillic, Greek, Arabic, Thai and Hindi out of the box, replacing the limited DejaVu Sans fallback. Move all @font-face declarations into app.pdf.partials.fonts and include it from every invoice/estimate/payment/report template, dropping per-template font-family hardcodes and the conditional Thai locale include.

Introduce FontService + FontController to download static Noto Sans CJK packages (zh, zh_CN, ja, ko) from life888888/cjk-fonts-ttf on demand. GeneratesPdfTrait::ensureFontsForLocale primes the family before rendering and the partial emits @font-face rules for installed packages so dompdf resolves them through standard CSS — no separate registerFont() instance required. Static TTFs are mandatory because dompdf's PHP-Font-Lib does not parse variable fonts (fvar/gvar tables), which is why Google Fonts' NotoSansTC[wght].ttf rendered empty boxes.

Expose status/install via /api/v1/fonts/status and /api/v1/fonts/{package}/install with matching FONTS_STATUS / FONTS_INSTALL constants in scripts-v2/api/endpoints.ts. Flip DOMPDF_ENABLE_REMOTE default to true for remote asset loading.
2026-04-06 23:32:00 +02:00
Darko Gjorgjijoski
346e5df7ee Fix Thai font path with duplicated static/ segment in PDF locale partial
The @font-face URLs in resources/views/app/pdf/locale/th.blade.php pointed to resource_path('static/static/fonts/THSarabunNew*.ttf'), which does not exist on disk, so dompdf fell back to a default face when rendering Thai PDFs. Drop the duplicated segment so the bundled THSarabunNew TTFs resolve correctly.
2026-04-06 21:48:00 +02:00
Darko Gjorgjijoski
0ce88ab817 Remove app/Space folder and extract model business logic into services
Relocate all 14 files from the catch-all app/Space namespace into proper
locations: data providers to Support/Formatters, installation utilities to
Services/Installation, PDF utils to Services/Pdf, module/update classes to
Services/Module and Services/Update, SiteApi trait to Traits, and helpers
to Support.

Extract ~1,400 lines of business logic from 8 fat models (Invoice, Payment,
Estimate, RecurringInvoice, Company, Customer, Expense, User) into 9 new
service classes with constructor injection. Controllers now depend on
services instead of calling static model methods. Shared item/tax creation
logic consolidated into DocumentItemService.
2026-04-03 15:37:22 +02:00
mchev
aa88dc340d Closes #588 2026-04-01 21:30:32 +02:00
klittle81
c70e2abf8a Apply suggestion from @klittle81
remove the <br> at end as its not needed
2026-02-27 22:43:40 -05:00
klittle81
fc05cf61fa Patch to update reciept PDF generated by payment.blade.php to include Invoice Total, Balance Due, and Invoice Status 2026-02-27 22:06:27 -05:00
Calcen
c035c834d4 Fix: Weird gap in invoice items description (#439)
- Ensure invoice item display is block for better layout. 
- Gets rid of the weird extra gap between last line and the line above it.
2025-08-31 03:23:58 +02:00
Fabio Ribeiro
d69a56e2d5 feat: Tax included (#370)
* feat: Tax included

* Added a toggle switch in tax settings to enable the feature.
* Database migration adding tax_included field into estimates, invoices
  and recurring invoices table.
* Toggle switch to enable and store the tax_included by estimates,
  invoices and recurring invoices.
* In case of tax included enabled, total taxes will be recalculated and
  the invoices, estimates and recurring invoices total won't be sum with
  taxes.
* Apply tax included when discount_per_item/tax_per_item item is enabled.
* Custom component to show the net total when tax included is enabled.
* Update invoice and estimates pdfs with net total.

* chore: Tax included by default

A switch button inside the tax settings to enable the tax included by
default in invoices, estimates and recurring invoices.
2025-08-28 10:28:24 +02:00
mchev
bf5b544ca3 Adding Flat Tax support with fixed amount (#253)
* Possibility to set a fixed amount on tax types settings

* Pint and manage flat taxes on items

* Fix display errors and handle global taxes

* Tests

* Pint with PHP 8.2 cause with PHP 8.3 version it cause workflow error

* Merging percent and fixed amount into one column

* Now display the currency on SelectTaxPopup on fixed taxes
2025-05-04 02:24:56 +02:00
mchev
3f560a1de2 Add Amount Paid and Amount Due to Invoice PDF (#248)
* Display payment status on invoices

* Update en.json
2025-01-12 11:36:36 +01:00
SpeedX
022769ba38 Fix Logo render in Payment PDF (#162)
* Fix logo render in Payment PDF

* Fix CSS to make it consistent with other templates
2024-10-14 11:47:10 +02:00
Darko Gjorgjijoski
c799149d2d Improved logo display in Invoice/Estimate PDFs 2024-08-04 16:08:22 +02:00
jacobi petrucciani
f10154539e fix logo rendering in pdf output for invoices 2024-07-31 14:22:48 -04:00
Darko Gjorgjijoski
cd9df54c5b Upgrade to Laravel 10, Vite 5+ 2024-01-28 17:17:32 +01:00
Darko Gjorgjijoski
cec86c39ed Update logo/screenshots 2024-01-28 02:59:42 +01:00
Dhruv Bhatt
4e47f58bad fixed - No query results for model [Crater\Models\Currency] (#1070)
* fixed report pdf issue

* Removed telescope service provider file
2022-10-26 19:33:25 +05:30
Ritthikrai W
204483836a 🌐Update: support Thai language (#768)
* add thai language config

* update thai translation

* update thai translation

* add THSarabunNew fonts to using in pdf

* update: pdf file to support thai language by checking isLocale('th') and include thai font-family

* update: thai translation

* remove the index.php file (not used)

* move THSarabunNew fonts to resoureces/static/fonts

* Add .gitkeep to storage/fonts to pre-build the fonts directory

Co-authored-by: Ritthikrai (Champ) Wiengchai <ritthikrai.w@aware.co.th>
2022-06-15 18:17:36 +05:30
NicoHood
157559cc05 Improve invoice 1 template css (#872)
There is no class "header" that's why I removed it. Also I fixed some whitespace issues
2022-04-01 13:50:27 +05:30
Harsh Jagad
a14655d73b Update dompdf version 2022-01-12 11:44:45 +00:00
harshjagad20
725afa9f65 fix pdf issue & payment update issue 2021-12-09 18:06:25 +05:30
radhika587
603bf637a7 fix custom field issue and report issues 2021-12-06 12:51:31 +00:00
Mohit Panjwani
082d5cacf2 v5.0.0 update 2021-11-30 18:58:19 +05:30
Patrick Lucas
6bfab30f14 Add tax column to invoices
When an invoice has tax per item enabled, include a tax column so that
it's clear how much tax is being applied to each item.
2021-07-21 14:07:07 +02:00
Mohit Panjwani
9f673d7eb3 fix tax-per-item issue display for estimates 2021-07-16 11:56:18 +05:30
Mohit Panjwani
d3a745605e fix tax-per-item issue 2021-07-16 11:49:56 +05:30
Mohit Panjwani
cdaa1ff103 refactor estimate & invoice templates 2021-04-12 14:40:59 +05:30
Florian Gareis
428be640c3 Don't capitalize address on invoice 2021-03-22 14:49:31 +01:00
Florian Gareis
cea8405ace Translate PDF titles 2021-03-20 14:35:22 +01:00
Sebastian Cretu
f9d6e8b0cc fix(items): added unit name after quantity in the pdf templates 2021-03-03 17:09:05 +01:00
Mohit Panjwani
02a2db4417 Merge pull request #372 from makakken/master
Fixes #371
2021-02-24 15:40:34 +05:30
Mohit Panjwani
7f0da9dc36 fix conflict 2021-02-12 13:19:56 +05:30
Sebastian Cretu
375a59a504 fix(payments): display the currency in receipts 2021-02-08 20:42:10 +01:00
makakken
6cb8d30915 Update invoice3.blade.php
Fix Exception: 'box_sizing' is not a recognized CSS property.
2021-02-04 11:02:59 +01:00
makakken
9b55e84724 Update invoice2.blade.php
Fix Exception: 'box_sizing' is not a recognized CSS property.
2021-02-04 11:02:32 +01:00
makakken
cf5da7684b Update invoice1.blade.php
fix box_sizing DOMPDF Bug
2021-02-04 11:01:57 +01:00
brijraj_04
3695e7d075 fix payment currency issue 2021-02-02 17:22:44 +05:30
spvarma
8b04e94446 fix total discount issue 2020-12-24 13:43:29 +05:30
edevrob
8dee0da434 PDF templates fix
DomPDF font-weight problems fix
2020-12-09 21:13:56 +02:00
Mohit Panjwani
89ee58590c build version 400 2020-12-02 17:54:08 +05:30
Mohit Panjwani
450c265ded Merge branch 'refactor-report-pdfs' into 'master'
Refactor report pdfs

See merge request mohit.panjvani/crater-web!233
2020-05-11 15:48:49 +00:00
Jay Makwana
8446ac2b27 refactor invoice2 2020-05-11 16:19:02 +05:30
Jay Makwana
11db99da73 refactor invoice 1 style 2020-05-09 18:50:58 +05:30
Jay Makwana
0f3e8fce3b refactor heading text in payment 2020-05-08 20:55:00 +05:30
radhu587
325f90bba5 Fix issues on invoice template 2020-05-08 18:49:02 +05:30
radhu587
a739a938fc Fix estimate template issues 2020-05-08 16:52:48 +05:30
Jay Makwana
fc1a7c7438 refactor reports pdfs 2020-05-07 18:59:50 +05:30
radhu587
6046113cb1 Refactor Invoice and Payment templates 2020-05-07 16:42:04 +05:30
Jay Makwana
611ffafec5 refactor sales customers pdf 2020-05-06 20:41:15 +05:30