diff --git a/503.html b/503.html
new file mode 100644
index 00000000..d8fbc8c3
--- /dev/null
+++ b/503.html
@@ -0,0 +1,30 @@
+
+
+
+
+
We'll be back soon!
+
Sorry for the inconvenience but we're performing some maintenance at the moment. We'll be back online shortly!
+
— CIEF EXCHANGE
+
+
+
diff --git a/app/Classes/Modules/Exports/Services/ExportsAnalyticBookingTransactions.php b/app/Classes/Modules/Exports/Services/ExportsAnalyticBookingTransactions.php
index c1e2af71..a4252e9b 100644
--- a/app/Classes/Modules/Exports/Services/ExportsAnalyticBookingTransactions.php
+++ b/app/Classes/Modules/Exports/Services/ExportsAnalyticBookingTransactions.php
@@ -51,8 +51,8 @@ class ExportsAnalyticBookingTransactions implements FromQuery, WithHeadings, Wit
* @return \Illuminate\Support\Collection|mixed
*/
public function query()
- {
- return Booking::query();
+ {
+ return Booking::query()->whereBetween('created_at', [Carbon::now()->subMonth(1), Carbon::now()]); //Limit, 'expensive' query;
}
/**
@@ -66,12 +66,12 @@ class ExportsAnalyticBookingTransactions implements FromQuery, WithHeadings, Wit
$companyType[companyType::PERSONAL_BUSINESS] = 'PERSONAL_BUSINESS';
$payments = $booking->transactions()->where('type', 1)->whereIn('status', [2, 3]);
-
+
$paymentmethondArray = PaymentMethodType::PAYMENT_METHODS_ID;
$paymentmethondArray[0] = 'Hybrid';
$paymentMethod = '';
foreach ($payments->get() as $payment) {
- if ( $paymentMethod == '' ) {
+ if ( $paymentMethod == '' ) {
$paymentMethod = $payment->payment_method;
} else if ( $payment->payment_method != $paymentMethod ) {
$paymentMethod = 0; // set it to Hybrid
@@ -104,4 +104,4 @@ class ExportsAnalyticBookingTransactions implements FromQuery, WithHeadings, Wit
'',
];
}
-}
\ No newline at end of file
+}
diff --git a/app/Classes/Modules/Exports/Services/ExportsCustomers.php b/app/Classes/Modules/Exports/Services/ExportsCustomers.php
index 9f314030..18498b4c 100644
--- a/app/Classes/Modules/Exports/Services/ExportsCustomers.php
+++ b/app/Classes/Modules/Exports/Services/ExportsCustomers.php
@@ -5,6 +5,7 @@ namespace App\Classes\Modules\Exports\Services;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\CompanyType;
use App\Models\Company;
+use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
@@ -38,7 +39,8 @@ class ExportsCustomers implements FromQuery, WithHeadings, WithHeadingRow, WithM
*/
public function query()
{
- return Company::where('business_type', '=', 2);
+ return Company::where('business_type', '=', 2)
+ ->whereBetween('created_at', [Carbon::now()->subMonths(12), Carbon::now()]); //Limit, 'expensive' query;
}
/**
@@ -66,4 +68,4 @@ class ExportsCustomers implements FromQuery, WithHeadings, WithHeadingRow, WithM
count($company->segments()->where('segment_id', '=', 5)->get()) ? 'Exchange 1.0' : 'Exchange 2.0'
];
}
-}
\ No newline at end of file
+}
diff --git a/app/Classes/Modules/Exports/Services/ExportsTransactions.php b/app/Classes/Modules/Exports/Services/ExportsTransactions.php
index 6d6751bf..b66cf878 100644
--- a/app/Classes/Modules/Exports/Services/ExportsTransactions.php
+++ b/app/Classes/Modules/Exports/Services/ExportsTransactions.php
@@ -9,6 +9,7 @@ use App\Models\Booking;
use App\Models\Company;
use App\Models\Transaction;
use App\Models\Wallet;
+use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromQuery;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
@@ -26,7 +27,9 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping, Sho
*/
public function query()
{
- return Transaction::whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL])->where('owner_type', '!=',Wallet::class);
+ return Transaction::whereBetween('created_at', [Carbon::now()->subMonths(1), Carbon::now()]) //Limit, 'expensive' query;
+ ->whereIn('type', [TransactionType::PAYMENT, TransactionType::BILL])
+ ->where('owner_type', '!=',Wallet::class);
}
/**
@@ -87,7 +90,7 @@ class ExportsTransactions implements FromQuery, WithHeadingRow, WithMapping, Sho
$transaction->currency_rate,
$transaction->tax,
$transaction->service_charge,
- $transactionStatus[$transaction->status],
+ isset($transactionStatus[$transaction->status]) ? $transactionStatus[$transaction->status] : 'Unknown Status',
\PhpOffice\PhpSpreadsheet\Shared\Date::dateTimeToExcel($transaction->created_at),
\PhpOffice\PhpSpreadsheet\Shared\Date::dateTimeToExcel($transaction->updated_at),
// $marking
diff --git a/database/migrations/2024_10_15_044532_add_index_to_transactions.php b/database/migrations/2024_10_15_044532_add_index_to_transactions.php
new file mode 100644
index 00000000..4123fe3a
--- /dev/null
+++ b/database/migrations/2024_10_15_044532_add_index_to_transactions.php
@@ -0,0 +1,32 @@
+index(['owner_id', 'owner_type', 'created_at', 'status'], 'idx_transactions_owner_date_status');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('transactions', function (Blueprint $table) {
+ $table->dropIndex('idx_transactions_owner_date_status');
+ });
+ }
+}
diff --git a/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue b/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue
index 0e48240e..85db0263 100644
--- a/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue
+++ b/resources/assets/vue/components/bookings/elements/UploadDebtorExcelComponent.vue
@@ -72,9 +72,9 @@
this.submit(this.route('api.debtor.import'), 'post', this.section, true, false)
},
downloadReport(){
- let route = route('newDebtor.export');
+ let url = route('newDebtor.export');
if(window.LARAVEL_VAPOR_ENABLED){
- this.$store.dispatch('crudRequest', {endpoint: route, method: 'get'})
+ this.$store.dispatch('crudRequest', {endpoint: url, method: 'get'})
.then(response =>
{
let success = response.ok;
@@ -88,7 +88,7 @@
);
}
else{
- window.open(route, '_blank');
+ window.open(url, '_blank');
}
},
},
diff --git a/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue b/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue
index f171ec83..2adb9a43 100644
--- a/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue
+++ b/resources/assets/vue/components/bookings/sections/SupplierPendingOrdersSectionComponent.vue
@@ -124,7 +124,6 @@