From f37e711baabde9b5552d83ef3f102780a8e4f0e5 Mon Sep 17 00:00:00 2001 From: batuhanbas Date: Wed, 4 Mar 2020 12:28:24 +0300 Subject: [PATCH 01/65] attchment updated for revenue/payment --- resources/views/purchases/payments/edit.blade.php | 7 ++++++- resources/views/sales/revenues/edit.blade.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/views/purchases/payments/edit.blade.php b/resources/views/purchases/payments/edit.blade.php index 2f96ce145..c92e93fb6 100644 --- a/resources/views/purchases/payments/edit.blade.php +++ b/resources/views/purchases/payments/edit.blade.php @@ -57,7 +57,12 @@ {{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }} - {{ Form::fileGroup('attachment', trans('general.attachment')) }} +
+ @if($payment->attachment) + @php $file = $payment->attachment; @endphp + @include('partials.media.file') + @endif +
@if ($payment->bill) {{ Form::textGroup('document', trans_choice('general.bills', 1), 'file-invoice', ['disabled' => 'disabled'], $payment->bill->bill_number) }} diff --git a/resources/views/sales/revenues/edit.blade.php b/resources/views/sales/revenues/edit.blade.php index 0b2889c47..25abb483d 100644 --- a/resources/views/sales/revenues/edit.blade.php +++ b/resources/views/sales/revenues/edit.blade.php @@ -57,7 +57,12 @@ {{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }} - {{ Form::fileGroup('attachment', trans('general.attachment')) }} +
+ @if($revenue->attachment) + @php $file = $revenue->attachment; @endphp + @include('partials.media.file') + @endif +
@if ($revenue->invoice) {{ Form::textGroup('document', trans_choice('general.invoices', 1), 'file-invoice', ['disabled' => 'disabled'], $revenue->invoice->invoice_number) }} From 018eef5be9af964c6d3c4dc75c7547da37c249b9 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Wed, 4 Mar 2020 13:40:25 +0300 Subject: [PATCH 02/65] interval must be at least 1 --- app/Traits/Recurring.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Traits/Recurring.php b/app/Traits/Recurring.php index 2a71f4195..bbbe671b5 100644 --- a/app/Traits/Recurring.php +++ b/app/Traits/Recurring.php @@ -17,7 +17,7 @@ trait Recurring } $frequency = ($request['recurring_frequency'] != 'custom') ? $request['recurring_frequency'] : $request['recurring_custom_frequency']; - $interval = ($request['recurring_frequency'] != 'custom') ? 1 : (int) $request['recurring_interval']; + $interval = (($request['recurring_frequency'] != 'custom') || ($request['recurring_interval'] < 1)) ? 1 : (int) $request['recurring_interval']; $started_at = $request->get('paid_at') ?: ($request->get('invoiced_at') ?: $request->get('billed_at')); $this->recurring()->create([ @@ -39,7 +39,7 @@ trait Recurring } $frequency = ($request['recurring_frequency'] != 'custom') ? $request['recurring_frequency'] : $request['recurring_custom_frequency']; - $interval = ($request['recurring_frequency'] != 'custom') ? 1 : (int) $request['recurring_interval']; + $interval = (($request['recurring_frequency'] != 'custom') || ($request['recurring_interval'] < 1)) ? 1 : (int) $request['recurring_interval']; $started_at = $request->get('paid_at') ?: ($request->get('invoiced_at') ?: $request->get('billed_at')); $recurring = $this->recurring(); From 2dd57c508442013902fd6cff0d2b88204d6ebb40 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Wed, 4 Mar 2020 13:55:00 +0300 Subject: [PATCH 03/65] fixed upload files --- resources/views/purchases/payments/edit.blade.php | 10 ++++++---- resources/views/sales/revenues/edit.blade.php | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/resources/views/purchases/payments/edit.blade.php b/resources/views/purchases/payments/edit.blade.php index c92e93fb6..46e50e34c 100644 --- a/resources/views/purchases/payments/edit.blade.php +++ b/resources/views/purchases/payments/edit.blade.php @@ -57,12 +57,14 @@ {{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }} -
- @if($payment->attachment) + @if ($payment->attachment) +
@php $file = $payment->attachment; @endphp @include('partials.media.file') - @endif -
+
+ @else + {{ Form::fileGroup('attachment', trans('general.attachment')) }} + @endif @if ($payment->bill) {{ Form::textGroup('document', trans_choice('general.bills', 1), 'file-invoice', ['disabled' => 'disabled'], $payment->bill->bill_number) }} diff --git a/resources/views/sales/revenues/edit.blade.php b/resources/views/sales/revenues/edit.blade.php index 25abb483d..4fde29250 100644 --- a/resources/views/sales/revenues/edit.blade.php +++ b/resources/views/sales/revenues/edit.blade.php @@ -57,12 +57,14 @@ {{ Form::textGroup('reference', trans('general.reference'), 'file',[]) }} -
- @if($revenue->attachment) + @if ($revenue->attachment) +
@php $file = $revenue->attachment; @endphp @include('partials.media.file') - @endif -
+
+ @else + {{ Form::fileGroup('attachment', trans('general.attachment')) }} + @endif @if ($revenue->invoice) {{ Form::textGroup('document', trans_choice('general.invoices', 1), 'file-invoice', ['disabled' => 'disabled'], $revenue->invoice->invoice_number) }} From 0cac208ee124a5cab2bcf55b436ef4324ee216e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 4 Mar 2020 14:23:14 +0300 Subject: [PATCH 04/65] update composer.lock file --- composer.lock | 374 +++++++++++++++++++++++++------------------------- 1 file changed, 187 insertions(+), 187 deletions(-) diff --git a/composer.lock b/composer.lock index d531cb2ef..1209bd6e3 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "akaunting/firewall", - "version": "1.2.7", + "version": "1.2.8", "source": { "type": "git", "url": "https://github.com/akaunting/firewall.git", - "reference": "645e06c886f6c8c5afc3c31a81d6f8ea41170e01" + "reference": "3ab35b816a3aa6ee60c630c2ba53563ff5bd3c7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/akaunting/firewall/zipball/645e06c886f6c8c5afc3c31a81d6f8ea41170e01", - "reference": "645e06c886f6c8c5afc3c31a81d6f8ea41170e01", + "url": "https://api.github.com/repos/akaunting/firewall/zipball/3ab35b816a3aa6ee60c630c2ba53563ff5bd3c7e", + "reference": "3ab35b816a3aa6ee60c630c2ba53563ff5bd3c7e", "shasum": "" }, "require": { @@ -67,7 +67,7 @@ "waf", "xss" ], - "time": "2020-01-30T22:24:37+00:00" + "time": "2020-02-24T22:27:02+00:00" }, { "name": "akaunting/language", @@ -485,26 +485,26 @@ }, { "name": "barryvdh/laravel-debugbar", - "version": "v3.2.8", + "version": "v3.2.9", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-debugbar.git", - "reference": "18208d64897ab732f6c04a19b319fe8f1d57a9c0" + "reference": "42d5da5379a7860093f8e4032167e4cb5ebec180" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/18208d64897ab732f6c04a19b319fe8f1d57a9c0", - "reference": "18208d64897ab732f6c04a19b319fe8f1d57a9c0", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/42d5da5379a7860093f8e4032167e4cb5ebec180", + "reference": "42d5da5379a7860093f8e4032167e4cb5ebec180", "shasum": "" }, "require": { - "illuminate/routing": "^5.5|^6", - "illuminate/session": "^5.5|^6", - "illuminate/support": "^5.5|^6", - "maximebf/debugbar": "~1.15.0", + "illuminate/routing": "^5.5|^6|^7", + "illuminate/session": "^5.5|^6|^7", + "illuminate/support": "^5.5|^6|^7", + "maximebf/debugbar": "^1.15.1", "php": ">=7.0", - "symfony/debug": "^3|^4", - "symfony/finder": "^3|^4" + "symfony/debug": "^3|^4|^5", + "symfony/finder": "^3|^4|^5" }, "require-dev": { "laravel/framework": "5.5.x" @@ -549,25 +549,25 @@ "profiler", "webprofiler" ], - "time": "2019-08-29T07:01:03+00:00" + "time": "2020-02-25T20:42:23+00:00" }, { "name": "barryvdh/laravel-dompdf", - "version": "v0.8.5", + "version": "v0.8.6", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-dompdf.git", - "reference": "7393732b2f3a3ee357974cbb0c46c9b65b84dad1" + "reference": "d7108f78cf5254a2d8c224542967f133e5a6d4e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/7393732b2f3a3ee357974cbb0c46c9b65b84dad1", - "reference": "7393732b2f3a3ee357974cbb0c46c9b65b84dad1", + "url": "https://api.github.com/repos/barryvdh/laravel-dompdf/zipball/d7108f78cf5254a2d8c224542967f133e5a6d4e8", + "reference": "d7108f78cf5254a2d8c224542967f133e5a6d4e8", "shasum": "" }, "require": { "dompdf/dompdf": "^0.8", - "illuminate/support": "^5.5|^6", + "illuminate/support": "^5.5|^6|^7", "php": ">=7" }, "type": "library", @@ -605,37 +605,37 @@ "laravel", "pdf" ], - "time": "2019-08-23T14:30:33+00:00" + "time": "2020-02-25T20:44:34+00:00" }, { "name": "barryvdh/laravel-ide-helper", - "version": "v2.6.6", + "version": "v2.6.7", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "b91b959364d97af658f268c733c75dccdbff197e" + "reference": "edd69c5e0508972c81f1f7173236de2459c45814" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/b91b959364d97af658f268c733c75dccdbff197e", - "reference": "b91b959364d97af658f268c733c75dccdbff197e", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/edd69c5e0508972c81f1f7173236de2459c45814", + "reference": "edd69c5e0508972c81f1f7173236de2459c45814", "shasum": "" }, "require": { "barryvdh/reflection-docblock": "^2.0.6", "composer/composer": "^1.6", "doctrine/dbal": "~2.3", - "illuminate/console": "^5.5|^6", - "illuminate/filesystem": "^5.5|^6", - "illuminate/support": "^5.5|^6", - "php": ">=7" + "illuminate/console": "^5.5|^6|^7", + "illuminate/filesystem": "^5.5|^6|^7", + "illuminate/support": "^5.5|^6|^7", + "php": ">=7.2" }, "require-dev": { - "illuminate/config": "^5.5|^6", - "illuminate/view": "^5.5|^6", - "phpro/grumphp": "^0.14", - "phpunit/phpunit": "4.*", - "scrutinizer/ocular": "~1.1", + "illuminate/config": "^5.5|^6|^7", + "illuminate/view": "^5.5|^6|^7", + "mockery/mockery": "^1.3", + "orchestra/testbench": "^3|^4", + "phpro/grumphp": "^0.17.1", "squizlabs/php_codesniffer": "^3" }, "type": "library", @@ -676,7 +676,7 @@ "phpstorm", "sublime" ], - "time": "2019-10-30T20:53:27+00:00" + "time": "2020-02-25T20:41:32+00:00" }, { "name": "barryvdh/reflection-docblock", @@ -1041,16 +1041,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "cbe23383749496fe0f373345208b79568e4bc248" + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/cbe23383749496fe0f373345208b79568e4bc248", - "reference": "cbe23383749496fe0f373345208b79568e4bc248", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/1ab9842d69e64fb3a01be6b656501032d1b78cb7", + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7", "shasum": "" }, "require": { @@ -1081,26 +1081,26 @@ "Xdebug", "performance" ], - "time": "2019-11-06T16:40:04+00:00" + "time": "2020-03-01T12:26:26+00:00" }, { "name": "consoletvs/charts", - "version": "6.5.3", + "version": "6.5.4", "source": { "type": "git", "url": "https://github.com/ConsoleTVs/Charts.git", - "reference": "a4a8a71c438a00b95ea74a080ce5bf8916c60918" + "reference": "524257b5d525666385bd2e91b06e376994a7b683" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ConsoleTVs/Charts/zipball/a4a8a71c438a00b95ea74a080ce5bf8916c60918", - "reference": "a4a8a71c438a00b95ea74a080ce5bf8916c60918", + "url": "https://api.github.com/repos/ConsoleTVs/Charts/zipball/524257b5d525666385bd2e91b06e376994a7b683", + "reference": "524257b5d525666385bd2e91b06e376994a7b683", "shasum": "" }, "require": { "balping/json-raw-encoder": "^1.0", - "illuminate/console": "^5.0|^6.0", - "illuminate/support": "^5.0|^6.0", + "illuminate/console": "^5.0|^6.0|^7.0", + "illuminate/support": "^5.0|^6.0|^7.0", "php": ">=7.0" }, "type": "library", @@ -1127,7 +1127,7 @@ } ], "description": "The laravel charting package", - "time": "2019-09-03T16:50:50+00:00" + "time": "2020-03-03T23:16:14+00:00" }, { "name": "consoletvs/identify", @@ -2551,16 +2551,16 @@ }, { "name": "jaybizzle/crawler-detect", - "version": "v1.2.93", + "version": "v1.2.94", "source": { "type": "git", "url": "https://github.com/JayBizzle/Crawler-Detect.git", - "reference": "608ec84bdf85fa8200c0f36f455483698b450ecd" + "reference": "fbd4c12741583fb9d8f0bcbf65248a34eed68fc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/608ec84bdf85fa8200c0f36f455483698b450ecd", - "reference": "608ec84bdf85fa8200c0f36f455483698b450ecd", + "url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/fbd4c12741583fb9d8f0bcbf65248a34eed68fc9", + "reference": "fbd4c12741583fb9d8f0bcbf65248a34eed68fc9", "shasum": "" }, "require": { @@ -2596,7 +2596,7 @@ "crawlerdetect", "php crawler detect" ], - "time": "2020-02-16T12:34:48+00:00" + "time": "2020-02-20T21:42:59+00:00" }, { "name": "jenssegers/agent", @@ -2845,16 +2845,16 @@ }, { "name": "kyslik/column-sortable", - "version": "6.2.0", + "version": "6.2.1", "source": { "type": "git", "url": "https://github.com/Kyslik/column-sortable.git", - "reference": "4b628bffdb1724284dd0ae091262d24790225768" + "reference": "2fecd327c29ae925bf951f787a41e4e7ca315446" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Kyslik/column-sortable/zipball/4b628bffdb1724284dd0ae091262d24790225768", - "reference": "4b628bffdb1724284dd0ae091262d24790225768", + "url": "https://api.github.com/repos/Kyslik/column-sortable/zipball/2fecd327c29ae925bf951f787a41e4e7ca315446", + "reference": "2fecd327c29ae925bf951f787a41e4e7ca315446", "shasum": "" }, "require": { @@ -2898,7 +2898,7 @@ "sortable", "sorting" ], - "time": "2019-10-14T19:39:29+00:00" + "time": "2020-03-01T20:53:06+00:00" }, { "name": "laracasts/flash", @@ -2956,16 +2956,16 @@ }, { "name": "laravel/framework", - "version": "v6.16.0", + "version": "v6.18.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "b47217e41868d3049ec545cbb713aa94c6f39e55" + "reference": "077b895d935b7fbcfb1d1eb34217fa4f80a130d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/b47217e41868d3049ec545cbb713aa94c6f39e55", - "reference": "b47217e41868d3049ec545cbb713aa94c6f39e55", + "url": "https://api.github.com/repos/laravel/framework/zipball/077b895d935b7fbcfb1d1eb34217fa4f80a130d8", + "reference": "077b895d935b7fbcfb1d1eb34217fa4f80a130d8", "shasum": "" }, "require": { @@ -3098,7 +3098,7 @@ "framework", "laravel" ], - "time": "2020-02-18T15:17:52+00:00" + "time": "2020-03-03T13:14:27+00:00" }, { "name": "laravel/tinker", @@ -3233,16 +3233,16 @@ }, { "name": "league/commonmark", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "4f30be7a2cbf3bfa5788abab71384713e48f451f" + "reference": "8015f806173c6ee54de25a87c2d69736696e88db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/4f30be7a2cbf3bfa5788abab71384713e48f451f", - "reference": "4f30be7a2cbf3bfa5788abab71384713e48f451f", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/8015f806173c6ee54de25a87c2d69736696e88db", + "reference": "8015f806173c6ee54de25a87c2d69736696e88db", "shasum": "" }, "require": { @@ -3303,7 +3303,7 @@ "md", "parser" ], - "time": "2020-02-08T23:42:03+00:00" + "time": "2020-02-28T18:53:50+00:00" }, { "name": "league/flysystem", @@ -3455,23 +3455,23 @@ }, { "name": "lorisleiva/laravel-search-string", - "version": "v0.1.4", + "version": "v0.1.5", "source": { "type": "git", "url": "https://github.com/lorisleiva/laravel-search-string.git", - "reference": "669cc42ca23756bebbfcd3bb610c3c332e511227" + "reference": "5fd936cb2dd9e604a5786cfbacf0e1e0eb538e8f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lorisleiva/laravel-search-string/zipball/669cc42ca23756bebbfcd3bb610c3c332e511227", - "reference": "669cc42ca23756bebbfcd3bb610c3c332e511227", + "url": "https://api.github.com/repos/lorisleiva/laravel-search-string/zipball/5fd936cb2dd9e604a5786cfbacf0e1e0eb538e8f", + "reference": "5fd936cb2dd9e604a5786cfbacf0e1e0eb538e8f", "shasum": "" }, "require": { - "illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*|^6.0" + "illuminate/support": "^5.5|^6.0|^7.0" }, "require-dev": { - "orchestra/testbench": "3.8.*|^4.0" + "orchestra/testbench": "^5.0" }, "type": "library", "extra": { @@ -3497,25 +3497,25 @@ } ], "description": "Generates database queries based on one unique string using a simple and customizable syntax.", - "time": "2019-09-11T09:02:26+00:00" + "time": "2020-03-01T14:09:46+00:00" }, { "name": "maatwebsite/excel", - "version": "3.1.18", + "version": "3.1.19", "source": { "type": "git", "url": "https://github.com/Maatwebsite/Laravel-Excel.git", - "reference": "d0231ab1f4bb93c8695630cb445ada1fdc54add0" + "reference": "96527a9ebc2e79e9a5fa7eaef7e23c9e9bcc587c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/d0231ab1f4bb93c8695630cb445ada1fdc54add0", - "reference": "d0231ab1f4bb93c8695630cb445ada1fdc54add0", + "url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/96527a9ebc2e79e9a5fa7eaef7e23c9e9bcc587c", + "reference": "96527a9ebc2e79e9a5fa7eaef7e23c9e9bcc587c", "shasum": "" }, "require": { "ext-json": "*", - "illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*|^6.0", + "illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0", "php": "^7.0", "phpoffice/phpspreadsheet": "^1.10" }, @@ -3564,7 +3564,7 @@ "php", "phpspreadsheet" ], - "time": "2019-12-24T10:40:12+00:00" + "time": "2020-02-28T15:47:45+00:00" }, { "name": "markbaker/complex", @@ -3732,22 +3732,22 @@ }, { "name": "maximebf/debugbar", - "version": "v1.15.1", + "version": "v1.16.1", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "6c4277f6117e4864966c9cb58fb835cee8c74a1e" + "reference": "58998b818c6567fac01e35b8a4b70c1a64530556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/6c4277f6117e4864966c9cb58fb835cee8c74a1e", - "reference": "6c4277f6117e4864966c9cb58fb835cee8c74a1e", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/58998b818c6567fac01e35b8a4b70c1a64530556", + "reference": "58998b818c6567fac01e35b8a4b70c1a64530556", "shasum": "" }, "require": { - "php": ">=5.6", + "php": "^7.1", "psr/log": "^1.0", - "symfony/var-dumper": "^2.6|^3|^4" + "symfony/var-dumper": "^2.6|^3|^4|^5" }, "require-dev": { "phpunit/phpunit": "^5" @@ -3760,7 +3760,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.16-dev" } }, "autoload": { @@ -3789,7 +3789,7 @@ "debug", "debugbar" ], - "time": "2019-09-24T14:55:42+00:00" + "time": "2019-11-24T09:46:11+00:00" }, { "name": "misterphilip/maintenance-mode", @@ -4036,16 +4036,16 @@ }, { "name": "nesbot/carbon", - "version": "2.30.0", + "version": "2.31.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "912dff66d2690ca66abddb9b291a1df5f371d3b4" + "reference": "bbc0ab53f41a4c6f223c18efcdbd9bc725eb5d2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/912dff66d2690ca66abddb9b291a1df5f371d3b4", - "reference": "912dff66d2690ca66abddb9b291a1df5f371d3b4", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bbc0ab53f41a4c6f223c18efcdbd9bc725eb5d2d", + "reference": "bbc0ab53f41a4c6f223c18efcdbd9bc725eb5d2d", "shasum": "" }, "require": { @@ -4102,7 +4102,7 @@ "datetime", "time" ], - "time": "2020-02-07T15:25:46+00:00" + "time": "2020-03-01T11:11:58+00:00" }, { "name": "nikic/php-parser", @@ -4445,26 +4445,25 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", "shasum": "" }, "require": { - "php": "^7.1", + "php": "^7.2", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "^7.1", - "mockery/mockery": "~1", - "phpunit/phpunit": "^7.0" + "ext-tokenizer": "^7.2", + "mockery/mockery": "~1" }, "type": "library", "extra": { @@ -4488,20 +4487,20 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2019-08-22T18:11:29+00:00" + "time": "2020-02-18T18:59:58+00:00" }, { "name": "phpoffice/phpspreadsheet", - "version": "1.10.1", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git", - "reference": "1648dc9ebef6ebe0c5a172e16cf66732918416e0" + "reference": "c2a205e82f9cf1cc9fab86b79e808d86dd680470" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/1648dc9ebef6ebe0c5a172e16cf66732918416e0", - "reference": "1648dc9ebef6ebe0c5a172e16cf66732918416e0", + "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/c2a205e82f9cf1cc9fab86b79e808d86dd680470", + "reference": "c2a205e82f9cf1cc9fab86b79e808d86dd680470", "shasum": "" }, "require": { @@ -4581,7 +4580,7 @@ "xls", "xlsx" ], - "time": "2019-12-01T23:13:51+00:00" + "time": "2020-03-02T13:09:03+00:00" }, { "name": "phpoption/phpoption", @@ -5566,16 +5565,16 @@ }, { "name": "symfony/console", - "version": "v4.4.4", + "version": "v4.4.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f512001679f37e6a042b51897ed24a2f05eba656" + "reference": "4fa15ae7be74e53f6ec8c83ed403b97e23b665e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f512001679f37e6a042b51897ed24a2f05eba656", - "reference": "f512001679f37e6a042b51897ed24a2f05eba656", + "url": "https://api.github.com/repos/symfony/console/zipball/4fa15ae7be74e53f6ec8c83ed403b97e23b665e9", + "reference": "4fa15ae7be74e53f6ec8c83ed403b97e23b665e9", "shasum": "" }, "require": { @@ -5638,20 +5637,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2020-01-25T12:44:29+00:00" + "time": "2020-02-24T13:10:00+00:00" }, { "name": "symfony/css-selector", - "version": "v5.0.4", + "version": "v5.0.5", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "ff60c90cb7950b592ebc84ad1289d0345bf24f9f" + "reference": "a0b51ba9938ccc206d9284de7eb527c2d4550b44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/ff60c90cb7950b592ebc84ad1289d0345bf24f9f", - "reference": "ff60c90cb7950b592ebc84ad1289d0345bf24f9f", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/a0b51ba9938ccc206d9284de7eb527c2d4550b44", + "reference": "a0b51ba9938ccc206d9284de7eb527c2d4550b44", "shasum": "" }, "require": { @@ -5691,20 +5690,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2020-01-04T14:08:26+00:00" + "time": "2020-02-04T09:41:09+00:00" }, { "name": "symfony/debug", - "version": "v4.4.4", + "version": "v4.4.5", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "20236471058bbaa9907382500fc14005c84601f0" + "reference": "a980d87a659648980d89193fd8b7a7ca89d97d21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/20236471058bbaa9907382500fc14005c84601f0", - "reference": "20236471058bbaa9907382500fc14005c84601f0", + "url": "https://api.github.com/repos/symfony/debug/zipball/a980d87a659648980d89193fd8b7a7ca89d97d21", + "reference": "a980d87a659648980d89193fd8b7a7ca89d97d21", "shasum": "" }, "require": { @@ -5747,26 +5746,26 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2020-01-25T12:44:29+00:00" + "time": "2020-02-23T14:41:43+00:00" }, { "name": "symfony/error-handler", - "version": "v4.4.4", + "version": "v4.4.5", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "d2721499ffcaf246a743e01cdf6696d3d5dd74c1" + "reference": "89aa4b9ac6f1f35171b8621b24f60477312085be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/d2721499ffcaf246a743e01cdf6696d3d5dd74c1", - "reference": "d2721499ffcaf246a743e01cdf6696d3d5dd74c1", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/89aa4b9ac6f1f35171b8621b24f60477312085be", + "reference": "89aa4b9ac6f1f35171b8621b24f60477312085be", "shasum": "" }, "require": { "php": "^7.1.3", "psr/log": "~1.0", - "symfony/debug": "^4.4", + "symfony/debug": "^4.4.5", "symfony/var-dumper": "^4.4|^5.0" }, "require-dev": { @@ -5803,20 +5802,20 @@ ], "description": "Symfony ErrorHandler Component", "homepage": "https://symfony.com", - "time": "2020-01-27T09:48:47+00:00" + "time": "2020-02-26T11:45:31+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.4.4", + "version": "v4.4.5", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "9e3de195e5bc301704dd6915df55892f6dfc208b" + "reference": "4ad8e149799d3128621a3a1f70e92b9897a8930d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9e3de195e5bc301704dd6915df55892f6dfc208b", - "reference": "9e3de195e5bc301704dd6915df55892f6dfc208b", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4ad8e149799d3128621a3a1f70e92b9897a8930d", + "reference": "4ad8e149799d3128621a3a1f70e92b9897a8930d", "shasum": "" }, "require": { @@ -5873,7 +5872,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2020-01-10T21:54:01+00:00" + "time": "2020-02-04T09:32:40+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -5935,7 +5934,7 @@ }, { "name": "symfony/filesystem", - "version": "v4.4.4", + "version": "v4.4.5", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -5985,16 +5984,16 @@ }, { "name": "symfony/finder", - "version": "v4.4.4", + "version": "v4.4.5", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "3a50be43515590faf812fbd7708200aabc327ec3" + "reference": "ea69c129aed9fdeca781d4b77eb20b62cf5d5357" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3a50be43515590faf812fbd7708200aabc327ec3", - "reference": "3a50be43515590faf812fbd7708200aabc327ec3", + "url": "https://api.github.com/repos/symfony/finder/zipball/ea69c129aed9fdeca781d4b77eb20b62cf5d5357", + "reference": "ea69c129aed9fdeca781d4b77eb20b62cf5d5357", "shasum": "" }, "require": { @@ -6030,20 +6029,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2020-01-04T13:00:46+00:00" + "time": "2020-02-14T07:42:58+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.4.4", + "version": "v4.4.5", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "491a20dfa87e0b3990170593bc2de0bb34d828a5" + "reference": "7e41b4fcad4619535f45f8bfa7744c4f384e1648" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/491a20dfa87e0b3990170593bc2de0bb34d828a5", - "reference": "491a20dfa87e0b3990170593bc2de0bb34d828a5", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/7e41b4fcad4619535f45f8bfa7744c4f384e1648", + "reference": "7e41b4fcad4619535f45f8bfa7744c4f384e1648", "shasum": "" }, "require": { @@ -6085,20 +6084,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2020-01-31T09:11:17+00:00" + "time": "2020-02-13T19:40:01+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.4.4", + "version": "v4.4.5", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "62116a9c8fb15faabb158ad9cb785c353c2572e5" + "reference": "8c8734486dada83a6041ab744709bdc1651a8462" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/62116a9c8fb15faabb158ad9cb785c353c2572e5", - "reference": "62116a9c8fb15faabb158ad9cb785c353c2572e5", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8c8734486dada83a6041ab744709bdc1651a8462", + "reference": "8c8734486dada83a6041ab744709bdc1651a8462", "shasum": "" }, "require": { @@ -6175,20 +6174,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2020-01-31T12:45:06+00:00" + "time": "2020-02-29T10:31:38+00:00" }, { "name": "symfony/mime", - "version": "v5.0.4", + "version": "v5.0.5", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "2a3c7fee1f1a0961fa9cf360d5da553d05095e59" + "reference": "9b3e5b5e58c56bbd76628c952d2b78556d305f3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/2a3c7fee1f1a0961fa9cf360d5da553d05095e59", - "reference": "2a3c7fee1f1a0961fa9cf360d5da553d05095e59", + "url": "https://api.github.com/repos/symfony/mime/zipball/9b3e5b5e58c56bbd76628c952d2b78556d305f3c", + "reference": "9b3e5b5e58c56bbd76628c952d2b78556d305f3c", "shasum": "" }, "require": { @@ -6237,7 +6236,7 @@ "mime", "mime-type" ], - "time": "2020-01-04T14:08:26+00:00" + "time": "2020-02-04T09:41:09+00:00" }, { "name": "symfony/polyfill-ctype", @@ -6592,16 +6591,16 @@ }, { "name": "symfony/process", - "version": "v4.4.4", + "version": "v4.4.5", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "f5697ab4cb14a5deed7473819e63141bf5352c36" + "reference": "bf9166bac906c9e69fb7a11d94875e7ced97bcd7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/f5697ab4cb14a5deed7473819e63141bf5352c36", - "reference": "f5697ab4cb14a5deed7473819e63141bf5352c36", + "url": "https://api.github.com/repos/symfony/process/zipball/bf9166bac906c9e69fb7a11d94875e7ced97bcd7", + "reference": "bf9166bac906c9e69fb7a11d94875e7ced97bcd7", "shasum": "" }, "require": { @@ -6637,20 +6636,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2020-01-09T09:50:08+00:00" + "time": "2020-02-07T20:06:44+00:00" }, { "name": "symfony/routing", - "version": "v4.4.4", + "version": "v4.4.5", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "7bf4e38573728e317b926ca4482ad30470d0e86a" + "reference": "4124d621d0e445732520037f888a0456951bde8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/7bf4e38573728e317b926ca4482ad30470d0e86a", - "reference": "7bf4e38573728e317b926ca4482ad30470d0e86a", + "url": "https://api.github.com/repos/symfony/routing/zipball/4124d621d0e445732520037f888a0456951bde8c", + "reference": "4124d621d0e445732520037f888a0456951bde8c", "shasum": "" }, "require": { @@ -6713,7 +6712,7 @@ "uri", "url" ], - "time": "2020-01-08T17:29:02+00:00" + "time": "2020-02-25T12:41:09+00:00" }, { "name": "symfony/service-contracts", @@ -6775,16 +6774,16 @@ }, { "name": "symfony/translation", - "version": "v4.4.4", + "version": "v4.4.5", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "f5d2ac46930238b30a9c2f1b17c905f3697d808c" + "reference": "0a19a77fba20818a969ef03fdaf1602de0546353" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/f5d2ac46930238b30a9c2f1b17c905f3697d808c", - "reference": "f5d2ac46930238b30a9c2f1b17c905f3697d808c", + "url": "https://api.github.com/repos/symfony/translation/zipball/0a19a77fba20818a969ef03fdaf1602de0546353", + "reference": "0a19a77fba20818a969ef03fdaf1602de0546353", "shasum": "" }, "require": { @@ -6847,7 +6846,7 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2020-01-15T13:29:06+00:00" + "time": "2020-02-04T09:32:40+00:00" }, { "name": "symfony/translation-contracts", @@ -6908,16 +6907,16 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.4", + "version": "v4.4.5", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "46b53fd714568af343953c039ff47b67ce8af8d6" + "reference": "2572839911702b0405479410ea7a1334bfab0b96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/46b53fd714568af343953c039ff47b67ce8af8d6", - "reference": "46b53fd714568af343953c039ff47b67ce8af8d6", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2572839911702b0405479410ea7a1334bfab0b96", + "reference": "2572839911702b0405479410ea7a1334bfab0b96", "shasum": "" }, "require": { @@ -6980,7 +6979,7 @@ "debug", "dump" ], - "time": "2020-01-25T12:44:29+00:00" + "time": "2020-02-24T13:10:00+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -7257,23 +7256,23 @@ }, { "name": "facade/flare-client-php", - "version": "1.3.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/facade/flare-client-php.git", - "reference": "24444ea0e1556f0a4b5fc8e61802caf72ae9a408" + "reference": "db1e03426e7f9472c9ecd1092aff00f56aa6c004" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/flare-client-php/zipball/24444ea0e1556f0a4b5fc8e61802caf72ae9a408", - "reference": "24444ea0e1556f0a4b5fc8e61802caf72ae9a408", + "url": "https://api.github.com/repos/facade/flare-client-php/zipball/db1e03426e7f9472c9ecd1092aff00f56aa6c004", + "reference": "db1e03426e7f9472c9ecd1092aff00f56aa6c004", "shasum": "" }, "require": { "facade/ignition-contracts": "~1.0", - "illuminate/pipeline": "~5.5|~5.6|~5.7|~5.8|^6.0", + "illuminate/pipeline": "^5.5|^6.0|^7.0", "php": "^7.1", - "symfony/http-foundation": "~3.3|~4.1", + "symfony/http-foundation": "^3.3|^4.1|^5.0", "symfony/var-dumper": "^3.4|^4.0|^5.0" }, "require-dev": { @@ -7307,7 +7306,7 @@ "flare", "reporting" ], - "time": "2019-12-15T18:28:38+00:00" + "time": "2020-03-02T15:52:04+00:00" }, { "name": "facade/ignition", @@ -8262,16 +8261,16 @@ }, { "name": "scrivo/highlight.php", - "version": "v9.18.1.0", + "version": "v9.18.1.1", "source": { "type": "git", "url": "https://github.com/scrivo/highlight.php.git", - "reference": "a57c858cb753f543965a1e17af386a648012ed8f" + "reference": "52fc21c99fd888e33aed4879e55a3646f8d40558" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/a57c858cb753f543965a1e17af386a648012ed8f", - "reference": "a57c858cb753f543965a1e17af386a648012ed8f", + "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/52fc21c99fd888e33aed4879e55a3646f8d40558", + "reference": "52fc21c99fd888e33aed4879e55a3646f8d40558", "shasum": "" }, "require": { @@ -8281,6 +8280,7 @@ }, "require-dev": { "phpunit/phpunit": "^4.8|^5.7", + "sabberworm/php-css-parser": "^8.3", "symfony/finder": "^2.8|^3.4", "symfony/var-dumper": "^2.8|^3.4" }, @@ -8326,7 +8326,7 @@ "highlight.php", "syntax" ], - "time": "2020-02-03T02:19:36+00:00" + "time": "2020-03-02T05:59:21+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", From 08ee6e3ef912f554514d25454ad2630d3f404e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 4 Mar 2020 15:13:40 +0300 Subject: [PATCH 05/65] Customer create issue solved. --- app/Http/Requests/Common/Contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Requests/Common/Contact.php b/app/Http/Requests/Common/Contact.php index 85445643e..b69cce146 100644 --- a/app/Http/Requests/Common/Contact.php +++ b/app/Http/Requests/Common/Contact.php @@ -37,7 +37,7 @@ class Contact extends FormRequest $id = null; } - if (!empty($this->request->get('create_user')) && empty($this->request->get('user_id'))) { + if (($this->request->get('create_user', 'false') === 'true') && empty($this->request->get('user_id'))) { $required = 'required|'; } From 0dea12591994f8aa72a98dc3eb8781ccf1465930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 4 Mar 2020 15:53:15 +0300 Subject: [PATCH 06/65] Create customer to user issue solved.. --- app/Jobs/Common/CreateContact.php | 2 +- app/Jobs/Common/UpdateContact.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Jobs/Common/CreateContact.php b/app/Jobs/Common/CreateContact.php index 6b30924b6..b136766b3 100644 --- a/app/Jobs/Common/CreateContact.php +++ b/app/Jobs/Common/CreateContact.php @@ -27,7 +27,7 @@ class CreateContact extends Job */ public function handle() { - if (!empty($this->request->input('create_user'))) { + if ($this->request->get('create_user', 'false') === 'true') { $this->createUser(); } diff --git a/app/Jobs/Common/UpdateContact.php b/app/Jobs/Common/UpdateContact.php index be513a71a..504228e7d 100644 --- a/app/Jobs/Common/UpdateContact.php +++ b/app/Jobs/Common/UpdateContact.php @@ -33,7 +33,7 @@ class UpdateContact extends Job { $this->authorize(); - if (!empty($this->request->input('create_user'))) { + if ($this->request->get('create_user', 'false') === 'true') { $this->createUser(); } From 710bb7a293b3a3cbc3266c6ffb14faa4225b2e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 4 Mar 2020 15:54:41 +0300 Subject: [PATCH 07/65] version update 2.0.3 to 2.0.4 --- config/version.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/version.php b/config/version.php index 8df22adf8..823f67304 100644 --- a/config/version.php +++ b/config/version.php @@ -10,15 +10,15 @@ return [ 'minor' => '0', - 'patch' => '3', + 'patch' => '4', 'build' => '', 'status' => 'Stable', - 'date' => '24-Feb-2020', + 'date' => '04-Mar-2020', - 'time' => '18:30', + 'time' => '14:30', 'zone' => 'GMT +3', From 907d348d8faf5ceed8896eb6eab862a931cce75c Mon Sep 17 00:00:00 2001 From: denisdulici Date: Wed, 4 Mar 2020 17:02:16 +0300 Subject: [PATCH 08/65] fixed tests --- tests/Feature/Sales/CustomersTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Feature/Sales/CustomersTest.php b/tests/Feature/Sales/CustomersTest.php index 2f6740ad0..d76a21565 100644 --- a/tests/Feature/Sales/CustomersTest.php +++ b/tests/Feature/Sales/CustomersTest.php @@ -114,7 +114,7 @@ class CustomersTest extends FeatureTestCase $password = $this->faker->password; return $this->getRequest() + [ - 'create_user' => 1, + 'create_user' => 'true', 'locale' => 'en-GB', 'password' => $password, 'password_confirmation' => $password, From 8201af741b1ae6d2957fe6bfe4cdf7e56bd7abc2 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Thu, 5 Mar 2020 17:22:07 +0300 Subject: [PATCH 09/65] generate bill number --- app/Http/Controllers/Purchases/Bills.php | 4 ++- .../Purchase/IncreaseNextBillNumber.php | 23 ++++++++++++++++ app/Models/Purchase/Bill.php | 1 + app/Providers/Event.php | 1 + app/Traits/Purchases.php | 27 +++++++++++++++++++ .../views/purchases/bills/create.blade.php | 2 +- 6 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 app/Listeners/Purchase/IncreaseNextBillNumber.php diff --git a/app/Http/Controllers/Purchases/Bills.php b/app/Http/Controllers/Purchases/Bills.php index 541351a85..e56108269 100644 --- a/app/Http/Controllers/Purchases/Bills.php +++ b/app/Http/Controllers/Purchases/Bills.php @@ -108,7 +108,9 @@ class Bills extends Controller $categories = Category::type('expense')->enabled()->orderBy('name')->pluck('name', 'id'); - return view('purchases.bills.create', compact('vendors', 'currencies', 'currency', 'items', 'taxes', 'categories')); + $number = $this->getNextBillNumber(); + + return view('purchases.bills.create', compact('vendors', 'currencies', 'currency', 'items', 'taxes', 'categories', 'number')); } /** diff --git a/app/Listeners/Purchase/IncreaseNextBillNumber.php b/app/Listeners/Purchase/IncreaseNextBillNumber.php new file mode 100644 index 000000000..c05ee5b41 --- /dev/null +++ b/app/Listeners/Purchase/IncreaseNextBillNumber.php @@ -0,0 +1,23 @@ +increaseNextBillNumber(); + } +} diff --git a/app/Models/Purchase/Bill.php b/app/Models/Purchase/Bill.php index 76f5a0223..931810c6d 100644 --- a/app/Models/Purchase/Bill.php +++ b/app/Models/Purchase/Bill.php @@ -99,5 +99,6 @@ class Bill extends DocumentModel public function onCloning($src, $child = null) { $this->status = 'draft'; + $this->bill_number = $this->getNextBillNumber(); } } diff --git a/app/Providers/Event.php b/app/Providers/Event.php index c8f04a232..42d2af107 100644 --- a/app/Providers/Event.php +++ b/app/Providers/Event.php @@ -25,6 +25,7 @@ class Event extends Provider ], 'App\Events\Purchase\BillCreated' => [ 'App\Listeners\Purchase\CreateBillCreatedHistory', + 'App\Listeners\Purchase\IncreaseNextBillNumber', ], 'App\Events\Purchase\BillReceived' => [ 'App\Listeners\Purchase\MarkBillReceived', diff --git a/app/Traits/Purchases.php b/app/Traits/Purchases.php index beb1a0184..228ae3c7d 100644 --- a/app/Traits/Purchases.php +++ b/app/Traits/Purchases.php @@ -4,6 +4,33 @@ namespace App\Traits; trait Purchases { + /** + * Generate next bill number + * + * @return string + */ + public function getNextBillNumber() + { + $prefix = setting('bill.number_prefix', 'BIL-'); + $next = setting('bill.number_next', '1'); + $digit = setting('bill.number_digit', '5'); + + $number = $prefix . str_pad($next, $digit, '0', STR_PAD_LEFT); + + return $number; + } + + /** + * Increase the next bill number + */ + public function increaseNextBillNumber() + { + $next = setting('bill.number_next', 1) + 1; + + setting(['bill.number_next' => $next]); + setting()->save(); + } + /** * Get a collection of bill statuses * diff --git a/resources/views/purchases/bills/create.blade.php b/resources/views/purchases/bills/create.blade.php index b9a630f14..9c62679a8 100644 --- a/resources/views/purchases/bills/create.blade.php +++ b/resources/views/purchases/bills/create.blade.php @@ -25,7 +25,7 @@ {{ Form::dateGroup('due_at', trans('bills.due_date'), 'calendar', ['id' => 'due_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], request()->get('due_at', request()->get('billed_at', Date::now()->toDateString()))) }} - {{ Form::textGroup('bill_number', trans('bills.bill_number'), 'file') }} + {{ Form::textGroup('bill_number', trans('bills.bill_number'), 'file', ['required' => 'required'], $number) }} {{ Form::textGroup('order_number', trans('bills.order_number'), 'shopping-cart',[]) }} From c4ca77916c3455199d724a60d6af93d10ae876ab Mon Sep 17 00:00:00 2001 From: batuhanbas Date: Fri, 6 Mar 2020 12:28:21 +0300 Subject: [PATCH 10/65] Forgotten disabled attribute --- resources/views/partials/form/money_group.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/partials/form/money_group.blade.php b/resources/views/partials/form/money_group.blade.php index ed0cdccf9..db111f114 100644 --- a/resources/views/partials/form/money_group.blade.php +++ b/resources/views/partials/form/money_group.blade.php @@ -16,7 +16,7 @@ @endif @if (isset($attributes['disabled'])) - :disabled="'{{ $attributes['disabled'] }}'" + :disabled="{{ $attributes['disabled'] }}" @endif @if (isset($attributes['masked'])) From 59fd259c1e9c3440e3d8b33f02afe526452848f5 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Fri, 6 Mar 2020 16:24:17 +0300 Subject: [PATCH 11/65] styling --- .../Resources/views/show.blade.php | 26 ++++-- .../Resources/views/show.blade.php | 91 ++++++++++--------- 2 files changed, 65 insertions(+), 52 deletions(-) diff --git a/modules/OfflinePayments/Resources/views/show.blade.php b/modules/OfflinePayments/Resources/views/show.blade.php index a8907ff48..316b3c3d4 100644 --- a/modules/OfflinePayments/Resources/views/show.blade.php +++ b/modules/OfflinePayments/Resources/views/show.blade.php @@ -1,16 +1,24 @@ -

{{ $setting['name'] }}

+
+
+ @if (!empty($setting['name'])) +

{{ $setting['name'] }}

+ @endif -@if ($setting['description']) -
- {{ $setting['description'] }} + @if (!empty($setting['description'])) +
+ {{ $setting['description'] }} +
+ @endif
-@endif +
-
-
- +
+
+ +
+ +//--> diff --git a/modules/PaypalStandard/Resources/views/show.blade.php b/modules/PaypalStandard/Resources/views/show.blade.php index bdd14657d..7248daf36 100644 --- a/modules/PaypalStandard/Resources/views/show.blade.php +++ b/modules/PaypalStandard/Resources/views/show.blade.php @@ -1,48 +1,53 @@
-

{{ $setting['name'] }}

+
+ @if (!empty($setting['name'])) +

{{ $setting['name'] }}

+ @endif - @if($setting['mode'] == 'sandbox') -
{{ trans('paypal-standard::general.test_mode') }}
- @endif + @if ($setting['mode'] == 'sandbox') +
{{ trans('paypal-standard::general.test_mode') }}
+ @endif -
- {{ trans('paypal-standard::general.description') }} -
- -
- - - - - @foreach ($invoice->items as $item) - - - - - @endforeach - - - - - - - - - - - - - - - - - - - -
-
- -
+
+ {{ trans('paypal-standard::general.description') }}
- +
+
+ +
+
+
+ + + + + @foreach ($invoice->items as $item) + + + + + @endforeach + + + + + + + + + + + + + + + + + + + + +
+
+
From 080c6616c27973ebf8413dfdec6b5e7e3a434842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Fri, 6 Mar 2020 17:46:37 +0300 Subject: [PATCH 12/65] Tax add new create page stylee.. --- resources/views/modals/taxes/create.blade.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/resources/views/modals/taxes/create.blade.php b/resources/views/modals/taxes/create.blade.php index f753337d2..1ef955c1b 100644 --- a/resources/views/modals/taxes/create.blade.php +++ b/resources/views/modals/taxes/create.blade.php @@ -3,7 +3,7 @@ '@submit.prevent' => 'onSubmit', '@keydown' => 'form.errors.clear($event.target.name)', 'role' => 'form', - 'class' => 'form-loading-button m--3', + 'class' => 'form-loading-button', 'route' => 'taxes.store', 'novalidate' => true ]) !!} @@ -12,8 +12,7 @@ {{ Form::textGroup('rate', trans('taxes.rate'), 'percent') }} - {{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, 'normal') }} - - {!! Form::hidden('enabled', '1', []) !!} + {!! Form::hidden('type', 'normal') !!} + {!! Form::hidden('enabled', '1') !!}
{!! Form::close() !!} From 67f35aa9a21024e25b25aad4e756ab85935f7395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Fri, 6 Mar 2020 18:04:23 +0300 Subject: [PATCH 13/65] selectbox add new new style --- .../assets/js/components/AkauntingSelect.vue | 67 +++++++++++++++++-- .../form/multi_select_add_new_group.blade.php | 1 + .../form/select_add_new_group.blade.php | 5 +- .../form/select_group_add_new_group.blade.php | 5 +- 4 files changed, 69 insertions(+), 9 deletions(-) diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index 865b6b2dc..23f43665b 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -55,6 +55,8 @@ :key="value" :label="label" :value="value"> + {{ label }} + {{ new_text }} + {{ label }} + {{ new_text }} @@ -124,6 +128,8 @@ :key="value" :label="label" :value="value"> + {{ label }} + {{ new_text }} + {{ label }} + {{ new_text }} @@ -193,6 +201,8 @@ :key="value" :label="label" :value="value"> + {{ label }} + {{ new_text }} + {{ label }} + {{ new_text }} @@ -262,6 +274,8 @@ :key="value" :label="label" :value="value"> + {{ label }} + {{ new_text }} + {{ label }} + {{ new_text }} @@ -331,6 +347,8 @@ :key="value" :label="label" :value="value"> + {{ label }} + {{ new_text }} + {{ label }} + {{ new_text }} @@ -356,7 +376,9 @@ - + + + {{ new_text }} - + diff --git a/resources/assets/js/components/AkauntingSelectRemote.vue b/resources/assets/js/components/AkauntingSelectRemote.vue index 7d66a1765..61b21d504 100644 --- a/resources/assets/js/components/AkauntingSelectRemote.vue +++ b/resources/assets/js/components/AkauntingSelectRemote.vue @@ -305,8 +305,8 @@ - + {{ new_text }} @@ -370,8 +370,8 @@ :key="option.id" :label="option.name" :value="option.id"> - {{ label }} - {{ new_text }}{{ option.name }} + {{ new_text }} { if (response.data.success) { + this.selectOptions[response.data.data.id] = response.data.data['name']; + this.new_options[response.data.data.id] = response.data.data['name']; + this.real_model = response.data.data.id; + /* this.selectOptions = []; this.selectOptions.push(response.data.data); this.new_options[response.data.data.id] = response.data.data.id; this.real_model = response.data.data.id; - + */ this.change(); if (this.title) { @@ -788,7 +792,7 @@ export default { if (response.data.success) { this.selectOptions[response.data.data.id] = response.data.data['name']; this.new_options[response.data.data.id] = response.data.data['name']; - this.real_model = response.data.data.id.toString(); + this.real_model = response.data.data.id; this.change(); @@ -821,7 +825,15 @@ export default { watch: { options: function (options) { // update options - //this.selectOptions = options; + this.selectOptions = options; + + if (Object.keys(this.new_options).length) { + for (let [key, value] of Object.entries(this.new_options)) { + if (!this.selectOptions[key]) { + this.selectOptions[key] = value; + } + } + } }, value: function (value) { diff --git a/resources/views/sales/invoices/item.blade.php b/resources/views/sales/invoices/item.blade.php index 8a25cb83b..a282d879d 100644 --- a/resources/views/sales/invoices/item.blade.php +++ b/resources/views/sales/invoices/item.blade.php @@ -30,6 +30,7 @@ 'path' => route('modals.items.store'), 'type' => 'inline', 'field' => 'name', + 'new_text' => trans('modules.new'), ])}}" @interface="row.item_id = $event" @label="row.name = $event" From 58a796c2b480309825bd5925ed485b7abf9bf9ca Mon Sep 17 00:00:00 2001 From: denisdulici Date: Mon, 9 Mar 2020 10:26:02 +0300 Subject: [PATCH 21/65] moved ajax dispatch to trait --- app/Abstracts/Http/Controller.php | 31 +------------------------------ app/Traits/Jobs.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/app/Abstracts/Http/Controller.php b/app/Abstracts/Http/Controller.php index 779868b1b..2a4bf8bef 100644 --- a/app/Abstracts/Http/Controller.php +++ b/app/Abstracts/Http/Controller.php @@ -30,7 +30,7 @@ abstract class Controller extends BaseController * * @return void */ - protected function setPermissions() + public function setPermissions() { // No need to check for permission in console if (app()->runningInConsole()) { @@ -90,33 +90,4 @@ abstract class Controller extends BaseController return new LengthAwarePaginator($items->forPage($page, $perPage), $items->count(), $perPage, $page, $options); } - - /** - * Dispatch a job to its appropriate handler and return a response array for ajax calls. - * - * @param mixed $job - * @return mixed - */ - public function ajaxDispatch($job) - { - try { - $data = $this->dispatch($job); - - $response = [ - 'success' => true, - 'error' => false, - 'data' => $data, - 'message' => '', - ]; - } catch(\Exception $e) { - $response = [ - 'success' => false, - 'error' => true, - 'data' => null, - 'message' => $e->getMessage(), - ]; - } - - return $response; - } } diff --git a/app/Traits/Jobs.php b/app/Traits/Jobs.php index a3482face..c8fcb1a20 100644 --- a/app/Traits/Jobs.php +++ b/app/Traits/Jobs.php @@ -31,6 +31,35 @@ trait Jobs return $result; } + /** + * Dispatch a job to its appropriate handler and return a response array for ajax calls. + * + * @param mixed $job + * @return mixed + */ + public function ajaxDispatch($job) + { + try { + $data = $this->dispatch($job); + + $response = [ + 'success' => true, + 'error' => false, + 'data' => $data, + 'message' => '', + ]; + } catch(\Exception $e) { + $response = [ + 'success' => false, + 'error' => true, + 'data' => null, + 'message' => $e->getMessage(), + ]; + } + + return $response; + } + public function getDispatchFunction() { $config = config('queue.default'); From 3444cd8dd82eedadce2d42269405c5239a530bb1 Mon Sep 17 00:00:00 2001 From: blackpidgeon Date: Mon, 9 Mar 2020 09:02:25 +0100 Subject: [PATCH 22/65] Fix typo in function name --- app/Http/Controllers/Banking/Reconciliations.php | 2 +- app/Models/Banking/Account.php | 4 ++-- app/Models/Setting/Category.php | 2 +- app/Widgets/IncomeByCategory.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Banking/Reconciliations.php b/app/Http/Controllers/Banking/Reconciliations.php index 96e0b9b29..1309127f0 100644 --- a/app/Http/Controllers/Banking/Reconciliations.php +++ b/app/Http/Controllers/Banking/Reconciliations.php @@ -198,7 +198,7 @@ class Reconciliations extends Controller $total = $account->opening_balance; // Sum income transactions - $transactions = $account->income_transacions()->whereDate('paid_at', '<', $started_at)->get(); + $transactions = $account->income_transactions()->whereDate('paid_at', '<', $started_at)->get(); foreach ($transactions as $item) { $total += $item->amount; } diff --git a/app/Models/Banking/Account.php b/app/Models/Banking/Account.php index 72a9211be..fa92b774c 100644 --- a/app/Models/Banking/Account.php +++ b/app/Models/Banking/Account.php @@ -39,7 +39,7 @@ class Account extends Model return $this->transactions()->where('type', 'expense'); } - public function income_transacions() + public function income_transactions() { return $this->transactions()->where('type', 'income'); } @@ -81,7 +81,7 @@ class Account extends Model $total = $this->opening_balance; // Sum Incomes - $total += $this->income_transacions->sum('amount'); + $total += $this->income_transactions->sum('amount'); // Subtract Expenses $total -= $this->expense_transactions->sum('amount'); diff --git a/app/Models/Setting/Category.php b/app/Models/Setting/Category.php index 9d93ca0d9..b627a811a 100644 --- a/app/Models/Setting/Category.php +++ b/app/Models/Setting/Category.php @@ -32,7 +32,7 @@ class Category extends Model return $this->transactions()->where('type', 'expense'); } - public function income_transacions() + public function income_transactions() { return $this->transactions()->where('type', 'income'); } diff --git a/app/Widgets/IncomeByCategory.php b/app/Widgets/IncomeByCategory.php index 46fd72a52..ee532420a 100644 --- a/app/Widgets/IncomeByCategory.php +++ b/app/Widgets/IncomeByCategory.php @@ -15,10 +15,10 @@ class IncomeByCategory extends Widget public function show() { - Category::with('income_transacions')->type('income')->each(function ($category) { + Category::with('income_transactions')->type('income')->each(function ($category) { $amount = 0; - $this->applyFilters($category->income_transacions())->each(function ($transaction) use (&$amount) { + $this->applyFilters($category->income_transactions())->each(function ($transaction) use (&$amount) { $amount += $transaction->getAmountConvertedToDefault(); }); From 3dde3af30042d9e5aeb02a25c13681bf70c2ab9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 9 Mar 2020 11:54:18 +0300 Subject: [PATCH 23/65] Modal create account. --- app/Http/Controllers/Modals/Accounts.php | 65 +++++++++++++++++++ .../views/modals/accounts/create.blade.php | 21 ++++++ routes/admin.php | 1 + 3 files changed, 87 insertions(+) create mode 100644 app/Http/Controllers/Modals/Accounts.php create mode 100644 resources/views/modals/accounts/create.blade.php diff --git a/app/Http/Controllers/Modals/Accounts.php b/app/Http/Controllers/Modals/Accounts.php new file mode 100644 index 000000000..477c00c21 --- /dev/null +++ b/app/Http/Controllers/Modals/Accounts.php @@ -0,0 +1,65 @@ +middleware('permission:create-banking-accounts')->only(['create', 'store', 'duplicate', 'import']); + $this->middleware('permission:read-banking-accounts')->only(['index', 'show', 'edit', 'export']); + $this->middleware('permission:update-banking-accounts')->only(['update', 'enable', 'disable']); + $this->middleware('permission:delete-banking-accounts')->only('destroy'); + } + + /** + * Show the form for creating a new resource. + * + * @return Response + */ + public function create() + { + $currencies = Currency::enabled()->pluck('name', 'code'); + + $currency = Currency::where('code', '=', setting('default.currency'))->first(); + + $html = view('modals.accounts.create', compact('currencies', 'currency'))->render(); + + return response()->json([ + 'success' => true, + 'error' => false, + 'message' => 'null', + 'html' => $html, + ]); + } + + /** + * Store a newly created resource in storage. + * + * @param Request $request + * + * @return Response + */ + public function store(Request $request) + { + $request['enabled'] = 1; + + $response = $this->ajaxDispatch(new CreateAccount($request)); + + if ($response['success']) { + $response['message'] = trans('messages.success.added', ['type' => trans_choice('general.accounts', 1)]); + } + + return response()->json($response); + } +} diff --git a/resources/views/modals/accounts/create.blade.php b/resources/views/modals/accounts/create.blade.php new file mode 100644 index 000000000..e62522ec1 --- /dev/null +++ b/resources/views/modals/accounts/create.blade.php @@ -0,0 +1,21 @@ +{!! Form::open([ + 'id' => 'form-create-account', + '@submit.prevent' => 'onSubmit', + '@keydown' => 'form.errors.clear($event.target.name)', + 'role' => 'form', + 'class' => 'form-loading-button', + 'route' => 'accounts.store', + 'novalidate' => true +]) !!} +
+ {{ Form::textGroup('name', trans('general.name'), 'font') }} + + {{ Form::textGroup('number', trans('accounts.number'), 'pencil-alt') }} + + {{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'change' => 'onChangeCurrency']) }} + + {{ Form::moneyGroup('opening_balance', trans('accounts.opening_balance'), 'balance-scale', ['required' => 'required', 'currency' => $currency], 0.00) }} + + {!! Form::hidden('enabled', '1', []) !!} +
+{!! Form::close() !!} diff --git a/routes/admin.php b/routes/admin.php index 5c7b4fd83..2bee70a97 100644 --- a/routes/admin.php +++ b/routes/admin.php @@ -213,6 +213,7 @@ Route::group(['prefix' => 'install'], function () { }); Route::group(['as' => 'modals.', 'prefix' => 'modals'], function () { + Route::resource('accounts', 'Modals\Accounts'); Route::resource('categories', 'Modals\Categories'); Route::resource('currencies', 'Modals\Currencies'); Route::resource('customers', 'Modals\Customers'); From 27b12da3547db72de727fa24a19534aa0f74b1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 9 Mar 2020 11:57:06 +0300 Subject: [PATCH 24/65] select new feature fixed. --- resources/assets/js/components/AkauntingSelect.vue | 10 +++++----- resources/views/banking/accounts/create.blade.php | 2 +- resources/views/banking/accounts/edit.blade.php | 2 +- .../views/banking/reconciliations/create.blade.php | 2 +- resources/views/common/items/create.blade.php | 2 +- resources/views/common/items/edit.blade.php | 2 +- resources/views/modals/items/create.blade.php | 4 ++-- .../partials/form/multi_select_add_new_group.blade.php | 5 ++++- .../views/partials/form/select_add_new_group.blade.php | 5 ++++- .../partials/form/select_group_add_new_group.blade.php | 5 ++++- resources/views/purchases/bills/create.blade.php | 2 +- resources/views/purchases/bills/edit.blade.php | 2 +- resources/views/purchases/payments/create.blade.php | 2 +- resources/views/purchases/payments/edit.blade.php | 2 +- resources/views/purchases/vendors/create.blade.php | 2 +- resources/views/purchases/vendors/edit.blade.php | 2 +- resources/views/sales/customers/create.blade.php | 2 +- resources/views/sales/customers/edit.blade.php | 2 +- resources/views/sales/invoices/create.blade.php | 2 +- resources/views/sales/invoices/edit.blade.php | 2 +- resources/views/sales/revenues/create.blade.php | 2 +- resources/views/sales/revenues/edit.blade.php | 2 +- 22 files changed, 36 insertions(+), 27 deletions(-) diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index 0f713f714..3ba0d9109 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -470,7 +470,7 @@ export default { status: false, path: null, type: 'modal', // modal, inline - field: 'name', + field: {}, new_text: 'New', buttons: {} }; @@ -523,7 +523,7 @@ export default { show: false, path: this.addNew.path, type: this.addNew.type, // modal, inline - field: this.addNew.name, + field: this.addNew.field, buttons: this.addNew.buttons }, add_new_text: this.addNew.text, @@ -660,9 +660,9 @@ export default { this.form.loading = false; if (response.data.success) { - this.selectOptions[response.data.data.id] = response.data.data['name']; - this.new_options[response.data.data.id] = response.data.data['name']; - this.real_model = response.data.data.id.toString(); + this.selectOptions[response.data.data[this.add_new.field.key]] = response.data.data[this.add_new.field.value]; + this.new_options[response.data.data[this.add_new.field.key]] = response.data.data[this.add_new.field.value]; + this.real_model = response.data.data[this.add_new.field.key].toString(); this.change(); diff --git a/resources/views/banking/accounts/create.blade.php b/resources/views/banking/accounts/create.blade.php index f50d52f2d..c1db44e49 100644 --- a/resources/views/banking/accounts/create.blade.php +++ b/resources/views/banking/accounts/create.blade.php @@ -21,7 +21,7 @@ {{ Form::textGroup('number', trans('accounts.number'), 'pencil-alt') }} - {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'path' => route('modals.currencies.create'), 'change' => 'onChangeCurrency']) }} + {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], 'change' => 'onChangeCurrency']) }} {{ Form::moneyGroup('opening_balance', trans('accounts.opening_balance'), 'balance-scale', ['required' => 'required', 'currency' => $currency], 0) }} diff --git a/resources/views/banking/accounts/edit.blade.php b/resources/views/banking/accounts/edit.blade.php index e01f468b9..4a0014f67 100644 --- a/resources/views/banking/accounts/edit.blade.php +++ b/resources/views/banking/accounts/edit.blade.php @@ -22,7 +22,7 @@ {{ Form::textGroup('number', trans('accounts.number'), 'pencil-alt') }} - {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $account->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create'), 'change' => 'onChangeCurrency']) }} + {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $account->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], 'change' => 'onChangeCurrency']) }} {{ Form::moneyGroup('opening_balance', trans('accounts.opening_balance'), 'balance-scale', ['required' => 'required', 'currency' => $currency], $account->opening_balance) }} diff --git a/resources/views/banking/reconciliations/create.blade.php b/resources/views/banking/reconciliations/create.blade.php index 16dcb7c4e..2dbb5c4f7 100644 --- a/resources/views/banking/reconciliations/create.blade.php +++ b/resources/views/banking/reconciliations/create.blade.php @@ -22,7 +22,7 @@ {{ Form::moneyGroup('closing_balance', trans('reconciliations.closing_balance'), 'balance-scale', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency], request('closing_balance', 0.00), 'col-xl-2') }} - {{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, request('account_id', setting('default.account')), ['required' => 'required', 'change' => 'onChangeAccount'], 'col-xl-2') }} + {{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, request('account_id', setting('default.account')), ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount'], 'col-xl-2') }}
{!! Form::button('  ' . trans('reconciliations.transactions'), ['type' => 'button', '@click' => 'onReconcilition', 'class' => 'btn btn-success header-button-top']) !!} diff --git a/resources/views/common/items/create.blade.php b/resources/views/common/items/create.blade.php index 875e476d9..62023f1a7 100644 --- a/resources/views/common/items/create.blade.php +++ b/resources/views/common/items/create.blade.php @@ -19,7 +19,7 @@
{{ Form::textGroup('name', trans('general.name'), 'tag') }} - {{ Form::selectAddNewGroup('tax_id', trans_choice('general.taxes', 1), 'percentage', $taxes, setting('default.tax'), ['path' => route('modals.taxes.create')]) }} + {{ Form::selectAddNewGroup('tax_id', trans_choice('general.taxes', 1), 'percentage', $taxes, setting('default.tax'), ['path' => route('modals.taxes.create'), 'field' => ['key' => 'id', 'value' => 'title']]) }} {{ Form::textareaGroup('description', trans('general.description')) }} diff --git a/resources/views/common/items/edit.blade.php b/resources/views/common/items/edit.blade.php index fca27b25b..f0e93058c 100644 --- a/resources/views/common/items/edit.blade.php +++ b/resources/views/common/items/edit.blade.php @@ -20,7 +20,7 @@
{{ Form::textGroup('name', trans('general.name'), 'tag') }} - {{ Form::selectAddNewGroup('tax_id', trans_choice('general.taxes', 1), 'percentage', $taxes, $item->tax_id, ['path' => route('modals.taxes.create')]) }} + {{ Form::selectAddNewGroup('tax_id', trans_choice('general.taxes', 1), 'percentage', $taxes, $item->tax_id, ['path' => route('modals.taxes.create'), 'field' => ['key' => 'id', 'value' => 'title']]) }} {{ Form::textareaGroup('description', trans('general.description')) }} diff --git a/resources/views/modals/items/create.blade.php b/resources/views/modals/items/create.blade.php index deb855afd..64f64fa16 100644 --- a/resources/views/modals/items/create.blade.php +++ b/resources/views/modals/items/create.blade.php @@ -10,7 +10,7 @@
{{ Form::textGroup('name', trans('general.name'), 'tag') }} - {{ Form::selectAddNewGroup('tax_id', trans_choice('general.taxes', 1), 'percentage', $taxes, setting('default.tax'), ['path' => route('modals.taxes.create')]) }} + {{ Form::selectGroup('tax_id', trans_choice('general.taxes', 1), 'percentage', $taxes, setting('default.tax'), []) }} {{ Form::textareaGroup('description', trans('general.description')) }} @@ -18,7 +18,7 @@ {{ Form::textGroup('purchase_price', trans('items.purchase_price'), 'money-bill-wave-alt') }} - {{ Form::selectAddNewGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null, ['required' => 'required', 'path' => route('modals.categories.create') . '?type=item']) }} + {{ Form::selectGroup('category_id', trans_choice('general.categories', 1), 'folder', $categories, null) }} {!! Form::hidden('enabled', '1', []) !!}
diff --git a/resources/views/partials/form/multi_select_add_new_group.blade.php b/resources/views/partials/form/multi_select_add_new_group.blade.php index 736668ac1..b7208974d 100644 --- a/resources/views/partials/form/multi_select_add_new_group.blade.php +++ b/resources/views/partials/form/multi_select_add_new_group.blade.php @@ -30,7 +30,10 @@ 'text' => trans('general.add_new'), 'path' => isset($attributes['path']) ? $attributes['path']: false, 'type' => isset($attributes['type']) ? $attributes['type'] : 'modal', - 'field' => isset($attributes['field']) ? $attributes['field'] : 'name', + 'field' => [ + 'key' => isset($attributes['field']['key']) ? $attributes['field']['key'] : 'id', + 'value' => isset($attributes['field']['value']) ? $attributes['field']['value'] : 'name' + ], 'new_text' => trans('modules.new'), 'buttons' => [ 'cancel' => [ diff --git a/resources/views/partials/form/select_add_new_group.blade.php b/resources/views/partials/form/select_add_new_group.blade.php index adea5052f..14383fc84 100644 --- a/resources/views/partials/form/select_add_new_group.blade.php +++ b/resources/views/partials/form/select_add_new_group.blade.php @@ -28,7 +28,10 @@ 'text' => trans('general.add_new'), 'path' => isset($attributes['path']) ? $attributes['path']: false, 'type' => isset($attributes['type']) ? $attributes['type'] : 'modal', - 'field' => isset($attributes['field']) ? $attributes['field'] : 'name', + 'field' => [ + 'key' => isset($attributes['field']['key']) ? $attributes['field']['key'] : 'id', + 'value' => isset($attributes['field']['value']) ? $attributes['field']['value'] : 'name' + ], 'new_text' => trans('modules.new'), 'buttons' => [ 'cancel' => [ diff --git a/resources/views/partials/form/select_group_add_new_group.blade.php b/resources/views/partials/form/select_group_add_new_group.blade.php index b98c773b8..117d00f6d 100644 --- a/resources/views/partials/form/select_group_add_new_group.blade.php +++ b/resources/views/partials/form/select_group_add_new_group.blade.php @@ -28,7 +28,10 @@ 'text' => trans('general.add_new'), 'path' => isset($attributes['path']) ? $attributes['path']: false, 'type' => isset($attributes['type']) ? $attributes['type'] : 'modal', - 'field' => isset($attributes['field']) ? $attributes['field'] : 'name', + 'field' => [ + 'key' => isset($attributes['field']['key']) ? $attributes['field']['key'] : 'id', + 'value' => isset($attributes['field']['value']) ? $attributes['field']['value'] : 'name' + ], 'new_text' => trans('modules.new'), 'buttons' => [ 'cancel' => [ diff --git a/resources/views/purchases/bills/create.blade.php b/resources/views/purchases/bills/create.blade.php index 9c62679a8..910fb1268 100644 --- a/resources/views/purchases/bills/create.blade.php +++ b/resources/views/purchases/bills/create.blade.php @@ -19,7 +19,7 @@
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, config('general.vendors'), ['required' => 'required', 'path' => route('modals.vendors.create'), 'change' => 'onChangeContact']) }} - {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'path' => route('modals.currencies.create'), 'change' => 'onChangeCurrency']) }} + {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], 'change' => 'onChangeCurrency']) }} {{ Form::dateGroup('billed_at', trans('bills.bill_date'), 'calendar', ['id' => 'billed_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], request()->get('billed_at', Date::now()->toDateString())) }} diff --git a/resources/views/purchases/bills/edit.blade.php b/resources/views/purchases/bills/edit.blade.php index 56e844f9c..415960492 100644 --- a/resources/views/purchases/bills/edit.blade.php +++ b/resources/views/purchases/bills/edit.blade.php @@ -20,7 +20,7 @@
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $bill->contact_id, ['required' => 'required', 'path' => route('modals.vendors.create'), 'change' => 'onChangeContact']) }} - {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $bill->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create'), 'change' => 'onChangeCurrency']) }} + {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $bill->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], 'change' => 'onChangeCurrency']) }} {{ Form::dateGroup('billed_at', trans('bills.bill_date'), 'calendar', ['id' => 'billed_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($bill->billed_at)->toDateString()) }} diff --git a/resources/views/purchases/payments/create.blade.php b/resources/views/purchases/payments/create.blade.php index 8649154d8..a496ca250 100644 --- a/resources/views/purchases/payments/create.blade.php +++ b/resources/views/purchases/payments/create.blade.php @@ -24,7 +24,7 @@ {{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'currency' => $currency], 0.00) }} - {{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'change' => 'onChangeAccount']) }} + {{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }} {{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, setting('default.vendor'), ['path' => route('modals.vendors.create')]) }} diff --git a/resources/views/purchases/payments/edit.blade.php b/resources/views/purchases/payments/edit.blade.php index 46e50e34c..377760a62 100644 --- a/resources/views/purchases/payments/edit.blade.php +++ b/resources/views/purchases/payments/edit.blade.php @@ -43,7 +43,7 @@ {{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency], $payment->amount) }} - {{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $payment->account_id, ['required' => 'required', 'change' => 'onChangeAccount']) }} + {{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $payment->account_id, ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }} {{ Form::selectAddNewGroup('contact_id', trans_choice('general.vendors', 1), 'user', $vendors, $payment->contact_id, ['path' => route('modals.vendors.create')]) }} diff --git a/resources/views/purchases/vendors/create.blade.php b/resources/views/purchases/vendors/create.blade.php index e78f6e1ae..b3480255d 100644 --- a/resources/views/purchases/vendors/create.blade.php +++ b/resources/views/purchases/vendors/create.blade.php @@ -23,7 +23,7 @@ {{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }} - {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'path' => route('modals.currencies.create')]) }} + {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name']]) }} {{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }} diff --git a/resources/views/purchases/vendors/edit.blade.php b/resources/views/purchases/vendors/edit.blade.php index 2ba74f074..41167795d 100644 --- a/resources/views/purchases/vendors/edit.blade.php +++ b/resources/views/purchases/vendors/edit.blade.php @@ -24,7 +24,7 @@ {{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }} - {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $vendor->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create')]) }} + {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $vendor->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name']]) }} {{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }} diff --git a/resources/views/sales/customers/create.blade.php b/resources/views/sales/customers/create.blade.php index 4f0b40f44..80a18a2d4 100644 --- a/resources/views/sales/customers/create.blade.php +++ b/resources/views/sales/customers/create.blade.php @@ -24,7 +24,7 @@ {{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }} - {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'path' => route('modals.currencies.create')]) }} + {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name']]) }} {{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }} diff --git a/resources/views/sales/customers/edit.blade.php b/resources/views/sales/customers/edit.blade.php index 0ff5d74f9..58851e745 100644 --- a/resources/views/sales/customers/edit.blade.php +++ b/resources/views/sales/customers/edit.blade.php @@ -23,7 +23,7 @@ {{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }} - {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $customer->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create')]) }} + {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $customer->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name']]) }} {{ Form::textGroup('phone', trans('general.phone'), 'phone', []) }} diff --git a/resources/views/sales/invoices/create.blade.php b/resources/views/sales/invoices/create.blade.php index cf5fe2f53..0c0726986 100644 --- a/resources/views/sales/invoices/create.blade.php +++ b/resources/views/sales/invoices/create.blade.php @@ -19,7 +19,7 @@
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, config('general.customers'), ['required' => 'required', 'path' => route('modals.customers.create'), 'change' => 'onChangeContact']) }} - {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'path' => route('modals.currencies.create'), 'change' => 'onChangeCurrency']) }} + {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], 'change' => 'onChangeCurrency']) }} {{ Form::dateGroup('invoiced_at', trans('invoices.invoice_date'), 'calendar', ['id' => 'invoiced_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], request()->get('invoiced_at', Date::now()->toDateString())) }} diff --git a/resources/views/sales/invoices/edit.blade.php b/resources/views/sales/invoices/edit.blade.php index 949706b7f..7e3a3c65e 100644 --- a/resources/views/sales/invoices/edit.blade.php +++ b/resources/views/sales/invoices/edit.blade.php @@ -20,7 +20,7 @@
{{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $invoice->contact_id, ['required' => 'required', 'path' => route('modals.customers.create'), 'change' => 'onChangeContact']) }} - {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $invoice->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create'), 'change' => 'onChangeCurrency']) }} + {{ Form::selectAddNewGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, $invoice->currency_code, ['required' => 'required', 'path' => route('modals.currencies.create'), 'field' => ['key' => 'code', 'value' => 'name'], 'change' => 'onChangeCurrency']) }} {{ Form::dateGroup('invoiced_at', trans('invoices.invoice_date'), 'calendar', ['id' => 'invoiced_at', 'class' => 'form-control datepicker', 'required' => 'required', 'date-format' => 'Y-m-d', 'autocomplete' => 'off'], Date::parse($invoice->invoiced_at)->toDateString()) }} diff --git a/resources/views/sales/revenues/create.blade.php b/resources/views/sales/revenues/create.blade.php index 8c0dfddac..bb7cab44f 100644 --- a/resources/views/sales/revenues/create.blade.php +++ b/resources/views/sales/revenues/create.blade.php @@ -24,7 +24,7 @@ {{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency], 0) }} - {{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'change' => 'onChangeAccount']) }} + {{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, setting('default.account'), ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }} {{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, setting('default.contact'), ['path' => route('modals.customers.create')]) }} diff --git a/resources/views/sales/revenues/edit.blade.php b/resources/views/sales/revenues/edit.blade.php index 4fde29250..37e9cd77b 100644 --- a/resources/views/sales/revenues/edit.blade.php +++ b/resources/views/sales/revenues/edit.blade.php @@ -43,7 +43,7 @@ {{ Form::moneyGroup('amount', trans('general.amount'), 'money-bill-alt', ['required' => 'required', 'autofocus' => 'autofocus', 'currency' => $currency], $revenue->amount) }} - {{ Form::selectGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $revenue->account_id, ['required' => 'required', 'change' => 'onChangeAccount']) }} + {{ Form::selectAddNewGroup('account_id', trans_choice('general.accounts', 1), 'university', $accounts, $revenue->account_id, ['required' => 'required', 'path' => route('modals.accounts.create'), 'change' => 'onChangeAccount']) }} {{ Form::selectAddNewGroup('contact_id', trans_choice('general.customers', 1), 'user', $customers, $revenue->contact_id, ['path' => route('modals.customers.create')]) }} From de0d74bb5f0c156216b26b1134d097203efa3630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 9 Mar 2020 12:43:56 +0300 Subject: [PATCH 25/65] close #1336 Fixed: Wrong amount sent to backend --- app/Http/Middleware/Money.php | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/app/Http/Middleware/Money.php b/app/Http/Middleware/Money.php index 538ded968..a84e0a3b2 100644 --- a/app/Http/Middleware/Money.php +++ b/app/Http/Middleware/Money.php @@ -22,15 +22,10 @@ class Money $sale_price = $request->get('sale_price'); $purchase_price = $request->get('purchase_price'); $opening_balance = $request->get('opening_balance'); - $currency_code = $request->get('currency_code'); $items = $request->get('items'); - if (empty($currency_code)) { - $currency_code = setting('default.currency'); - } - if (!empty($amount)) { - $amount = money($request->get('amount'), $currency_code)->getAmount(); + $amount = money($amount)->getAmount(); $request->request->set('amount', $amount); } @@ -42,11 +37,7 @@ class Money continue; } - if (isset($item['currency']) && $item['currency'] != $currency_code) { - $items[$key]['price'] = money($item['price'], $item['currency'])->getAmount(); - } else { - $items[$key]['price'] = money($item['price'], $currency_code)->getAmount(); - } + $items[$key]['price'] = money($item['price'])->getAmount(); } $request->request->set('items', $items); @@ -54,24 +45,10 @@ class Money } if (isset($opening_balance)) { - $opening_balance = money($opening_balance, $currency_code)->getAmount(); + $opening_balance = money($opening_balance)->getAmount(); $request->request->set('opening_balance', $opening_balance); } - - /* check item price use money - if (isset($sale_price)) { - $sale_price = money($sale_price, $currency_code)->getAmount(); - - $request->request->set('sale_price', $sale_price); - } - - if (isset($purchase_price)) { - $purchase_price = money($purchase_price, $currency_code)->getAmount(); - - $request->request->set('purchase_price', $purchase_price); - } - */ } return $next($request); From e14486154cc5b38f0c2e88057d7cb7725050cdc0 Mon Sep 17 00:00:00 2001 From: batuhanbas Date: Mon, 9 Mar 2020 17:17:42 +0300 Subject: [PATCH 26/65] reports data alignment updated --- app/Abstracts/Report.php | 45 +++++++++++++++++++ public/css/akaunting-color.css | 13 ++++-- public/css/custom.css | 16 +++++-- public/css/print.css | 5 +++ .../partials/reports/table/footer.blade.php | 8 ++-- .../partials/reports/table/header.blade.php | 10 ++--- .../partials/reports/table/rows.blade.php | 8 ++-- .../profit_loss/content/footer.blade.php | 8 ++-- .../profit_loss/content/header.blade.php | 8 ++-- .../profit_loss/table/footer.blade.php | 8 ++-- 10 files changed, 97 insertions(+), 32 deletions(-) diff --git a/app/Abstracts/Report.php b/app/Abstracts/Report.php index aa94530ff..a4a8d0064 100644 --- a/app/Abstracts/Report.php +++ b/app/Abstracts/Report.php @@ -67,6 +67,9 @@ abstract class Report 'datasets' => [], ]; + public $column_width = 'report-column'; + public $head_column_width = 'head_report_column'; + public function __construct(Model $model = null, $load_data = true) { $this->setGroups(); @@ -76,6 +79,8 @@ abstract class Report } $this->model = $model; + $this->setHeadColumnWidth(); + $this->setDataColumnWidth(); if (!$load_data) { return; @@ -198,6 +203,46 @@ abstract class Report return \Excel::download(new Export($this->views['content'], $this), \Str::filename($this->model->name) . '.xlsx'); } + public function setHeadColumnWidth() + { + if (empty($this->model->settings->period)) { + return; + } + + $head_width = 'head_report_column'; + + switch ($this->model->settings->period) { + case 'quarterly': + $head_width = 'col-sm-2'; + break; + case 'yearly': + $head_width = 'col-sm-4'; + break; + } + + $this->head_column_width = $head_width; + } + + public function setDataColumnWidth() + { + if (empty($this->model->settings->period)) { + return; + } + + $width = 'report-column'; + + switch ($this->model->settings->period) { + case 'quarterly': + $width = 'col-sm-2'; + break; + case 'yearly': + $width = 'col-sm-4'; + break; + } + + $this->column_width = $width; + } + public function setYear() { $this->year = request('year', Date::now()->year); diff --git a/public/css/akaunting-color.css b/public/css/akaunting-color.css index f0b33e61d..514b7edaa 100644 --- a/public/css/akaunting-color.css +++ b/public/css/akaunting-color.css @@ -2087,6 +2087,11 @@ div.required .form-control-label:not(span):after, td.required:after box-shadow: rgba(248, 248, 255) 0 0 0 1px, rgba(248, 248, 255) 0 4px 16px; } +.btn-icon-clipboard:focus +{ + outline: none; +} + /*--Settings Board Icon Color--*/ .btn-icon-clipboard i { @@ -2323,7 +2328,7 @@ option:focus /*--------Login Card Background Color Finish--------*/ -/*--------General Progress Bar Color--------*/ +/*--General Progress Bar Color---*/ #nprogress .bar { background: #3f3c72 !important; @@ -2340,10 +2345,10 @@ option:focus { box-shadow: 0 0 10px #3f3c72, 0 0 5px #3f3c72 !important; } -/*--------General Progress Bar Color Finish--------*/ +/*--General Progress Bar Color Finish---*/ -/*--------List Group Item Active-------*/ +/*--List Group Item Active---*/ .list-group-item.active { z-index: 2; @@ -2351,7 +2356,7 @@ option:focus background-color: #3c3f72 !important; border-color: #3c3f72 !important; } -/*--------List Group Item Active Finish-------*/ +/*--List Group Item Active Finish---*/ /*--Wizard Delete Button Text--*/ diff --git a/public/css/custom.css b/public/css/custom.css index b4d5d9c4b..98f8ec13e 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -526,7 +526,6 @@ button:focus box-shadow: none !important; } /*--------Shadow None Focus Finish--------*/ - /*--------Settings Index Page Finish--------*/ @@ -637,8 +636,19 @@ table .align-items-center td span.badge /*--------Report Column--------*/ .report-column { - max-width: 100px; - width: 160px !important; + -webkit-box-flex: 0; + -ms-flex: 0 0 6.66%; + flex: 0 0 6.66%; + max-width: 6.66%; +} + +.head_report_column +{ + -webkit-box-flex: 0; + -ms-flex: 0 0 10%; + flex: 0 0 10%; + width: 10%; + max-width: 10%; } /*--------Report Column Finish--------*/ diff --git a/public/css/print.css b/public/css/print.css index f507e508f..2114b3308 100644 --- a/public/css/print.css +++ b/public/css/print.css @@ -141,6 +141,11 @@ th, td float: right !important; } +.font-size-unset +{ + font-size: unset; +} + .text { color: #3c3f72; diff --git a/resources/views/partials/reports/table/footer.blade.php b/resources/views/partials/reports/table/footer.blade.php index 32c99027a..80a92d73b 100644 --- a/resources/views/partials/reports/table/footer.blade.php +++ b/resources/views/partials/reports/table/footer.blade.php @@ -1,11 +1,11 @@ - - {{ trans_choice('general.totals', 1) }} + + {{ trans_choice('general.totals', 1) }} @php $grand_total = 0; @endphp @foreach($class->footer_totals[$table] as $total) @php $grand_total += $total; @endphp - @money($total, setting('default.currency'), true) + @money($total, setting('default.currency'), true) @endforeach - @money($grand_total, setting('default.currency'), true) + @money($grand_total, setting('default.currency'), true) diff --git a/resources/views/partials/reports/table/header.blade.php b/resources/views/partials/reports/table/header.blade.php index e56d91cae..f3d447ac0 100644 --- a/resources/views/partials/reports/table/header.blade.php +++ b/resources/views/partials/reports/table/header.blade.php @@ -1,13 +1,13 @@ - + @if (($table == 'default') && !empty($class->groups)) - {{ $class->groups[$class->model->settings->group] }} + {{ $class->groups[$class->model->settings->group] }} @else - {{ $table }} + {{ $table }} @endif @foreach($class->dates as $date) - {{ $date }} + {{ $date }} @endforeach - {{ trans_choice('general.totals', 1) }} + {{ trans_choice('general.totals', 1) }} diff --git a/resources/views/partials/reports/table/rows.blade.php b/resources/views/partials/reports/table/rows.blade.php index 68ac59682..0b869bcc3 100644 --- a/resources/views/partials/reports/table/rows.blade.php +++ b/resources/views/partials/reports/table/rows.blade.php @@ -1,9 +1,9 @@ @php $row_total = 0; @endphp - - {{ $class->row_names[$table][$id] }} + + {{ $class->row_names[$table][$id] }} @foreach($rows as $row) @php $row_total += $row; @endphp - @money($row, setting('default.currency'), true) + @money($row, setting('default.currency'), true) @endforeach - @money($row_total, setting('default.currency'), true) + @money($row_total, setting('default.currency'), true) diff --git a/resources/views/reports/profit_loss/content/footer.blade.php b/resources/views/reports/profit_loss/content/footer.blade.php index 713c2f314..73371afab 100644 --- a/resources/views/reports/profit_loss/content/footer.blade.php +++ b/resources/views/reports/profit_loss/content/footer.blade.php @@ -1,12 +1,12 @@
- - + + @foreach($class->net_profit as $profit) - + @endforeach - diff --git a/resources/views/reports/profit_loss/content/header.blade.php b/resources/views/reports/profit_loss/content/header.blade.php index 8b700c307..e4318f3cf 100644 --- a/resources/views/reports/profit_loss/content/header.blade.php +++ b/resources/views/reports/profit_loss/content/header.blade.php @@ -1,12 +1,12 @@
{{ trans('reports.net_profit') }}
{{ trans('reports.net_profit') }}@money($profit, setting('default.currency'), true)@money($profit, setting('default.currency'), true) + @money(array_sum($class->net_profit), setting('default.currency'), true)
- - + + @foreach($class->dates as $date) - + @endforeach - diff --git a/resources/views/reports/profit_loss/table/footer.blade.php b/resources/views/reports/profit_loss/table/footer.blade.php index 7d3b1e01c..261cda330 100644 --- a/resources/views/reports/profit_loss/table/footer.blade.php +++ b/resources/views/reports/profit_loss/table/footer.blade.php @@ -1,11 +1,11 @@ - - + + @php $grand_total = 0; @endphp @foreach($class->footer_totals[$table] as $date => $total) @php $grand_total += $total; @endphp - + @endforeach - + From 08f349c42ccd6a27ef2552605b0cbe2a70d4a190 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Mon, 9 Mar 2020 18:07:16 +0300 Subject: [PATCH 27/65] fixed currency conversion --- app/Abstracts/DocumentModel.php | 4 +- app/Http/Controllers/Portal/Invoices.php | 4 +- app/Http/Controllers/Purchases/Bills.php | 2 +- app/Http/Controllers/Sales/Invoices.php | 2 +- .../Banking/CreateDocumentTransaction.php | 8 ++-- app/Jobs/Banking/CreateTransfer.php | 4 +- app/Jobs/Banking/UpdateTransfer.php | 4 +- app/Models/Banking/Transaction.php | 5 --- app/Traits/Currencies.php | 38 +++++-------------- composer.json | 2 +- 10 files changed, 24 insertions(+), 49 deletions(-) diff --git a/app/Abstracts/DocumentModel.php b/app/Abstracts/DocumentModel.php index c0c7896c0..efd540783 100644 --- a/app/Abstracts/DocumentModel.php +++ b/app/Abstracts/DocumentModel.php @@ -98,7 +98,7 @@ abstract class DocumentModel extends Model $default_model->currency_code = $item->currency_code; $default_model->currency_rate = $currencies[$item->currency_code]; - $default_amount = (double) $default_model->getDivideConvertedAmount(); + $default_amount = (double) $default_model->getAmountConvertedToDefault(); $convert_model = new Transaction(); $convert_model->default_currency_code = $item->currency_code; @@ -106,7 +106,7 @@ abstract class DocumentModel extends Model $convert_model->currency_code = $this->currency_code; $convert_model->currency_rate = $currencies[$this->currency_code]; - $amount = (double) $convert_model->getAmountConvertedFromCustomDefault(); + $amount = (double) $convert_model->getAmountConvertedFromDefault(); } $paid += $amount; diff --git a/app/Http/Controllers/Portal/Invoices.php b/app/Http/Controllers/Portal/Invoices.php index 4abaf5803..24cb48447 100644 --- a/app/Http/Controllers/Portal/Invoices.php +++ b/app/Http/Controllers/Portal/Invoices.php @@ -100,7 +100,7 @@ class Invoices extends Controller if ($invoice->currency_code != $item->currency_code) { $item->default_currency_code = $invoice->currency_code; - $amount = $item->getAmountConvertedFromCustomDefault(); + $amount = $item->getAmountConvertedFromDefault(); } $paid += $amount; @@ -129,7 +129,7 @@ class Invoices extends Controller if ($invoice->currency_code != $item->currency_code) { $item->default_currency_code = $invoice->currency_code; - $amount = $item->getAmountConvertedFromCustomDefault(); + $amount = $item->getAmountConvertedFromDefault(); } $paid += $amount; diff --git a/app/Http/Controllers/Purchases/Bills.php b/app/Http/Controllers/Purchases/Bills.php index e56108269..661445943 100644 --- a/app/Http/Controllers/Purchases/Bills.php +++ b/app/Http/Controllers/Purchases/Bills.php @@ -371,7 +371,7 @@ class Bills extends Controller if ($bill->currency_code != $item->currency_code) { $item->default_currency_code = $bill->currency_code; - $amount = $item->getAmountConvertedFromCustomDefault(); + $amount = $item->getAmountConvertedFromDefault(); } $paid += $amount; diff --git a/app/Http/Controllers/Sales/Invoices.php b/app/Http/Controllers/Sales/Invoices.php index 66eda1591..38a2d66e2 100644 --- a/app/Http/Controllers/Sales/Invoices.php +++ b/app/Http/Controllers/Sales/Invoices.php @@ -447,7 +447,7 @@ class Invoices extends Controller if ($invoice->currency_code != $item->currency_code) { $item->default_currency_code = $invoice->currency_code; - $amount = $item->getAmountConvertedFromCustomDefault(); + $amount = $item->getAmountConvertedFromDefault(); } $paid += $amount; diff --git a/app/Jobs/Banking/CreateDocumentTransaction.php b/app/Jobs/Banking/CreateDocumentTransaction.php index 201c7a526..400f59d47 100644 --- a/app/Jobs/Banking/CreateDocumentTransaction.php +++ b/app/Jobs/Banking/CreateDocumentTransaction.php @@ -92,7 +92,7 @@ class CreateDocumentTransaction extends Job $default_amount_model->currency_code = $this->request['currency_code']; $default_amount_model->currency_rate = $currencies[$this->request['currency_code']]; - $default_amount = (double) $default_amount_model->getDivideConvertedAmount(); + $default_amount = (double) $default_amount_model->getAmountConvertedToDefault(); $convert_amount_model = new Transaction(); $convert_amount_model->default_currency_code = $this->request['currency_code']; @@ -100,7 +100,7 @@ class CreateDocumentTransaction extends Job $convert_amount_model->currency_code = $this->model->currency_code; $convert_amount_model->currency_rate = $currencies[$this->model->currency_code]; - $amount = (double) $convert_amount_model->getAmountConvertedFromCustomDefault(); + $amount = (double) $convert_amount_model->getAmountConvertedFromDefault(); } $total_amount -= $this->model->paid; @@ -126,7 +126,7 @@ class CreateDocumentTransaction extends Job $error_amount_model->currency_code = $this->model->currency_code; $error_amount_model->currency_rate = $currencies[$this->model->currency_code]; - $error_amount = (double) $error_amount_model->getDivideConvertedAmount(); + $error_amount = (double) $error_amount_model->getAmountConvertedToDefault(); $convert_amount_model = new Transaction(); $convert_amount_model->default_currency_code = $this->model->currency_code; @@ -134,7 +134,7 @@ class CreateDocumentTransaction extends Job $convert_amount_model->currency_code = $this->request['currency_code']; $convert_amount_model->currency_rate = $currencies[$this->request['currency_code']]; - $error_amount = (double) $convert_amount_model->getAmountConvertedFromCustomDefault(); + $error_amount = (double) $convert_amount_model->getAmountConvertedFromDefault(); } $message = trans('messages.error.over_payment', ['amount' => money($error_amount, $this->request['currency_code'], true)]); diff --git a/app/Jobs/Banking/CreateTransfer.php b/app/Jobs/Banking/CreateTransfer.php index 9c93e53d8..1daaac4a6 100644 --- a/app/Jobs/Banking/CreateTransfer.php +++ b/app/Jobs/Banking/CreateTransfer.php @@ -64,7 +64,7 @@ class CreateTransfer extends Job $default_amount_model->currency_code = $expense_currency_code; $default_amount_model->currency_rate = $currencies[$expense_currency_code]; - $default_amount = $default_amount_model->getAmountDivided(); + $default_amount = $default_amount_model->getAmountConvertedToDefault(); } $transfer_amount = new Transfer(); @@ -74,7 +74,7 @@ class CreateTransfer extends Job $transfer_amount->currency_code = $income_currency_code; $transfer_amount->currency_rate = $currencies[$income_currency_code]; - $amount = $transfer_amount->getAmountConvertedFromCustomDefault(); + $amount = $transfer_amount->getAmountConvertedFromDefault(); } else { $amount = $this->request->get('amount'); } diff --git a/app/Jobs/Banking/UpdateTransfer.php b/app/Jobs/Banking/UpdateTransfer.php index 99a887042..4437936e2 100644 --- a/app/Jobs/Banking/UpdateTransfer.php +++ b/app/Jobs/Banking/UpdateTransfer.php @@ -71,7 +71,7 @@ class UpdateTransfer extends Job $default_amount_model->currency_code = $expense_currency_code; $default_amount_model->currency_rate = $currencies[$expense_currency_code]; - $default_amount = $default_amount_model->getDivideConvertedAmount(); + $default_amount = $default_amount_model->getAmountConvertedToDefault(); } $transfer_amount = new Transfer(); @@ -81,7 +81,7 @@ class UpdateTransfer extends Job $transfer_amount->currency_code = $income_currency_code; $transfer_amount->currency_rate = $currencies[$income_currency_code]; - $amount = $transfer_amount->getAmountConvertedFromCustomDefault(); + $amount = $transfer_amount->getAmountConvertedFromDefault(); } else { $amount = $this->request->get('amount'); } diff --git a/app/Models/Banking/Transaction.php b/app/Models/Banking/Transaction.php index ffd3395a0..c33afb47c 100644 --- a/app/Models/Banking/Transaction.php +++ b/app/Models/Banking/Transaction.php @@ -211,9 +211,4 @@ class Transaction extends Model return $this->getMedia('attachment')->last(); } - - public function getDivideConvertedAmount($format = false) - { - return $this->divide($this->amount, $this->currency_code, $this->currency_rate, $format); - } } diff --git a/app/Traits/Currencies.php b/app/Traits/Currencies.php index 48693ddaa..09a6579cb 100644 --- a/app/Traits/Currencies.php +++ b/app/Traits/Currencies.php @@ -3,46 +3,31 @@ namespace App\Traits; use Akaunting\Money\Money; -use Akaunting\Money\Currency; trait Currencies { - public function convert($amount, $from, $to, $rate, $format = false) + public function convert($method, $amount, $from, $to, $rate, $format = false) { - $money = Money::$from($amount, $format); + $money = Money::$to($amount, $format); // No need to convert same currency if ($from == $to) { return $format ? $money->format() : $money->getAmount(); } - $money = $money->convert(new Currency($to), (double) $rate); + $money = $money->$method((double) $rate); return $format ? $money->format() : $money->getAmount(); } - public function divide($amount, $code, $rate, $format = false) - { - $money = Money::$code($amount, $format); - - $money = $money->divide((double) $rate); - - return $format ? $money->format() : $money->getAmount(); - } - - public function getAmount($with_tax = true) - { - return $with_tax ? $this->amount : (isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount); - } - public function convertToDefault($amount, $from, $rate, $format = false) { - return $this->convert($amount, $from, $this->getDefaultCurrency(), $rate, $format); + return $this->convert('divide', $amount, $from, $this->getDefaultCurrency(), $rate, $format); } public function convertFromDefault($amount, $to, $rate, $format = false) { - return $this->convert($amount, $this->getDefaultCurrency(), $to, $rate, $format); + return $this->convert('multiply', $amount, $this->getDefaultCurrency(), $to, $rate, $format); } public function getAmountConvertedToDefault($format = false, $with_tax = true) @@ -55,18 +40,13 @@ trait Currencies return $this->convertFromDefault($this->getAmount($with_tax), $this->currency_code, $this->currency_rate, $format); } - public function getAmountConvertedFromCustomDefault($format = false, $with_tax = true) + public function getAmount($with_tax = true) { - return $this->convert($this->getAmount($with_tax), $this->default_currency_code, $this->currency_code, $this->currency_rate, $format); + return $with_tax ? $this->amount : (isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount); } - public function getAmountDivided($format = false, $with_tax = true) + public function getDefaultCurrency() { - return $this->divide($this->getAmount($with_tax), $this->currency_code, $this->currency_rate, $format); - } - - protected function getDefaultCurrency() - { - return setting('default.currency', 'USD'); + return !empty($this->default_currency_code) ? $this->default_currency_code : setting('default.currency', 'USD'); } } diff --git a/composer.json b/composer.json index f5deaa9c3..d9baa9b04 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "akaunting/language": "1.0.*", "akaunting/menu": "1.0.*", "akaunting/module": "1.0.*", - "akaunting/money": "1.0.*", + "akaunting/money": "1.1.*", "akaunting/setting": "1.1.*", "akaunting/version": "1.0.*", "barryvdh/laravel-debugbar": "3.2.*", From ca5750b1e3521e526010ea7a3f9c10fa6cdea7ba Mon Sep 17 00:00:00 2001 From: denisdulici Date: Tue, 10 Mar 2020 11:26:34 +0300 Subject: [PATCH 28/65] formatting --- app/Models/Common/Contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/Common/Contact.php b/app/Models/Common/Contact.php index 109762bf6..632c0a97d 100644 --- a/app/Models/Common/Contact.php +++ b/app/Models/Common/Contact.php @@ -114,7 +114,7 @@ class Contact extends Model $this->$collection()->accrued()->notPaid()->each(function ($item) use (&$amount) { $unpaid = $item->amount - $item->paid; - $amount += $this->convertFromDefault($unpaid, $item->currency_code, $item->currency_rate, false); + $amount += $this->convertFromDefault($unpaid, $item->currency_code, $item->currency_rate); }); return $amount; From 5e82e510a1bd03a4fdf8756757803b41fad14421 Mon Sep 17 00:00:00 2001 From: batuhanbas Date: Tue, 10 Mar 2020 12:31:10 +0300 Subject: [PATCH 29/65] forgotten classes in reports --- resources/views/partials/reports/table/footer.blade.php | 4 ++-- resources/views/partials/reports/table/header.blade.php | 4 ++-- resources/views/partials/reports/table/rows.blade.php | 4 ++-- .../views/reports/profit_loss/content/footer.blade.php | 4 ++-- .../views/reports/profit_loss/content/header.blade.php | 6 +++--- resources/views/reports/profit_loss/table/footer.blade.php | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/resources/views/partials/reports/table/footer.blade.php b/resources/views/partials/reports/table/footer.blade.php index 80a92d73b..aae77f330 100644 --- a/resources/views/partials/reports/table/footer.blade.php +++ b/resources/views/partials/reports/table/footer.blade.php @@ -4,8 +4,8 @@ @php $grand_total = 0; @endphp @foreach($class->footer_totals[$table] as $total) @php $grand_total += $total; @endphp - + @endforeach - + diff --git a/resources/views/partials/reports/table/header.blade.php b/resources/views/partials/reports/table/header.blade.php index f3d447ac0..e4dfb3bc1 100644 --- a/resources/views/partials/reports/table/header.blade.php +++ b/resources/views/partials/reports/table/header.blade.php @@ -6,8 +6,8 @@ @endif @foreach($class->dates as $date) - + @endforeach - + diff --git a/resources/views/partials/reports/table/rows.blade.php b/resources/views/partials/reports/table/rows.blade.php index 0b869bcc3..5b62bebc8 100644 --- a/resources/views/partials/reports/table/rows.blade.php +++ b/resources/views/partials/reports/table/rows.blade.php @@ -3,7 +3,7 @@ @foreach($rows as $row) @php $row_total += $row; @endphp - + @endforeach - + diff --git a/resources/views/reports/profit_loss/content/footer.blade.php b/resources/views/reports/profit_loss/content/footer.blade.php index 73371afab..f7091fb6b 100644 --- a/resources/views/reports/profit_loss/content/footer.blade.php +++ b/resources/views/reports/profit_loss/content/footer.blade.php @@ -4,9 +4,9 @@ @foreach($class->net_profit as $profit) - + @endforeach - diff --git a/resources/views/reports/profit_loss/content/header.blade.php b/resources/views/reports/profit_loss/content/header.blade.php index e4318f3cf..d67f42022 100644 --- a/resources/views/reports/profit_loss/content/header.blade.php +++ b/resources/views/reports/profit_loss/content/header.blade.php @@ -2,11 +2,11 @@
{{ $date }}{{ $date }} + {{ trans_choice('general.totals', 1) }}
{{ trans_choice('general.totals', 1) }}
{{ trans_choice('general.totals', 1) }}@money($total, setting('default.currency'), true)@money($total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)
@money($total, setting('default.currency'), true)@money($total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)
{{ $table }}{{ $date }}{{ $date }}{{ trans_choice('general.totals', 1) }}{{ trans_choice('general.totals', 1) }}
{{ $class->row_names[$table][$id] }}@money($row, setting('default.currency'), true)@money($row, setting('default.currency'), true)@money($row_total, setting('default.currency'), true)@money($row_total, setting('default.currency'), true)
{{ trans('reports.net_profit') }}@money($profit, setting('default.currency'), true)@money($profit, setting('default.currency'), true) + @money(array_sum($class->net_profit), setting('default.currency'), true)
- + @foreach($class->dates as $date) - + @endforeach - diff --git a/resources/views/reports/profit_loss/table/footer.blade.php b/resources/views/reports/profit_loss/table/footer.blade.php index 261cda330..92cc749f3 100644 --- a/resources/views/reports/profit_loss/table/footer.blade.php +++ b/resources/views/reports/profit_loss/table/footer.blade.php @@ -4,8 +4,8 @@ @php $grand_total = 0; @endphp @foreach($class->footer_totals[$table] as $date => $total) @php $grand_total += $total; @endphp - + @endforeach - + From 1d08c0ea80d4b818ec031728981d05b64d49543b Mon Sep 17 00:00:00 2001 From: batuhanbas Date: Tue, 10 Mar 2020 14:54:20 +0300 Subject: [PATCH 30/65] report function usage updated --- app/Abstracts/Report.php | 37 +++++-------------- public/css/custom.css | 18 ++++----- .../partials/reports/table/footer.blade.php | 6 +-- .../partials/reports/table/header.blade.php | 8 ++-- .../partials/reports/table/rows.blade.php | 6 +-- .../profit_loss/content/footer.blade.php | 8 ++-- .../profit_loss/content/header.blade.php | 6 +-- .../profit_loss/table/footer.blade.php | 8 ++-- 8 files changed, 40 insertions(+), 57 deletions(-) diff --git a/app/Abstracts/Report.php b/app/Abstracts/Report.php index a4a8d0064..9b16044a3 100644 --- a/app/Abstracts/Report.php +++ b/app/Abstracts/Report.php @@ -67,8 +67,8 @@ abstract class Report 'datasets' => [], ]; - public $column_width = 'report-column'; - public $head_column_width = 'head_report_column'; + public $column_name_width = 'report-column-name'; + public $column_value_width = 'report-column-value'; public function __construct(Model $model = null, $load_data = true) { @@ -79,8 +79,6 @@ abstract class Report } $this->model = $model; - $this->setHeadColumnWidth(); - $this->setDataColumnWidth(); if (!$load_data) { return; @@ -100,6 +98,7 @@ abstract class Report $this->setFilters(); $this->setRows(); $this->setData(); + $this->setColumnWidth(); $this->loaded = true; } @@ -203,33 +202,13 @@ abstract class Report return \Excel::download(new Export($this->views['content'], $this), \Str::filename($this->model->name) . '.xlsx'); } - public function setHeadColumnWidth() + public function setColumnWidth() { if (empty($this->model->settings->period)) { return; } - $head_width = 'head_report_column'; - - switch ($this->model->settings->period) { - case 'quarterly': - $head_width = 'col-sm-2'; - break; - case 'yearly': - $head_width = 'col-sm-4'; - break; - } - - $this->head_column_width = $head_width; - } - - public function setDataColumnWidth() - { - if (empty($this->model->settings->period)) { - return; - } - - $width = 'report-column'; + $width = ''; switch ($this->model->settings->period) { case 'quarterly': @@ -240,7 +219,11 @@ abstract class Report break; } - $this->column_width = $width; + if (empty($width)) { + return; + } + + $this->column_name_width = $this->column_value_width = $width; } public function setYear() diff --git a/public/css/custom.css b/public/css/custom.css index 98f8ec13e..62dbd3de2 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -634,15 +634,7 @@ table .align-items-center td span.badge /*--------Report Column--------*/ -.report-column -{ - -webkit-box-flex: 0; - -ms-flex: 0 0 6.66%; - flex: 0 0 6.66%; - max-width: 6.66%; -} - -.head_report_column +.report-column-name { -webkit-box-flex: 0; -ms-flex: 0 0 10%; @@ -650,6 +642,14 @@ table .align-items-center td span.badge width: 10%; max-width: 10%; } + +.report-column-value +{ + -webkit-box-flex: 0; + -ms-flex: 0 0 6.66%; + flex: 0 0 6.66%; + max-width: 6.66%; +} /*--------Report Column Finish--------*/ diff --git a/resources/views/partials/reports/table/footer.blade.php b/resources/views/partials/reports/table/footer.blade.php index aae77f330..7464aa6b6 100644 --- a/resources/views/partials/reports/table/footer.blade.php +++ b/resources/views/partials/reports/table/footer.blade.php @@ -1,11 +1,11 @@ - + @php $grand_total = 0; @endphp @foreach($class->footer_totals[$table] as $total) @php $grand_total += $total; @endphp - + @endforeach - + diff --git a/resources/views/partials/reports/table/header.blade.php b/resources/views/partials/reports/table/header.blade.php index e4dfb3bc1..c4d0edd32 100644 --- a/resources/views/partials/reports/table/header.blade.php +++ b/resources/views/partials/reports/table/header.blade.php @@ -1,13 +1,13 @@ @if (($table == 'default') && !empty($class->groups)) - + @else - + @endif @foreach($class->dates as $date) - + @endforeach - + diff --git a/resources/views/partials/reports/table/rows.blade.php b/resources/views/partials/reports/table/rows.blade.php index 5b62bebc8..9ae064ea4 100644 --- a/resources/views/partials/reports/table/rows.blade.php +++ b/resources/views/partials/reports/table/rows.blade.php @@ -1,9 +1,9 @@ @php $row_total = 0; @endphp - + @foreach($rows as $row) @php $row_total += $row; @endphp - + @endforeach - + diff --git a/resources/views/reports/profit_loss/content/footer.blade.php b/resources/views/reports/profit_loss/content/footer.blade.php index f7091fb6b..0344cba21 100644 --- a/resources/views/reports/profit_loss/content/footer.blade.php +++ b/resources/views/reports/profit_loss/content/footer.blade.php @@ -1,12 +1,12 @@ -
+
{{ $date }}{{ $date }} + {{ trans_choice('general.totals', 1) }}
@money($total, setting('default.currency'), true)@money($total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)
{{ trans_choice('general.totals', 1) }}{{ trans_choice('general.totals', 1) }}@money($total, setting('default.currency'), true)@money($total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)
{{ $class->groups[$class->model->settings->group] }}{{ $class->groups[$class->model->settings->group] }}{{ $table }}{{ $table }}{{ $date }}{{ $date }}{{ trans_choice('general.totals', 1) }}{{ trans_choice('general.totals', 1) }}
{{ $class->row_names[$table][$id] }}{{ $class->row_names[$table][$id] }}@money($row, setting('default.currency'), true)@money($row, setting('default.currency'), true)@money($row_total, setting('default.currency'), true)@money($row_total, setting('default.currency'), true)
- + @foreach($class->net_profit as $profit) - + @endforeach - diff --git a/resources/views/reports/profit_loss/content/header.blade.php b/resources/views/reports/profit_loss/content/header.blade.php index d67f42022..77bb48802 100644 --- a/resources/views/reports/profit_loss/content/header.blade.php +++ b/resources/views/reports/profit_loss/content/header.blade.php @@ -2,11 +2,11 @@
{{ trans('reports.net_profit') }}{{ trans('reports.net_profit') }}@money($profit, setting('default.currency'), true)@money($profit, setting('default.currency'), true) + @money(array_sum($class->net_profit), setting('default.currency'), true)
- + @foreach($class->dates as $date) - + @endforeach - diff --git a/resources/views/reports/profit_loss/table/footer.blade.php b/resources/views/reports/profit_loss/table/footer.blade.php index 92cc749f3..469f393a5 100644 --- a/resources/views/reports/profit_loss/table/footer.blade.php +++ b/resources/views/reports/profit_loss/table/footer.blade.php @@ -1,11 +1,11 @@ - - + + @php $grand_total = 0; @endphp @foreach($class->footer_totals[$table] as $date => $total) @php $grand_total += $total; @endphp - + @endforeach - + From fa3dcd3b25be4dfbf0794796da9db8e0ba984c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 10 Mar 2020 15:02:19 +0300 Subject: [PATCH 31/65] invoice and bill item create.. --- app/Listeners/Update/V20/Version205.php | 100 ++++++++++++++++++++++++ app/Providers/Event.php | 1 + 2 files changed, 101 insertions(+) create mode 100644 app/Listeners/Update/V20/Version205.php diff --git a/app/Listeners/Update/V20/Version205.php b/app/Listeners/Update/V20/Version205.php new file mode 100644 index 000000000..3c68064d4 --- /dev/null +++ b/app/Listeners/Update/V20/Version205.php @@ -0,0 +1,100 @@ +skipThisUpdate($event)) { + return; + } + + $this->items = []; + + $this->updateBillItems(); + + $this->updateInvoiceItems(); + } + + protected function updateBillItems() + { + $bill_items = DB::table('bill_items')->whereNull('deleted_at')->where('item_id', 0)->cursor(); + + foreach ($bill_items as $bill_item) { + $item_id = $this->getItemId($bill_item); + + DB::table('bill_items') + ->where('id', $bill_item->id) + ->update(['item_id' => $item_id]); + } + } + + protected function updateInvoiceItems() + { + $invoice_items = DB::table('invoice_items')->whereNull('deleted_at')->where('item_id', 0)->cursor(); + + foreach ($invoice_items as $invoice_item) { + $item_id = $this->getItemId($invoice_item); + + DB::table('invoice_items') + ->where('id', $invoice_item->id) + ->update(['item_id' => $item_id]); + + DB::table('items') + ->where('id', $item_id) + ->update(['sales_price' => $invoice_item->price]); + } + } + + protected function getItemId($item) + { + // Set category_id for company. + if (!isset($this->categories[$item->company_id])) { + $this->categories[$item->company_id] = DB::table('categories')->where('company_id', $item->company_id)->where('type', 'item')->first()->id; + } + + // Return set item_id for item name. + if (isset($this->items[$item->company_id]) && in_array($item->name, $this->items[$item->company_id])) { + return array_search($item->name, $this->items[$item->company_id]); + } + + // Insert new item. + $item_id = DB::table('items')->insertGetId([ + 'company_id' => $item->company_id, + 'name' => $item->name, + 'description' => null, + 'sale_price' => $item->price, + 'purchase_price' => $item->price, + 'category_id' => $this->categories[$item->company_id], + 'tax_id' => null, + 'enabled' => 1, + 'created_at' => $item->created_at, + 'updated_at' => $item->updated_at, + 'deleted_at' => null, + ]); + + // Set item_id for item name. + $this->items[$item->company_id][$item_id] = $item->name; + + return $item_id; + } +} diff --git a/app/Providers/Event.php b/app/Providers/Event.php index 42d2af107..22c0704ec 100644 --- a/app/Providers/Event.php +++ b/app/Providers/Event.php @@ -16,6 +16,7 @@ class Event extends Provider 'App\Listeners\Update\CreateModuleUpdatedHistory', 'App\Listeners\Update\V20\Version200', 'App\Listeners\Update\V20\Version203', + 'App\Listeners\Update\V20\Version205', ], 'Illuminate\Auth\Events\Login' => [ 'App\Listeners\Auth\Login', From f05425b0915319b2eab908c05c38230868e12198 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Tue, 10 Mar 2020 15:14:35 +0300 Subject: [PATCH 32/65] styling --- resources/views/partials/reports/table.blade.php | 2 +- resources/views/reports/profit_loss/content/footer.blade.php | 2 +- resources/views/reports/profit_loss/content/header.blade.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/partials/reports/table.blade.php b/resources/views/partials/reports/table.blade.php index 424e3907c..a3794a43a 100644 --- a/resources/views/partials/reports/table.blade.php +++ b/resources/views/partials/reports/table.blade.php @@ -1,4 +1,4 @@ -
+
{{ $date }}{{ $date }} + {{ trans_choice('general.totals', 1) }}
{{ trans_choice('general.totals', 1) }}
{{ trans_choice('general.totals', 1) }}@money($total, setting('default.currency'), true)@money($total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)
@include($class->views['table.header']) diff --git a/resources/views/reports/profit_loss/content/footer.blade.php b/resources/views/reports/profit_loss/content/footer.blade.php index 0344cba21..e2d7e44a3 100644 --- a/resources/views/reports/profit_loss/content/footer.blade.php +++ b/resources/views/reports/profit_loss/content/footer.blade.php @@ -1,4 +1,4 @@ -
+
diff --git a/resources/views/reports/profit_loss/content/header.blade.php b/resources/views/reports/profit_loss/content/header.blade.php index 77bb48802..9682fa509 100644 --- a/resources/views/reports/profit_loss/content/header.blade.php +++ b/resources/views/reports/profit_loss/content/header.blade.php @@ -1,4 +1,4 @@ -
+
From 397b050eaeb67b6c8dd895e804240dd89efaff72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 10 Mar 2020 17:25:22 +0300 Subject: [PATCH 33/65] close #1340 Fixed: Missing edit invoice and bill item taxes. --- app/Models/Purchase/BillItem.php | 25 +++++++++++++++++++++++++ app/Models/Sale/InvoiceItem.php | 25 +++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/app/Models/Purchase/BillItem.php b/app/Models/Purchase/BillItem.php index 76ae399e0..774d2784b 100644 --- a/app/Models/Purchase/BillItem.php +++ b/app/Models/Purchase/BillItem.php @@ -27,6 +27,15 @@ class BillItem extends Model */ public $cloneable_relations = ['taxes']; + public static function boot() + { + parent::boot(); + + static::retrieved(function($model) { + $model->setTaxIds(); + }); + } + public function bill() { return $this->belongsTo('App\Models\Purchase\Bill'); @@ -74,4 +83,20 @@ class BillItem extends Model { $this->attributes['tax'] = (double) $value; } + + /** + * Convert tax to Array. + * + * @return void + */ + public function setTaxIds() + { + $tax_ids = []; + + foreach ($this->taxes as $tax) { + $tax_ids[] = (string) $tax->tax_id; + } + + $this->setAttribute('tax_id', $tax_ids); + } } diff --git a/app/Models/Sale/InvoiceItem.php b/app/Models/Sale/InvoiceItem.php index b9bd13a43..8fac300a2 100644 --- a/app/Models/Sale/InvoiceItem.php +++ b/app/Models/Sale/InvoiceItem.php @@ -26,6 +26,15 @@ class InvoiceItem extends Model */ public $cloneable_relations = ['taxes']; + public static function boot() + { + parent::boot(); + + static::retrieved(function($model) { + $model->setTaxIds(); + }); + } + public function invoice() { return $this->belongsTo('App\Models\Sale\Invoice'); @@ -73,4 +82,20 @@ class InvoiceItem extends Model { $this->attributes['tax'] = (double) $value; } + + /** + * Convert tax to Array. + * + * @return void + */ + public function setTaxIds() + { + $tax_ids = []; + + foreach ($this->taxes as $tax) { + $tax_ids[] = (string) $tax->tax_id; + } + + $this->setAttribute('tax_id', $tax_ids); + } } From f75635c4ae3bad885b70a540dcd583d83d2c108a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 10 Mar 2020 17:30:47 +0300 Subject: [PATCH 34/65] old invoice and bill items get table.. --- resources/views/purchases/bills/create.blade.php | 2 +- resources/views/purchases/bills/edit.blade.php | 2 +- resources/views/sales/invoices/create.blade.php | 2 +- resources/views/sales/invoices/edit.blade.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/purchases/bills/create.blade.php b/resources/views/purchases/bills/create.blade.php index 910fb1268..6b5b0ced6 100644 --- a/resources/views/purchases/bills/create.blade.php +++ b/resources/views/purchases/bills/create.blade.php @@ -198,7 +198,7 @@ @push('scripts_start') diff --git a/resources/views/purchases/bills/edit.blade.php b/resources/views/purchases/bills/edit.blade.php index 415960492..4bd955b1b 100644 --- a/resources/views/purchases/bills/edit.blade.php +++ b/resources/views/purchases/bills/edit.blade.php @@ -201,7 +201,7 @@ @push('scripts_start') diff --git a/resources/views/sales/invoices/create.blade.php b/resources/views/sales/invoices/create.blade.php index 0c0726986..d32cdf149 100644 --- a/resources/views/sales/invoices/create.blade.php +++ b/resources/views/sales/invoices/create.blade.php @@ -200,7 +200,7 @@ @push('scripts_start') diff --git a/resources/views/sales/invoices/edit.blade.php b/resources/views/sales/invoices/edit.blade.php index 7e3a3c65e..72aec97ee 100644 --- a/resources/views/sales/invoices/edit.blade.php +++ b/resources/views/sales/invoices/edit.blade.php @@ -203,7 +203,7 @@ @push('scripts_start') From 38a97f9498d98934546bf8991a0bbac127a62413 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Tue, 10 Mar 2020 17:42:13 +0300 Subject: [PATCH 35/65] styling reports --- .../views/partials/reports/table/footer.blade.php | 2 +- .../views/partials/reports/table/header.blade.php | 2 +- resources/views/partials/reports/table/rows.blade.php | 2 +- .../views/reports/profit_loss/content/footer.blade.php | 4 +--- .../views/reports/profit_loss/content/header.blade.php | 4 +--- .../views/reports/profit_loss/table/footer.blade.php | 2 +- .../views/reports/tax_summary/content/footer.blade.php | 1 - .../views/reports/tax_summary/content/header.blade.php | 10 +++++----- .../views/reports/tax_summary/table/footer.blade.php | 8 ++++---- 9 files changed, 15 insertions(+), 20 deletions(-) diff --git a/resources/views/partials/reports/table/footer.blade.php b/resources/views/partials/reports/table/footer.blade.php index 7464aa6b6..ba6e3260a 100644 --- a/resources/views/partials/reports/table/footer.blade.php +++ b/resources/views/partials/reports/table/footer.blade.php @@ -6,6 +6,6 @@ @php $grand_total += $total; @endphp @endforeach - + diff --git a/resources/views/partials/reports/table/header.blade.php b/resources/views/partials/reports/table/header.blade.php index c4d0edd32..85da605e6 100644 --- a/resources/views/partials/reports/table/header.blade.php +++ b/resources/views/partials/reports/table/header.blade.php @@ -8,6 +8,6 @@ @foreach($class->dates as $date) @endforeach - + diff --git a/resources/views/partials/reports/table/rows.blade.php b/resources/views/partials/reports/table/rows.blade.php index 9ae064ea4..30fdbb3e4 100644 --- a/resources/views/partials/reports/table/rows.blade.php +++ b/resources/views/partials/reports/table/rows.blade.php @@ -5,5 +5,5 @@ @php $row_total += $row; @endphp @endforeach - + diff --git a/resources/views/reports/profit_loss/content/footer.blade.php b/resources/views/reports/profit_loss/content/footer.blade.php index e2d7e44a3..286aeb58f 100644 --- a/resources/views/reports/profit_loss/content/footer.blade.php +++ b/resources/views/reports/profit_loss/content/footer.blade.php @@ -6,9 +6,7 @@ @foreach($class->net_profit as $profit) @endforeach - +
@money($total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)@money($grand_total, setting('default.currency'), true)
{{ $date }}{{ trans_choice('general.totals', 1) }}{{ trans_choice('general.totals', 1) }}
@money($row, setting('default.currency'), true)@money($row_total, setting('default.currency'), true)@money($row_total, setting('default.currency'), true)
@money($profit, setting('default.currency'), true) - @money(array_sum($class->net_profit), setting('default.currency'), true) - @money(array_sum($class->net_profit), setting('default.currency'), true)
diff --git a/resources/views/reports/profit_loss/content/header.blade.php b/resources/views/reports/profit_loss/content/header.blade.php index 9682fa509..8e3aa5fbd 100644 --- a/resources/views/reports/profit_loss/content/header.blade.php +++ b/resources/views/reports/profit_loss/content/header.blade.php @@ -6,9 +6,7 @@ @foreach($class->dates as $date) {{ $date }} @endforeach - - {{ trans_choice('general.totals', 1) }} - + {{ trans_choice('general.totals', 1) }} diff --git a/resources/views/reports/profit_loss/table/footer.blade.php b/resources/views/reports/profit_loss/table/footer.blade.php index 469f393a5..5cae13c0c 100644 --- a/resources/views/reports/profit_loss/table/footer.blade.php +++ b/resources/views/reports/profit_loss/table/footer.blade.php @@ -6,6 +6,6 @@ @php $grand_total += $total; @endphp @money($total, setting('default.currency'), true) @endforeach - @money($grand_total, setting('default.currency'), true) + @money($grand_total, setting('default.currency'), true) diff --git a/resources/views/reports/tax_summary/content/footer.blade.php b/resources/views/reports/tax_summary/content/footer.blade.php index e6b2eb47b..e69de29bb 100644 --- a/resources/views/reports/tax_summary/content/footer.blade.php +++ b/resources/views/reports/tax_summary/content/footer.blade.php @@ -1 +0,0 @@ -
 
diff --git a/resources/views/reports/tax_summary/content/header.blade.php b/resources/views/reports/tax_summary/content/header.blade.php index 72e64f7e6..b658d1847 100644 --- a/resources/views/reports/tax_summary/content/header.blade.php +++ b/resources/views/reports/tax_summary/content/header.blade.php @@ -1,12 +1,12 @@ -
+
- - + + @foreach($class->dates as $date) - + @endforeach - +
{{ $date }}{{ $date }}{{ trans_choice('general.totals', 1) }}{{ trans_choice('general.totals', 1) }}
diff --git a/resources/views/reports/tax_summary/table/footer.blade.php b/resources/views/reports/tax_summary/table/footer.blade.php index 9e280f413..17b2c7bd9 100644 --- a/resources/views/reports/tax_summary/table/footer.blade.php +++ b/resources/views/reports/tax_summary/table/footer.blade.php @@ -1,11 +1,11 @@ - - {{ trans('reports.net') }} + + {{ trans('reports.net') }} @php $grand_total = 0; @endphp @foreach($class->footer_totals[$table] as $total) @php $grand_total += $total; @endphp - @money($total, setting('default.currency'), true) + @money($total, setting('default.currency'), true) @endforeach - @money($grand_total, setting('default.currency'), true) + @money($grand_total, setting('default.currency'), true) From 64cd21d5eaf99c5afe9cea31423ebb8f2f4d958c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 10 Mar 2020 17:43:19 +0300 Subject: [PATCH 36/65] close #1341 Changed: Remove code and image buttons from settings editor --- .../js/components/AkauntingHtmlEditor.vue | 94 +++++++++++++++++++ resources/assets/js/mixins/global.js | 5 +- .../assets/js/views/settings/settings.js | 14 +-- .../partials/form/text_editor_group.blade.php | 4 +- 4 files changed, 104 insertions(+), 13 deletions(-) create mode 100644 resources/assets/js/components/AkauntingHtmlEditor.vue diff --git a/resources/assets/js/components/AkauntingHtmlEditor.vue b/resources/assets/js/components/AkauntingHtmlEditor.vue new file mode 100644 index 000000000..22be7451b --- /dev/null +++ b/resources/assets/js/components/AkauntingHtmlEditor.vue @@ -0,0 +1,94 @@ + + diff --git a/resources/assets/js/mixins/global.js b/resources/assets/js/mixins/global.js index f765248d7..46bdabf21 100644 --- a/resources/assets/js/mixins/global.js +++ b/resources/assets/js/mixins/global.js @@ -11,12 +11,13 @@ import AkauntingSelect from './../components/AkauntingSelect'; import AkauntingSelectRemote from './../components/AkauntingSelectRemote'; import AkauntingDate from './../components/AkauntingDate'; import AkauntingRecurring from './../components/AkauntingRecurring'; +import AkauntingHtmlEditor from './../components/AkauntingHtmlEditor'; import NProgress from 'nprogress'; import 'nprogress/nprogress.css'; import NProgressAxios from './../plugins/nprogress-axios'; -import { Select, Option, Steps, Step, Button, Link, Tooltip } from 'element-ui'; +import { Select, Option, Steps, Step, Button, Link, Tooltip, ColorPicker } from 'element-ui'; import Form from './../plugins/form'; @@ -31,6 +32,7 @@ export default { AkauntingModalAddNew, AkauntingDate, AkauntingRecurring, + AkauntingHtmlEditor, [Select.name]: Select, [Option.name]: Option, [Steps.name]: Steps, @@ -38,6 +40,7 @@ export default { [Button.name]: Button, [Link.name]: Link, [Tooltip.name]: Tooltip, + [ColorPicker.name]: ColorPicker, }, data: function () { diff --git a/resources/assets/js/views/settings/settings.js b/resources/assets/js/views/settings/settings.js index ee28fd6ba..40c7f9be6 100644 --- a/resources/assets/js/views/settings/settings.js +++ b/resources/assets/js/views/settings/settings.js @@ -14,11 +14,9 @@ import Global from './../../mixins/global'; import Form from './../../plugins/form'; import BulkAction from './../../plugins/bulk-action'; -import HtmlEditor from './../../components/Inputs/HtmlEditor'; -import {ColorPicker} from 'element-ui'; // plugin setup -Vue.use(DashboardPlugin, ColorPicker); +Vue.use(DashboardPlugin); const app = new Vue({ el: '#app', @@ -27,13 +25,9 @@ const app = new Vue({ Global ], - components: { - HtmlEditor, - [ColorPicker.name]: ColorPicker, - }, - mounted() { this.onChangeProtocol(this.form.protocol); + this.color = this.form.color; }, @@ -41,7 +35,7 @@ const app = new Vue({ return { form: new Form('setting'), bulk_action: new BulkAction('settings'), - email:{ + email: { sendmailPath:true, smtpHost:true, smtpPort:true, @@ -60,7 +54,7 @@ const app = new Vue({ }, color: '#55588b', - predefineColors:[ + predefineColors: [ '#3c3f72', '#55588b', '#e5e5e5', diff --git a/resources/views/partials/form/text_editor_group.blade.php b/resources/views/partials/form/text_editor_group.blade.php index ade409483..74ff56c1c 100644 --- a/resources/views/partials/form/text_editor_group.blade.php +++ b/resources/views/partials/form/text_editor_group.blade.php @@ -7,7 +7,7 @@ {!! Form::label($name, $text, ['class' => 'form-control-label'])!!} @endif - + >
Date: Tue, 10 Mar 2020 19:01:38 +0300 Subject: [PATCH 37/65] Modal vendor create currency issue solved. --- resources/views/modals/vendors/create.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/modals/vendors/create.blade.php b/resources/views/modals/vendors/create.blade.php index b08f0ccd2..a2a6f81a2 100644 --- a/resources/views/modals/vendors/create.blade.php +++ b/resources/views/modals/vendors/create.blade.php @@ -14,7 +14,7 @@ {{ Form::textGroup('tax_number', trans('general.tax_number'), 'percent', []) }} - {{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'model' => setting('default.currency')]) }} + {{ Form::selectGroup('currency_code', trans_choice('general.currencies', 1), 'exchange-alt', $currencies, setting('default.currency')) }} {{ Form::textareaGroup('address', trans('general.address')) }} From adbc26a6bd98e509ff2f9ae50ce338d44decad72 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Tue, 10 Mar 2020 19:09:13 +0300 Subject: [PATCH 38/65] added progress bar --- database/seeds/SampleData.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/database/seeds/SampleData.php b/database/seeds/SampleData.php index 21af5cac1..7c15f855d 100755 --- a/database/seeds/SampleData.php +++ b/database/seeds/SampleData.php @@ -27,12 +27,35 @@ class SampleData extends Seeder $count = (int) $this->command->option('count'); $acc_count = ($count <= 10) ? $count : 10; + $this->command->info('Creating sample data...'); + + $bar = $this->command->getOutput()->createProgressBar(6); + $bar->setFormat('verbose'); + + $bar->start(); + factory(Contact::class, $count)->create(); + $bar->advance(); + factory(Category::class, $count)->create(); + $bar->advance(); + factory(Item::class, $count)->create(); + $bar->advance(); + factory(Account::class, $acc_count)->create(); + $bar->advance(); + factory(Bill::class, $count)->create(); + $bar->advance(); + factory(Invoice::class, $count)->create(); + $bar->advance(); + + $bar->finish(); + + $this->command->info(''); + $this->command->info('Sample data created.'); Model::unguard(); } From 48f3b7c3b65b9dc776430d98d01defd4d6175b77 Mon Sep 17 00:00:00 2001 From: denisdulici Date: Wed, 11 Mar 2020 14:15:24 +0300 Subject: [PATCH 39/65] added mute/unmute --- app/Abstracts/Observer.php | 10 ++++++++++ app/Jobs/Purchase/DeleteBill.php | 5 +++-- app/Jobs/Sale/DeleteInvoice.php | 5 +++-- app/Observers/Transaction.php | 11 ++--------- 4 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 app/Abstracts/Observer.php diff --git a/app/Abstracts/Observer.php b/app/Abstracts/Observer.php new file mode 100644 index 000000000..a6edc2c59 --- /dev/null +++ b/app/Abstracts/Observer.php @@ -0,0 +1,10 @@ + true]); + Transaction::mute(); $this->deleteRelationships($this->bill, [ 'items', 'item_taxes', 'histories', 'transactions', 'recurring', 'totals' @@ -34,7 +35,7 @@ class DeleteBill extends Job $this->bill->delete(); - session()->forget('deleting_bill'); + Transaction::unmute(); return true; } diff --git a/app/Jobs/Sale/DeleteInvoice.php b/app/Jobs/Sale/DeleteInvoice.php index a2beaef8c..decf06677 100644 --- a/app/Jobs/Sale/DeleteInvoice.php +++ b/app/Jobs/Sale/DeleteInvoice.php @@ -4,6 +4,7 @@ namespace App\Jobs\Sale; use App\Abstracts\Job; use App\Models\Sale\Invoice; +use App\Observers\Transaction; class DeleteInvoice extends Job { @@ -26,7 +27,7 @@ class DeleteInvoice extends Job */ public function handle() { - session(['deleting_invoice' => true]); + Transaction::mute(); $this->deleteRelationships($this->invoice, [ 'items', 'item_taxes', 'histories', 'transactions', 'recurring', 'totals' @@ -34,7 +35,7 @@ class DeleteInvoice extends Job $this->invoice->delete(); - session()->forget('deleting_invoice'); + Transaction::unmute(); return true; } diff --git a/app/Observers/Transaction.php b/app/Observers/Transaction.php index c3985d652..fa7247e12 100644 --- a/app/Observers/Transaction.php +++ b/app/Observers/Transaction.php @@ -2,12 +2,13 @@ namespace App\Observers; +use App\Abstracts\Observer; use App\Jobs\Purchase\CreateBillHistory; use App\Jobs\Sale\CreateInvoiceHistory; use App\Models\Banking\Transaction as Model; use App\Traits\Jobs; -class Transaction +class Transaction extends Observer { use Jobs; @@ -30,10 +31,6 @@ class Transaction protected function updateInvoice($transaction) { - if (session('deleting_invoice')) { - return; - } - $invoice = $transaction->invoice; $invoice->status = ($invoice->transactions->count() > 1) ? 'partial' : 'sent'; @@ -45,10 +42,6 @@ class Transaction protected function updateBill($transaction) { - if (session('deleting_bill')) { - return; - } - $bill = $transaction->bill; $bill->status = ($bill->transactions->count() > 1) ? 'partial' : 'received'; From 2f49904b182eadc9141d457e15895b56313433b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 11 Mar 2020 15:59:24 +0300 Subject: [PATCH 40/65] Invoice & bill item new style.. --- .../js/components/AkauntingSelectRemote.vue | 264 +++++++++--------- resources/assets/js/views/purchases/bills.js | 4 +- resources/assets/js/views/sales/invoices.js | 4 +- .../views/purchases/bills/item.blade.php | 6 +- resources/views/sales/invoices/item.blade.php | 5 +- 5 files changed, 151 insertions(+), 132 deletions(-) diff --git a/resources/assets/js/components/AkauntingSelectRemote.vue b/resources/assets/js/components/AkauntingSelectRemote.vue index 61b21d504..621c09c1d 100644 --- a/resources/assets/js/components/AkauntingSelectRemote.vue +++ b/resources/assets/js/components/AkauntingSelectRemote.vue @@ -312,94 +312,96 @@ {{ new_text }} - -
-

- {{ loadingText }} -

-
- -
-

- {{ noMatchingDataText }} -

-
    - -
-
- -
-

- {{ noDataText }} -

-
    - -
-
- - - - - {{ option.name }} - {{ new_text }} - - - - - {{ label }} - {{ new_text }} - - - - -
- - - {{ add_new_text }} - + + +
+

+ {{ loadingText }} +

- - {{ new_text }} -
+
+

+ {{ noMatchingDataText }} +

+
    + +
+
+ +
+

+ {{ noDataText }} +

+
    + +
+
+ + + + + {{ option.name }} + {{ new_text }} + + + + + {{ label }} + {{ new_text }} + + + + +
+ + + {{ add_new_text }} + +
+
+ + + {{ new_text }} +
@endpush - From 724601ed3168e1ff65056052b815217e541ab38e Mon Sep 17 00:00:00 2001 From: Akaunting Date: Sat, 14 Mar 2020 17:57:32 +0300 Subject: [PATCH 64/65] left menu updated --- resources/views/partials/admin/menu.blade.php | 2 +- resources/views/partials/admin/scripts.blade.php | 5 ----- resources/views/partials/portal/menu.blade.php | 2 +- resources/views/partials/portal/scripts.blade.php | 5 ----- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/resources/views/partials/admin/menu.blade.php b/resources/views/partials/admin/menu.blade.php index 780533ee9..276b84952 100644 --- a/resources/views/partials/admin/menu.blade.php +++ b/resources/views/partials/admin/menu.blade.php @@ -1,5 +1,5 @@ @stack('menu_start') -