Compare commits
7 Commits
e5e85a8eea
...
renovate/l
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a3946e956 | |||
| e20915ca82 | |||
|
|
5f4494f5aa | ||
| 58e6cbfac0 | |||
|
|
9fa73b2ecc | ||
| 1ace049687 | |||
|
|
d75d435456 |
@@ -48,11 +48,10 @@ class InvoiceDataMail extends Mailable
|
|||||||
$greeting = 'Dear Sir/Madam,<br><br>We are sending here with list of "Despatch pending sale invoice & STO invoice as on date"';
|
$greeting = 'Dear Sir/Madam,<br><br>We are sending here with list of "Despatch pending sale invoice & STO invoice as on date"';
|
||||||
|
|
||||||
if ($this->scheduleType == 'Daily') {
|
if ($this->scheduleType == 'Daily') {
|
||||||
$firstRecord = InvoiceDataValidation::orderBy('document_date', 'asc')->first();
|
$firstRecord = InvoiceDataValidation::orderBy('document_date', 'asc')->first(); // 'desc'
|
||||||
// $lastRecord = InvoiceDataValidation::orderBy('document_date', 'desc')->first();
|
|
||||||
|
|
||||||
$startDate = null;
|
$startDate = null;
|
||||||
if ($firstRecord && $firstRecord->document_date != null && $firstRecord->document_date != '') {
|
if ($firstRecord && $firstRecord?->document_date != null && $firstRecord?->document_date != '') {
|
||||||
$startDate = \Carbon\Carbon::parse($firstRecord->document_date)->startOfDay();
|
$startDate = \Carbon\Carbon::parse($firstRecord->document_date)->startOfDay();
|
||||||
// $endDate = \Carbon\Carbon::parse($lastRecord->document_date)->endOfDay();
|
// $endDate = \Carbon\Carbon::parse($lastRecord->document_date)->endOfDay();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
"filament/filament": "^3.3",
|
"filament/filament": "^3.3",
|
||||||
"intervention/image": "^3.11",
|
"intervention/image": "^3.11",
|
||||||
"irazasyed/telegram-bot-sdk": "^3.15",
|
"irazasyed/telegram-bot-sdk": "^3.15",
|
||||||
"laravel/framework": "^11.31",
|
"laravel/framework": "^12.0",
|
||||||
"laravel/sanctum": "^4.0",
|
"laravel/sanctum": "^4.0",
|
||||||
"laravel/tinker": "^2.9",
|
"laravel/tinker": "^2.9",
|
||||||
"league/flysystem-sftp-v3": "^3.30",
|
"league/flysystem-sftp-v3": "^3.30",
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\AlertMailRule;
|
|
||||||
use Illuminate\Console\Scheduling\Schedule;
|
|
||||||
use Illuminate\Foundation\Inspiring;
|
use Illuminate\Foundation\Inspiring;
|
||||||
use Illuminate\Support\Facades\Artisan;
|
use Illuminate\Support\Facades\Artisan;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use App\Models\AlertMailRule;
|
||||||
|
use Illuminate\Console\Scheduling\Schedule;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Artisan::command('inspire', function () {
|
Artisan::command('inspire', function () {
|
||||||
$this->comment(Inspiring::quote());
|
$this->comment(Inspiring::quote());
|
||||||
@@ -13,88 +14,84 @@ Artisan::command('inspire', function () {
|
|||||||
// Schedule::command('send:invoice-report');
|
// Schedule::command('send:invoice-report');
|
||||||
// Schedule::command('send:production-report');
|
// Schedule::command('send:production-report');
|
||||||
|
|
||||||
// app()->booted(function () {
|
app()->booted(function () {
|
||||||
// $schedule = app(Schedule::class);
|
$schedule = app(Schedule::class);
|
||||||
|
|
||||||
// // $schedule->command('report:send-daily-production')->dailyAt('07:59');
|
// $schedule->command('report:send-daily-production')->dailyAt('07:59');
|
||||||
|
// Production report scheduling
|
||||||
|
$productionRules = AlertMailRule::where('module', 'ProductionQuantities')
|
||||||
|
->where('rule_name', 'ProductionMail')
|
||||||
|
->select('plant', 'schedule_type')
|
||||||
|
->distinct()
|
||||||
|
->get();
|
||||||
|
|
||||||
// if (Schema::hasTable('alert_mail_rules')) {
|
foreach ($productionRules as $rule) {
|
||||||
|
$type = $rule->schedule_type;
|
||||||
|
$plantId = $rule->plant;
|
||||||
|
|
||||||
// // Production report scheduling
|
$command = $schedule->command('send:production-report', [$type, $plantId]);
|
||||||
// $productionRules = AlertMailRule::where('module', 'ProductionQuantities')
|
// ->appendOutputTo(storage_path('logs/scheduler.log'));
|
||||||
// ->where('rule_name', 'ProductionMail')
|
|
||||||
// ->select('plant', 'schedule_type')
|
|
||||||
// ->distinct()
|
|
||||||
// ->get();
|
|
||||||
|
|
||||||
// foreach ($productionRules as $rule) {
|
switch ($type) {
|
||||||
// $type = $rule->schedule_type;
|
case 'Live':
|
||||||
// $plantId = $rule->plant;
|
$command->everyMinute();
|
||||||
|
break;
|
||||||
|
case 'Hourly':
|
||||||
|
$command->hourly();
|
||||||
|
break;
|
||||||
|
case 'Daily':
|
||||||
|
$command->dailyAt('07:59');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// $command = $schedule->command('send:production-report', [$type, $plantId]);
|
// Invoice report scheduling
|
||||||
// // ->appendOutputTo(storage_path('logs/scheduler.log'));
|
$invoiceRules = AlertMailRule::where('module', 'InvoiceValidation')
|
||||||
|
->select('plant', 'schedule_type')
|
||||||
|
->distinct()
|
||||||
|
->get();
|
||||||
|
|
||||||
// switch ($type) {
|
foreach ($invoiceRules as $rule) {
|
||||||
// case 'Live':
|
$type = $rule->schedule_type;
|
||||||
// $command->everyMinute();
|
$plantId = $rule->plant;
|
||||||
// break;
|
|
||||||
// case 'Hourly':
|
|
||||||
// $command->hourly();
|
|
||||||
// break;
|
|
||||||
// case 'Daily':
|
|
||||||
// $command->dailyAt('07:59');
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Invoice report scheduling
|
$command = $schedule->command('send:invoice-report', [$type, $plantId]);
|
||||||
// $invoiceRules = AlertMailRule::where('module', 'InvoiceValidation')
|
|
||||||
// ->select('plant', 'schedule_type')
|
|
||||||
// ->distinct()
|
|
||||||
// ->get();
|
|
||||||
|
|
||||||
// foreach ($invoiceRules as $rule) {
|
switch ($type) {
|
||||||
// $type = $rule->schedule_type;
|
case 'Live':
|
||||||
// $plantId = $rule->plant;
|
$command->everyMinute();
|
||||||
|
break;
|
||||||
|
case 'Hourly':
|
||||||
|
$command->hourly();
|
||||||
|
break;
|
||||||
|
case 'Daily':
|
||||||
|
$command->dailyAt('07:59');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// $command = $schedule->command('send:invoice-report', [$type, $plantId]);
|
// Invoice Data Report Scheduling
|
||||||
|
$invoiceDataRules = AlertMailRule::where('module', 'InvoiceDataReport')
|
||||||
|
->select('plant', 'schedule_type')
|
||||||
|
->distinct()
|
||||||
|
->get();
|
||||||
|
|
||||||
// switch ($type) {
|
foreach ($invoiceDataRules as $rule) {
|
||||||
// case 'Live':
|
$type = $rule->schedule_type;
|
||||||
// $command->everyMinute();
|
$plantId = $rule->plant;
|
||||||
// break;
|
|
||||||
// case 'Hourly':
|
|
||||||
// $command->hourly();
|
|
||||||
// break;
|
|
||||||
// case 'Daily':
|
|
||||||
// $command->dailyAt('07:59');
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// // Invoice Data Report Scheduling
|
$command = $schedule->command('send:invoice-data-report', [$type, $plantId]);
|
||||||
// $invoiceDataRules = AlertMailRule::where('module', 'InvoiceDataReport')
|
|
||||||
// ->select('plant', 'schedule_type')
|
|
||||||
// ->distinct()
|
|
||||||
// ->get();
|
|
||||||
|
|
||||||
// foreach ($invoiceDataRules as $rule) {
|
switch ($type) {
|
||||||
// $type = $rule->schedule_type;
|
case 'Live':
|
||||||
// $plantId = $rule->plant;
|
$command->everyMinute();
|
||||||
|
break;
|
||||||
// $command = $schedule->command('send:invoice-data-report', [$type, $plantId]);
|
case 'Hourly':
|
||||||
|
$command->hourly();
|
||||||
// switch ($type) {
|
break;
|
||||||
// case 'Live':
|
case 'Daily':
|
||||||
// $command->everyMinute();
|
$command->dailyAt('10:00');
|
||||||
// break;
|
break;
|
||||||
// case 'Hourly':
|
}
|
||||||
// $command->hourly();
|
}
|
||||||
// break;
|
});
|
||||||
// case 'Daily':
|
|
||||||
// $command->dailyAt('10:00');
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|||||||
Reference in New Issue
Block a user