Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117681354
D4653.1774876292.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D4653.1774876292.diff
View Options
diff --git a/src/app/Console/Commands/Data/Reports/VatCommand.php b/src/app/Console/Commands/Data/Reports/VatCommand.php
--- a/src/app/Console/Commands/Data/Reports/VatCommand.php
+++ b/src/app/Console/Commands/Data/Reports/VatCommand.php
@@ -2,6 +2,7 @@
namespace App\Console\Commands\Data\Reports;
+use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Mail\Mailables\Attachment;
use Illuminate\Support\Facades\DB;
@@ -31,6 +32,10 @@
{
$recipient = $this->argument('email');
+ // Note: Constructor takes care of date, but startOfDay()/endOfDay() takes care of time
+ $start = (new Carbon('first day of last month'))->startOfDay();
+ $end = (new Carbon('last day of last month'))->endOfDay();
+
$result = DB::select(
<<<SQL
SELECT
@@ -51,8 +56,11 @@
WHERE
p.status = 'paid'
AND us.`key` = 'country'
+ AND p.created_at >= ?
+ AND p.created_at <= ?
ORDER BY timestamp, country
- SQL
+ SQL,
+ [$start->toDateTimeString(), $end->toDateTimeString()]
);
$fp = fopen('php://memory', 'w');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 30, 1:11 PM (2 d, 10 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18809715
Default Alt Text
D4653.1774876292.diff (1 KB)
Attached To
Mode
D4653: Fix vat report period
Attached
Detach File
Event Timeline