Merge branch 'dillon/debug-and-fixes-3-36' into dillon/voucherify-35

This commit is contained in:
Dillon
2023-06-01 21:20:53 +08:00
6 changed files with 23 additions and 12 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ class Helper
* @return array
*/
static function debugLoggerForPerfexCRM($log){
if($log){
if($log && isset($log['message'])){
$message = $log['message'];
$substring = 'No data were found';
if (isset($message)) {
+2 -1
View File
@@ -65,7 +65,8 @@ class UpdatePerfexCRMInvoice implements ShouldQueue
$invoiceId = $result->payload['id'];
} else {
// Log::error(json_encode('UpdatePerfexCRMInvoice CreatePerfexCRMInvoiceProcessor failed'));
Helper::debugLoggerForPerfexCRM('UpdatePerfexCRMInvoice CreatePerfexCRMInvoiceProcessor failed');
$log['message'] = 'UpdatePerfexCRMInvoice CreatePerfexCRMInvoiceProcessor failed';
Helper::debugLoggerForPerfexCRM($log);
}
}
else{
@@ -65,7 +65,7 @@ class AutoPurchaseOrderFillLogic extends AbstractControllerLogic
public function logic(Request $request) : JsonResponse
{
$bookings = Booking::where('service_id', '!=', 4)->where(function($query){
return $query->whereMonth('created_at', '<', 03)->whereYear('created_at', 2023);
return $query->whereMonth('created_at', '=', 04)->whereYear('created_at', 2023);
})->whereDoesntHave('transactions', function($q){
$q->where('type', TransactionType::PURCHASE_ORDER);
$q->whereIn('status', [ApprovalStatus::PENDING_VERIFICATION, ApprovalStatus::APPROVED]);
@@ -33,9 +33,18 @@ class ImportHoneyTrapController
$excelRows = $import->rows;
$excelRows = $excelRows->toArray();
$returnArray = [];
$returnArray = [];
$segment_name = 'honey trap campaign';
$segment = Segment::where('name', $segment_name)->first();
$segment_id = Segment::where('name', 'honey trap platinum')->first()->id;
if (!$segment) {
$row['status'] = 'Failed';
$row['message'] = '"' . $segment_name . '"' . ' not found';
$returnArray[] = $row;
return response()->json($returnArray);
}
$segment_id = $segment->id;
foreach ($excelRows as $row) {
@@ -111,6 +120,6 @@ class ImportHoneyTrapController
{
$unixTime = (($date - 25569) * 86400);
$date = new DateTime("@$unixTime");
return $date->format('d/m/Y');
return $date->format('Y-m-d'); // Change the format to 'Y-m-d'
}
}
@@ -26,12 +26,12 @@
:endpoint="route('api.company.list')"
:options="{
segments_in: [parameters.id],
with_total_payments: true,
recency: '2022-02-15',
frequency: 15,
business_type: 2,
with_bookings: true,
order_by: { column: 'total_payments', DESC: true },
// with_total_payments: true,
// recency: '2022-02-15',
// frequency: 15,
// business_type: 2,
// with_bookings: true,
// order_by: { column: 'total_payments', DESC: true },
}"
>
<template slot="list" slot-scope="{ data }">
@@ -36,6 +36,7 @@
@endphp
<section id="customer-account" class="m-b-50">
<h3>Customer Account</h3>
<p>Company Id: <span>{{$company->id}}</span></p>
<p>Marking: <span><a href="{{route('customer.profile', $company->reference)}}" target="_blank">{{$company->reference}}</a></span></p>
<p>Account Type: <span>{{$company->type === 1 ? 'Business' : 'Personal'}}</span></p>
@if($company->type === 1)<p>Company's Name: <span>{{$company->name}}</span></p>@endif