134 Commits
1.2.2 ... 2.1.1

Author SHA1 Message Date
Darko Gjorgjijoski
8c343b4b92 New Crowdin updates (#304)
* New translations en.json (Spanish)

* New translations en.json (French)

* New translations en.json (Indonesian)

* New translations en.json (Indonesian)
2025-02-05 11:10:06 +01:00
Darko Gjorgjijoski
a60cac3e66 Update version.md 2025-02-05 11:04:44 +01:00
mchev
6a0d3a3bcc Fix customer dropdown (#307) 2025-02-05 11:04:17 +01:00
Darko Gjorgjijoski
3e52b84fa8 New Crowdin updates (#279)
* New translations en.json (Japanese)

* New translations en.json (Japanese)

* New translations en.json (Japanese)

* New translations en.json (Spanish)

* New translations en.json (Indonesian)

* New translations en.json (Indonesian)

* New translations en.json (Indonesian)

* New translations en.json (Japanese)

* New translations en.json (Japanese)

* New translations en.json (German)

* New translations en.json (Japanese)

* New translations en.json (Japanese)

* New translations en.json (Japanese)
2025-02-01 10:41:49 +01:00
Darko Gjorgjijoski
d1f45a790b Bump version 2025-02-01 10:41:19 +01:00
Darko Gjorgjijoski
bec0c058a8 Bump version 2025-01-13 02:14:23 +01:00
Darko Gjorgjijoski
d862ee05e9 Refactor Custom Invoice/Estimate PDF Templates (#277)
* Add utility class for managing templates

* Register custom pdf template views location

* Update the make:template command to make use of PdfTemplateUtils

* Update PDF invoice/estimate template controllers

* Register pdf_templates filesystem disk

* Remove unused leftovers

* Reformat with pint
2025-01-13 01:20:13 +01:00
Darko Gjorgjijoski
12d9d6c801 Regenerate IDE Helper Assets (#274)
* Add back laravel/ui package

* Fix wrong Closure import

* Regenerate ide-helper files
2025-01-12 20:48:06 +01:00
Darko Gjorgjijoski
e9e52c60a7 Reformat with pint 2025-01-12 18:37:08 +01:00
Darko Gjorgjijoski
34b9f52af7 Upgrade Laravel and other third-party packages 2025-01-12 18:22:51 +01:00
Darko Gjorgjijoski
fcf64c0b26 Upgrade Vite, Vue and other thrid-party packages 2025-01-12 17:38:54 +01:00
Darko Gjorgjijoski
7e2d257f7d Update caniuse-lite package 2025-01-12 17:11:50 +01:00
Darko Gjorgjijoski
c617f7d169 Fix: PDF Template command (#272)
* Fix `make:template` command

* Fix issue related to Vite assets

* Reformat code

---------

Co-authored-by: Steven Rombauts <steven@kotuha.be>
2025-01-12 16:19:54 +01:00
Darko Gjorgjijoski
1804481fc6 New Crowdin updates (#262)
* New translations en.json (Indonesian)

* New translations en.json (Turkish)

* New translations en.json (Hindi)

* New translations en.json (Hindi)

* New translations en.json (Persian)

* New translations en.json (Chinese Traditional)

* Update source file en.json

* New translations en.json (Dutch)

* New translations en.json (Czech)

* New translations en.json (Indonesian)

* New translations en.json (Turkish)

* New translations en.json (Hindi)

* New translations en.json (Persian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Romanian)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Arabic)

* New translations en.json (Bulgarian)

* New translations en.json (German)

* New translations en.json (Greek)

* New translations en.json (Finnish)

* New translations en.json (Italian)

* New translations en.json (Japanese)

* New translations en.json (Lithuanian)

* New translations en.json (Macedonian)

* New translations en.json (Polish)

* New translations en.json (Russian)

* New translations en.json (Slovak)

* New translations en.json (Slovenian)

* New translations en.json (Swedish)

* New translations en.json (Ukrainian)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Thai)

* New translations en.json (Croatian)

* New translations en.json (Latvian)

* New translations en.json (Serbian (Latin))

* New translations en.json (Dutch)

* New translations en.json (Czech)

* New translations en.json (Indonesian)

* New translations en.json (Turkish)

* New translations en.json (Hindi)

* New translations en.json (Persian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Romanian)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Arabic)

* New translations en.json (Bulgarian)

* New translations en.json (German)

* New translations en.json (Greek)

* New translations en.json (Finnish)

* New translations en.json (Italian)

* New translations en.json (Japanese)

* New translations en.json (Lithuanian)

* New translations en.json (Macedonian)

* New translations en.json (Polish)

* New translations en.json (Russian)

* New translations en.json (Slovak)

* New translations en.json (Slovenian)

* New translations en.json (Swedish)

* New translations en.json (Ukrainian)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Thai)

* New translations en.json (Croatian)

* New translations en.json (Latvian)

* New translations en.json (Serbian (Latin))

* Update source file en.json
2025-01-12 15:09:28 +01:00
mchev
9bed81fe8f Handle demo version of the app (#256) 2025-01-12 13:56:52 +01:00
Darko Gjorgjijoski
f52b73f517 Invoice time support (#269)
* Changed invoice date to datetime

* Fixed code style errors

* Update TimeFormatsController.php

* Update TimeFormatter.php

* Update TimeFormatsController namespace

* Fix missing comma in language file

* Fix formatting

---------

Co-authored-by: troky <troky2001@yahoo.com>
2025-01-12 13:32:47 +01:00
Mohamed Safouan Besrour
32e03b98a3 Update CurrenciesTableSeeder.php (#258) 2025-01-12 11:42:12 +01: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
mchev
ef9adbd6c9 Adding sent and viewed field to payload (#247) 2025-01-12 11:27:29 +01:00
Loduis Madariaga Barrios
969cbe9ad8 fix: update company info on array of companies. (#227) 2025-01-12 11:02:58 +01:00
Darko Gjorgjijoski
6031f0dbdd Module paths (#268)
* refactor: Update file paths for stub files for module creation (#144)

---------

Co-authored-by: Dominik Hendrix <dominik.hendrix@g-fittings.com>

* Revert unrelated change

---------

Co-authored-by: Dominik Hendrix <all@dhendrix.de>
Co-authored-by: Dominik Hendrix <dominik.hendrix@g-fittings.com>
2025-01-12 10:49:04 +01:00
Loduis Madariaga Barrios
06a71fc7b3 fix: Corrects and simplifies password visibility icon logic. (#222) 2025-01-12 10:48:34 +01:00
Darko Gjorgjijoski
fd1c7be1f8 New Crowdin updates (#241)
* New translations en.json (Slovak)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Spanish)

* New translations en.json (Indonesian)

* New translations en.json (German)

* New translations en.json (Arabic)

* New translations en.json (Arabic)

* New translations en.json (Japanese)

* New translations en.json (Japanese)

* New translations en.json (Dutch)

* New translations en.json (Czech)

* New translations en.json (Czech)
2025-01-05 12:06:14 +01:00
Darko Gjorgjijoski
c466d51fe0 New Crowdin updates (#235)
* New translations en.json (Swedish)

* New translations en.json (Croatian)

* New translations en.json (Russian)

* New translations en.json (French)

* New translations en.json (Ukrainian)

* New translations en.json (Slovak)

* New translations en.json (Romanian)

* New translations en.json (Spanish)

* New translations en.json (Arabic)

* New translations en.json (Bulgarian)

* New translations en.json (Czech)

* New translations en.json (German)

* New translations en.json (Greek)

* New translations en.json (Finnish)

* New translations en.json (Italian)

* New translations en.json (Japanese)

* New translations en.json (Lithuanian)

* New translations en.json (Macedonian)

* New translations en.json (Dutch)

* New translations en.json (Polish)

* New translations en.json (Slovenian)

* New translations en.json (Turkish)

* New translations en.json (Chinese Traditional)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Indonesian)

* New translations en.json (Persian)

* New translations en.json (Thai)

* New translations en.json (Latvian)

* New translations en.json (Hindi)

* New translations en.json (Serbian (Latin))
2024-12-03 18:39:00 +01:00
OniriCorpe
e8dccb178b Specifying that a custom frequency should be in the cron format (#231) 2024-12-03 15:27:21 +01:00
Darko Gjorgjijoski
f5b36d7e6c New Crowdin updates (#232)
* New translations en.json (French)

* New translations en.json (Croatian)

* New translations en.json (Ukrainian)

* New translations en.json (Ukrainian)

* New translations en.json (Ukrainian)

* New translations en.json (Slovak)
2024-12-03 15:27:09 +01:00
OniriCorpe
a32bbb6268 Fixes receipt view (#234)
The #185 modifications were also necessary here
2024-12-03 15:26:05 +01:00
Darko Gjorgjijoski
9599814ae5 New Crowdin updates (#225)
* New translations en.json (Swedish)

* New translations en.json (Croatian)

* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Croatian)

* New translations en.json (Russian)

* New translations en.json (French)

* New translations en.json (French)
2024-11-29 21:29:22 +01:00
Darko Gjorgjijoski
0d14da93d0 New Crowdin updates (#221)
* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Greek)

* New translations en.json (Greek)
2024-11-18 01:21:13 +01:00
Loduis Madariaga Barrios
298c170867 feat(infrastructure): improve htaccess configuration. (#214) 2024-11-17 00:18:35 +01:00
Rihards Simanovičs
b49228eabf chore: Update Issue Template (#215)
* chore: update issue template

Signed-off-by: Rihards Simanovics <rihards.s@griffin-web.studio>

* chore: correct spelling in issue template

Signed-off-by: Rihards Simanovics <rihards.s@griffin-web.studio>

* fix: adjust render for some textarea fields and add a reproduction step

* fix: remove render from markdown fields

looks like github gets confused as all textarea fields are markdown by the default

* style: add comments and correct labels

* feat(github): add code quality issue template

* refactor: remove direct references to Files

From template fields, descriptions, and placeholders

* refactor(github): convert feature request template to issue form

---------

Signed-off-by: Rihards Simanovics <rihards.s@griffin-web.studio>
2024-11-17 00:18:18 +01:00
Darko Gjorgjijoski
99ada6fbcc New Crowdin updates (#217)
* New translations en.json (Japanese)

* New translations en.json (Japanese)
2024-11-17 00:17:37 +01:00
Darko Gjorgjijoski
ed4a59574c Customer tax id validation (#220)
* Remove tax_id validation

* Remove validation leftovers
2024-11-17 00:17:25 +01:00
Darko Gjorgjijoski
be2e1df442 Add 'Database Overwrtie' during install for SQLite type (#219) 2024-11-17 00:07:44 +01:00
Darko Gjorgjijoski
ddca5a7b6d New translations en.json (Dutch) (#211) 2024-11-11 12:24:48 +01:00
Darko Gjorgjijoski
51d001aa0f New Crowdin updates (#209)
* New translations en.json (Romanian)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Arabic)

* New translations en.json (Bulgarian)

* New translations en.json (Czech)

* New translations en.json (German)

* New translations en.json (Greek)

* New translations en.json (Finnish)

* New translations en.json (Italian)

* New translations en.json (Japanese)

* New translations en.json (Lithuanian)

* New translations en.json (Macedonian)

* New translations en.json (Dutch)

* New translations en.json (Polish)

* New translations en.json (Russian)

* New translations en.json (Slovak)

* New translations en.json (Slovenian)

* New translations en.json (Swedish)

* New translations en.json (Turkish)

* New translations en.json (Ukrainian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Indonesian)

* New translations en.json (Persian)

* New translations en.json (Thai)

* New translations en.json (Croatian)

* New translations en.json (Latvian)

* New translations en.json (Hindi)

* New translations en.json (Serbian (Latin))

* New translations en.json (Turkish)
2024-11-09 21:39:07 +01:00
Darko Gjorgjijoski
5d817b5c45 Ignore the translations branch from CI 2024-11-09 15:22:23 +01:00
Ali Çömez | Slaweally
ac2c73829c Update tr.json (#205) 2024-11-09 15:01:57 +01:00
Loduis Madariaga Barrios
317f763a85 chore(wizard): add missing translations for Spanish version in setup wizard (#207) 2024-11-09 14:38:20 +01:00
Joël Kuijper
e112ed5875 Add missing dutch translations (#208) 2024-11-09 14:38:02 +01:00
Darko Gjorgjijoski
84c10264ed Add missing strings lost in merge (#200)
Issue #199
2024-11-02 21:47:22 +01:00
Darko Gjorgjijoski
b143642056 New Crowdin updates (#188)
* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Croatian)

* New translations en.json (Croatian)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Croatian)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Spanish)

* New translations en.json (Japanese)

* New translations en.json (Japanese)

* New translations en.json (German)

* New translations en.json (Japanese)

* New translations en.json (Spanish)

* New translations en.json (Croatian)

* New translations en.json (Spanish)

* New translations en.json (Japanese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (German)

* New translations en.json (Croatian)

* New translations en.json (Romanian)

* New translations en.json (French)

* New translations en.json (Arabic)

* New translations en.json (Bulgarian)

* New translations en.json (Czech)

* New translations en.json (Greek)

* New translations en.json (Finnish)

* New translations en.json (Italian)

* New translations en.json (Lithuanian)

* New translations en.json (Macedonian)

* New translations en.json (Dutch)

* New translations en.json (Polish)

* New translations en.json (Russian)

* New translations en.json (Slovak)

* New translations en.json (Slovenian)

* New translations en.json (Swedish)

* New translations en.json (Turkish)

* New translations en.json (Ukrainian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Vietnamese)

* New translations en.json (Indonesian)

* New translations en.json (Persian)

* New translations en.json (Thai)

* New translations en.json (Latvian)

* New translations en.json (Hindi)

* New translations en.json (Serbian (Latin))

* Update source file en.json
2024-11-02 12:49:04 +01:00
mchev
967c225df9 Merge pull request #198 from mchev/invoice_cancellation
Support for Zero and Negative Item Quantities on Invoices
2024-11-02 12:20:55 +01:00
mchev
e1a0a2d8e4 Merge pull request #138 from IDerr/develop
Add VAT and Tax into PDF Trait
2024-11-02 12:19:43 +01:00
mchev
748168ffa5 Merge pull request #189 from loduis/master
enhance(wizard): update translations, refine icons, and add automated…
2024-11-02 10:36:52 +01:00
mchev
4db243e136 Merge branch 'master' into master 2024-11-02 10:31:53 +01:00
mchev
bc0c8d5348 Merge pull request #166 from mchev/customer_tax_id
Include a Tax ID field in both customer creation and invoices
2024-11-02 10:28:49 +01:00
mchev
6583569b1c Merge pull request #190 from mchev/issue_71
Refactor editor and allow links
2024-11-02 10:28:30 +01:00
mchev
134c99369e Merge pull request #186 from mchev/issue_181
Fix table data not refreshing properly (keys)
2024-11-02 10:28:12 +01:00
Loduis Madariaga
f2ae4e17c8 enhance(wizard): update translations, refine icons, and add automated requirement verification 2024-10-17 07:24:17 -05:00
Martin Chevignard
4ff62c0adf Refactor editor and allow links 2024-10-17 11:16:11 +02:00
Darko Gjorgjijoski
2604db32ce New Crowdin updates (#154)
* New translations en.json (Spanish)

* New translations en.json (Finnish)

* New translations en.json (French)

* New translations en.json (German)

* New translations en.json (Romanian)

* New translations en.json (Arabic)

* New translations en.json (Bulgarian)

* New translations en.json (Czech)

* New translations en.json (Greek)

* New translations en.json (Italian)

* New translations en.json (Japanese)

* New translations en.json (Lithuanian)

* New translations en.json (Macedonian)

* New translations en.json (Dutch)

* New translations en.json (Polish)

* New translations en.json (Russian)

* New translations en.json (Slovak)

* New translations en.json (Slovenian)

* New translations en.json (Swedish)

* New translations en.json (Turkish)

* New translations en.json (Ukrainian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Indonesian)

* New translations en.json (Persian)

* New translations en.json (Thai)

* New translations en.json (Croatian)

* New translations en.json (Latvian)

* New translations en.json (Hindi)

* New translations en.json (Serbian (Latin))

* New translations en.json (Russian)

* New translations en.json (Spanish)

* New translations en.json (Spanish)

* New translations en.json (Japanese)

* New translations en.json (Japanese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Japanese)

* New translations en.json (Japanese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Spanish)

* New translations en.json (Japanese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Slovak)

* New translations en.json (Swedish)

* New translations en.json (Vietnamese)

* New translations en.json (Romanian)

* New translations en.json (French)

* New translations en.json (Arabic)

* New translations en.json (Bulgarian)

* New translations en.json (Czech)

* New translations en.json (German)

* New translations en.json (Greek)

* New translations en.json (Finnish)

* New translations en.json (Italian)

* New translations en.json (Lithuanian)

* New translations en.json (Macedonian)

* New translations en.json (Dutch)

* New translations en.json (Polish)

* New translations en.json (Russian)

* New translations en.json (Slovenian)

* New translations en.json (Turkish)

* New translations en.json (Ukrainian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Indonesian)

* New translations en.json (Persian)

* New translations en.json (Thai)

* New translations en.json (Croatian)

* New translations en.json (Latvian)

* New translations en.json (Hindi)

* New translations en.json (Serbian (Latin))

* Update source file en.json

* New translations en.json (Japanese)

* New translations en.json (Japanese)
2024-10-16 15:18:26 +02:00
Darko Gjorgjijoski
01d32d50b5 Exclude crowdin branch from workflows 2024-10-16 00:54:02 +02:00
SalvaGR
0c86563375 fix: missing values in en.json translation (#179) 2024-10-15 20:53:08 +02:00
mchev
33c2949a7b Fix carbon int val (#185) 2024-10-15 20:51:17 +02:00
mchev
547a2be0a3 Update readme.md 2024-10-15 19:14:55 +02:00
Martin Chevignard
59b43fa258 Public Invoice View fix 2024-10-15 17:55:56 +02:00
Martin Chevignard
168b741936 Upadate filters with laravel best practices 2024-10-15 16:20:04 +02: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
mchev
068f48568e Fix carbon dates on custom fields value (#178) 2024-10-11 13:17:01 +02:00
Martin Chevignard
03b9defeb1 Customers tax id field 2024-10-04 12:07:29 +02:00
mchev
dd98df1c77 Fix long text on dropdown items (#157) 2024-09-30 20:15:56 +02:00
Darko Gjorgjijoski
c8c75a6aa7 New Crowdin updates (#85)
* New translations en.json (Romanian)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Arabic)

* New translations en.json (Bulgarian)

* New translations en.json (Czech)

* New translations en.json (German)

* New translations en.json (Greek)

* New translations en.json (Finnish)

* New translations en.json (Italian)

* New translations en.json (Japanese)

* New translations en.json (Lithuanian)

* New translations en.json (Macedonian)

* New translations en.json (Dutch)

* New translations en.json (Polish)

* New translations en.json (Russian)

* New translations en.json (Slovak)

* New translations en.json (Slovenian)

* New translations en.json (Swedish)

* New translations en.json (Turkish)

* New translations en.json (Ukrainian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Indonesian)

* New translations en.json (Persian)

* New translations en.json (Thai)

* New translations en.json (Croatian)

* New translations en.json (Latvian)

* New translations en.json (Hindi)

* New translations en.json (Serbian (Latin))

* New translations en.json (Macedonian)

* New translations en.json (Dutch)

* New translations en.json (Dutch)

* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Swedish)

* New translations en.json (Hindi)

* New translations en.json (Hindi)

* New translations en.json (Dutch)

* New translations en.json (Swedish)

* New translations en.json (Spanish)

* New translations en.json (French)

* New translations en.json (Indonesian)

* New translations en.json (Indonesian)

* New translations en.json (Vietnamese)

* New translations en.json (Vietnamese)

* New translations en.json (Vietnamese)

* New translations en.json (Vietnamese)

* New translations en.json (Vietnamese)

* New translations en.json (Vietnamese)

* New translations en.json (Vietnamese)

* New translations en.json (Slovak)

* New translations en.json (Vietnamese)

* New translations en.json (Slovak)

* New translations en.json (Slovak)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (German)

* New translations en.json (Spanish)

* New translations en.json (Spanish)

* New translations en.json (Finnish)

* New translations en.json (French)

* New translations en.json (German)

* Update source file en.json

* New translations en.json (Spanish)

* New translations en.json (Finnish)

* New translations en.json (French)

* New translations en.json (German)

* New translations en.json (Romanian)

* New translations en.json (Arabic)

* New translations en.json (Bulgarian)

* New translations en.json (Czech)

* New translations en.json (Greek)

* New translations en.json (Italian)

* New translations en.json (Japanese)

* New translations en.json (Lithuanian)

* New translations en.json (Macedonian)

* New translations en.json (Dutch)

* New translations en.json (Polish)

* New translations en.json (Russian)

* New translations en.json (Slovak)

* New translations en.json (Slovenian)

* New translations en.json (Swedish)

* New translations en.json (Turkish)

* New translations en.json (Ukrainian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Indonesian)

* New translations en.json (Persian)

* New translations en.json (Thai)

* New translations en.json (Croatian)

* New translations en.json (Latvian)

* New translations en.json (Hindi)

* New translations en.json (Serbian (Latin))
2024-09-24 19:51:47 +02:00
Darko Gjorgjijoski
5ece0f43c0 Bump version 2024-09-24 19:05:06 +02:00
Darko Gjorgjijoski
91962f43b2 Add additional language and bump sqlite version 2024-08-04 21:40:15 +02:00
Darko Gjorgjijoski
50613fcff0 Remove unecessary debug calls 2024-08-04 19:50:14 +02:00
Darko Gjorgjijoski
468aec6bc1 Fix partially paid status appearing after invoice update 2024-08-04 19:45:08 +02:00
Darko Gjorgjijoski
c799149d2d Improved logo display in Invoice/Estimate PDFs 2024-08-04 16:08:22 +02:00
Darko Gjorgjijoski
c9e85f18da Merge branch 'develop' into pdf-templates-logo 2024-08-04 15:17:09 +02:00
Darko Gjorgjijoski
9a46f892ab Add support for release channels (insider release channel) in Updater 2024-08-04 03:04:10 +02:00
Darko Gjorgjijoski
bcb89bc9ae Ignore .dev/docker-compose.yml to allow devs to customize one of those 2024-08-04 02:39:20 +02:00
Darko Gjorgjijoski
fbac9abbc5 Expose port 5173 for the Dev environment 2024-08-04 02:38:02 +02:00
Darko Gjorgjijoski
f16b4df44a Remove extensions from composer 2024-08-01 20:48:12 +02:00
Darko Gjorgjijoski
f82937e85e Set app version on install and updates 2024-08-01 19:39:47 +02:00
jacobi petrucciani
f10154539e fix logo rendering in pdf output for invoices 2024-07-31 14:22:48 -04:00
Darko Gjorgjijoski
a64701bda5 Set SESSION_DRIVER to file by default 2024-07-29 14:24:48 +02:00
Darko Gjorgjijoski
da600d0144 Add database overwrite checkbox on Install wizard
Allows overwriting the existing database when installing InvoiceShelf
2024-07-29 14:21:34 +02:00
Darko Gjorgjijoski
56a555bc4a Fix installer wizard step highlighting 2024-07-29 14:06:21 +02:00
Darko Gjorgjijoski
6422da193b Improve .dev/php/entrypoint permissions setting 2024-07-29 13:01:43 +02:00
Darko Gjorgjijoski
cc39f37b12 Update axios and vite 2024-07-29 13:00:54 +02:00
Darko Gjorgjijoski
f95d03f281 Fix "declarations that appear after nested rules" deprecation warning 2024-07-29 12:55:29 +02:00
Darko Gjorgjijoski
4b9052079f Update docker context for the php image 2024-07-28 17:45:06 -07:00
Darko Gjorgjijoski
bf5f95d29d Update file line ending format 2024-07-28 17:44:22 -07:00
Darko Gjorgjijoski
53343c64eb Update migrations formatting & namespace 2024-07-28 23:14:34 +02:00
Darko Gjorgjijoski
dfc4b1982e Update namespace on 1.x migration 2024-07-28 23:13:53 +02:00
Darko Gjorgjijoski
8dd9d0c414 Consolidate migrations v2.0 should go after v1.x 2024-07-28 22:46:45 +02:00
Darko Gjorgjijoski
84a6181240 Merge master 2024-07-28 22:43:02 +02:00
Darko Gjorgjijoski
25fb260cd7 Update local links 2024-07-28 21:07:48 +02:00
Darko Gjorgjijoski
17082ea8c8 Improvements to SQLite dev setup 2024-07-28 21:02:49 +02:00
Darko Gjorgjijoski
c4ade42a8f Update dev readme 2024-07-28 21:02:00 +02:00
Darko Gjorgjijoski
314abe4cc6 Add node and exif & update entrypoint 2024-07-28 19:54:07 +02:00
Darko Gjorgjijoski
45ff9c89a8 Add development environment 2024-07-28 17:25:32 +02:00
Darko Gjorgjijoski
9df5b306a2 Make artisan file executable 2024-07-28 17:24:57 +02:00
Darko Gjorgjijoski
310d05eab1 Set backup to point to the default database connection 2024-07-28 17:24:44 +02:00
Darko Gjorgjijoski
f986454084 Set backup to point to the default database connection 2024-07-28 17:22:40 +02:00
mchev
0c0de64549 Updated download link 2024-07-27 09:49:57 +02:00
Darko Gjorgjijoski
19bf467068 Add "none" as choice for MAIL_ENCRYPTION settings/install that translates to =NULL 2024-07-21 10:42:00 +02:00
Darko Gjorgjijoski
532a044bb9 Add APP_NAME in .env.example 2024-07-18 09:00:00 +02:00
mchev
948e9ea814 Delete CONTRIBUTING.md 2024-07-17 15:55:34 +02:00
mchev
1bd33b8b1b Create CONTRIBUTING.md 2024-07-17 15:50:22 +02:00
mchev
b06cc46eaf Create CONTRIBUTING.md 2024-07-17 12:37:33 +02:00
mchev
c8439d859d Add cache and queue tables migrations (#121)
* Add cache and queue tables migrations
2024-07-17 12:06:04 +02:00
Darko Gjorgjijoski
a866187f71 Add default cache and queue configs 2024-07-17 11:32:42 +02:00
Darko Gjorgjijoski
e212714c63 Pint 2024-07-13 15:19:00 +02:00
Darko Gjorgjijoski
429a8ae826 Add sqlite3 into the php requirements 2024-07-13 15:18:30 +02:00
Darko Gjorgjijoski
94cfe55555 Add sqlite3 validation 2024-07-13 15:18:10 +02:00
Darko Gjorgjijoski
ad9d08c43c Create empty SQLite database if it doesn't exist 2024-07-13 15:12:54 +02:00
Darko Gjorgjijoski
27a511bc09 Update version
[ci-skip]
2024-07-13 03:11:14 +02:00
Darko Gjorgjijoski
1317d57ef8 Update readme.md 2024-07-13 03:07:18 +02:00
Darko Gjorgjijoski
ba85f407d6 Revert "Add version.md file"
This reverts commit 75b0c264dc.
2024-07-13 02:49:02 +02:00
Darko Gjorgjijoski
b37019f845 Set the default database to SQLite 2024-07-13 02:29:20 +02:00
Darko Gjorgjijoski
75b0c264dc Add version.md file 2024-07-13 02:14:41 +02:00
Darko Gjorgjijoski
98852686c7 Add doctrine/dbal and run pint 2024-07-13 02:03:22 +02:00
Darko Gjorgjijoski
a907f8c932 Set the default database to be SQLite 2024-07-12 17:13:54 +02:00
Darko Gjorgjijoski
53866f721c Require dbal as dependency for migrations that changing columns 2024-07-12 12:37:04 +02:00
Darko Gjorgjijoski
9c0d79bf59 Add app version 2024-07-12 03:08:07 +02:00
Darko Gjorgjijoski
33076dc240 Update makefile 2024-07-11 14:10:40 +02:00
Darko Gjorgjijoski
de126465a8 Update code style (pint) 2024-07-11 13:42:43 +02:00
Darko Gjorgjijoski
9317751de9 Remove duplicate SESSION_DOMAIN 2024-07-11 13:37:31 +02:00
Darko Gjorgjijoski
24ba33fd02 Update /installation/languages controller namespace 2024-07-11 13:36:57 +02:00
mchev
9fcf3792c7 Translate recurring invoice subject (#110)
* Translate recurring invoice subject
2024-06-25 19:44:23 +02:00
mchev
2c9f81c571 Merge pull request #109 from mchev/customer-portal
Fix CompanySetting not being imported in BootstrapController
2024-06-20 14:56:56 +02:00
mchev
0af379909d Merge pull request #108 from mchev/updating_other_stored_namespaces
Adding new field to update #107
2024-06-20 14:56:45 +02:00
mchev
680e105f1b Fix CompanySetting not imported in BootstrapController 2024-06-16 21:58:16 +02:00
mchev
210f735e40 Adding new field to update #107 2024-06-16 21:35:55 +02:00
mchev
a0bf6f7f59 Replacing model_type in database (#100)
* Replacing model_type in database

* Also update old Crater namespace
2024-06-07 12:10:57 +02:00
mchev
bb8258036a Clone estimates (#97)
* Clone estimates

* Clone estimate test feature

* Resolve namespace

* Fix string to int for Carbon

* Fix homes routes and default queue key

* Move dropdown item below View and use the propper translation key
2024-06-06 12:16:41 +02:00
mchev
14c599ed4f Allow decimals on items quantities (#94)
* Allow decimals on items quantities #80

* Updating all requests validation

* Revert discount_val
2024-06-05 15:10:36 +02:00
mchev
592a537379 Replace fixed text length with css line-clamp (#96) 2024-06-05 14:36:32 +02:00
mchev
bf5a8cdb28 Increasing base total validation limit for IDR currency (#98) 2024-06-05 12:16:09 +02:00
Darko Gjorgjijoski
96e2f6cf0f Run pint 2024-06-05 12:09:04 +02:00
agencetwogether
3b61440e1f Complete dashboard translations & small UI improvements (#69)
* fix dropdown action Estimate Dashboard and fix translating full Dasboard page

* Update app.php

* fix locale in app.php config

* Wizard install with translation, customer portal with translation, and fixing hardcoding strings to get translation

* fixes asked to review

* fixes pint

---------

Co-authored-by: Max <contact@agencetwogether.fr>
Co-authored-by: Darko Gjorgjijoski <5760249+gdarko@users.noreply.github.com>
2024-06-05 12:07:46 +02:00
mchev
3259173066 Laravel 11 (#84)
* Convert string references to `::class`

PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.

* Use Faker methods

Accessing Faker properties was deprecated in Faker 1.14.

* Convert route options to fluent methods

Laravel 8 adopts the tuple syntax for controller actions. Since the old options array is incompatible with this syntax, Shift converted them to use modern, fluent methods.

* Adopt class based routes

* Remove default `app` files

* Shift core files

* Streamline config files

* Set new `ENV` variables

* Default new `bootstrap/app.php`

* Re-register HTTP middleware

* Consolidate service providers

* Re-register service providers

* Re-register routes

* Re-register scheduled commands

* Bump Composer dependencies

* Use `<env>` tags for configuration

`<env>` tags have a lower precedence than system environment variables making it easier to overwrite PHPUnit configuration values in additional environments, such a CI.

Review this blog post for more details on configuration precedence when testing Laravel: https://jasonmccreary.me/articles/laravel-testing-configuration-precedence/

* Adopt anonymous migrations

* Rename `password_resets` table

* Convert `$casts` property to method

* Adopt Laravel type hints

* Mark base controller as `abstract`

* Remove `CreatesApplication` testing trait

* Shift cleanup

* Fix shift first issues

* Updating Rules for laravel 11, sanctum config and pint

* Fix Carbon issue on dashboard

* Temporary fix for tests while migration is issue fixed on laravel side

* Carbon needs numerical values, not strings

* Minimum php version

* Fix domain installation step not fetching the correct company_id

* Fix Role Policy wasn't properly registered

---------
2024-06-05 11:33:52 +02:00
Jay Muntz
72311db1bd Fix SES configuration process to set correct SES_KEY and SES_SECRET (#74)
* Fix SES configuration process to set correct SES_KEY and SES_SECRET

* Fixed SES from name

---------

Co-authored-by: Jay Muntz <jaymuntz@jaymuntz.com>
2024-05-31 12:46:06 +02:00
848 changed files with 46397 additions and 21916 deletions

175
.dev/README.md Normal file
View File

@@ -0,0 +1,175 @@
# InvoiceShelf Development Environment
This is dockerized development environment that allows developers to easily get started to develop InvoiceShelf.
This development environment is **NOT MEANT TO BE USED IN PRODUCTION** and is preconfigured with all the needed tools that InvoiceShelf requires for development purposes. It works on Windows, Linux and MacOS.
For production grade docker image, please refer to [InvoiceShelf/docker](https://github.com/InvoiceShelf/docker) and [InvoiceShelf on DockerHub](https://hub.docker.com/r/invoiceshelf/invoiceshelf).
## How to set up
### 1. Hosts configuration
We use `invoiceshelf.test` domain for local development within this environment and you need to adhere to it.
For that purpose you need to edit your OS hosts file or DNS server and add the following line to make the local domain name available on your system.
```
127.0.0.1 invoiceshelf.test
```
#### 1.1. Windows
The hosts file on Windows is located at `C:\Windows\system32\drivers\etc\hosts`.
You need to launch Notepad as administrator, open the file through **File > Open**, add the line from above and save the file.
#### 1.2. Linux/MacOS
The hosts file on Linux and Mac is located at `/etc/hosts`.
You need to open the file using your favorite editor as sudo/root, add the line from above and save the file.
### 2. FileSystem configuration (Linux)
If you are using **Linux**, you need to make sure that **USRID** and **GRPID** environment variables are set and matching your current session user ids. Those two variables are required to set up the filesystem permissions correctly on Linux.
You can run it one time, every time before starting as follows:
```
export USRID=$(id -u) && export GRPID=$(id -g)
```
or you can append this to your .zshrc/.bashrc by running this command in your terminal:
```
grep -qxF 'export USRID=$(id -u) GRPID=$(id -g)' ~/.${SHELL##*/}rc || echo 'export USRID=$(id -u) GRPID=$(id -g)' >> ~/.${SHELL##*/}rc
```
this will append the `export` line to your rc file and run it on each terminal session.
### 3. Clone the project
Clone the InvoiceShelf project directly from InvoiceShelf git or your forked repository:
```bash
git clone git@github.com:InvoiceShelf/InvoiceShelf.git
```
## Development Workflow
We bundled separate docker-compose.yml file for each database: MySQL, PostgresSQL and SQLite, you can use any of those to spin up your development environment.
| Database | Compose File |
|---------|---------------------------|
| SQLite3 | docker-compose.sqlite.yml |
| MariaDB | docker-compose.mysql.yml |
| PostgresSQL | dpcler-compose.pgsql.yml |
### 1. Spinning Up
To **spin up** the environment, run docker compose as follows:
**Important**: If you are on **Linux** and didn't add the `export` line to your .zshrc/.bashrc file, you need to repeat `step 2` before spinning up, otherwise you will face permissions issues.
```
docker compose -f .dev/docker-compose.mysql.yml up --build
```
### 2. Spinning Down
To **spin down** the environment, run docker compose as follows:
```
docker compose -f .dev/docker-compose.mysql.yml down
```
### 3. Working with binaries
To correctly run `composer`, `npm`, `artisan`, `pint`, `pest` or other binaries within this project, you must ssh into the container as follows:
```
docker exec -it --user invoiceshelf invoiceshelf-dev-php /bin/bash
```
In the `/home/invoiceshelf/app` directory you can find the application root and run the commands from there.
## What is included
### 1. Web Server
This dockerized environment uses PHP-FPM and NGINX together to serve the website `invoiceshelf.test`
Both NGINX and PHP-FPM are configured with optimal settings for development. Please don't use this in production.
**URL**: http://invoiceshelf.test/
### 2. Databases
This dockerized environment comes with support for all three databases that InvoiceShelf suppots: MySQL, PostgreSQL and SQLite.
The setup parameters/credentials for each of the supported databases are as follows.
| | MySQL | PostgreSQL | SQLite |
|---|---|---|---|
| **DB_USER** | invoiceshelf | invoiceshelf | Not applicable |
| **DB_PASS** | invoiceshelf | invoiceshelf | Not applicable |
| **DB_NAME** | invoiceshelf | invoiceshelf | /home/invoiceshelf/database/database.sqlite |
| **DB_HOST** | db-mysql | db-pgsql | Not applicable |
| **DB_PORT** | 3036 | 5432 | Not applicable |
**Note:** The only required field for SQLite is **DB_NAME**.
### 3. Adminer
Adminer is UI tool for viewing the database contents and executing queries.
It supports MySQL, PostgreSQL, SQLite.
**URL**: http://invoiceshelf.test:8080
#### MySQL/PostgresSQL
To log into the MySQL or PostgresSQL, use the database information specified in the above section (2. Databases)
#### SQLite
To log into the SQLite, use the following credentials:
| KEY | VALUE |
|--------------|---------------------------|
| **USERNAME** | admin |
| **PASSWORD** | admin |
| **DATABASE** | /database/database.sqlite |
### 4. Mailpit (fake mail)
To utilize Mailpit, use the following credentials:
| KEY | VALUE |
|---------------------|-------------|
| **MAIL DRIVER** | smtp |
| **MAIL HOST** | mail |
| **MAIL PORT** | 1025 |
| **MAIL ENCRYPTION** | none |
| **MAIL USER** | leave empty |
| **MAIL PASS** | leave empty |
| **FROM MAIL ADDR** | your choice |
| **FROM MAIL NAME** | your choice |
**URL**: http://invoiceshelf.test:8025
---
If you have any questions, feel free to open issue.

14
.dev/adminer/Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM adminer:latest
USER root
RUN set -x && \
apt update && \
apt install curl -y && \
cd /var/www/html/plugins-enabled && \
curl -O https://gist.githubusercontent.com/gdarko/00af6e9a754f09c3f81cd3c606c33311/raw/d5f6a30f00edecf30a5d380340d9dae79a3b7352/login-password-less.php
USER adminer
CMD [ "php", "-S", "[::]:8080", "-t", "/var/www/html" ]
EXPOSE 8080

View File

@@ -0,0 +1,70 @@
services:
php-fpm:
container_name: invoiceshelf-dev-php
build:
context: ./php
dockerfile: Dockerfile
args:
- UID=${USRID:-1000}
- GID=${GRPID:-1000}
ports:
- 5173:5173
volumes:
- ../:/home/invoiceshelf/app
networks:
- invoiceshelf-dev
nginx:
container_name: invoiceshelf-dev-nginx
image: nginx:stable
ports:
- '80:80'
volumes:
- ./nginx/conf.d/dev.conf:/etc/nginx/conf.d/dev.conf
- ../:/home/invoiceshelf/app
networks:
- invoiceshelf-dev
db:
image: mariadb:10.9
container_name: invoiceshelf-dev-mysql
environment:
MYSQL_ROOT_PASSWORD: invoiceshelf
MYSQL_DATABASE: invoiceshelf
MYSQL_USER: invoiceshelf
MYSQL_PASSWORD: invoiceshelf
ports:
- "3306:3306"
volumes:
- invoiceshelf-dev-mysql:/var/lib/mysql
networks:
- invoiceshelf-dev
adminer:
container_name: invoiceshelf-dev-adminer
build:
context: ./adminer
dockerfile: Dockerfile
environment:
ADMINER_PLUGINS: tables-filter
ADMINER_DESIGN: konya
ports:
- '8080:8080'
networks:
- invoiceshelf-dev
mail:
container_name: invoiceshelf-dev-mailpit
image: axllent/mailpit:latest
restart: always
ports:
- 1025:1025
- 8025:8025
networks:
- invoiceshelf-dev
networks:
invoiceshelf-dev:
volumes:
invoiceshelf-dev-mysql:

View File

@@ -0,0 +1,69 @@
services:
php-fpm:
container_name: invoiceshelf-dev-php
build:
context: ./php
dockerfile: Dockerfile
args:
- UID=${USRID:-1000}
- GID=${GRPID:-1000}
ports:
- 5173:5173
volumes:
- ../:/home/invoiceshelf/app
networks:
- invoiceshelf-dev
nginx:
container_name: invoiceshelf-dev-nginx
image: nginx:stable
ports:
- '80:80'
volumes:
- ./nginx/conf.d/dev.conf:/etc/nginx/conf.d/dev.conf
- ../:/home/invoiceshelf/app
networks:
- invoiceshelf-dev
db:
image: postgres:15
container_name: invoiceshelf-dev-pgsql
environment:
- POSTGRES_PASSWORD=invoiceshelf
- POSTGRES_USER=invoiceshelf
- POSTGRES_DB=invoiceshelf
ports:
- 5432:5432
volumes:
- invoiceshelf-dev-pgsql:/var/lib/postgresql/data
networks:
- invoiceshelf-dev
adminer:
container_name: invoiceshelf-dev-adminer
build:
context: ./adminer
dockerfile: Dockerfile
environment:
ADMINER_PLUGINS: tables-filter
ADMINER_DESIGN: konya
ports:
- '8080:8080'
networks:
- invoiceshelf-dev
mail:
container_name: invoiceshelf-dev-mailpit
image: axllent/mailpit:latest
restart: always
ports:
- 1025:1025
- 8025:8025
networks:
- invoiceshelf-dev
networks:
invoiceshelf-dev:
volumes:
invoiceshelf-dev-pgsql:

View File

@@ -0,0 +1,54 @@
services:
php-fpm:
container_name: invoiceshelf-dev-php
build:
context: ./php
dockerfile: Dockerfile
args:
- UID=${USRID:-1000}
- GID=${GRPID:-1000}
volumes:
- ../:/home/invoiceshelf/app
ports:
- 5173:5173
networks:
- invoiceshelf-dev
nginx:
container_name: invoiceshelf-dev-nginx
image: nginx:stable
ports:
- '80:80'
volumes:
- ./nginx/conf.d/dev.conf:/etc/nginx/conf.d/dev.conf
- ../:/home/invoiceshelf/app
networks:
- invoiceshelf-dev
adminer:
container_name: invoiceshelf-dev-adminer
build:
context: ./adminer
dockerfile: Dockerfile
environment:
ADMINER_PLUGINS: tables-filter
ADMINER_DESIGN: konya
volumes:
- ../database:/database
ports:
- '8080:8080'
networks:
- invoiceshelf-dev
mail:
container_name: invoiceshelf-dev-mailpit
image: axllent/mailpit:latest
restart: always
ports:
- 1025:1025
- 8025:8025
networks:
- invoiceshelf-dev
networks:
invoiceshelf-dev:

View File

@@ -0,0 +1,22 @@
server {
listen 80;
root /home/invoiceshelf/app/public;
index index.php;
error_log /var/log/nginx/dev-error.log;
access_log /var/log/nginx/dev-access.log;
server_name invoiceshelf.test;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
}

64
.dev/php/Dockerfile Normal file
View File

@@ -0,0 +1,64 @@
FROM php:8.3-fpm-bookworm
ARG UID
ARG GID
ENV UID=${UID}
ENV GID=${GID}
USER root
# Create user/group
RUN addgroup --gid ${GID} --system invoiceshelf && \
adduser --gid ${GID} --system --disabled-password --shell /bin/sh -u ${UID} --home /home/invoiceshelf invoiceshelf && \
sed -i "s/user = www-data/user = invoiceshelf/g" /usr/local/etc/php-fpm.d/www.conf && \
sed -i "s/group = www-data/group = invoiceshelf/g" /usr/local/etc/php-fpm.d/www.conf
# Install composer & npm
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && \
curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
apt install -y nodejs
# install dependencies
RUN apt update && apt install -y \
libpng-dev \
zlib1g-dev \
libxml2-dev \
libzip-dev \
libonig-dev \
libpq-dev \
sqlite3 \
postgresql-client \
mariadb-client \
zip \
curl \
unzip \
webp \
&& docker-php-ext-configure gd \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install bcmath \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install mysqli \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-install pgsql \
&& docker-php-ext-install pdo_pgsql \
&& docker-php-ext-install zip \
&& docker-php-ext-install xml \
&& docker-php-ext-install exif \
&& docker-php-source delete
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Set workdir
WORKDIR /home/invoiceshelf/app
# Copy Files
COPY entrypoint.sh /entrypoint.sh
# Entrypoint
ENTRYPOINT ["/entrypoint.sh"]
# Launch php-fpm
CMD ["php-fpm"]

44
.dev/php/entrypoint.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/bash
echo "############################################"
echo "### InvoiceShelf Development Environment ###"
echo "############################################"
cd /home/invoiceshelf/app
# Composer build
if [ ! -d vendor ]; then
composer install
fi
# Empty sqlite database
if [ ! -f database/database.sqlite ]; then
cp database/stubs/sqlite.empty.db database/database.sqlite
fi
# .env file set up
if [ ! -f .env ]; then
cp .env.example .env
php artisan key:generate --force
fi
# NPM build
if [ ! -d node_modules ]; then
npm install
npm run build
fi
# Storage symlink
php artisan storage:link
# Permissions
chmod 775 storage/framework
chmod 775 storage/logs
chmod 775 bootstrap/cache
chown -R ${UID}:${GID} /home/invoiceshelf/app
chmod +x artisan
echo "Entrypoint complete."
exec $@

1974
.dev/php/php.ini Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,35 @@
APP_ENV=production
APP_KEY=base64:kgk/4DW1vEVy7aEvet5FPp5un6PIGe/so8H0mvoUtW0=
APP_DEBUG=true
APP_NAME="InvoiceShelf"
APP_LOG_LEVEL=debug
APP_TIMEZONE=UTC
APP_URL=http://invoiceshelf.test
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=invoiceshelf
DB_USERNAME=invoiceshelf
DB_PASSWORD="invoiceshelf"
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_DRIVER=sync
SESSION_DRIVER=cookie
APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database
BCRYPT_ROUNDS=12
DB_CONNECTION=sqlite
DB_HOST=
DB_PORT=
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
BROADCAST_CONNECTION=log
CACHE_STORE=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=1440
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
@@ -36,8 +50,7 @@ PUSHER_KEY=
PUSHER_SECRET=
SANCTUM_STATEFUL_DOMAINS=invoiceshelf.test
SESSION_DOMAIN=invoiceshelf.test
TRUSTED_PROXIES="*"
CRON_JOB_AUTH_TOKEN=""
LOG_STACK=single

24
.gitattributes vendored
View File

@@ -1,3 +1,25 @@
* text=auto
# Set the default behavior, in case people don't have core.autocrlf set.
* text eol=lf
# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text
# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.gif binary
*.otf binary
*.eot binary
*.svg binary
*.ttf binary
*.woff binary
*.woff2 binary
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored

65
.github/CONTRIBUTING.md vendored Normal file
View File

@@ -0,0 +1,65 @@
# Welcome to InvoiceShelf contributing guide <!-- omit in toc -->
Thank you for investing your time in contributing to our project! :sparkles:.
Read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community approachable and respectable.
In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.
## New contributor guide
To get an overview of the project, read the [README](../README.md) file. Here are some resources to help you get started with open source contributions:
- [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github)
- [Set up Git](https://docs.github.com/en/get-started/getting-started-with-git/set-up-git)
- [GitHub flow](https://docs.github.com/en/get-started/using-github/github-flow)
- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests)
## Getting started
### Issues
#### Create a new issue
If you spot a problem, [search if an issue already exists](https://docs.github.com/en/github/searching-for-information-on-github/searching-on-github/searching-issues-and-pull-requests#search-by-the-title-body-or-comments). If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/InvoiceShelf/InvoiceShelf/issues/new/choose).
#### Solve an issue
Scan through our [existing issues](https://github.com/InvoiceShelf/InvoiceShelf/issues) to find one that interests you. You can narrow down the search using `labels` as filters. See "[Label reference](https://docs.github.com/en/contributing/collaborating-on-github-docs/label-reference)" for more information. As a general rule, we dont assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix.
### Make Changes
#### Make changes locally
1. Fork the repository.
- Using GitHub Desktop:
- [Getting started with GitHub Desktop](https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/getting-started-with-github-desktop) will guide you through setting up Desktop.
- Once Desktop is set up, you can use it to [fork the repo](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/cloning-and-forking-repositories-from-github-desktop)!
- Using the command line:
- [Fork the repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo) so that you can make your changes without affecting the original project until you're ready to merge them.
2. Install or update to **Node.js**, at the version specified in `.node-version`. For more information, see [the development guide](../contributing/development.md).
3. Create a working branch and start with your changes!
### Commit your update
Commit the changes once you are happy with them. Don't forget to use the "[Self review checklist](https://docs.github.com/en/contributing/collaborating-on-github-docs/self-review-checklist)" to speed up the review process :zap:.
### Pull Request
When you're finished with the changes, create a pull request, also known as a PR.
- Fill the "Ready for review" template so that we can review your PR. This template helps reviewers understand your changes as well as the purpose of your pull request.
- Don't forget to [link PR to issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one.
- Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge.
Once you submit your PR, a project maintainer will review your proposal. We may ask questions or request additional information.
- We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch.
- As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations).
- If you run into any merge issues, check out this [git tutorial](https://github.com/skills/resolve-merge-conflicts) to help you resolve merge conflicts and other issues.
### Your PR is merged!
Congratulations :tada::tada: The InvoiceShelf team thanks you :sparkles:.
Once your PR is merged, your contributions will be publicly visible on the [InvoiceShelf repository](https://github.com/InvoiceShelf/InvoiceShelf).

View File

@@ -1,26 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Please complete the following information:**
- InvoiceShelf version:
- PHP version:
- Database type and version:
**Optional info**
- OS: [e.g. Ubuntu]
- Browser: [e.g. chrome, safari]

202
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,202 @@
name: Bug report
description: Template for bug reports
labels:
- bug
- triage
projects: ["InvoiceShelf/2"]
assignees:
- rihards-simanovics
body:
# Ask user to confirm they've tried to fix or research the issue before
# posting a bug report.
- type: checkboxes
id: confirm-read-documentation
attributes:
label: Issue filing pre-requisites
description: "Prior to filing an issue please confirm that:"
options:
- label: I've checked the documentation.
required: true
- label: I've looked for similar issues both Open and Closed.
required: true
- label: >-
Ive tried clearing both cache and cookies in my browser or tried
opening the app in the Incognito/InPrivate window.
required: true
# Thank users for taking time to submit a bug report
- type: markdown
attributes:
value: >-
If you did all of the above, we first would like to thank you for taking
the time to fill out this bug report, it will help us tremendously to
find and fix the issue sooner!
# Description fo the bug
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
placeholder: >-
When doing `x`, `y`, and `z` in that order, an error occurs, but when x,
z and then y is done, the error does not occur.
validations:
required: true
# Reproduction steps
- type: textarea
id: reproduce
attributes:
label: Steps to Reproduce the issue
description: A clear step-by-step explanation of how to reproduce your issue
placeholder: >-
## Produces an error:
1. Do X;
2. Do Y;
3. Do Z;
## Works fine:
4. Do X;
5. Do Z;
6. Do Y.
validations:
required: true
# Expected Behaviour
- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
placeholder: doing `x`, `y`, and `z` in that order should not generate an error.
validations:
required: true
# Actual Behaviour
- type: textarea
id: actual-behavior
attributes:
label: Actual behavior
description: A clear and concise description of what actually happen.
placeholder: doing `x`, `y`, and `z` in that order generate an error.
validations:
required: true
# Section break
- type: markdown
attributes:
value: |-
## Envirment
Now lets collect some information about your environment.
# App Version
- type: input
id: invoiceshelf-version
attributes:
label: InvoiceShelf version
placeholder: v0.0.0
validations:
required: true
# PHP Version
- type: input
id: php-version
attributes:
label: PHP version
placeholder: v0.0.0
validations:
required: true
# DB Type
- type: input
id: database-type
attributes:
label: Database type
placeholder: MariaDB / MySQL / PostreSQL / SQLite
validations:
required: true
# DB Version
- type: input
id: db-version
attributes:
label: Database version
placeholder: v0.0.0
validations:
required: true
# Web Browser
- type: input
id: web-browser
attributes:
label: Web Browser
placeholder: "Firefox / Safari / or any other (chromium based browser)"
# OS Version
- type: input
id: server-os
attributes:
label: Server OS
description: If Linux please make sure to provide both distro name and it's version
placeholder: Windows / Linux (e.g. Ubuntu 24.04)
# Associated Logs
- type: markdown
attributes:
value: >-
## Logs
last but not least, could you please take some time to get us the logs
for:
# Log Reverse proxy
- type: textarea
id: log-rev-proxy
attributes:
label: Reverse-proxy logs
description: >-
Please provide logs from your Apache, Nginx, Traefik, or any other
reverse proxy application.
placeholder: >-
[2015-02-04 10:00:00] production.INFO: Laravel 5.0 released. The world rejoices.
[2015-12-03 12:00:00] production.INFO: PHP 7.0 introduced scalar type declarations. Minds blown.
[2016-05-15 14:00:00] production.INFO: Composer installed new dependencies. Dependency hell avoided.
[2017-08-20 16:00:00] production.INFO: Artisan command executed: migrate. Smooth sailing.
[2018-01-10 09:00:00] production.INFO: User login successful.
[2018-01-10 09:05:00] production.ERROR: Database connection failed. Did you try turning it off and on again?
[2018-01-10 09:10:00] production.WARNING: Deprecated function used in UserController.php. Time to refactor, again.
[2018-01-10 09:15:00] production.ERROR: Uncaught Exception: Division by zero. Oops, math is hard.
[2018-01-10 09:20:00] production.INFO: User logout successful. See you later, alligator.
[2019-03-25 11:00:00] production.INFO: Cache cleared. Fresh start!
[2019-06-30 13:00:00] production.ERROR: Syntax error. Missing semicolon strikes again.
[2020-09-10 15:00:00] production.INFO: User registered. Welcome aboard!
[2021-11-05 17:00:00] production.WARNING: Low disk space. Time to clean up.
[2022-12-20 19:00:00] production.INFO: Server rebooted. All systems go.
[2024-11-14 18:56:20] production.INFO: Unexpected item in the bagging area. Please wait for assistance.
render: irc logs
# PHP/Laravel Logs
- type: textarea
id: log-laravel
attributes:
label: Laravel/PHP logs
description: Please provide logs from either PHP or Laravel or both.
placeholder: >-
2023-04-12 10:15:32 [NGINX] 172.16.0.5 - - [12/Apr/2023:10:15:32 +0000] "GET /index.html HTTP/1.1" 200 1024 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
2023-04-12 10:15:33 [NGINX] 172.16.0.7 - - [12/Apr/2023:10:15:33 +0000] "POST /login HTTP/1.1" 302 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8"
2023-04-12 10:15:34 [NGINX] 172.16.0.9 - - [12/Apr/2023:10:15:34 +0000] "GET /about HTTP/1.1" 200 2048 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
2023-04-12 10:15:35 [NGINX] 172.16.0.11 - - [12/Apr/2023:10:15:35 +0000] "PUT /api/v1/users/123 HTTP/1.1" 200 - "https://example.com/profile" "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1"
2023-04-12 10:15:36 [NGINX] 172.16.0.13 - - [12/Apr/2023:10:15:36 +0000] "DELETE /api/v1/products/456 HTTP/1.1" 204 - "-" "Dalvik/2.1.0 (Linux; U; Android 10; Pixel 4 Build/QD1A.190821.014.C2)"
2023-04-12 10:15:37 [NGINX] 172.16.0.15 - - [12/Apr/2023:10:15:37 +0000] "GET /easter-egg HTTP/1.1" 200 42 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.3"
render: irc logs
# Special thanks
- type: markdown
attributes:
value: >-
This template was generated with [Issue Forms
Creator](https://issue-forms-creator.netlify.app)

View File

@@ -0,0 +1,73 @@
# Big thanks to https://github.com/files-community/Files/ for a template of the code_quality_issue
name: Code Quality Issue
description: Create a code quality issue to help InvoiceShelf keep a clean codebase
labels:
- code quality
- triage
projects: ["InvoiceShelf/2"]
assignees:
- rihards-simanovics
body:
# Tip to warn of checking for existing issues
- type: markdown
attributes:
value: >
> [!TIP]
> Have you checked for similar code quality issues? There's a
possibility your suggestion is already being tracked. Please do a
thorough search before creating a new issue.
# Issue body
- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of what the code quality issue is.
validations:
required: true
# Related code
- type: textarea
id: code-in-question
attributes:
label: The code in question
description: >-
A list of the different InvoiceShelf and/or areas of the code concerned by the issue.
validations:
required: true
# Gains
- type: textarea
id: gains
attributes:
label: Gains
description: What would fixing this code quality issue bring to the source code?
value: |
- eg. A better readability.
- eg. Uncoupling concepts X and Y.
- eg. Clarifying the responsibility of class C.
validations:
required: true
# Requirements
- type: textarea
id: requirements
attributes:
label: Requirements
description: Describe all the requirements to solve the code quality issue.
value: |
- eg. Using a specific design pattern.
- eg. Separating Interface I into three new interfaces I1, I2 and I3.
- eg. Regrouping the duplicated process into a new helper.
# Remarks
- type: textarea
id: comments
attributes:
label: Comments
description: >-
Additional information, comments or screenshots about the code quality
issue.

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Documentation
url: https://docs.invoiceshelf.com/
about: App documentation.
- name: Translation issue
url: https://crowdin.com/project/invoiceshelf
about: Help improve translations on Crowdin.
- name: Question & Discussion
url: https://discord.gg/hwg2FtwWHW
about: Post your questions and join the discussion. You can participate in chats on every channel.

View File

@@ -1,17 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

View File

@@ -0,0 +1,74 @@
# Big thanks to https://github.com/files-community/Files/ for a template of the feature_request
name: Feature Request
labels:
- feature request
- triage
projects: ["InvoiceShelf/2"]
assignees:
- rihards-simanovics
description: >-
This project thrives from differentiation from competing apps. Suggest an idea
for InvoiceShelf.
body:
# Tip to warn of checking for existing issues
- type: markdown
attributes:
value: >
> [!TIP]
>Have you checked for similar feature requests? There's a possibility
your suggestion is already being tracked. Please do a thorough search
before creating a new issue.
# Description
- type: textarea
id: what-feature
attributes:
label: What feature or improvement do you think would benefit InvoiceShelf?
description: Please include your use case
validations:
required: true
# Tooltip about Requirements
- type: markdown
attributes:
value: >
---
Please include a list changes required to make this improvement. A good
rule of thumb is to start your proposal with no more than 7 high-level
requirements.
# Requirements
- type: textarea
id: requirements
attributes:
label: Requirements
description: Describe all the requirements to make your idea happen.
value: |
- This proposal will accomplish X
- This proposal will accomplish Y
- This proposal will accomplish Z
validations:
required: true
# InvoiceShelf Version
- type: input
id: invoiceshelf_version
attributes:
label: App Version
description: Which version of InvoiceShelf are you using?
placeholder: v0.0.0
validations:
required: true
# Additional Comments
- type: textarea
id: comments
attributes:
label: Comments
description: >-
Additional information, comments or screenshots about the feature
request.

View File

@@ -7,11 +7,15 @@ on:
- '**/*.md'
- 'public/build/*.js'
- 'public/build/**/*.js'
branches-ignore:
- 'translations'
pull_request:
paths-ignore:
- '**/*.md'
- 'public/build/*.js'
- 'public/build/**/*.js'
branches-ignore:
- 'translations'
# Allow manually triggering the workflow.
workflow_dispatch:

2
.gitignore vendored
View File

@@ -22,3 +22,5 @@ Homestead.yaml
.php-cs-fixer.cache
/storage/fonts*
package-lock.json
/.dev/docker-compose.yml
/.dev/docker-compose.yaml

View File

@@ -29,14 +29,15 @@ dist-gen: clean composer npm-build
@cp -r routes InvoiceShelf
@cp -r storage InvoiceShelf
@cp -r vendor InvoiceShelf 2> /dev/null || true
@cp -r version.md InvoiceShelf
@cp -r .env.example InvoiceShelf
@cp -r artisan InvoiceShelf
@cp -r composer.json InvoiceShelf
@cp -r composer.lock InvoiceShelf
@cp -r server.php InvoiceShelf
@cp -r LICENSE InvoiceShelf
@cp -r readme.md InvoiceShelf
@cp -r SECURITY.md InvoiceShelf
@cp -r server.php InvoiceShelf
@touch InvoiceShelf/storage/logs/laravel.log
dist-clean: dist-gen

File diff suppressed because it is too large Load Diff

1629
_ide_helper_models.php Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
<?php
namespace InvoiceShelf\Bouncer\Scopes;
namespace App\Bouncer\Scopes;
use Silber\Bouncer\Database\Scope\Scope;

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use App\Models\Estimate;
use Carbon\Carbon;
use Illuminate\Console\Command;
use InvoiceShelf\Models\Estimate;
class CheckEstimateStatus extends Command
{
@@ -37,7 +37,7 @@ class CheckEstimateStatus extends Command
*
* @return mixed
*/
public function handle()
public function handle(): void
{
$date = Carbon::now();
$status = [Estimate::STATUS_ACCEPTED, Estimate::STATUS_REJECTED, Estimate::STATUS_EXPIRED];

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use App\Models\Invoice;
use Carbon\Carbon;
use Illuminate\Console\Command;
use InvoiceShelf\Models\Invoice;
class CheckInvoiceStatus extends Command
{
@@ -37,7 +37,7 @@ class CheckInvoiceStatus extends Command
*
* @return mixed
*/
public function handle()
public function handle(): void
{
$date = Carbon::now();
$invoices = Invoice::whereNotIn('status', [Invoice::STATUS_COMPLETED, Invoice::STATUS_DRAFT])

View File

@@ -1,9 +1,12 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use App\Space\PdfTemplateUtils;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
class CreateTemplateCommand extends Command
{
@@ -33,32 +36,57 @@ class CreateTemplateCommand extends Command
/**
* Execute the console command.
*
* @return int
*/
public function handle()
public function handle(): int
{
$templateName = $this->argument('name');
$type = $this->option('type');
$templateType = $this->option('type');
if (! $type) {
$type = $this->choice('Create a template for?', ['invoice', 'estimate']);
if (! $templateType) {
$templateType = $this->choice('Create a template for?', ['invoice', 'estimate']);
}
if (Storage::disk('views')->exists("/app/pdf/{$type}/{$templateName}.blade.php")) {
if (PdfTemplateUtils::customTemplateFileExists($templateType, sprintf('%s.blade.php', $templateName))) {
$this->info('Template with given name already exists.');
return 0;
return self::INVALID;
}
Storage::disk('views')->copy("/app/pdf/{$type}/{$type}1.blade.php", "/app/pdf/{$type}/{$templateName}.blade.php");
copy(public_path("/build/img/PDF/{$type}1.png"), public_path("/build/img/PDF/{$templateName}.png"));
copy(resource_path("/static/img/PDF/{$type}1.png"), resource_path("/static/img/PDF/{$templateName}.png"));
if (! PdfTemplateUtils::toCustomTemplateMarkupFile(
Str::replace(
sprintf('app.pdf.%s', $templateType),
sprintf('pdf_templates::%s', $templateType),
Storage::disk('views')->get("/app/pdf/{$templateType}/{$templateType}1.blade.php"),
),
$templateType,
$templateName
)) {
$this->error(sprintf('Unable to create %s template.', ucfirst($templateType)));
$path = resource_path("views/app/pdf/{$type}/{$templateName}.blade.php");
$type = ucfirst($type);
$this->info("{$type} Template created successfully at ".$path);
return self::FAILURE;
}
return 0;
PdfTemplateUtils::toCustomTemplateImageFile(
File::get(resource_path("static/img/PDF/{$templateType}1.png")),
$templateType,
$templateName,
);
if (! PdfTemplateUtils::customTemplateFileExists($templateType, 'partials/table.blade.php')) {
PdfTemplateUtils::toCustomTemplateFile(
Storage::disk('views')->get("/app/pdf/{$templateType}/partials/table.blade.php"),
$templateType,
'partials/table.blade.php'
);
}
$this->info(
sprintf('%s Template created successfully at %s',
ucfirst($templateType),
PdfTemplateUtils::getCustomTemplateFilePath($templateType, sprintf('%s.blade.php', $templateName))
)
);
return self::SUCCESS;
}
}

View File

@@ -1,9 +1,9 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use App\Space\ModuleInstaller;
use Illuminate\Console\Command;
use InvoiceShelf\Space\ModuleInstaller;
class InstallModuleCommand extends Command
{
@@ -33,10 +33,8 @@ class InstallModuleCommand extends Command
/**
* Execute the console command.
*
* @return int
*/
public function handle()
public function handle(): int
{
ModuleInstaller::complete($this->argument('module'), $this->argument('version'));

View File

@@ -1,11 +1,13 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
use Illuminate\Support\Facades\Artisan;
use function Laravel\Prompts\confirm;
class ResetApp extends Command
{
use ConfirmableTrait;
@@ -39,30 +41,49 @@ class ResetApp extends Command
*
* @return mixed
*/
public function handle()
/**
* Execute the console command to reset the application.
*
* This will:
* 1. Enable maintenance mode to prevent access during reset
* 2. Fresh migrate the database with initial seeds
* 3. Seed demo data using DemoSeeder
* 4. Clear all application caches
* 5. Disable maintenance mode
*
* The --force flag can be used to skip confirmation prompt.
*/
public function handle(): void
{
if (! $this->confirmToProceed()) {
return;
if (! $this->option('force')) {
if (! confirm('Are you sure you want to reset the application?')) {
$this->components->error('Reset cancelled');
return;
}
}
$this->info('Running migrate:fresh');
// Enable maintenance mode to prevent access during reset
$this->info('Activating maintenance mode...');
Artisan::call('down');
// Fresh migrate database and run initial seeds
$this->info('Running migrate:fresh');
Artisan::call('migrate:fresh --seed --force');
// Seed demo data
$this->info('Seeding database');
Artisan::call('db:seed', ['--class' => 'DemoSeeder', '--force' => true]);
$path = base_path('.env');
// Clear all application caches
$this->info('Clearing cache...');
Artisan::call('optimize:clear');
if (file_exists($path)) {
file_put_contents($path, str_replace(
'APP_DEBUG=true',
'APP_DEBUG=false',
file_get_contents($path)
));
}
// Disable maintenance mode
$this->info('Deactivating maintenance mode...');
Artisan::call('up');
$this->info('App has been reset successfully');
$this->info('App reset completed successfully!');
}
}

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use App\Models\Setting;
use App\Space\Updater;
use Illuminate\Console\Command;
use InvoiceShelf\Models\Setting;
use InvoiceShelf\Space\Updater;
// Implementation taken from Akaunting - https://github.com/akaunting/akaunting
class UpdateCommand extends Command
@@ -42,7 +42,7 @@ class UpdateCommand extends Command
/**
* Execute the console command.
*/
public function handle()
public function handle(): void
{
set_time_limit(3600); // 1 hour

View File

@@ -1,60 +0,0 @@
<?php
namespace InvoiceShelf\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use InvoiceShelf\Models\CompanySetting;
use InvoiceShelf\Models\RecurringInvoice;
use InvoiceShelf\Space\InstallUtils;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
Commands\ResetApp::class,
Commands\UpdateCommand::class,
Commands\CreateTemplateCommand::class,
Commands\InstallModuleCommand::class,
];
/**
* Define the application's command schedule.
*
* @return void
*/
protected function schedule(Schedule $schedule)
{
if (InstallUtils::isDbCreated()) {
$schedule->command('check:invoices:status')
->daily();
$schedule->command('check:estimates:status')
->daily();
$recurringInvoices = RecurringInvoice::where('status', 'ACTIVE')->get();
foreach ($recurringInvoices as $recurringInvoice) {
$timeZone = CompanySetting::getSetting('time_zone', $recurringInvoice->company_id);
$schedule->call(function () use ($recurringInvoice) {
$recurringInvoice->generateInvoice();
})->cron($recurringInvoice->frequency)->timezone($timeZone);
}
}
}
/**
* Register the Closure based commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

View File

@@ -1,6 +1,6 @@
<?php
namespace InvoiceShelf\Events;
namespace App\Events;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;

View File

@@ -1,6 +1,6 @@
<?php
namespace InvoiceShelf\Events;
namespace App\Events;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;

View File

@@ -1,6 +1,6 @@
<?php
namespace InvoiceShelf\Events;
namespace App\Events;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;

View File

@@ -1,6 +1,6 @@
<?php
namespace InvoiceShelf\Events;
namespace App\Events;
use Illuminate\Foundation\Events\Dispatchable;

View File

@@ -1,51 +0,0 @@
<?php
namespace InvoiceShelf\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @return void
*/
public function report(Throwable $exception)
{
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}
}

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Generators;
namespace App\Generators;
use InvoiceShelf\Models\Estimate;
use InvoiceShelf\Models\Invoice;
use InvoiceShelf\Models\Payment;
use App\Models\Estimate;
use App\Models\Invoice;
use App\Models\Payment;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Spatie\MediaLibrary\Support\PathGenerator\PathGenerator;

View File

@@ -1,23 +1,30 @@
<?php
namespace InvoiceShelf\Http\Controllers;
namespace App\Http\Controllers;
use App\Models\Setting;
use Illuminate\Http\Request;
use InvoiceShelf\Models\Setting;
class AppVersionController extends Controller
{
/**
* Handle the incoming request.
*
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\JsonResponse
*/
public function __invoke(Request $request)
{
$version = Setting::getSetting('version');
$channel = Setting::getSetting('updater_channel');
if (is_null($channel)) {
$channel = 'stable';
Setting::setSetting('updater_channel', 'stable'); // default.
}
return response()->json([
'version' => $version,
'channel' => $channel,
]);
}
}

View File

@@ -1,13 +1,13 @@
<?php
namespace InvoiceShelf\Http\Controllers;
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
abstract class Controller extends BaseController
{
use AuthorizesRequests;
use DispatchesJobs;

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Auth;
namespace App\Http\Controllers\V1\Admin\Auth;
use App\Http\Controllers\Controller;
use App\Providers\AppServiceProvider;
use Illuminate\Foundation\Auth\ConfirmsPasswords;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Providers\RouteServiceProvider;
class ConfirmPasswordController extends Controller
{
@@ -26,7 +26,7 @@ class ConfirmPasswordController extends Controller
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
protected $redirectTo = AppServiceProvider::HOME;
/**
* Create a new controller instance.

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Auth;
namespace App\Http\Controllers\V1\Admin\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
class ForgotPasswordController extends Controller
{

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Auth;
namespace App\Http\Controllers\V1\Admin\Auth;
use App\Http\Controllers\Controller;
use App\Providers\AppServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Providers\RouteServiceProvider;
class LoginController extends Controller
{
@@ -26,7 +26,7 @@ class LoginController extends Controller
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
protected $redirectTo = AppServiceProvider::HOME;
/**
* Create a new controller instance.

View File

@@ -1,12 +1,12 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Auth;
namespace App\Http\Controllers\V1\Admin\Auth;
use App\Http\Controllers\Controller;
use App\Models\User;
use App\Providers\AppServiceProvider;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Validator;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\User;
use InvoiceShelf\Providers\RouteServiceProvider;
class RegisterController extends Controller
{
@@ -28,7 +28,7 @@ class RegisterController extends Controller
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
protected $redirectTo = AppServiceProvider::HOME;
/**
* Create a new controller instance.

View File

@@ -1,13 +1,13 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Auth;
namespace App\Http\Controllers\V1\Admin\Auth;
use App\Http\Controllers\Controller;
use App\Providers\AppServiceProvider;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Foundation\Auth\ResetsPasswords;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Providers\RouteServiceProvider;
class ResetPasswordController extends Controller
{
@@ -29,7 +29,7 @@ class ResetPasswordController extends Controller
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
protected $redirectTo = AppServiceProvider::HOME;
/**
* Get the response for a successful password reset.

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Auth;
namespace App\Http\Controllers\V1\Admin\Auth;
use App\Http\Controllers\Controller;
use App\Providers\AppServiceProvider;
use Illuminate\Foundation\Auth\VerifiesEmails;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Providers\RouteServiceProvider;
class VerificationController extends Controller
{
@@ -26,7 +26,7 @@ class VerificationController extends Controller
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
protected $redirectTo = AppServiceProvider::HOME;
/**
* Create a new controller instance.

View File

@@ -2,10 +2,10 @@
// Implementation taken from nova-backup-tool - https://github.com/spatie/nova-backup-tool/
namespace InvoiceShelf\Http\Controllers\V1\Admin\Backup;
namespace App\Http\Controllers\V1\Admin\Backup;
use App\Http\Controllers\Controller;
use Illuminate\Http\JsonResponse;
use InvoiceShelf\Http\Controllers\Controller;
class ApiController extends Controller
{

View File

@@ -2,13 +2,13 @@
// Implementation taken from nova-backup-tool - https://github.com/spatie/nova-backup-tool/
namespace InvoiceShelf\Http\Controllers\V1\Admin\Backup;
namespace App\Http\Controllers\V1\Admin\Backup;
use App\Jobs\CreateBackupJob;
use App\Rules\Backup\PathToZip;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use InvoiceShelf\Jobs\CreateBackupJob;
use InvoiceShelf\Rules\Backup\PathToZip;
use Spatie\Backup\BackupDestination\Backup;
use Spatie\Backup\BackupDestination\BackupDestination;
use Spatie\Backup\Helpers\Format;
@@ -80,7 +80,7 @@ class BackupsController extends ApiController
$this->authorize('manage backups');
$validated = $request->validate([
'path' => ['required', new PathToZip()],
'path' => ['required', new PathToZip],
]);
$backupDestination = BackupDestination::create(config('filesystems.default'), config('backup.backup.name'));

View File

@@ -2,10 +2,10 @@
// Implementation taken from nova-backup-tool - https://github.com/spatie/nova-backup-tool/
namespace InvoiceShelf\Http\Controllers\V1\Admin\Backup;
namespace App\Http\Controllers\V1\Admin\Backup;
use App\Rules\Backup\PathToZip;
use Illuminate\Http\Request;
use InvoiceShelf\Rules\Backup\PathToZip;
use Spatie\Backup\BackupDestination\Backup;
use Spatie\Backup\BackupDestination\BackupDestination;
use Symfony\Component\HttpFoundation\Response;
@@ -18,7 +18,7 @@ class DownloadBackupController extends ApiController
$this->authorize('manage backups');
$validated = $request->validate([
'path' => ['required', new PathToZip()],
'path' => ['required', new PathToZip],
]);
$backupDestination = BackupDestination::create(config('filesystems.default'), config('backup.backup.name'));

View File

@@ -1,13 +1,13 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Company;
namespace App\Http\Controllers\V1\Admin\Company;
use App\Http\Controllers\Controller;
use App\Http\Requests\CompaniesRequest;
use App\Http\Resources\CompanyResource;
use App\Models\Company;
use App\Models\User;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\CompaniesRequest;
use InvoiceShelf\Http\Resources\CompanyResource;
use InvoiceShelf\Models\Company;
use InvoiceShelf\Models\User;
use Silber\Bouncer\BouncerFacade;
use Vinkla\Hashids\Facades\Hashids;

View File

@@ -1,11 +1,11 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Company;
namespace App\Http\Controllers\V1\Admin\Company;
use App\Http\Controllers\Controller;
use App\Http\Resources\CompanyResource;
use App\Models\Company;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Resources\CompanyResource;
use InvoiceShelf\Models\Company;
class CompanyController extends Controller
{

View File

@@ -1,9 +1,9 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Config;
namespace App\Http\Controllers\V1\Admin\Config;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
class FiscalYearsController extends Controller
{

View File

@@ -1,9 +1,9 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Config;
namespace App\Http\Controllers\V1\Admin\Config;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
class LanguagesController extends Controller
{

View File

@@ -1,9 +1,9 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Config;
namespace App\Http\Controllers\V1\Admin\Config;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
class RetrospectiveEditsController extends Controller
{

View File

@@ -1,12 +1,12 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\CustomField;
namespace App\Http\Controllers\V1\Admin\CustomField;
use App\Http\Controllers\Controller;
use App\Http\Requests\CustomFieldRequest;
use App\Http\Resources\CustomFieldResource;
use App\Models\CustomField;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\CustomFieldRequest;
use InvoiceShelf\Http\Resources\CustomFieldResource;
use InvoiceShelf\Models\CustomField;
class CustomFieldsController extends Controller
{

View File

@@ -1,16 +1,16 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Customer;
namespace App\Http\Controllers\V1\Admin\Customer;
use App\Http\Controllers\Controller;
use App\Http\Resources\CustomerResource;
use App\Models\CompanySetting;
use App\Models\Customer;
use App\Models\Expense;
use App\Models\Invoice;
use App\Models\Payment;
use Carbon\Carbon;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Resources\CustomerResource;
use InvoiceShelf\Models\CompanySetting;
use InvoiceShelf\Models\Customer;
use InvoiceShelf\Models\Expense;
use InvoiceShelf\Models\Invoice;
use InvoiceShelf\Models\Payment;
class CustomerStatsController extends Controller
{
@@ -35,15 +35,16 @@ class CustomerStatsController extends Controller
$start = Carbon::now();
$end = Carbon::now();
$terms = explode('-', $fiscalYear);
$companyStartMonth = intval($terms[0]);
if ($terms[0] <= $start->month) {
$startDate->month($terms[0])->startOfMonth();
$start->month($terms[0])->startOfMonth();
$end->month($terms[0])->endOfMonth();
if ($companyStartMonth <= $start->month) {
$startDate->month($companyStartMonth)->startOfMonth();
$start->month($companyStartMonth)->startOfMonth();
$end->month($companyStartMonth)->endOfMonth();
} else {
$startDate->subYear()->month($terms[0])->startOfMonth();
$start->subYear()->month($terms[0])->startOfMonth();
$end->subYear()->month($terms[0])->endOfMonth();
$startDate->subYear()->month($companyStartMonth)->startOfMonth();
$start->subYear()->month($companyStartMonth)->startOfMonth();
$end->subYear()->month($companyStartMonth)->endOfMonth();
}
if ($request->has('previous_year')) {
@@ -87,7 +88,7 @@ class CustomerStatsController extends Controller
($receiptTotals[$i] - $expenseTotals[$i])
);
$i++;
array_push($months, $start->format('M'));
array_push($months, $start->translatedFormat('M'));
$monthCounter++;
$end->startOfMonth();
$start->addMonth()->startOfMonth();

View File

@@ -1,14 +1,14 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Customer;
namespace App\Http\Controllers\V1\Admin\Customer;
use App\Http\Controllers\Controller;
use App\Http\Requests;
use App\Http\Requests\DeleteCustomersRequest;
use App\Http\Resources\CustomerResource;
use App\Models\Customer;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests;
use InvoiceShelf\Http\Requests\DeleteCustomersRequest;
use InvoiceShelf\Http\Resources\CustomerResource;
use InvoiceShelf\Models\Customer;
class CustomersController extends Controller
{

View File

@@ -1,17 +1,17 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Dashboard;
namespace App\Http\Controllers\V1\Admin\Dashboard;
use App\Http\Controllers\Controller;
use App\Models\Company;
use App\Models\CompanySetting;
use App\Models\Customer;
use App\Models\Estimate;
use App\Models\Expense;
use App\Models\Invoice;
use App\Models\Payment;
use Carbon\Carbon;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\Company;
use InvoiceShelf\Models\CompanySetting;
use InvoiceShelf\Models\Customer;
use InvoiceShelf\Models\Estimate;
use InvoiceShelf\Models\Expense;
use InvoiceShelf\Models\Invoice;
use InvoiceShelf\Models\Payment;
use Silber\Bouncer\BouncerFacade;
class DashboardController extends Controller
@@ -40,15 +40,16 @@ class DashboardController extends Controller
$start = Carbon::now();
$end = Carbon::now();
$terms = explode('-', $fiscalYear);
$companyStartMonth = intval($terms[0]);
if ($terms[0] <= $start->month) {
$startDate->month($terms[0])->startOfMonth();
$start->month($terms[0])->startOfMonth();
$end->month($terms[0])->endOfMonth();
if ($companyStartMonth <= $start->month) {
$startDate->month($companyStartMonth)->startOfMonth();
$start->month($companyStartMonth)->startOfMonth();
$end->month($companyStartMonth)->endOfMonth();
} else {
$startDate->subYear()->month($terms[0])->startOfMonth();
$start->subYear()->month($terms[0])->startOfMonth();
$end->subYear()->month($terms[0])->endOfMonth();
$startDate->subYear()->month($companyStartMonth)->startOfMonth();
$start->subYear()->month($companyStartMonth)->startOfMonth();
$end->subYear()->month($companyStartMonth)->endOfMonth();
}
if ($request->has('previous_year')) {
@@ -90,7 +91,7 @@ class DashboardController extends Controller
($receipt_totals[$i] - $expense_totals[$i])
);
$i++;
array_push($months, $start->format('M'));
array_push($months, $start->translatedFormat('M'));
$monthCounter++;
$end->startOfMonth();
$start->addMonth()->startOfMonth();

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Estimate;
namespace App\Http\Controllers\V1\Admin\Estimate;
use App\Http\Controllers\Controller;
use App\Models\Estimate;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\Estimate;
class ChangeEstimateStatusController extends Controller
{

View File

@@ -0,0 +1,131 @@
<?php
namespace App\Http\Controllers\V1\Admin\Estimate;
use App\Http\Controllers\Controller;
use App\Http\Resources\EstimateResource;
use App\Models\CompanySetting;
use App\Models\Estimate;
use App\Services\SerialNumberFormatter;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Vinkla\Hashids\Facades\Hashids;
class CloneEstimateController extends Controller
{
/**
* Mail a specific invoice to the corresponding customer's email address.
*
* @return \Illuminate\Http\JsonResponse
*/
public function __invoke(Request $request, Estimate $estimate)
{
$this->authorize('create', Estimate::class);
$date = Carbon::now();
$serial = (new SerialNumberFormatter)
->setModel($estimate)
->setCompany($estimate->company_id)
->setCustomer($estimate->customer_id)
->setNextNumbers();
$due_date = null;
$dueDateEnabled = CompanySetting::getSetting(
'estimate_set_expiry_date_automatically',
$request->header('company')
);
if ($dueDateEnabled === 'YES') {
$dueDateDays = intval(CompanySetting::getSetting(
'estimate_expiry_date_days',
$request->header('company')
));
$due_date = Carbon::now()->addDays($dueDateDays)->format('Y-m-d');
}
$exchange_rate = $estimate->exchange_rate;
$newEstimate = Estimate::create([
'estimate_date' => $date->format('Y-m-d'),
'expiry_date' => $due_date,
'estimate_number' => $serial->getNextNumber(),
'sequence_number' => $serial->nextSequenceNumber,
'customer_sequence_number' => $serial->nextCustomerSequenceNumber,
'reference_number' => $estimate->reference_number,
'customer_id' => $estimate->customer_id,
'company_id' => $request->header('company'),
'template_name' => $estimate->template_name,
'status' => Estimate::STATUS_DRAFT,
'sub_total' => $estimate->sub_total,
'discount' => $estimate->discount,
'discount_type' => $estimate->discount_type,
'discount_val' => $estimate->discount_val,
'total' => $estimate->total,
'due_amount' => $estimate->total,
'tax_per_item' => $estimate->tax_per_item,
'discount_per_item' => $estimate->discount_per_item,
'tax' => $estimate->tax,
'notes' => $estimate->notes,
'exchange_rate' => $exchange_rate,
'base_total' => $estimate->total * $exchange_rate,
'base_discount_val' => $estimate->discount_val * $exchange_rate,
'base_sub_total' => $estimate->sub_total * $exchange_rate,
'base_tax' => $estimate->tax * $exchange_rate,
'base_due_amount' => $estimate->total * $exchange_rate,
'currency_id' => $estimate->currency_id,
'sales_tax_type' => $estimate->sales_tax_type,
'sales_tax_address_type' => $estimate->sales_tax_address_type,
]);
$newEstimate->unique_hash = Hashids::connection(Estimate::class)->encode($newEstimate->id);
$newEstimate->save();
$estimate->load('items.taxes');
$estimateItems = $estimate->items->toArray();
foreach ($estimateItems as $estimateItem) {
$estimateItem['company_id'] = $request->header('company');
$estimateItem['name'] = $estimateItem['name'];
$estimateItem['exchange_rate'] = $exchange_rate;
$estimateItem['base_price'] = $estimateItem['price'] * $exchange_rate;
$estimateItem['base_discount_val'] = $estimateItem['discount_val'] * $exchange_rate;
$estimateItem['base_tax'] = $estimateItem['tax'] * $exchange_rate;
$estimateItem['base_total'] = $estimateItem['total'] * $exchange_rate;
$item = $newEstimate->items()->create($estimateItem);
if (array_key_exists('taxes', $estimateItem) && $estimateItem['taxes']) {
foreach ($estimateItem['taxes'] as $tax) {
$tax['company_id'] = $request->header('company');
if ($tax['amount']) {
$item->taxes()->create($tax);
}
}
}
}
if ($estimate->taxes) {
foreach ($estimate->taxes->toArray() as $tax) {
$tax['company_id'] = $request->header('company');
$newEstimate->taxes()->create($tax);
}
}
if ($estimate->fields()->exists()) {
$customFields = [];
foreach ($estimate->fields as $data) {
$customFields[] = [
'id' => $data->custom_field_id,
'value' => $data->defaultAnswer,
];
}
$newEstimate->addCustomFields($customFields);
}
return new EstimateResource($newEstimate);
}
}

View File

@@ -1,16 +1,16 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Estimate;
namespace App\Http\Controllers\V1\Admin\Estimate;
use App\Http\Controllers\Controller;
use App\Http\Resources\InvoiceResource;
use App\Models\CompanySetting;
use App\Models\Estimate;
use App\Models\Invoice;
use App\Services\SerialNumberFormatter;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Resources\InvoiceResource;
use InvoiceShelf\Models\CompanySetting;
use InvoiceShelf\Models\Estimate;
use InvoiceShelf\Models\Invoice;
use InvoiceShelf\Services\SerialNumberFormatter;
use Vinkla\Hashids\Facades\Hashids;
class ConvertEstimateController extends Controller
@@ -35,14 +35,14 @@ class ConvertEstimateController extends Controller
);
if ($dueDateEnabled === 'YES') {
$dueDateDays = CompanySetting::getSetting(
$dueDateDays = intval(CompanySetting::getSetting(
'invoice_due_date_days',
$request->header('company')
);
));
$due_date = Carbon::now()->addDays($dueDateDays)->format('Y-m-d');
}
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setModel($invoice)
->setCompany($estimate->company_id)
->setCustomer($estimate->customer_id)

View File

@@ -1,23 +1,25 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Estimate;
namespace App\Http\Controllers\V1\Admin\Estimate;
use App\Http\Controllers\Controller;
use App\Models\Estimate;
use App\Space\PdfTemplateUtils;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\Estimate;
class EstimateTemplatesController extends Controller
{
/**
* Handle the incoming request.
*
* @return \Illuminate\Http\Response
* @return JsonResponse
*/
public function __invoke(Request $request)
{
$this->authorize('viewAny', Estimate::class);
$estimateTemplates = Estimate::estimateTemplates();
$estimateTemplates = PdfTemplateUtils::getFormattedTemplates('estimate');
return response()->json([
'estimateTemplates' => $estimateTemplates,

View File

@@ -1,14 +1,14 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Estimate;
namespace App\Http\Controllers\V1\Admin\Estimate;
use App\Http\Controllers\Controller;
use App\Http\Requests\DeleteEstimatesRequest;
use App\Http\Requests\EstimatesRequest;
use App\Http\Resources\EstimateResource;
use App\Jobs\GenerateEstimatePdfJob;
use App\Models\Estimate;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\DeleteEstimatesRequest;
use InvoiceShelf\Http\Requests\EstimatesRequest;
use InvoiceShelf\Http\Resources\EstimateResource;
use InvoiceShelf\Jobs\GenerateEstimatePdfJob;
use InvoiceShelf\Models\Estimate;
class EstimatesController extends Controller
{

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Estimate;
namespace App\Http\Controllers\V1\Admin\Estimate;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\SendEstimatesRequest;
use InvoiceShelf\Models\Estimate;
use App\Http\Controllers\Controller;
use App\Http\Requests\SendEstimatesRequest;
use App\Models\Estimate;
class SendEstimateController extends Controller
{

View File

@@ -1,11 +1,11 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Estimate;
namespace App\Http\Controllers\V1\Admin\Estimate;
use App\Http\Controllers\Controller;
use App\Http\Requests\SendEstimatesRequest;
use App\Models\Estimate;
use Illuminate\Mail\Markdown;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\SendEstimatesRequest;
use InvoiceShelf\Models\Estimate;
class SendEstimatePreviewController extends Controller
{

View File

@@ -1,12 +1,12 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
namespace App\Http\Controllers\V1\Admin\ExchangeRate;
use App\Http\Controllers\Controller;
use App\Http\Requests\ExchangeRateProviderRequest;
use App\Http\Resources\ExchangeRateProviderResource;
use App\Models\ExchangeRateProvider;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\ExchangeRateProviderRequest;
use InvoiceShelf\Http\Resources\ExchangeRateProviderResource;
use InvoiceShelf\Models\ExchangeRateProvider;
class ExchangeRateProviderController extends Controller
{

View File

@@ -1,11 +1,11 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
namespace App\Http\Controllers\V1\Admin\ExchangeRate;
use App\Http\Controllers\Controller;
use App\Models\Currency;
use App\Models\ExchangeRateProvider;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\Currency;
use InvoiceShelf\Models\ExchangeRateProvider;
class GetActiveProviderController extends Controller
{

View File

@@ -1,15 +1,15 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
namespace App\Http\Controllers\V1\Admin\ExchangeRate;
use App\Http\Controllers\Controller;
use App\Models\CompanySetting;
use App\Models\Currency;
use App\Models\ExchangeRateLog;
use App\Models\ExchangeRateProvider;
use App\Traits\ExchangeRateProvidersTrait;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\CompanySetting;
use InvoiceShelf\Models\Currency;
use InvoiceShelf\Models\ExchangeRateLog;
use InvoiceShelf\Models\ExchangeRateProvider;
use InvoiceShelf\Traits\ExchangeRateProvidersTrait;
class GetExchangeRateController extends Controller
{

View File

@@ -1,11 +1,11 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
namespace App\Http\Controllers\V1\Admin\ExchangeRate;
use App\Http\Controllers\Controller;
use App\Models\ExchangeRateProvider;
use App\Traits\ExchangeRateProvidersTrait;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\ExchangeRateProvider;
use InvoiceShelf\Traits\ExchangeRateProvidersTrait;
class GetSupportedCurrenciesController extends Controller
{

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\ExchangeRate;
namespace App\Http\Controllers\V1\Admin\ExchangeRate;
use App\Http\Controllers\Controller;
use App\Models\ExchangeRateProvider;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\ExchangeRateProvider;
class GetUsedCurrenciesController extends Controller
{

View File

@@ -1,12 +1,12 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Expense;
namespace App\Http\Controllers\V1\Admin\Expense;
use App\Http\Controllers\Controller;
use App\Http\Requests\ExpenseCategoryRequest;
use App\Http\Resources\ExpenseCategoryResource;
use App\Models\ExpenseCategory;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\ExpenseCategoryRequest;
use InvoiceShelf\Http\Resources\ExpenseCategoryResource;
use InvoiceShelf\Models\ExpenseCategory;
class ExpenseCategoriesController extends Controller
{
@@ -60,7 +60,7 @@ class ExpenseCategoriesController extends Controller
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \InvoiceShelf\Models\ExpenseCategory $ExpenseCategory
* @param \App\Models\ExpenseCategory $ExpenseCategory
* @return \Illuminate\Http\Response
*/
public function update(ExpenseCategoryRequest $request, ExpenseCategory $category)
@@ -75,7 +75,7 @@ class ExpenseCategoriesController extends Controller
/**
* Remove the specified resource from storage.
*
* @param \InvoiceShelf\ExpensesCategory $category
* @param \App\ExpensesCategory $category
* @return \Illuminate\Http\Response
*/
public function destroy(ExpenseCategory $category)

View File

@@ -1,13 +1,13 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Expense;
namespace App\Http\Controllers\V1\Admin\Expense;
use App\Http\Controllers\Controller;
use App\Http\Requests\DeleteExpensesRequest;
use App\Http\Requests\ExpenseRequest;
use App\Http\Resources\ExpenseResource;
use App\Models\Expense;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\DeleteExpensesRequest;
use InvoiceShelf\Http\Requests\ExpenseRequest;
use InvoiceShelf\Http\Resources\ExpenseResource;
use InvoiceShelf\Models\Expense;
class ExpensesController extends Controller
{

View File

@@ -1,9 +1,9 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Expense;
namespace App\Http\Controllers\V1\Admin\Expense;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\Expense;
use App\Http\Controllers\Controller;
use App\Models\Expense;
class ShowReceiptController extends Controller
{

View File

@@ -1,17 +1,17 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Expense;
namespace App\Http\Controllers\V1\Admin\Expense;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\UploadExpenseReceiptRequest;
use InvoiceShelf\Models\Expense;
use App\Http\Controllers\Controller;
use App\Http\Requests\UploadExpenseReceiptRequest;
use App\Models\Expense;
class UploadReceiptController extends Controller
{
/**
* Upload the expense receipts to storage.
*
* @param \InvoiceShelf\Http\Requests\ExpenseRequest $request
* @param \App\Http\Requests\ExpenseRequest $request
* @return \Illuminate\Http\JsonResponse
*/
public function __invoke(UploadExpenseReceiptRequest $request, Expense $expense)

View File

@@ -1,17 +1,17 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use App\Http\Resources\CompanyResource;
use App\Http\Resources\UserResource;
use App\Models\Company;
use App\Models\CompanySetting;
use App\Models\Currency;
use App\Models\Module;
use App\Models\Setting;
use App\Traits\GeneratesMenuTrait;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Resources\CompanyResource;
use InvoiceShelf\Http\Resources\UserResource;
use InvoiceShelf\Models\Company;
use InvoiceShelf\Models\CompanySetting;
use InvoiceShelf\Models\Currency;
use InvoiceShelf\Models\Module;
use InvoiceShelf\Models\Setting;
use InvoiceShelf\Traits\GeneratesMenuTrait;
use Silber\Bouncer\BouncerFacade;
class BootstrapController extends Controller

View File

@@ -1,14 +1,14 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\BulkExchangeRateRequest;
use InvoiceShelf\Models\CompanySetting;
use InvoiceShelf\Models\Estimate;
use InvoiceShelf\Models\Invoice;
use InvoiceShelf\Models\Payment;
use InvoiceShelf\Models\Tax;
use App\Http\Controllers\Controller;
use App\Http\Requests\BulkExchangeRateRequest;
use App\Models\CompanySetting;
use App\Models\Estimate;
use App\Models\Invoice;
use App\Models\Payment;
use App\Models\Tax;
class BulkExchangeRateController extends Controller
{

View File

@@ -1,9 +1,9 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
class ConfigController extends Controller
{

View File

@@ -1,11 +1,11 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use App\Http\Resources\CountryResource;
use App\Models\Country;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Resources\CountryResource;
use InvoiceShelf\Models\Country;
class CountriesController extends Controller
{

View File

@@ -1,11 +1,11 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use App\Http\Resources\CurrencyResource;
use App\Models\Currency;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Resources\CurrencyResource;
use InvoiceShelf\Models\Currency;
class CurrenciesController extends Controller
{

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use App\Space\DateFormatter;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Space\DateFormatter;
class DateFormatsController extends Controller
{

View File

@@ -1,14 +1,14 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use App\Models\Currency;
use App\Models\Estimate;
use App\Models\Invoice;
use App\Models\Payment;
use App\Models\Tax;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\Currency;
use InvoiceShelf\Models\Estimate;
use InvoiceShelf\Models\Invoice;
use InvoiceShelf\Models\Payment;
use InvoiceShelf\Models\Tax;
class GetAllUsedCurrenciesController extends Controller
{

View File

@@ -1,13 +1,13 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use App\Models\Estimate;
use App\Models\Invoice;
use App\Models\Payment;
use App\Services\SerialNumberFormatter;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\Estimate;
use InvoiceShelf\Models\Invoice;
use InvoiceShelf\Models\Payment;
use InvoiceShelf\Services\SerialNumberFormatter;
class NextNumberController extends Controller
{
@@ -20,7 +20,7 @@ class NextNumberController extends Controller
{
$key = $request->key;
$nextNumber = null;
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setCompany($request->header('company'))
->setCustomer($request->userId);

View File

@@ -1,12 +1,12 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use App\Http\Requests\NotesRequest;
use App\Http\Resources\NoteResource;
use App\Models\Note;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\NotesRequest;
use InvoiceShelf\Http\Resources\NoteResource;
use InvoiceShelf\Models\Note;
class NotesController extends Controller
{

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use App\Services\SerialNumberFormatter;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Services\SerialNumberFormatter;
class NumberPlaceholdersController extends Controller
{

View File

@@ -1,11 +1,11 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use App\Models\Customer;
use App\Models\User;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\Customer;
use InvoiceShelf\Models\User;
class SearchController extends Controller
{

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\User;
class SearchUsersController extends Controller
{

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use App\Space\TimeFormatter;
use Illuminate\Http\Request;
class TimeFormatsController extends Controller
{
/**
* Handle the incoming request.
*
* @return \Illuminate\Http\Response
*/
public function __invoke(Request $request)
{
return response()->json([
'time_formats' => TimeFormatter::get_list(),
]);
}
}

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\General;
namespace App\Http\Controllers\V1\Admin\General;
use App\Http\Controllers\Controller;
use App\Space\TimeZones;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Space\TimeZones;
class TimezonesController extends Controller
{

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Invoice;
namespace App\Http\Controllers\V1\Admin\Invoice;
use App\Http\Controllers\Controller;
use App\Models\Invoice;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\Invoice;
class ChangeInvoiceStatusController extends Controller
{

View File

@@ -1,14 +1,14 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Invoice;
namespace App\Http\Controllers\V1\Admin\Invoice;
use App\Http\Controllers\Controller;
use App\Http\Resources\InvoiceResource;
use App\Models\CompanySetting;
use App\Models\Invoice;
use App\Services\SerialNumberFormatter;
use Carbon\Carbon;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Resources\InvoiceResource;
use InvoiceShelf\Models\CompanySetting;
use InvoiceShelf\Models\Invoice;
use InvoiceShelf\Services\SerialNumberFormatter;
use Vinkla\Hashids\Facades\Hashids;
class CloneInvoiceController extends Controller
@@ -24,7 +24,7 @@ class CloneInvoiceController extends Controller
$date = Carbon::now();
$serial = (new SerialNumberFormatter())
$serial = (new SerialNumberFormatter)
->setModel($invoice)
->setCompany($invoice->company_id)
->setCustomer($invoice->customer_id)
@@ -37,15 +37,25 @@ class CloneInvoiceController extends Controller
);
if ($dueDateEnabled === 'YES') {
$dueDateDays = CompanySetting::getSetting(
$dueDateDays = intval(CompanySetting::getSetting(
'invoice_due_date_days',
$request->header('company')
);
));
$due_date = Carbon::now()->addDays($dueDateDays)->format('Y-m-d');
}
$exchange_rate = $invoice->exchange_rate;
$dateFormat = 'Y-m-d';
$invoiceTimeEnabled = CompanySetting::getSetting(
'invoice_use_time',
$request->header('company')
);
if ($invoiceTimeEnabled === 'YES') {
$dateFormat .= ' H:i';
}
$newInvoice = Invoice::create([
'invoice_date' => $date->format('Y-m-d'),
'due_date' => $due_date,

View File

@@ -1,23 +1,29 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Invoice;
namespace App\Http\Controllers\V1\Admin\Invoice;
use App\Http\Controllers\Controller;
use App\Models\Invoice;
use App\Space\PdfTemplateUtils;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\Invoice;
class InvoiceTemplatesController extends Controller
{
/**
* Handle the incoming request.
*
* @return \Illuminate\Http\Response
*
* @return JsonResponse
*
* @throws AuthorizationException
*/
public function __invoke(Request $request)
{
$this->authorize('viewAny', Invoice::class);
$invoiceTemplates = Invoice::invoiceTemplates();
$invoiceTemplates = PdfTemplateUtils::getFormattedTemplates('invoice');
return response()->json([
'invoiceTemplates' => $invoiceTemplates,

View File

@@ -1,14 +1,14 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Invoice;
namespace App\Http\Controllers\V1\Admin\Invoice;
use App\Http\Controllers\Controller;
use App\Http\Requests;
use App\Http\Requests\DeleteInvoiceRequest;
use App\Http\Resources\InvoiceResource;
use App\Jobs\GenerateInvoicePdfJob;
use App\Models\Invoice;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests;
use InvoiceShelf\Http\Requests\DeleteInvoiceRequest;
use InvoiceShelf\Http\Resources\InvoiceResource;
use InvoiceShelf\Jobs\GenerateInvoicePdfJob;
use InvoiceShelf\Models\Invoice;
class InvoicesController extends Controller
{
@@ -21,12 +21,11 @@ class InvoicesController extends Controller
{
$this->authorize('viewAny', Invoice::class);
$limit = $request->has('limit') ? $request->limit : 10;
$limit = $request->input('limit', 10);
$invoices = Invoice::whereCompany()
->join('customers', 'customers.id', '=', 'invoices.customer_id')
->applyFilters($request->all())
->select('invoices.*', 'customers.name')
->with('customer')
->latest()
->paginateData($limit);

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Invoice;
namespace App\Http\Controllers\V1\Admin\Invoice;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\SendInvoiceRequest;
use InvoiceShelf\Models\Invoice;
use App\Http\Controllers\Controller;
use App\Http\Requests\SendInvoiceRequest;
use App\Models\Invoice;
class SendInvoiceController extends Controller
{

View File

@@ -1,11 +1,11 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Invoice;
namespace App\Http\Controllers\V1\Admin\Invoice;
use App\Http\Controllers\Controller;
use App\Http\Requests\SendInvoiceRequest;
use App\Models\Invoice;
use Illuminate\Mail\Markdown;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\SendInvoiceRequest;
use InvoiceShelf\Models\Invoice;
class SendInvoicePreviewController extends Controller
{

View File

@@ -1,14 +1,14 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Item;
namespace App\Http\Controllers\V1\Admin\Item;
use App\Http\Controllers\Controller;
use App\Http\Requests;
use App\Http\Requests\DeleteItemsRequest;
use App\Http\Resources\ItemResource;
use App\Models\Item;
use App\Models\TaxType;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests;
use InvoiceShelf\Http\Requests\DeleteItemsRequest;
use InvoiceShelf\Http\Resources\ItemResource;
use InvoiceShelf\Models\Item;
use InvoiceShelf\Models\TaxType;
class ItemsController extends Controller
{
@@ -40,7 +40,7 @@ class ItemsController extends Controller
/**
* Create Item.
*
* @param InvoiceShelf\Http\Requests\ItemsRequest $request
* @param App\Http\Requests\ItemsRequest $request
* @return \Illuminate\Http\JsonResponse
*/
public function store(Requests\ItemsRequest $request)
@@ -67,7 +67,7 @@ class ItemsController extends Controller
/**
* Update an existing Item.
*
* @param InvoiceShelf\Http\Requests\ItemsRequest $request
* @param App\Http\Requests\ItemsRequest $request
* @return \Illuminate\Http\JsonResponse
*/
public function update(Requests\ItemsRequest $request, Item $item)

View File

@@ -1,12 +1,12 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Item;
namespace App\Http\Controllers\V1\Admin\Item;
use App\Http\Controllers\Controller;
use App\Http\Requests\UnitRequest;
use App\Http\Resources\UnitResource;
use App\Models\Unit;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\UnitRequest;
use InvoiceShelf\Http\Resources\UnitResource;
use InvoiceShelf\Models\Unit;
class UnitsController extends Controller
{

View File

@@ -1,14 +1,14 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Mobile;
namespace App\Http\Controllers\V1\Admin\Mobile;
use App\Http\Controllers\Controller;
use App\Http\Requests\LoginRequest;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\ValidationException;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\LoginRequest;
use InvoiceShelf\Models\User;
class AuthController extends Controller
{

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Modules;
namespace App\Http\Controllers\V1\Admin\Modules;
use App\Http\Controllers\Controller;
use App\Space\ModuleInstaller;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Space\ModuleInstaller;
class ApiTokenController extends Controller
{

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Modules;
namespace App\Http\Controllers\V1\Admin\Modules;
use App\Http\Controllers\Controller;
use App\Space\ModuleInstaller;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Space\ModuleInstaller;
class CompleteModuleInstallationController extends Controller
{

View File

@@ -1,10 +1,10 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Modules;
namespace App\Http\Controllers\V1\Admin\Modules;
use App\Http\Controllers\Controller;
use App\Space\ModuleInstaller;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Space\ModuleInstaller;
class CopyModuleController extends Controller
{

View File

@@ -1,11 +1,11 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Modules;
namespace App\Http\Controllers\V1\Admin\Modules;
use App\Events\ModuleDisabledEvent;
use App\Http\Controllers\Controller;
use App\Models\Module as ModelsModule;
use Illuminate\Http\Request;
use InvoiceShelf\Events\ModuleDisabledEvent;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\Module as ModelsModule;
use Nwidart\Modules\Facades\Module;
class DisableModuleController extends Controller

Some files were not shown because too many files have changed in this diff Show More