M3 Security Fixes for scan command
This commit is contained in:
@@ -7,7 +7,6 @@ use DB;
|
||||
use Illuminate\Console\Command;
|
||||
use Log;
|
||||
use Modules\M3\Services\SpreadsheetExport;
|
||||
use Str;
|
||||
|
||||
class WHSMetricsSaveXls extends Command
|
||||
{
|
||||
@@ -106,7 +105,7 @@ class WHSMetricsSaveXls extends Command
|
||||
|
||||
private function summaryRows(string $company, string $warehouse, string $plant): array
|
||||
{
|
||||
return DB::connection(config('m3.connection', 'pgsql'))->select(<<<SQL
|
||||
return DB::connection(config('m3.connection', 'pgsql'))->select(<<<'SQL'
|
||||
WITH TEMPFILE AS (
|
||||
SELECT A.*,A4TPCKWGHT,A4NOPICLNS,A4PICKSTS,
|
||||
CASE WHEN UPPER(A4PICKSTS)<>'A' THEN 'Open' ELSE 'Closed' END AS STATUS,
|
||||
@@ -122,7 +121,7 @@ class WHSMetricsSaveXls extends Command
|
||||
|
||||
private function detailRows(string $company, string $warehouse, string $plant): array
|
||||
{
|
||||
return DB::connection(config('m3.connection', 'pgsql'))->select(<<<SQL
|
||||
return DB::connection(config('m3.connection', 'pgsql'))->select(<<<'SQL'
|
||||
WITH TEMPFILE AS (
|
||||
SELECT A3CO,A3WHS,A3PLT,A3MACPKR,A4PICKCRTS,SOURCE,
|
||||
(SELECT TO_TIMESTAMP(CAST(SHDT AS TEXT) || ' ' || CAST(SHTIME AS TEXT), 'YYYY-MM-DD HH24:MI:SS') FROM ICM699M WHERE SHMACPKR=A4MACPKR AND SHTYPE='Lisnr-Hold' ORDER BY SHDT DESC,SHTIME DESC FETCH FIRST 1 ROWS ONLY) AS CARRIERASSIGNED,
|
||||
@@ -140,6 +139,7 @@ class WHSMetricsSaveXls extends Command
|
||||
{
|
||||
if ($summary->isEmpty() || $details->isEmpty()) {
|
||||
Log::channel('dailyCron')->info('Today WHS Performance Report, no records found: Nothing to save...');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -147,5 +147,4 @@ class WHSMetricsSaveXls extends Command
|
||||
Log::channel('dailyCron')->info('Saving Today WHS Performance Report to Disk...');
|
||||
app(SpreadsheetExport::class)->storeSheets(['Summary' => $summary, 'Details' => $details], $file, 'publicLabels');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user