115 Commits

Author SHA1 Message Date
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
Darko Gjorgjijoski
1e530e0387 Include lang directory in the dist build (#65)
* Include lang/ dir in the build

* Bump version
2024-05-04 15:27:40 +02:00
Darko Gjorgjijoski
fa777d673f Update release migration rollback to point to 1.2.0 2024-05-04 13:48:42 +02:00
Darko Gjorgjijoski
8570252db5 Add missing migration 2024-05-04 13:35:51 +02:00
Darko Gjorgjijoski
ecb029758b Add Libyan Dinar (LD) (#63)
* Add Libyan Dinar (LD)

* Fix code style
2024-05-04 12:06:07 +02:00
Timo
6ea112c04f fix EnvironmentManager updateEnv (#60)
* fix EnvironmentManager updateEnv

* fix EnvironmentManager encode method

* fix code style
2024-05-04 10:35:35 +02:00
Timo
2784318ebf Migrate polymorphic relationships (#58)
* add crater media model type migration

* migrate all morph type fields

* fix code style

* migrate custom_field_values
2024-04-21 00:03:34 +02:00
Darko Gjorgjijoski
bb580f4b88 Restore open-direction top in Account language picker
Follow up to #55
2024-04-20 23:26:10 +02:00
Timo
8c83df558c Add Company VAT-ID and Tax-ID (#54)
* add company vat_id & tax_id field

* add tax & vat id field in company settings

* fix vat & tax id validation

* add german vat & tax id translation

* add translations for pdf

* add vat_id and tax_id field before timestamps

* make fields nullable and fix code style
2024-04-20 23:08:32 +02:00
Timo
dc8a85538f Support S3 compatible storage services (#56)
* add s3compat filesystem driver

* add s3compat ui modal

* fix code style
2024-04-16 17:24:56 +02:00
Darko Gjorgjijoski
093b2acc24 Merge branch 'master' of github.com:InvoiceShelf/InvoiceShelf 2024-04-16 03:02:27 +02:00
Timo
df85fd6a0a Fix base multi select open direction top (#55) 2024-04-16 03:01:53 +02:00
Darko Gjorgjijoski
db4396f160 Remove duplicate noLabel in dialog store 2024-04-16 03:01:14 +02:00
Darko Gjorgjijoski
1831560a62 Fix language switching. It now switches instantly 2024-04-16 02:58:44 +02:00
mchev
223678e5bd Fix locales issue #43 (#46)
* Fix locales issue #43

* Adding open-direction bottom to the language multiselect
2024-03-27 11:00:36 +01:00
Darko Gjorgjijoski
9bb4963e8a Fixes/backup issues (#51)
* Fix: Error related to undefined Backup::size()

* Fix: Disable signals if PCNTL isn't loaded to avoid fatal error (Fixes SIGINT is not defined on environments that are missing the PCNTL library)
2024-03-27 01:15:49 +01:00
Darko Gjorgjijoski
8788f3d504 Tax calculation issue (#38)
* fix initial tax per item issue

* remove commit in estimate storage

* add changes in tax per item calculation

* add validation on requests

* fix minimum total issue

* fix table pagination filter issue

* minor fix

* remove compound interest and remove unused code

---------

Co-authored-by: yashkanakiya <yashkanakiya281297@gmail.com>
Co-authored-by: dhruvbhattt <dhruvbhatt7790@gmail.com>
Co-authored-by: gdarko <dg@darkog.com>
2024-02-18 10:54:12 +01:00
Darko Gjorgjijoski
0d006846d5 Merge pull request #37 from InvoiceShelf/bouncer-hotfix
Bouncer hotfix
2024-02-18 01:25:47 +01:00
gdarko
d2559c8773 Fix formatting 2024-02-18 00:49:15 +01:00
Darko Gjorgjijoski
20a489e52d Merge pull request #35 from dariuszz123/bugfix/missing-access-token-table-column
Added expires_at column to personal_access_tokens table
2024-02-18 00:27:13 +01:00
gdarko
e73ab3d4ee Override the default bouncer scope class with a temporary hotfix to the roles issue 2024-02-18 00:13:42 +01:00
gdarko
1c7274287d Lock silber/bouncer to 1.0.1 for now 2024-02-18 00:12:33 +01:00
Darius Kristapavicius
5ba8639ac8 Added expires_at column to personal_access_tokens table 2024-02-17 23:51:21 +02:00
863 changed files with 17357 additions and 11114 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
@@ -28,13 +42,15 @@ MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=
MAIL_FROM_NAME=
MAIL_FROM_ADDRESS=
PUSHER_APP_ID=
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

@@ -12,6 +12,8 @@ on:
- '**/*.md'
- 'public/build/*.js'
- 'public/build/**/*.js'
branches-ignore:
- 'l10n_master2'
# Allow manually triggering the workflow.
workflow_dispatch:

3
.gitignore vendored
View File

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

View File

@@ -25,17 +25,19 @@ dist-gen: clean composer npm-build
@cp -r public/robots.txt InvoiceShelf/public
@cp -r public/web.config InvoiceShelf/public
@cp -r resources InvoiceShelf
@cp -r lang InvoiceShelf
@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

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Bouncer\Scopes;
use Silber\Bouncer\Database\Scope\Scope;
class DefaultScope extends Scope
{
public function applyToModelQuery($query, $table = null)
{
if (is_null($this->scope) || $this->onlyScopeRelations) {
return $query;
}
if (is_null($table)) {
$table = $query->getModel()->getTable();
}
return $this->applyToQuery($query, $table);
}
public function applyToRelationQuery($query, $table)
{
if (is_null($this->scope)) {
return $query;
}
return $this->applyToQuery($query, $table);
}
protected function applyToQuery($query, $table)
{
return $query->where(function ($query) use ($table) {
$query->where("{$table}.scope", $this->scope)
->orWhereNull("{$table}.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,6 +1,6 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
@@ -33,10 +33,8 @@ 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');

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,6 +1,6 @@
<?php
namespace InvoiceShelf\Console\Commands;
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Console\ConfirmableTrait;
@@ -39,7 +39,7 @@ class ResetApp extends Command
*
* @return mixed
*/
public function handle()
public function handle(): void
{
if (! $this->confirmToProceed()) {
return;

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;
@@ -36,7 +36,7 @@ class BackupsController extends ApiController
return [
'path' => $backup->path(),
'created_at' => $backup->date()->format('Y-m-d H:i:s'),
'size' => Format::humanReadableSize($backup->size()),
'size' => Format::humanReadableSize($backup->sizeInBytes()),
];
})
->toArray();

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;
@@ -41,7 +41,7 @@ class DownloadBackupController extends ApiController
$downloadHeaders = [
'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0',
'Content-Type' => 'application/zip',
'Content-Length' => $backup->size(),
'Content-Length' => $backup->sizeInBytes(),
'Content-Disposition' => 'attachment; filename="'.$fileName.'"',
'Pragma' => 'public',
];

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,10 +35,10 @@ 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');
}

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 EstimateTemplatesController extends Controller
{

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
{

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

@@ -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
@@ -37,10 +37,10 @@ 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');
}

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 InvoiceTemplatesController 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\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

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 DownloadModuleController 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\ModuleEnabledEvent;
use App\Http\Controllers\Controller;
use App\Models\Module as ModelsModule;
use Illuminate\Http\Request;
use InvoiceShelf\Events\ModuleEnabledEvent;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Models\Module as ModelsModule;
use Nwidart\Modules\Facades\Module;
class EnableModuleController 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\Http\Controllers\Controller;
use App\Http\Resources\ModuleResource;
use App\Space\ModuleInstaller;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Resources\ModuleResource;
use InvoiceShelf\Space\ModuleInstaller;
class ModuleController 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 ModulesController extends Controller
{

View File

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

View File

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

View File

@@ -1,12 +1,12 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Payment;
namespace App\Http\Controllers\V1\Admin\Payment;
use App\Http\Controllers\Controller;
use App\Http\Requests\PaymentMethodRequest;
use App\Http\Resources\PaymentMethodResource;
use App\Models\PaymentMethod;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\PaymentMethodRequest;
use InvoiceShelf\Http\Resources\PaymentMethodResource;
use InvoiceShelf\Models\PaymentMethod;
class PaymentMethodsController extends Controller
{

View File

@@ -1,13 +1,13 @@
<?php
namespace InvoiceShelf\Http\Controllers\V1\Admin\Payment;
namespace App\Http\Controllers\V1\Admin\Payment;
use App\Http\Controllers\Controller;
use App\Http\Requests\DeletePaymentsRequest;
use App\Http\Requests\PaymentRequest;
use App\Http\Resources\PaymentResource;
use App\Models\Payment;
use Illuminate\Http\Request;
use InvoiceShelf\Http\Controllers\Controller;
use InvoiceShelf\Http\Requests\DeletePaymentsRequest;
use InvoiceShelf\Http\Requests\PaymentRequest;
use InvoiceShelf\Http\Resources\PaymentResource;
use InvoiceShelf\Models\Payment;
class PaymentsController extends Controller
{

View File

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

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