select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 1 - 2025-04-15 09:18:02 [2.19ms] */
select * from `users` where `id` = 5 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 2 - 2025-04-15 09:18:02 [0.72ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 3 - 2025-04-15 09:18:02 [0.48ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 4 - 2025-04-15 09:18:02 [0.58ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 5 - 2025-04-15 09:18:02 [49.91ms] */
select count(*) as aggregate from `party` where `party`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 6 - 2025-04-15 09:18:02 [18.29ms] */
select count(*) as aggregate from `party` where `created_at` > '2025-04-15' and `party`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 7 - 2025-04-15 09:18:02 [101.75ms] */
select count(*) as aggregate from `vehicle` where `vehicle`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 8 - 2025-04-15 09:18:02 [30.11ms] */
select count(*) as aggregate from `vehicle` where `created_at` > '2025-04-15' and `vehicle`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 9 - 2025-04-15 09:18:03 [120.04ms] */
select sum(`payment_amount`) as aggregate from `Payment` inner join `invoice_payment` on `invoice_payment`.`payment_id` = `payment`.`id` inner join `invoice` on `invoice_payment`.`invoice_id` = `invoice`.`id` inner join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` where `transaction`.`service_id` = 1 and `transaction`.`status` = 'END' and `payment_date` > '2025-04-14' and `Payment`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 10 - 2025-04-15 09:18:03 [44.98ms] */
select sum(`payment_amount`) as aggregate from `Payment` inner join `invoice_payment` on `invoice_payment`.`payment_id` = `payment`.`id` inner join `invoice` on `invoice_payment`.`invoice_id` = `invoice`.`id` inner join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` where `transaction`.`service_id` = 2 and `transaction`.`status` = 'END' and `payment_date` > '2025-04-14' and `Payment`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 11 - 2025-04-15 09:18:03 [274.87ms] */
select sum(`outstanding_balance`) as aggregate from `invoice` inner join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` where `transaction`.`service_id` = 1 and `invoice`.`invoice_amount` <> 0.00 and `due_date` < '2025-04-15' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 12 - 2025-04-15 09:18:04 [1273.56ms] */
select sum(`outstanding_balance`) as aggregate from `invoice` inner join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` where `transaction`.`service_id` = 2 and `invoice`.`invoice_amount` <> 0.00 and `due_date` < '2025-04-15' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 13 - 2025-04-15 09:18:04 [0.62ms] */
select * from `district` where `district`.`id` = 37 and `district`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 14 - 2025-04-15 09:18:04 [0.29ms] */
select * from `region` where `region`.`id` = 7 and `region`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/logout
   Query 1 - 2025-04-15 10:04:58 [1.95ms] */
select * from `users` where `id` = 5 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/logout
   Query 2 - 2025-04-15 10:04:58 [0.41ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/logout
   Query 3 - 2025-04-15 10:04:58 [0.32ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/logout
   Query 4 - 2025-04-15 10:04:58 [0.38ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 10:28:38 [1.51ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 10:28:38 [0.24ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 10:28:38 [0.34ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 10:28:38 [7.47ms] */
update `userprofiles` set `login_count` = 436, `last_login` = '2025-04-15 10:28:38', `userprofiles`.`updated_at` = '2025-04-15 10:28:38' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 10:28:38 [0.26ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 10:28:38 [0.38ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 10:28:38 [0.39ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 10:28:38 [0.23ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 10:28:38 [0.17ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 10:28:38 [0.25ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 10:28:38 [0.19ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 10:28:38 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 10:28:38 [3.3ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('b5d9b57e79e7fe809d6c5bb942c67887d20c94896a712c7ebc46cf2e44254f1171948a4c57ea11c7', 1, 5, '[]', 0, '2025-04-15 10:28:38', '2025-04-15 10:28:38', '2026-04-15 10:28:38');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 10:28:38 [0.24ms] */
select * from `oauth_access_tokens` where `id` = 'b5d9b57e79e7fe809d6c5bb942c67887d20c94896a712c7ebc46cf2e44254f1171948a4c57ea11c7' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 10:28:38 [2.91ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'b5d9b57e79e7fe809d6c5bb942c67887d20c94896a712c7ebc46cf2e44254f1171948a4c57ea11c7';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 10:28:38 [1.29ms] */
select * from `oauth_access_tokens` where `id` = 'b5d9b57e79e7fe809d6c5bb942c67887d20c94896a712c7ebc46cf2e44254f1171948a4c57ea11c7' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 10:28:38 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'b5d9b57e79e7fe809d6c5bb942c67887d20c94896a712c7ebc46cf2e44254f1171948a4c57ea11c7' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 10:28:38 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 10:28:38 [0.45ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 10:28:38 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'b5d9b57e79e7fe809d6c5bb942c67887d20c94896a712c7ebc46cf2e44254f1171948a4c57ea11c7' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 10:28:38 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 10:28:38 [0.32ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'HO785';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 10:28:38 [1.23ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'HO785' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 10:29:32 [2.22ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 10:29:32 [0.33ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 10:29:32 [0.54ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 10:29:32 [7.41ms] */
update `userprofiles` set `login_count` = 437, `last_login` = '2025-04-15 10:29:32', `userprofiles`.`updated_at` = '2025-04-15 10:29:32' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 10:29:32 [0.38ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 10:29:32 [0.71ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 10:29:32 [0.3ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 10:29:32 [0.3ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 10:29:32 [0.12ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 10:29:32 [0.15ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 10:29:32 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 10:29:32 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 10:29:32 [3.59ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('cddc598cdcc6c270fbebf94174173c24491fc304752dcb4e2c26ba871413bd0e4643153e1d8822fa', 1, 5, '[]', 0, '2025-04-15 10:29:32', '2025-04-15 10:29:32', '2026-04-15 10:29:32');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 10:29:32 [0.53ms] */
select * from `oauth_access_tokens` where `id` = 'cddc598cdcc6c270fbebf94174173c24491fc304752dcb4e2c26ba871413bd0e4643153e1d8822fa' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 10:29:32 [2.95ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'cddc598cdcc6c270fbebf94174173c24491fc304752dcb4e2c26ba871413bd0e4643153e1d8822fa';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 10:29:32 [1.93ms] */
select * from `oauth_access_tokens` where `id` = 'cddc598cdcc6c270fbebf94174173c24491fc304752dcb4e2c26ba871413bd0e4643153e1d8822fa' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 10:29:32 [0.22ms] */
select * from `oauth_access_tokens` where `id` = 'cddc598cdcc6c270fbebf94174173c24491fc304752dcb4e2c26ba871413bd0e4643153e1d8822fa' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 10:29:32 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 10:29:32 [0.24ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 10:29:32 [0.21ms] */
select * from `oauth_access_tokens` where `id` = 'cddc598cdcc6c270fbebf94174173c24491fc304752dcb4e2c26ba871413bd0e4643153e1d8822fa' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 10:29:32 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 10:29:32 [0.57ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'QL935';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 10:29:32 [7.1ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'QL935' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 10:30:00 [2.21ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 10:30:00 [0.16ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 10:30:00 [0.81ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 10:30:00 [6.22ms] */
update `userprofiles` set `login_count` = 438, `last_login` = '2025-04-15 10:30:00', `userprofiles`.`updated_at` = '2025-04-15 10:30:00' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 10:30:00 [0.16ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 10:30:00 [0.37ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 10:30:00 [0.15ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 10:30:00 [0.13ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 10:30:00 [0.12ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 10:30:00 [0.14ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 10:30:00 [0.23ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 10:30:00 [0.2ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 10:30:00 [4.04ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('88d04d8c5372516d78ffcf6388050d24f26f8f3645c2af80f9a1a35e371dbc7f34291bb634c59fbe', 1, 5, '[]', 0, '2025-04-15 10:30:00', '2025-04-15 10:30:00', '2026-04-15 10:30:00');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 10:30:00 [0.36ms] */
select * from `oauth_access_tokens` where `id` = '88d04d8c5372516d78ffcf6388050d24f26f8f3645c2af80f9a1a35e371dbc7f34291bb634c59fbe' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 10:30:00 [3.02ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '88d04d8c5372516d78ffcf6388050d24f26f8f3645c2af80f9a1a35e371dbc7f34291bb634c59fbe';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 10:30:00 [1.7ms] */
select * from `oauth_access_tokens` where `id` = '88d04d8c5372516d78ffcf6388050d24f26f8f3645c2af80f9a1a35e371dbc7f34291bb634c59fbe' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 10:30:00 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '88d04d8c5372516d78ffcf6388050d24f26f8f3645c2af80f9a1a35e371dbc7f34291bb634c59fbe' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 10:30:00 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 10:30:00 [0.16ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 10:30:00 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '88d04d8c5372516d78ffcf6388050d24f26f8f3645c2af80f9a1a35e371dbc7f34291bb634c59fbe' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 10:30:00 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 10:30:00 [0.14ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'QL935';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 10:30:00 [0.36ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'QL935' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 10:30:00 [2ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 10:30:00 [0.16ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 10:30:00 [0.32ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 10:30:00 [3.6ms] */
update `userprofiles` set `login_count` = 439, `userprofiles`.`updated_at` = '2025-04-15 10:30:00' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 10:30:00 [0.16ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 10:30:00 [0.39ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 10:30:00 [0.24ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 10:30:00 [0.2ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 10:30:00 [0.18ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 10:30:00 [0.24ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 10:30:00 [0.28ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 10:30:00 [0.24ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 10:30:00 [3.78ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('ccfb9a24b9453037923e5e5d81b0d1839da14e7af8625d0a53aba9336bcf30a2f07f36bc23828d27', 1, 5, '[]', 0, '2025-04-15 10:30:00', '2025-04-15 10:30:00', '2026-04-15 10:30:00');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 10:30:00 [0.27ms] */
select * from `oauth_access_tokens` where `id` = 'ccfb9a24b9453037923e5e5d81b0d1839da14e7af8625d0a53aba9336bcf30a2f07f36bc23828d27' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 10:30:00 [3.24ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'ccfb9a24b9453037923e5e5d81b0d1839da14e7af8625d0a53aba9336bcf30a2f07f36bc23828d27';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 1 - 2025-04-15 10:30:00 [2.18ms] */
select * from `oauth_access_tokens` where `id` = 'ccfb9a24b9453037923e5e5d81b0d1839da14e7af8625d0a53aba9336bcf30a2f07f36bc23828d27' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 2 - 2025-04-15 10:30:00 [0.27ms] */
select * from `oauth_access_tokens` where `id` = 'ccfb9a24b9453037923e5e5d81b0d1839da14e7af8625d0a53aba9336bcf30a2f07f36bc23828d27' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 3 - 2025-04-15 10:30:00 [0.25ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 4 - 2025-04-15 10:30:00 [0.31ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 5 - 2025-04-15 10:30:00 [0.27ms] */
select * from `oauth_access_tokens` where `id` = 'ccfb9a24b9453037923e5e5d81b0d1839da14e7af8625d0a53aba9336bcf30a2f07f36bc23828d27' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 6 - 2025-04-15 10:30:00 [0.26ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 7 - 2025-04-15 10:30:00 [123.87ms] */
select count(*) as aggregate from `payment` where `external_payment_reference_no` = 'SIN-R99sssfsadfass02';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 8 - 2025-04-15 10:30:00 [0.69ms] */
select * from `payment_method` where `name` = 'eDahab' and `payment_method`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 9 - 2025-04-15 10:30:00 [0.76ms] */
select * from `invoice` where `id` in (499077,  499078) and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 10 - 2025-04-15 10:30:00 [4.54ms] */
insert into `Payment` (`payment_amount`, `payment_date`, `external_payment_reference_no`, `payment_method_id`, `paid_by`, `paid_by_mobile`, `payment_collected_by`, `district_id`, `updated_by`, `created_by`, `created_at`, `updated_at`) values (109.0, '2025-04-15 10:30:00', 'SIN-R99sssfsadfass02', 2, 'ABCD', 1111111, 1, 1, 1, 1, '2025-04-15 10:30:00', '2025-04-15 10:30:00');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 11 - 2025-04-15 10:30:00 [0.29ms] */
select * from `Payment` where `id` = 177846 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 12 - 2025-04-15 10:30:00 [5.02ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('Payment', '{"attributes":{"payment_method_id":2,"payment_amount":"109.00","payment_date":"2025-04-15 10:30:00","external_payment_reference_no":"SIN-R99sssfsadfass02","payment_receipt_number":null,"siinpay_payref_number":null,"paid_by":"ABCD","paid_by_mobile":"1111111","district_id":1,"migration_id":null,"payment_collected_by":1}}', 1, 'App\Models\User', 177846, 'Modules\Transaction\Entities\Payment', 'created', '2025-04-15 10:30:00', '2025-04-15 10:30:00');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 13 - 2025-04-15 10:30:00 [3.84ms] */
insert into `invoice_payment` (`created_at`, `invoice_id`, `payment_id`, `updated_at`) values ('2025-04-15 10:30:00', 499077, 177846, '2025-04-15 10:30:00');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 14 - 2025-04-15 10:30:00 [0.4ms] */
select * from `invoice` where `invoice`.`id` = 499077 and `invoice`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 15 - 2025-04-15 10:30:00 [0.6ms] */
select `Payment`.*, `invoice_payment`.`invoice_id` as `pivot_invoice_id`, `invoice_payment`.`payment_id` as `pivot_payment_id`, `invoice_payment`.`created_at` as `pivot_created_at`, `invoice_payment`.`updated_at` as `pivot_updated_at` from `Payment` inner join `invoice_payment` on `Payment`.`id` = `invoice_payment`.`payment_id` where `invoice_payment`.`invoice_id` = 499077 and `Payment`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 16 - 2025-04-15 10:30:00 [1.62ms] */
select * from `invoice_item` where `invoice_item`.`invoice_id` = 499077 and `invoice_item`.`invoice_id` is not null and `invoice_item`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 17 - 2025-04-15 10:30:00 [3.21ms] */
update `invoice` set `invoice_amount` = 71, `outstanding_balance` = 0, `discounts` = 0, `total_invoice_amount` = 71, `status` = 'PAID', `invoice`.`updated_at` = '2025-04-15 10:30:00' where `id` = 499077;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 18 - 2025-04-15 10:30:00 [0.22ms] */
select * from `invoice` where `id` = 499077 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 19 - 2025-04-15 10:30:00 [3.49ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('invoice', '{"attributes":{"outstanding_balance":"0.00","status":"PAID"},"old":{"outstanding_balance":"71.00","status":"OPEN"}}', 1, 'App\Models\User', 499077, 'Modules\Transaction\Entities\Invoice', 'updated', '2025-04-15 10:30:00', '2025-04-15 10:30:00');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 20 - 2025-04-15 10:30:01 [479.28ms] */
select * from `transaction` where `invoice_id` = 499077 and `transaction`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 21 - 2025-04-15 10:30:01 [6.42ms] */
update `vehicle_tax` set `status` = 'PAID', `vehicle_tax`.`updated_at` = '2025-04-15 10:30:01' where `id` = 413551 and `vehicle_tax`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 22 - 2025-04-15 10:30:01 [0.68ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 23 - 2025-04-15 10:30:01 [1ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 24 - 2025-04-15 10:30:01 [0.7ms] */
select * from `roles` where `roles`.`id` = 5 and `roles`.`id` is not null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 25 - 2025-04-15 10:30:01 [0.97ms] */
select * from `transaction` where `transaction`.`id` = 523409 and `transaction`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 26 - 2025-04-15 10:30:01 [0.94ms] */
select * from `service_workflow` where `service_workflow`.`id` = 2 and `service_workflow`.`id` is not null and `service_workflow`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 27 - 2025-04-15 10:30:01 [0.66ms] */
select * from `service` where `service`.`id` = 2 and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 28 - 2025-04-15 10:30:01 [0.46ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 29 - 2025-04-15 10:30:01 [2.74ms] */
insert into `transaction_workflow` (`transaction_id`, `action`, `action_date`, `role_id`, `user_id`, `comments`, `updated_by`, `created_by`, `created_at`, `updated_at`) values (523409, 'APPROVED', '2025-04-15 10:30:01', 5, 1, null, 1, 1, '2025-04-15 10:30:01', '2025-04-15 10:30:01');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 30 - 2025-04-15 10:30:01 [0.52ms] */
select * from `workflow_definition` where `workflow_id` = 2 and `step_number` = 3 and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 31 - 2025-04-15 10:30:01 [0.5ms] */
update `transaction` set `current_workflow_state_id` = 8, `status` = 'INPROGRESS', `transaction`.`updated_at` = '2025-04-15 10:30:01' where `id` = 523409;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 32 - 2025-04-15 10:30:01 [0.26ms] */
select * from `service` where `service`.`id` = 2 and `service`.`id` is not null and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 33 - 2025-04-15 10:30:01 [0.37ms] */
select * from `invoice` where `invoice`.`id` = 499077 and `invoice`.`id` is not null and `invoice`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 34 - 2025-04-15 10:30:01 [0.37ms] */
select * from `vehicle_tax` where `transaction_id` = 523409 and `vehicle_tax`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 35 - 2025-04-15 10:30:01 [3.2ms] */
insert into `invoice_payment` (`created_at`, `invoice_id`, `payment_id`, `updated_at`) values ('2025-04-15 10:30:01', 499078, 177846, '2025-04-15 10:30:01');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 36 - 2025-04-15 10:30:01 [0.27ms] */
select * from `invoice` where `invoice`.`id` = 499078 and `invoice`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 37 - 2025-04-15 10:30:01 [0.3ms] */
select `Payment`.*, `invoice_payment`.`invoice_id` as `pivot_invoice_id`, `invoice_payment`.`payment_id` as `pivot_payment_id`, `invoice_payment`.`created_at` as `pivot_created_at`, `invoice_payment`.`updated_at` as `pivot_updated_at` from `Payment` inner join `invoice_payment` on `Payment`.`id` = `invoice_payment`.`payment_id` where `invoice_payment`.`invoice_id` = 499078 and `Payment`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 38 - 2025-04-15 10:30:01 [0.33ms] */
select * from `invoice_item` where `invoice_item`.`invoice_id` = 499078 and `invoice_item`.`invoice_id` is not null and `invoice_item`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 39 - 2025-04-15 10:30:01 [2.87ms] */
update `invoice` set `invoice_amount` = 38, `outstanding_balance` = 0, `discounts` = 0, `total_invoice_amount` = 38, `status` = 'PAID', `invoice`.`updated_at` = '2025-04-15 10:30:01' where `id` = 499078;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 40 - 2025-04-15 10:30:01 [0.31ms] */
select * from `invoice` where `id` = 499078 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 41 - 2025-04-15 10:30:01 [3.52ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('invoice', '{"attributes":{"outstanding_balance":"0.00","status":"PAID"},"old":{"outstanding_balance":"38.00","status":"OPEN"}}', 1, 'App\Models\User', 499078, 'Modules\Transaction\Entities\Invoice', 'updated', '2025-04-15 10:30:01', '2025-04-15 10:30:01');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 42 - 2025-04-15 10:30:01 [481.94ms] */
select * from `transaction` where `invoice_id` = 499078 and `transaction`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 43 - 2025-04-15 10:30:01 [12.37ms] */
update `vehicle_tax` set `status` = 'PAID', `vehicle_tax`.`updated_at` = '2025-04-15 10:30:01' where `id` = 413552 and `vehicle_tax`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 44 - 2025-04-15 10:30:01 [0.29ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 45 - 2025-04-15 10:30:01 [0.24ms] */
select * from `roles` where `roles`.`id` = 5 and `roles`.`id` is not null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 46 - 2025-04-15 10:30:01 [0.42ms] */
select * from `transaction` where `transaction`.`id` = 523410 and `transaction`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 47 - 2025-04-15 10:30:01 [1.24ms] */
select * from `service_workflow` where `service_workflow`.`id` = 2 and `service_workflow`.`id` is not null and `service_workflow`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 48 - 2025-04-15 10:30:01 [0.22ms] */
select * from `service` where `service`.`id` = 2 and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 49 - 2025-04-15 10:30:01 [0.22ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 50 - 2025-04-15 10:30:01 [1.41ms] */
insert into `transaction_workflow` (`transaction_id`, `action`, `action_date`, `role_id`, `user_id`, `comments`, `updated_by`, `created_by`, `created_at`, `updated_at`) values (523410, 'APPROVED', '2025-04-15 10:30:01', 5, 1, null, 1, 1, '2025-04-15 10:30:01', '2025-04-15 10:30:01');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 51 - 2025-04-15 10:30:01 [0.23ms] */
select * from `workflow_definition` where `workflow_id` = 2 and `step_number` = 3 and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 52 - 2025-04-15 10:30:01 [0.59ms] */
update `transaction` set `current_workflow_state_id` = 8, `status` = 'INPROGRESS', `transaction`.`updated_at` = '2025-04-15 10:30:01' where `id` = 523410;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 53 - 2025-04-15 10:30:01 [0.21ms] */
select * from `service` where `service`.`id` = 2 and `service`.`id` is not null and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 54 - 2025-04-15 10:30:01 [0.31ms] */
select * from `invoice` where `invoice`.`id` = 499078 and `invoice`.`id` is not null and `invoice`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 55 - 2025-04-15 10:30:01 [0.36ms] */
select * from `vehicle_tax` where `transaction_id` = 523410 and `vehicle_tax`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 11:00:04 [2.81ms] */
select * from `users` where `email` = 'userpayment@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 11:00:04 [0.5ms] */
select * from `users` where `id` = 154 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 11:00:04 [0.81ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 154 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 11:00:04 [3.36ms] */
update `userprofiles` set `login_count` = 1875, `last_login` = '2025-04-15 11:00:04', `userprofiles`.`updated_at` = '2025-04-15 11:00:04' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 11:00:04 [0.26ms] */
select * from `users` where `email` = 'userpayment@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 11:00:04 [0.39ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 11:00:04 [0.83ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 11:00:04 [0.57ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 11:00:04 [0.31ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 11:00:04 [0.76ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 11:00:04 [0.33ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 11:00:04 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 11:00:04 [4.5ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('2978f1e4eed6c7437df6b3fc3facd02bab5fac3ce6c95025e33300137f16ab83065eb9bca9c6e6e0', 154, 5, '[]', 0, '2025-04-15 11:00:04', '2025-04-15 11:00:04', '2026-04-15 11:00:04');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 11:00:04 [0.33ms] */
select * from `oauth_access_tokens` where `id` = '2978f1e4eed6c7437df6b3fc3facd02bab5fac3ce6c95025e33300137f16ab83065eb9bca9c6e6e0' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 11:00:04 [3.58ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '2978f1e4eed6c7437df6b3fc3facd02bab5fac3ce6c95025e33300137f16ab83065eb9bca9c6e6e0';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 11:00:04 [2.07ms] */
select * from `oauth_access_tokens` where `id` = '2978f1e4eed6c7437df6b3fc3facd02bab5fac3ce6c95025e33300137f16ab83065eb9bca9c6e6e0' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 11:00:04 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '2978f1e4eed6c7437df6b3fc3facd02bab5fac3ce6c95025e33300137f16ab83065eb9bca9c6e6e0' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 11:00:04 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 11:00:04 [0.25ms] */
select * from `users` where `id` = 154 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 11:00:04 [2.48ms] */
select * from `oauth_access_tokens` where `id` = '2978f1e4eed6c7437df6b3fc3facd02bab5fac3ce6c95025e33300137f16ab83065eb9bca9c6e6e0' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 11:00:04 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 11:00:04 [0.95ms] */
select count(*) as aggregate from `party` where `id` = 33125;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 11:00:04 [0.97ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'BS724';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-04-15 11:00:04 [10.07ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `invoice`.`party_id` = 33125 and `license_plate` = 'BS724' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 11:00:04 [1.35ms] */
select * from `users` where `email` = 'userpayment@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 11:00:04 [0.28ms] */
select * from `users` where `id` = 154 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 11:00:04 [0.47ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 154 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 11:00:04 [6.49ms] */
update `userprofiles` set `login_count` = 1876, `userprofiles`.`updated_at` = '2025-04-15 11:00:04' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 11:00:04 [0.71ms] */
select * from `users` where `email` = 'userpayment@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 11:00:04 [0.65ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 11:00:04 [0.33ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 11:00:04 [0.14ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 11:00:04 [0.12ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 11:00:04 [0.14ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 11:00:04 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 11:00:04 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 11:00:04 [4.28ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('f96c82be927c19aa27fdd9a893f186bdb43eaacf763abe2359aa0e46baa306f07617e27c74efcd02', 154, 5, '[]', 0, '2025-04-15 11:00:04', '2025-04-15 11:00:04', '2026-04-15 11:00:04');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 11:00:04 [0.44ms] */
select * from `oauth_access_tokens` where `id` = 'f96c82be927c19aa27fdd9a893f186bdb43eaacf763abe2359aa0e46baa306f07617e27c74efcd02' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 11:00:04 [2.83ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'f96c82be927c19aa27fdd9a893f186bdb43eaacf763abe2359aa0e46baa306f07617e27c74efcd02';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 11:00:04 [1.37ms] */
select * from `oauth_access_tokens` where `id` = 'f96c82be927c19aa27fdd9a893f186bdb43eaacf763abe2359aa0e46baa306f07617e27c74efcd02' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 11:00:04 [0.16ms] */
select * from `oauth_access_tokens` where `id` = 'f96c82be927c19aa27fdd9a893f186bdb43eaacf763abe2359aa0e46baa306f07617e27c74efcd02' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 11:00:04 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 11:00:04 [0.16ms] */
select * from `users` where `id` = 154 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 11:00:04 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'f96c82be927c19aa27fdd9a893f186bdb43eaacf763abe2359aa0e46baa306f07617e27c74efcd02' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 11:00:04 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 11:00:04 [0.29ms] */
select count(*) as aggregate from `party` where `id` = 64940;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 11:00:04 [0.28ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = '5656SXYVCYHC';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-04-15 11:00:04 [2.87ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `invoice`.`party_id` = 64940 and `license_plate` = '5656SXYVCYHC' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 11:29:41 [4.23ms] */
select * from `users` where `email` = 'mukhtaar.maxamed@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 11:29:41 [8.76ms] */
select * from `users` where `id` = 107 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 11:29:41 [1.85ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 107 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 11:29:41 [8.79ms] */
update `userprofiles` set `login_count` = 723, `last_login` = '2025-04-15 11:29:41', `userprofiles`.`updated_at` = '2025-04-15 11:29:41' where `id` = 107;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 11:29:41 [0.38ms] */
select * from `users` where `email` = 'mukhtaar.maxamed@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 11:29:41 [0.54ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 11:29:41 [1.43ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (107) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 11:29:41 [0.92ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 11:29:41 [0.25ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 11:29:41 [1.17ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 11:29:41 [0.28ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 11:29:41 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 11:29:41 [8.14ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e', 107, 5, '[]', 0, '2025-04-15 11:29:41', '2025-04-15 11:29:41', '2026-04-15 11:29:41');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 11:29:41 [0.45ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 11:29:41 [4.93ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/legacyapiendpoint
   Query 1 - 2025-04-15 11:29:42 [11.08ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/legacyapiendpoint
   Query 2 - 2025-04-15 11:29:42 [0.25ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/legacyapiendpoint
   Query 3 - 2025-04-15 11:29:42 [0.3ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/legacyapiendpoint
   Query 4 - 2025-04-15 11:29:42 [0.29ms] */
select * from `users` where `id` = 107 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/legacyapiendpoint
   Query 5 - 2025-04-15 11:29:42 [0.18ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/legacyapiendpoint
   Query 6 - 2025-04-15 11:29:42 [0.17ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/legacyuser/mukhtar
   Query 1 - 2025-04-15 11:29:42 [2.4ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/legacyuser/mukhtar
   Query 2 - 2025-04-15 11:29:42 [0.38ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/legacyuser/mukhtar
   Query 3 - 2025-04-15 11:29:42 [0.31ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/legacyuser/mukhtar
   Query 4 - 2025-04-15 11:29:42 [0.33ms] */
select * from `users` where `id` = 107 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/legacyuser/mukhtar
   Query 5 - 2025-04-15 11:29:42 [0.24ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/legacyuser/mukhtar
   Query 6 - 2025-04-15 11:29:42 [0.28ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 1 - 2025-04-15 11:35:48 [2.41ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 2 - 2025-04-15 11:35:48 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 3 - 2025-04-15 11:35:48 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 4 - 2025-04-15 11:35:48 [0.22ms] */
select * from `users` where `id` = 107 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 5 - 2025-04-15 11:35:48 [0.21ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 6 - 2025-04-15 11:35:48 [0.19ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 7 - 2025-04-15 11:35:48 [4.33ms] */
insert into `person` (`first_name`, `second_name`, `third_name`, `mother_first_name`, `date_of_birth`, `gender`, `occupation`, `place_of_birth`, `height`, `weight`, `eye_color`, `hair_color`, `updated_by`, `created_by`, `created_at`, `updated_at`) values ('MOHAMED', 'FATHI', 'LAJMI', 'WASIILA HANA KAANICHE', '1974-06-01T11:30:03', 'MALE', 'BOSASO AIRPORT MANAGER', 'SOUSSE', 175, 100, 'BLACK', 'BLACK', 107, 107, '2025-04-15 11:35:48', '2025-04-15 11:35:48');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 8 - 2025-04-15 11:35:48 [0.36ms] */
select * from `person` where `id` = 62333 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 9 - 2025-04-15 11:35:48 [8.6ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('person', '{"attributes":{"first_name":"MOHAMED","second_name":"FATHI","third_name":"LAJMI","fourth_name":null,"date_of_birth":"1974-06-01","gender":"MALE","occupation":"BOSASO AIRPORT MANAGER","place_of_birth":"SOUSSE","height":"175","weight":"100","eye_color":"BLACK","hair_color":"BLACK","mother_first_name":"WASIILA HANA KAANICHE","mother_second_name":null,"mother_third_name":null,"mother_fourth_name":null,"father_first_name":null,"father_second_name":null,"father_third_name":null,"father_fourth_name":null}}', 107, 'App\Models\User', 62333, 'Person', 'created', '2025-04-15 11:35:48', '2025-04-15 11:35:48');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 10 - 2025-04-15 11:35:48 [2.75ms] */
insert into `audits` (`old_values`, `new_values`, `event`, `auditable_id`, `auditable_type`, `user_id`, `user_type`, `tags`, `ip_address`, `user_agent`, `url`, `updated_at`, `created_at`) values ('[]', '{"first_name":"MOHAMED","second_name":"FATHI","third_name":"LAJMI","mother_first_name":"WASIILA HANA KAANICHE","date_of_birth":"1974-06-01T11:30:03","gender":"MALE","occupation":"BOSASO AIRPORT MANAGER","place_of_birth":"SOUSSE","height":"175","weight":"100","eye_color":"BLACK","hair_color":"BLACK","updated_by":107,"created_by":107,"id":62333}', 'created', 62333, 'Person', 107, 'App\Models\User', null, '41.223.108.50', null, 'https://testtra.puntlandgov.org/api/extparty', '2025-04-15 11:35:48', '2025-04-15 11:35:48');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 11 - 2025-04-15 11:35:48 [0.53ms] */
insert into `address` (`address_line_1`, `city`, `state`, `district_id`, `updated_by`, `created_by`, `created_at`, `updated_at`) values ('BALADE', 'BOSASO', 'PUNTLAND', 2, 107, 107, '2025-04-15 11:35:48', '2025-04-15 11:35:48');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 12 - 2025-04-15 11:35:48 [0.53ms] */
select * from `address` where `id` = 64959 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 13 - 2025-04-15 11:35:48 [1.39ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('address', '{"attributes":{"address_line_1":"BALADE","address_line_2":null,"city":"BOSASO","state":"PUNTLAND","district_id":2,"country":null}}', 107, 'App\Models\User', 64959, 'Modules\Party\Entities\Address', 'created', '2025-04-15 11:35:48', '2025-04-15 11:35:48');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 14 - 2025-04-15 11:35:48 [0.83ms] */
insert into `party` (`email`, `phone_number_1`, `phone_number_2`, `address_id`, `partyable_id`, `partyable_type`, `updated_by`, `created_by`, `created_at`, `updated_at`) values ('MOHAMEDLAJMI@TISCILTD.COM', '52-705-09', 5270509, 64959, 62333, 'Person', 107, 107, '2025-04-15 11:35:48', '2025-04-15 11:35:48');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 15 - 2025-04-15 11:35:48 [0.19ms] */
select * from `party` where `id` = 64959 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 16 - 2025-04-15 11:35:48 [9.36ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('party', '{"attributes":{"address_id":64959,"siinpay_account_number":null,"partyable_id":62333,"partyable_type":"Person","email":"MOHAMEDLAJMI@TISCILTD.COM","phone_number_1":"52-705-09","phone_number_2":"5270509","provisional":"N","migration_id":null,"company_migration_id":null}}', 107, 'App\Models\User', 64959, 'Modules\Party\Entities\Party', 'created', '2025-04-15 11:35:48', '2025-04-15 11:35:48');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 17 - 2025-04-15 11:35:48 [0.39ms] */
insert into `audits` (`old_values`, `new_values`, `event`, `auditable_id`, `auditable_type`, `user_id`, `user_type`, `tags`, `ip_address`, `user_agent`, `url`, `updated_at`, `created_at`) values ('[]', '{"email":"MOHAMEDLAJMI@TISCILTD.COM","phone_number_1":"52-705-09","phone_number_2":"5270509","address_id":64959,"partyable_id":62333,"partyable_type":"Person","updated_by":107,"created_by":107,"id":64959}', 'created', 64959, 'Modules\Party\Entities\Party', 107, 'App\Models\User', null, '41.223.108.50', null, 'https://testtra.puntlandgov.org/api/extparty', '2025-04-15 11:35:48', '2025-04-15 11:35:48');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 18 - 2025-04-15 11:35:48 [0.56ms] */
select * from `district` where `district`.`id` = 2 and `district`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 19 - 2025-04-15 11:35:48 [1.28ms] */
select * from `region` where `region`.`id` = 1 and `region`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 20 - 2025-04-15 11:35:48 [10.25ms] */
update `person` set `legacy_dl_customer_id` = 'BOS-28786637-39915', `person`.`updated_at` = '2025-04-15 11:35:48' where `id` = 62333;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 21 - 2025-04-15 11:35:48 [0.34ms] */
select * from `person` where `id` = 62333 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 22 - 2025-04-15 11:35:48 [2.69ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('person', '{"attributes":{"date_of_birth":"1974-06-01"},"old":{"date_of_birth":"1974-06-01T11:30:03"}}', 107, 'App\Models\User', 62333, 'Person', 'updated', '2025-04-15 11:35:48', '2025-04-15 11:35:48');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty
   Query 23 - 2025-04-15 11:35:48 [2.68ms] */
insert into `audits` (`old_values`, `new_values`, `event`, `auditable_id`, `auditable_type`, `user_id`, `user_type`, `tags`, `ip_address`, `user_agent`, `url`, `updated_at`, `created_at`) values ('{"legacy_dl_customer_id":null}', '{"legacy_dl_customer_id":"BOS-28786637-39915"}', 'updated', 62333, 'Person', 107, 'App\Models\User', null, '41.223.108.50', null, 'https://testtra.puntlandgov.org/api/extparty', '2025-04-15 11:35:48', '2025-04-15 11:35:48');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty/BOS-28786637-39915/bio/IRIS
   Query 1 - 2025-04-15 11:36:28 [1.34ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty/BOS-28786637-39915/bio/IRIS
   Query 2 - 2025-04-15 11:36:28 [0.13ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty/BOS-28786637-39915/bio/IRIS
   Query 3 - 2025-04-15 11:36:28 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty/BOS-28786637-39915/bio/IRIS
   Query 4 - 2025-04-15 11:36:28 [0.17ms] */
select * from `users` where `id` = 107 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty/BOS-28786637-39915/bio/IRIS
   Query 5 - 2025-04-15 11:36:28 [0.13ms] */
select * from `oauth_access_tokens` where `id` = 'b8bbd888ffc5b180625f7ee5d75682291e3e79213eaf4dae45ef673452dd6bfce965510799311e3e' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty/BOS-28786637-39915/bio/IRIS
   Query 6 - 2025-04-15 11:36:28 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/extparty/BOS-28786637-39915/bio/IRIS
   Query 7 - 2025-04-15 11:36:28 [119.85ms] */
select * from `person` where `legacy_dl_customer_id` = 'BOS-28786637-39915' and `person`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/login
   Query 1 - 2025-04-15 11:40:58 [11.96ms] */
select * from `users` where `email` = 'admin@admin.com' and `status` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/vehicle
   Query 1 - 2025-04-15 13:00:16 [1.58ms] */
select * from `oauth_access_tokens` where `id` = '78fac9b1e338f26ad55aa2b711d4e45f47c5372697b89b653dfaf45206517d2c822f06e2217df7c8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/vehicle
   Query 2 - 2025-04-15 13:00:16 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '78fac9b1e338f26ad55aa2b711d4e45f47c5372697b89b653dfaf45206517d2c822f06e2217df7c8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/vehicle
   Query 3 - 2025-04-15 13:00:16 [0.61ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/vehicle
   Query 4 - 2025-04-15 13:00:16 [0.88ms] */
select * from `users` where `id` = 153 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/vehicle
   Query 5 - 2025-04-15 13:00:16 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '78fac9b1e338f26ad55aa2b711d4e45f47c5372697b89b653dfaf45206517d2c822f06e2217df7c8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/vehicle
   Query 6 - 2025-04-15 13:00:16 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/vehicle
   Query 7 - 2025-04-15 13:00:16 [10.56ms] */
select `vehicle`.`id` as `vehicle_id`, `company`.`contact_party_id`, `party`.`id` as `party_id`, `vehicle`.`license_plate`, `vehicle`.`year`, `vehicle`.`odometer`, `vehicle`.`vin`, `sub_category`.`name` as `sub_category`, `classification_type`.`name` as `classification`, `make`.`name` as `make`, `model`.`name` as `model`, `vehicle_color`.`name` as `vehicle_color`, `fuel_type`.`name` as `fuel_type`, `vehicle_type`.`name` as `vehicle_type`, CASE
                WHEN party_vehicle.id IS NULL THEN "UNREGISTERED" ELSE party_vehicle.status END AS status, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS owner, `party`.`partyable_type` as `owner_type`, `party_vehicle`.`registration_date`, `vehicle`.`created_at`, `vehicle`.`updated_at` from `vehicle` left join `party_vehicle` on `party_vehicle`.`vehicle_id` = `vehicle`.`id` left join `sub_category` on `vehicle`.`sub_category_id` = `sub_category`.`id` left join `classification_type` on `party_vehicle`.`classification_id` = `classification_type`.`id` left join `model` on `vehicle`.`model_id` = `model`.`id` left join `make` on `model`.`make_id` = `make`.`id` left join `vehicle_color` on `vehicle`.`vehicle_color_id` = `vehicle_color`.`id` left join `fuel_type` on `vehicle`.`fuel_type_id` = `fuel_type`.`id` left join `vehicle_type` on `vehicle`.`vehicle_type_id` = `vehicle_type`.`id` left join `party` on `party_vehicle`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' where `license_plate` = 'RF081' and `party_vehicle`.`is_owner` = 'Y' and `vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/vehicle
   Query 8 - 2025-04-15 13:00:16 [0.37ms] */
select * from `party` where `party`.`id` = 51310 and `party`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/vehicle
   Query 9 - 2025-04-15 13:00:16 [0.23ms] */
select * from `vehicle` where `id` = 80426 and `provisional` = 'Y' and `vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/vehicle
   Query 10 - 2025-04-15 13:00:16 [0.4ms] */
select * from `party_vehicle` where `vehicle_id` = 80426 and `is_owner` = 'Y' and `party_vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/taxes
   Query 1 - 2025-04-15 13:00:17 [1.41ms] */
select * from `oauth_access_tokens` where `id` = '78fac9b1e338f26ad55aa2b711d4e45f47c5372697b89b653dfaf45206517d2c822f06e2217df7c8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/taxes
   Query 2 - 2025-04-15 13:00:17 [0.39ms] */
select * from `oauth_access_tokens` where `id` = '78fac9b1e338f26ad55aa2b711d4e45f47c5372697b89b653dfaf45206517d2c822f06e2217df7c8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/taxes
   Query 3 - 2025-04-15 13:00:17 [0.38ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/taxes
   Query 4 - 2025-04-15 13:00:17 [0.23ms] */
select * from `users` where `id` = 153 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/taxes
   Query 5 - 2025-04-15 13:00:17 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '78fac9b1e338f26ad55aa2b711d4e45f47c5372697b89b653dfaf45206517d2c822f06e2217df7c8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/taxes
   Query 6 - 2025-04-15 13:00:17 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/taxes
   Query 7 - 2025-04-15 13:00:17 [0.25ms] */
select * from `vehicle` where `vehicle`.`id` = 80426 and `vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/taxes
   Query 8 - 2025-04-15 13:00:17 [0.2ms] */
select * from `vehicle` where `id` = 80426 and `provisional` = 'Y' and `vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/taxes
   Query 9 - 2025-04-15 13:00:17 [0.25ms] */
select * from `party_vehicle` where `vehicle_id` = 80426 and `is_owner` = 'Y' and `party_vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/taxes
   Query 10 - 2025-04-15 13:00:17 [12.22ms] */
select `vehicle_tax`.`id`, `transaction`.`id` as `transaction_id`, `term`.`year`, `term`.`quarter`, `invoice`.`invoice_amount`, `invoice`.`outstanding_balance`, `vehicle_tax`.`exempt`, `invoice`.`status`, `tax_sticker`.`name` as `tax_sticker`, CASE
                WHEN term.quarter = 1 THEN DATE_FORMAT(CONCAT(term.year, "-03-31"), "%d-%m-%Y")
                WHEN term.quarter = 2 THEN DATE_FORMAT(CONCAT(term.year, "-06-30"), "%d-%m-%Y")
                WHEN term.quarter = 3 THEN DATE_FORMAT(CONCAT(term.year, "-09-30"), "%d-%m-%Y")
                WHEN term.quarter = 4 THEN DATE_FORMAT(CONCAT(term.year, "-12-31"), "%d-%m-%Y")
                ELSE NULL
                END as due_date from `vehicle_tax` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `transaction` on `vehicle_tax`.`transaction_id` = `transaction`.`id` left join `invoice` on `transaction`.`invoice_id` = `invoice`.`id` left join `tax_sticker` on `vehicle_tax`.`tax_sticker_id` = `tax_sticker`.`id` where `vehicle_tax`.`vehicle_id` = 80426 and `vehicle_tax`.`exempt` = 'N' and `vehicle_tax`.`deleted_at` is null and `transaction`.`deleted_at` is null and `invoice`.`deleted_at` is null order by `term`.`year` asc, `term`.`quarter` asc;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/region-list
   Query 1 - 2025-04-15 13:00:18 [1.33ms] */
select * from `oauth_access_tokens` where `id` = '78fac9b1e338f26ad55aa2b711d4e45f47c5372697b89b653dfaf45206517d2c822f06e2217df7c8' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/region-list
   Query 2 - 2025-04-15 13:00:18 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '78fac9b1e338f26ad55aa2b711d4e45f47c5372697b89b653dfaf45206517d2c822f06e2217df7c8' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/region-list
   Query 3 - 2025-04-15 13:00:18 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/region-list
   Query 4 - 2025-04-15 13:00:18 [0.16ms] */
select * from `users` where `id` = 153 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/region-list
   Query 5 - 2025-04-15 13:00:18 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '78fac9b1e338f26ad55aa2b711d4e45f47c5372697b89b653dfaf45206517d2c822f06e2217df7c8' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/region-list
   Query 6 - 2025-04-15 13:00:18 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/region-list
   Query 7 - 2025-04-15 13:00:18 [0.56ms] */
select `id`, `name` from `region` where `deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/payment_providers
   Query 1 - 2025-04-15 13:00:18 [1.37ms] */
select * from `oauth_access_tokens` where `id` = '78fac9b1e338f26ad55aa2b711d4e45f47c5372697b89b653dfaf45206517d2c822f06e2217df7c8' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/payment_providers
   Query 2 - 2025-04-15 13:00:18 [0.13ms] */
select * from `oauth_access_tokens` where `id` = '78fac9b1e338f26ad55aa2b711d4e45f47c5372697b89b653dfaf45206517d2c822f06e2217df7c8' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/payment_providers
   Query 3 - 2025-04-15 13:00:18 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/payment_providers
   Query 4 - 2025-04-15 13:00:18 [0.16ms] */
select * from `users` where `id` = 153 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/payment_providers
   Query 5 - 2025-04-15 13:00:18 [0.12ms] */
select * from `oauth_access_tokens` where `id` = '78fac9b1e338f26ad55aa2b711d4e45f47c5372697b89b653dfaf45206517d2c822f06e2217df7c8' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/payment_providers
   Query 6 - 2025-04-15 13:00:18 [0.22ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/api/payment_providers
   Query 7 - 2025-04-15 13:00:18 [1.27ms] */
select * from `payment_method` where exists (select * from `payment_configurations` where `payment_method`.`id` = `payment_configurations`.`provider_id` and `fee_type` = 'Government' and `payment_configurations`.`deleted_at` is null) and `payment_method`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 13:03:15 [1.88ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 13:03:15 [0.38ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 13:03:15 [0.53ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 13:03:15 [12.56ms] */
update `userprofiles` set `login_count` = 440, `last_login` = '2025-04-15 13:03:15', `userprofiles`.`updated_at` = '2025-04-15 13:03:15' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 13:03:15 [0.33ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 13:03:15 [0.39ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 13:03:15 [0.32ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 13:03:15 [0.31ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 13:03:15 [0.15ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 13:03:15 [1.56ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 13:03:15 [0.19ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 13:03:15 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 13:03:15 [4.55ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('a97d23655d668142fa372be1873d0532cd55098fd5190f0d3b88b3ac97d544558b5505696061b988', 1, 5, '[]', 0, '2025-04-15 13:03:15', '2025-04-15 13:03:15', '2026-04-15 13:03:15');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 13:03:15 [0.35ms] */
select * from `oauth_access_tokens` where `id` = 'a97d23655d668142fa372be1873d0532cd55098fd5190f0d3b88b3ac97d544558b5505696061b988' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 13:03:15 [3.05ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'a97d23655d668142fa372be1873d0532cd55098fd5190f0d3b88b3ac97d544558b5505696061b988';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 13:03:15 [1.42ms] */
select * from `oauth_access_tokens` where `id` = 'a97d23655d668142fa372be1873d0532cd55098fd5190f0d3b88b3ac97d544558b5505696061b988' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 13:03:15 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'a97d23655d668142fa372be1873d0532cd55098fd5190f0d3b88b3ac97d544558b5505696061b988' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 13:03:15 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 13:03:15 [0.31ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 13:03:15 [0.17ms] */
select * from `oauth_access_tokens` where `id` = 'a97d23655d668142fa372be1873d0532cd55098fd5190f0d3b88b3ac97d544558b5505696061b988' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 13:03:15 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 13:03:15 [0.31ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Bw187';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 13:03:15 [39.91ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Bw187' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 13:11:17 [1.94ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 13:11:17 [0.32ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 13:11:17 [0.74ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 13:11:17 [11.19ms] */
update `userprofiles` set `login_count` = 441, `last_login` = '2025-04-15 13:11:17', `userprofiles`.`updated_at` = '2025-04-15 13:11:17' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 13:11:17 [0.37ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 13:11:17 [0.72ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 13:11:17 [0.29ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 13:11:17 [0.19ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 13:11:17 [0.12ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 13:11:17 [0.15ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 13:11:17 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 13:11:17 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 13:11:17 [5.89ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('315676544c53b13f7239949673487421f71e25b754866dedf0a7f903f6516fbe44b1741dc9efd656', 1, 5, '[]', 0, '2025-04-15 13:11:17', '2025-04-15 13:11:17', '2026-04-15 13:11:17');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 13:11:17 [0.6ms] */
select * from `oauth_access_tokens` where `id` = '315676544c53b13f7239949673487421f71e25b754866dedf0a7f903f6516fbe44b1741dc9efd656' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 13:11:17 [2.72ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '315676544c53b13f7239949673487421f71e25b754866dedf0a7f903f6516fbe44b1741dc9efd656';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 13:11:17 [1.9ms] */
select * from `oauth_access_tokens` where `id` = '315676544c53b13f7239949673487421f71e25b754866dedf0a7f903f6516fbe44b1741dc9efd656' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 13:11:17 [0.23ms] */
select * from `oauth_access_tokens` where `id` = '315676544c53b13f7239949673487421f71e25b754866dedf0a7f903f6516fbe44b1741dc9efd656' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 13:11:17 [0.19ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 13:11:17 [0.21ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 13:11:17 [0.16ms] */
select * from `oauth_access_tokens` where `id` = '315676544c53b13f7239949673487421f71e25b754866dedf0a7f903f6516fbe44b1741dc9efd656' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 13:11:17 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 13:11:17 [0.18ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Bw187';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 13:11:17 [0.44ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Bw187' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 13:12:06 [1.39ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 13:12:06 [0.3ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 13:12:06 [1.01ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 13:12:06 [6.4ms] */
update `userprofiles` set `login_count` = 442, `last_login` = '2025-04-15 13:12:06', `userprofiles`.`updated_at` = '2025-04-15 13:12:06' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 13:12:06 [0.22ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 13:12:06 [0.42ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 13:12:06 [0.25ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 13:12:06 [0.24ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 13:12:06 [0.19ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 13:12:06 [0.26ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 13:12:06 [0.24ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 13:12:06 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 13:12:06 [4.72ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('9a5585524f0666c3d5848fce7d435bd965912f9022af4c00b97b63282577f7fb8e5c7e664f8cc6f3', 1, 5, '[]', 0, '2025-04-15 13:12:06', '2025-04-15 13:12:06', '2026-04-15 13:12:06');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 13:12:06 [0.37ms] */
select * from `oauth_access_tokens` where `id` = '9a5585524f0666c3d5848fce7d435bd965912f9022af4c00b97b63282577f7fb8e5c7e664f8cc6f3' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 13:12:06 [3.05ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '9a5585524f0666c3d5848fce7d435bd965912f9022af4c00b97b63282577f7fb8e5c7e664f8cc6f3';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 13:12:06 [1.42ms] */
select * from `oauth_access_tokens` where `id` = '9a5585524f0666c3d5848fce7d435bd965912f9022af4c00b97b63282577f7fb8e5c7e664f8cc6f3' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 13:12:06 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '9a5585524f0666c3d5848fce7d435bd965912f9022af4c00b97b63282577f7fb8e5c7e664f8cc6f3' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 13:12:06 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 13:12:06 [0.2ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 13:12:06 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '9a5585524f0666c3d5848fce7d435bd965912f9022af4c00b97b63282577f7fb8e5c7e664f8cc6f3' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 13:12:06 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 13:12:06 [1.03ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'BW187';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 13:12:06 [21.11ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'BW187' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 13:14:11 [1.37ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 13:14:11 [0.31ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 13:14:11 [1.73ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 13:14:11 [11.57ms] */
update `userprofiles` set `login_count` = 443, `last_login` = '2025-04-15 13:14:11', `userprofiles`.`updated_at` = '2025-04-15 13:14:11' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 13:14:11 [0.31ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 13:14:11 [0.42ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 13:14:11 [0.16ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 13:14:11 [0.15ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 13:14:11 [0.11ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 13:14:11 [0.13ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 13:14:11 [0.28ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 13:14:11 [0.16ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 13:14:11 [4.62ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('5efc6eb7acef1c4beadfa5b2babbac1a4b8b57a7623ed04ca8bd231c11ad9dbe7d0c20a39f17cc39', 1, 5, '[]', 0, '2025-04-15 13:14:11', '2025-04-15 13:14:11', '2026-04-15 13:14:11');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 13:14:11 [0.31ms] */
select * from `oauth_access_tokens` where `id` = '5efc6eb7acef1c4beadfa5b2babbac1a4b8b57a7623ed04ca8bd231c11ad9dbe7d0c20a39f17cc39' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 13:14:11 [4.2ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '5efc6eb7acef1c4beadfa5b2babbac1a4b8b57a7623ed04ca8bd231c11ad9dbe7d0c20a39f17cc39';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 13:14:12 [2.09ms] */
select * from `oauth_access_tokens` where `id` = '5efc6eb7acef1c4beadfa5b2babbac1a4b8b57a7623ed04ca8bd231c11ad9dbe7d0c20a39f17cc39' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 13:14:12 [0.42ms] */
select * from `oauth_access_tokens` where `id` = '5efc6eb7acef1c4beadfa5b2babbac1a4b8b57a7623ed04ca8bd231c11ad9dbe7d0c20a39f17cc39' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 13:14:12 [0.25ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 13:14:12 [0.23ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 13:14:12 [0.23ms] */
select * from `oauth_access_tokens` where `id` = '5efc6eb7acef1c4beadfa5b2babbac1a4b8b57a7623ed04ca8bd231c11ad9dbe7d0c20a39f17cc39' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 13:14:12 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 13:14:12 [2.7ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Sf258';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 13:14:12 [21.84ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Sf258' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 13:17:18 [1.68ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 13:17:18 [0.31ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 13:17:18 [0.95ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 13:17:19 [10.88ms] */
update `userprofiles` set `login_count` = 444, `last_login` = '2025-04-15 13:17:18', `userprofiles`.`updated_at` = '2025-04-15 13:17:18' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 13:17:19 [0.27ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 13:17:19 [0.48ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 13:17:19 [0.28ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 13:17:19 [0.15ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 13:17:19 [0.15ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 13:17:19 [0.57ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 13:17:19 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 13:17:19 [0.19ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 13:17:19 [5.49ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('242cb3a632be9411f06b66faebe70af9e78f02fbd01d78112fe7746d95b94f932b2eced31f3a4e53', 1, 5, '[]', 0, '2025-04-15 13:17:19', '2025-04-15 13:17:19', '2026-04-15 13:17:19');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 13:17:19 [0.35ms] */
select * from `oauth_access_tokens` where `id` = '242cb3a632be9411f06b66faebe70af9e78f02fbd01d78112fe7746d95b94f932b2eced31f3a4e53' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 13:17:19 [2.82ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '242cb3a632be9411f06b66faebe70af9e78f02fbd01d78112fe7746d95b94f932b2eced31f3a4e53';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 13:17:19 [1.44ms] */
select * from `oauth_access_tokens` where `id` = '242cb3a632be9411f06b66faebe70af9e78f02fbd01d78112fe7746d95b94f932b2eced31f3a4e53' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 13:17:19 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '242cb3a632be9411f06b66faebe70af9e78f02fbd01d78112fe7746d95b94f932b2eced31f3a4e53' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 13:17:19 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 13:17:19 [0.16ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 13:17:19 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '242cb3a632be9411f06b66faebe70af9e78f02fbd01d78112fe7746d95b94f932b2eced31f3a4e53' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 13:17:19 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 13:17:19 [0.25ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Sf258';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 13:17:19 [0.48ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Sf258' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 13:57:30 [1.39ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 13:57:30 [0.31ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 13:57:30 [1.48ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 13:57:30 [11.24ms] */
update `userprofiles` set `login_count` = 445, `last_login` = '2025-04-15 13:57:30', `userprofiles`.`updated_at` = '2025-04-15 13:57:30' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 13:57:30 [0.26ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 13:57:30 [0.47ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 13:57:30 [0.3ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 13:57:30 [0.19ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 13:57:30 [0.12ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 13:57:30 [0.15ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 13:57:30 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 13:57:30 [0.17ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 13:57:30 [5.18ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('cf6f80c87f232ad95283f365fd905264859c83fe95de67bb870c9234029de5efd3178d0058f7791c', 1, 5, '[]', 0, '2025-04-15 13:57:30', '2025-04-15 13:57:30', '2026-04-15 13:57:30');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 13:57:30 [0.5ms] */
select * from `oauth_access_tokens` where `id` = 'cf6f80c87f232ad95283f365fd905264859c83fe95de67bb870c9234029de5efd3178d0058f7791c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 13:57:30 [4.88ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'cf6f80c87f232ad95283f365fd905264859c83fe95de67bb870c9234029de5efd3178d0058f7791c';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 13:57:30 [1.49ms] */
select * from `oauth_access_tokens` where `id` = 'cf6f80c87f232ad95283f365fd905264859c83fe95de67bb870c9234029de5efd3178d0058f7791c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 13:57:30 [0.15ms] */
select * from `oauth_access_tokens` where `id` = 'cf6f80c87f232ad95283f365fd905264859c83fe95de67bb870c9234029de5efd3178d0058f7791c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 13:57:30 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 13:57:30 [0.18ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 13:57:30 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'cf6f80c87f232ad95283f365fd905264859c83fe95de67bb870c9234029de5efd3178d0058f7791c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 13:57:30 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 13:57:30 [0.14ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Sf258';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 13:57:30 [0.39ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Sf258' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 13:57:45 [1.74ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 13:57:45 [0.32ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 13:57:45 [2.11ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 13:57:45 [11.38ms] */
update `userprofiles` set `login_count` = 446, `last_login` = '2025-04-15 13:57:45', `userprofiles`.`updated_at` = '2025-04-15 13:57:45' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 13:57:45 [0.29ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 13:57:45 [0.6ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 13:57:45 [0.25ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 13:57:45 [0.17ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 13:57:45 [0.12ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 13:57:45 [0.14ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 13:57:45 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 13:57:45 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 13:57:45 [4.19ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('087ee9f41590fa489421aad8450d75f50035900be83766620297f80a7f47880cc5e62949d6b848e0', 1, 5, '[]', 0, '2025-04-15 13:57:45', '2025-04-15 13:57:45', '2026-04-15 13:57:45');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 13:57:45 [0.53ms] */
select * from `oauth_access_tokens` where `id` = '087ee9f41590fa489421aad8450d75f50035900be83766620297f80a7f47880cc5e62949d6b848e0' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 13:57:45 [5.91ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '087ee9f41590fa489421aad8450d75f50035900be83766620297f80a7f47880cc5e62949d6b848e0';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 13:57:45 [1.44ms] */
select * from `oauth_access_tokens` where `id` = '087ee9f41590fa489421aad8450d75f50035900be83766620297f80a7f47880cc5e62949d6b848e0' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 13:57:45 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '087ee9f41590fa489421aad8450d75f50035900be83766620297f80a7f47880cc5e62949d6b848e0' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 13:57:45 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 13:57:45 [0.16ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 13:57:45 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '087ee9f41590fa489421aad8450d75f50035900be83766620297f80a7f47880cc5e62949d6b848e0' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 13:57:45 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 13:57:45 [0.14ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Sf258';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 13:57:45 [0.33ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Sf258' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:07:21 [1.4ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:07:21 [0.33ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:07:21 [0.52ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:07:21 [7.54ms] */
update `userprofiles` set `login_count` = 447, `last_login` = '2025-04-15 14:07:21', `userprofiles`.`updated_at` = '2025-04-15 14:07:21' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:07:21 [0.25ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:07:21 [0.47ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:07:21 [0.2ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:07:21 [0.18ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:07:21 [0.14ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:07:21 [0.17ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:07:21 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:07:21 [0.11ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:07:21 [4.25ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('67f073f1508f8b29d9a4717548009649dcfe1b284b61b5927f4655f33658157eac7067a3bf1211ee', 1, 5, '[]', 0, '2025-04-15 14:07:21', '2025-04-15 14:07:21', '2026-04-15 14:07:21');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:07:21 [0.31ms] */
select * from `oauth_access_tokens` where `id` = '67f073f1508f8b29d9a4717548009649dcfe1b284b61b5927f4655f33658157eac7067a3bf1211ee' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:07:21 [2.73ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '67f073f1508f8b29d9a4717548009649dcfe1b284b61b5927f4655f33658157eac7067a3bf1211ee';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:07:21 [1.63ms] */
select * from `oauth_access_tokens` where `id` = '67f073f1508f8b29d9a4717548009649dcfe1b284b61b5927f4655f33658157eac7067a3bf1211ee' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:07:21 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '67f073f1508f8b29d9a4717548009649dcfe1b284b61b5927f4655f33658157eac7067a3bf1211ee' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:07:21 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:07:21 [0.18ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:07:21 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '67f073f1508f8b29d9a4717548009649dcfe1b284b61b5927f4655f33658157eac7067a3bf1211ee' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:07:21 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:07:21 [0.15ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Sf258';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:07:21 [0.36ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Sf258' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:10:30 [1.54ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:10:30 [0.27ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:10:30 [0.63ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:10:30 [7.26ms] */
update `userprofiles` set `login_count` = 448, `last_login` = '2025-04-15 14:10:30', `userprofiles`.`updated_at` = '2025-04-15 14:10:30' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:10:30 [0.63ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:10:30 [0.5ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:10:30 [0.61ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:10:30 [0.21ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:10:30 [0.15ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:10:30 [0.17ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:10:30 [0.18ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:10:30 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:10:30 [4.43ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('d83538cb6cbf33678ebc2c28a908458f04b49c4d42c4f16e84e1b6ec1e28ae8f38036af4e0ab9889', 1, 5, '[]', 0, '2025-04-15 14:10:30', '2025-04-15 14:10:30', '2026-04-15 14:10:30');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:10:30 [2.3ms] */
select * from `oauth_access_tokens` where `id` = 'd83538cb6cbf33678ebc2c28a908458f04b49c4d42c4f16e84e1b6ec1e28ae8f38036af4e0ab9889' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:10:30 [10.74ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'd83538cb6cbf33678ebc2c28a908458f04b49c4d42c4f16e84e1b6ec1e28ae8f38036af4e0ab9889';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:10:30 [1.47ms] */
select * from `oauth_access_tokens` where `id` = 'd83538cb6cbf33678ebc2c28a908458f04b49c4d42c4f16e84e1b6ec1e28ae8f38036af4e0ab9889' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:10:30 [0.15ms] */
select * from `oauth_access_tokens` where `id` = 'd83538cb6cbf33678ebc2c28a908458f04b49c4d42c4f16e84e1b6ec1e28ae8f38036af4e0ab9889' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:10:30 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:10:30 [0.17ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:10:30 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'd83538cb6cbf33678ebc2c28a908458f04b49c4d42c4f16e84e1b6ec1e28ae8f38036af4e0ab9889' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:10:30 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:10:30 [0.14ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Sf258';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:10:30 [0.32ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Sf258' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:14:11 [1.68ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:14:11 [0.29ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:14:11 [0.89ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:14:11 [6.47ms] */
update `userprofiles` set `login_count` = 449, `last_login` = '2025-04-15 14:14:11', `userprofiles`.`updated_at` = '2025-04-15 14:14:11' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:14:11 [0.29ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:14:11 [0.51ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:14:11 [0.58ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:14:11 [0.15ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:14:11 [0.12ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:14:11 [0.14ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:14:11 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:14:11 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:14:11 [3.82ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('60197a3e39a47a6a91e6e5a66afc9c5b68de6f53de4969d0a60295aea7fba642d60cef7e3ea2212c', 1, 5, '[]', 0, '2025-04-15 14:14:11', '2025-04-15 14:14:11', '2026-04-15 14:14:11');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:14:11 [1.04ms] */
select * from `oauth_access_tokens` where `id` = '60197a3e39a47a6a91e6e5a66afc9c5b68de6f53de4969d0a60295aea7fba642d60cef7e3ea2212c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:14:11 [2.73ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '60197a3e39a47a6a91e6e5a66afc9c5b68de6f53de4969d0a60295aea7fba642d60cef7e3ea2212c';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:14:11 [1.46ms] */
select * from `oauth_access_tokens` where `id` = '60197a3e39a47a6a91e6e5a66afc9c5b68de6f53de4969d0a60295aea7fba642d60cef7e3ea2212c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:14:11 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '60197a3e39a47a6a91e6e5a66afc9c5b68de6f53de4969d0a60295aea7fba642d60cef7e3ea2212c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:14:11 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:14:11 [0.17ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:14:11 [0.13ms] */
select * from `oauth_access_tokens` where `id` = '60197a3e39a47a6a91e6e5a66afc9c5b68de6f53de4969d0a60295aea7fba642d60cef7e3ea2212c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:14:11 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:14:11 [1.48ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'SF258';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:14:11 [17.76ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'SF258' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:14:12 [1.56ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:14:12 [0.3ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:14:12 [0.32ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:14:12 [9.31ms] */
update `userprofiles` set `login_count` = 450, `last_login` = '2025-04-15 14:14:12', `userprofiles`.`updated_at` = '2025-04-15 14:14:12' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:14:12 [0.23ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:14:12 [0.45ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:14:12 [0.36ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:14:12 [0.26ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:14:12 [0.22ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:14:12 [0.19ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:14:12 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:14:12 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:14:12 [3.04ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('5028bdbc009c72066c751c2ace0074d70bd3745998115a959c2c7b4a7816802bfcea718e8f7d9713', 1, 5, '[]', 0, '2025-04-15 14:14:12', '2025-04-15 14:14:12', '2026-04-15 14:14:12');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:14:12 [0.61ms] */
select * from `oauth_access_tokens` where `id` = '5028bdbc009c72066c751c2ace0074d70bd3745998115a959c2c7b4a7816802bfcea718e8f7d9713' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:14:12 [2.96ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '5028bdbc009c72066c751c2ace0074d70bd3745998115a959c2c7b4a7816802bfcea718e8f7d9713';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 1 - 2025-04-15 14:14:12 [1.42ms] */
select * from `oauth_access_tokens` where `id` = '5028bdbc009c72066c751c2ace0074d70bd3745998115a959c2c7b4a7816802bfcea718e8f7d9713' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 2 - 2025-04-15 14:14:12 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '5028bdbc009c72066c751c2ace0074d70bd3745998115a959c2c7b4a7816802bfcea718e8f7d9713' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 3 - 2025-04-15 14:14:12 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 4 - 2025-04-15 14:14:12 [0.16ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 5 - 2025-04-15 14:14:12 [0.13ms] */
select * from `oauth_access_tokens` where `id` = '5028bdbc009c72066c751c2ace0074d70bd3745998115a959c2c7b4a7816802bfcea718e8f7d9713' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 6 - 2025-04-15 14:14:12 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 7 - 2025-04-15 14:14:12 [251.74ms] */
select count(*) as aggregate from `payment` where `external_payment_reference_no` = 'SIN-R99sssfsadfass02';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:14:19 [1.37ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:14:19 [0.17ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:14:19 [1.76ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:14:19 [10.93ms] */
update `userprofiles` set `login_count` = 451, `last_login` = '2025-04-15 14:14:19', `userprofiles`.`updated_at` = '2025-04-15 14:14:19' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:14:19 [0.23ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:14:19 [0.55ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:14:19 [0.2ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:14:19 [0.18ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:14:19 [0.13ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:14:19 [0.16ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:14:19 [0.16ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:14:19 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:14:19 [5.59ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('e623f59829774baee17f6b328ba7cb77e374b4d37434c2abccaf29659101d08a8c76bafd1c1af576', 1, 5, '[]', 0, '2025-04-15 14:14:19', '2025-04-15 14:14:19', '2026-04-15 14:14:19');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:14:19 [0.27ms] */
select * from `oauth_access_tokens` where `id` = 'e623f59829774baee17f6b328ba7cb77e374b4d37434c2abccaf29659101d08a8c76bafd1c1af576' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:14:19 [3.14ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'e623f59829774baee17f6b328ba7cb77e374b4d37434c2abccaf29659101d08a8c76bafd1c1af576';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:14:19 [1.43ms] */
select * from `oauth_access_tokens` where `id` = 'e623f59829774baee17f6b328ba7cb77e374b4d37434c2abccaf29659101d08a8c76bafd1c1af576' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:14:19 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'e623f59829774baee17f6b328ba7cb77e374b4d37434c2abccaf29659101d08a8c76bafd1c1af576' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:14:19 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:14:19 [0.26ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:14:19 [0.19ms] */
select * from `oauth_access_tokens` where `id` = 'e623f59829774baee17f6b328ba7cb77e374b4d37434c2abccaf29659101d08a8c76bafd1c1af576' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:14:19 [0.17ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:14:19 [0.19ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'SF258';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:14:19 [0.37ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'SF258' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:14:19 [1.43ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:14:20 [0.4ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:14:20 [0.46ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:14:20 [7.11ms] */
update `userprofiles` set `login_count` = 452, `last_login` = '2025-04-15 14:14:20', `userprofiles`.`updated_at` = '2025-04-15 14:14:20' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:14:20 [0.47ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:14:20 [0.71ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:14:20 [0.28ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:14:20 [0.16ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:14:20 [0.15ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:14:20 [0.17ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:14:20 [0.17ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:14:20 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:14:20 [6.16ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('1f51fd009339518a26365a13d66ac25a263afb2186932f1aef4f86cd36d50b5cc50ad3e47b148422', 1, 5, '[]', 0, '2025-04-15 14:14:20', '2025-04-15 14:14:20', '2026-04-15 14:14:20');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:14:20 [0.37ms] */
select * from `oauth_access_tokens` where `id` = '1f51fd009339518a26365a13d66ac25a263afb2186932f1aef4f86cd36d50b5cc50ad3e47b148422' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:14:20 [3.29ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '1f51fd009339518a26365a13d66ac25a263afb2186932f1aef4f86cd36d50b5cc50ad3e47b148422';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 1 - 2025-04-15 14:14:20 [1.62ms] */
select * from `oauth_access_tokens` where `id` = '1f51fd009339518a26365a13d66ac25a263afb2186932f1aef4f86cd36d50b5cc50ad3e47b148422' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 2 - 2025-04-15 14:14:20 [0.17ms] */
select * from `oauth_access_tokens` where `id` = '1f51fd009339518a26365a13d66ac25a263afb2186932f1aef4f86cd36d50b5cc50ad3e47b148422' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 3 - 2025-04-15 14:14:20 [0.17ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 4 - 2025-04-15 14:14:20 [0.21ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 5 - 2025-04-15 14:14:20 [0.17ms] */
select * from `oauth_access_tokens` where `id` = '1f51fd009339518a26365a13d66ac25a263afb2186932f1aef4f86cd36d50b5cc50ad3e47b148422' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 6 - 2025-04-15 14:14:20 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 7 - 2025-04-15 14:14:20 [265.28ms] */
select count(*) as aggregate from `payment` where `external_payment_reference_no` = 'SIN-R99sssfsadfasss02';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 8 - 2025-04-15 14:14:20 [0.7ms] */
select * from `payment_method` where `name` = 'eDahab' and `payment_method`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 9 - 2025-04-15 14:14:20 [1.52ms] */
select * from `invoice` where `id` in (519639,  519640) and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 10 - 2025-04-15 14:14:20 [9.91ms] */
insert into `Payment` (`payment_amount`, `payment_date`, `external_payment_reference_no`, `payment_method_id`, `paid_by`, `paid_by_mobile`, `payment_collected_by`, `district_id`, `updated_by`, `created_by`, `created_at`, `updated_at`) values (109.0, '2025-04-15 14:14:20', 'SIN-R99sssfsadfasss02', 2, 'ABCD', 1111111, 1, 1, 1, 1, '2025-04-15 14:14:20', '2025-04-15 14:14:20');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 11 - 2025-04-15 14:14:20 [0.63ms] */
select * from `Payment` where `id` = 177847 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 12 - 2025-04-15 14:14:20 [6.49ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('Payment', '{"attributes":{"payment_method_id":2,"payment_amount":"109.00","payment_date":"2025-04-15 14:14:20","external_payment_reference_no":"SIN-R99sssfsadfasss02","payment_receipt_number":null,"siinpay_payref_number":null,"paid_by":"ABCD","paid_by_mobile":"1111111","district_id":1,"migration_id":null,"payment_collected_by":1}}', 1, 'App\Models\User', 177847, 'Modules\Transaction\Entities\Payment', 'created', '2025-04-15 14:14:20', '2025-04-15 14:14:20');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 13 - 2025-04-15 14:14:20 [4.05ms] */
insert into `invoice_payment` (`created_at`, `invoice_id`, `payment_id`, `updated_at`) values ('2025-04-15 14:14:20', 519639, 177847, '2025-04-15 14:14:20');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 14 - 2025-04-15 14:14:20 [0.44ms] */
select * from `invoice` where `invoice`.`id` = 519639 and `invoice`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 15 - 2025-04-15 14:14:20 [1.04ms] */
select `Payment`.*, `invoice_payment`.`invoice_id` as `pivot_invoice_id`, `invoice_payment`.`payment_id` as `pivot_payment_id`, `invoice_payment`.`created_at` as `pivot_created_at`, `invoice_payment`.`updated_at` as `pivot_updated_at` from `Payment` inner join `invoice_payment` on `Payment`.`id` = `invoice_payment`.`payment_id` where `invoice_payment`.`invoice_id` = 519639 and `Payment`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 16 - 2025-04-15 14:14:20 [4.03ms] */
select * from `invoice_item` where `invoice_item`.`invoice_id` = 519639 and `invoice_item`.`invoice_id` is not null and `invoice_item`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 17 - 2025-04-15 14:14:20 [3.54ms] */
update `invoice` set `invoice_amount` = 71, `outstanding_balance` = 0, `discounts` = 0, `total_invoice_amount` = 71, `status` = 'PAID', `invoice`.`updated_at` = '2025-04-15 14:14:20' where `id` = 519639;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 18 - 2025-04-15 14:14:20 [0.3ms] */
select * from `invoice` where `id` = 519639 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 19 - 2025-04-15 14:14:20 [3.21ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('invoice', '{"attributes":{"outstanding_balance":"0.00","status":"PAID"},"old":{"outstanding_balance":"71.00","status":"OPEN"}}', 1, 'App\Models\User', 519639, 'Modules\Transaction\Entities\Invoice', 'updated', '2025-04-15 14:14:20', '2025-04-15 14:14:20');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 20 - 2025-04-15 14:14:21 [700.35ms] */
select * from `transaction` where `invoice_id` = 519639 and `transaction`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 21 - 2025-04-15 14:14:21 [5.61ms] */
update `vehicle_tax` set `status` = 'PAID', `vehicle_tax`.`updated_at` = '2025-04-15 14:14:21' where `id` = 434113 and `vehicle_tax`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 22 - 2025-04-15 14:14:21 [0.29ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 23 - 2025-04-15 14:14:21 [0.42ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 24 - 2025-04-15 14:14:21 [0.25ms] */
select * from `roles` where `roles`.`id` = 5 and `roles`.`id` is not null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 25 - 2025-04-15 14:14:21 [0.72ms] */
select * from `transaction` where `transaction`.`id` = 543971 and `transaction`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 26 - 2025-04-15 14:14:21 [1.03ms] */
select * from `service_workflow` where `service_workflow`.`id` = 2 and `service_workflow`.`id` is not null and `service_workflow`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 27 - 2025-04-15 14:14:21 [0.52ms] */
select * from `service` where `service`.`id` = 2 and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 28 - 2025-04-15 14:14:21 [0.24ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 29 - 2025-04-15 14:14:21 [2.7ms] */
insert into `transaction_workflow` (`transaction_id`, `action`, `action_date`, `role_id`, `user_id`, `comments`, `updated_by`, `created_by`, `created_at`, `updated_at`) values (543971, 'APPROVED', '2025-04-15 14:14:21', 5, 1, null, 1, 1, '2025-04-15 14:14:21', '2025-04-15 14:14:21');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 30 - 2025-04-15 14:14:21 [0.57ms] */
select * from `workflow_definition` where `workflow_id` = 2 and `step_number` = 3 and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 31 - 2025-04-15 14:14:21 [0.87ms] */
update `transaction` set `current_workflow_state_id` = 8, `status` = 'INPROGRESS', `transaction`.`updated_at` = '2025-04-15 14:14:21' where `id` = 543971;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 32 - 2025-04-15 14:14:21 [2.91ms] */
select * from `service` where `service`.`id` = 2 and `service`.`id` is not null and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 33 - 2025-04-15 14:14:21 [0.4ms] */
select * from `invoice` where `invoice`.`id` = 519639 and `invoice`.`id` is not null and `invoice`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 34 - 2025-04-15 14:14:21 [0.75ms] */
select * from `vehicle_tax` where `transaction_id` = 543971 and `vehicle_tax`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 35 - 2025-04-15 14:14:21 [3.56ms] */
insert into `invoice_payment` (`created_at`, `invoice_id`, `payment_id`, `updated_at`) values ('2025-04-15 14:14:21', 519640, 177847, '2025-04-15 14:14:21');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 36 - 2025-04-15 14:14:21 [0.29ms] */
select * from `invoice` where `invoice`.`id` = 519640 and `invoice`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 37 - 2025-04-15 14:14:21 [0.32ms] */
select `Payment`.*, `invoice_payment`.`invoice_id` as `pivot_invoice_id`, `invoice_payment`.`payment_id` as `pivot_payment_id`, `invoice_payment`.`created_at` as `pivot_created_at`, `invoice_payment`.`updated_at` as `pivot_updated_at` from `Payment` inner join `invoice_payment` on `Payment`.`id` = `invoice_payment`.`payment_id` where `invoice_payment`.`invoice_id` = 519640 and `Payment`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 38 - 2025-04-15 14:14:21 [0.43ms] */
select * from `invoice_item` where `invoice_item`.`invoice_id` = 519640 and `invoice_item`.`invoice_id` is not null and `invoice_item`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 39 - 2025-04-15 14:14:21 [3.3ms] */
update `invoice` set `invoice_amount` = 38, `outstanding_balance` = 0, `discounts` = 0, `total_invoice_amount` = 38, `status` = 'PAID', `invoice`.`updated_at` = '2025-04-15 14:14:21' where `id` = 519640;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 40 - 2025-04-15 14:14:21 [0.28ms] */
select * from `invoice` where `id` = 519640 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 41 - 2025-04-15 14:14:21 [2.97ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('invoice', '{"attributes":{"outstanding_balance":"0.00","status":"PAID"},"old":{"outstanding_balance":"38.00","status":"OPEN"}}', 1, 'App\Models\User', 519640, 'Modules\Transaction\Entities\Invoice', 'updated', '2025-04-15 14:14:21', '2025-04-15 14:14:21');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 42 - 2025-04-15 14:14:21 [813.56ms] */
select * from `transaction` where `invoice_id` = 519640 and `transaction`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 43 - 2025-04-15 14:14:22 [6.43ms] */
update `vehicle_tax` set `status` = 'PAID', `vehicle_tax`.`updated_at` = '2025-04-15 14:14:22' where `id` = 434114 and `vehicle_tax`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 44 - 2025-04-15 14:14:22 [0.2ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 45 - 2025-04-15 14:14:22 [0.16ms] */
select * from `roles` where `roles`.`id` = 5 and `roles`.`id` is not null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 46 - 2025-04-15 14:14:22 [0.4ms] */
select * from `transaction` where `transaction`.`id` = 543972 and `transaction`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 47 - 2025-04-15 14:14:22 [0.17ms] */
select * from `service_workflow` where `service_workflow`.`id` = 2 and `service_workflow`.`id` is not null and `service_workflow`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 48 - 2025-04-15 14:14:22 [0.16ms] */
select * from `service` where `service`.`id` = 2 and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 49 - 2025-04-15 14:14:22 [0.16ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 50 - 2025-04-15 14:14:22 [2.79ms] */
insert into `transaction_workflow` (`transaction_id`, `action`, `action_date`, `role_id`, `user_id`, `comments`, `updated_by`, `created_by`, `created_at`, `updated_at`) values (543972, 'APPROVED', '2025-04-15 14:14:22', 5, 1, null, 1, 1, '2025-04-15 14:14:22', '2025-04-15 14:14:22');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 51 - 2025-04-15 14:14:22 [0.64ms] */
select * from `workflow_definition` where `workflow_id` = 2 and `step_number` = 3 and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 52 - 2025-04-15 14:14:22 [3.3ms] */
update `transaction` set `current_workflow_state_id` = 8, `status` = 'INPROGRESS', `transaction`.`updated_at` = '2025-04-15 14:14:22' where `id` = 543972;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 53 - 2025-04-15 14:14:22 [0.14ms] */
select * from `service` where `service`.`id` = 2 and `service`.`id` is not null and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 54 - 2025-04-15 14:14:22 [0.75ms] */
select * from `invoice` where `invoice`.`id` = 519640 and `invoice`.`id` is not null and `invoice`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 55 - 2025-04-15 14:14:22 [0.76ms] */
select * from `vehicle_tax` where `transaction_id` = 543972 and `vehicle_tax`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:16:16 [1.37ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:16:16 [0.25ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:16:16 [1.4ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:16:16 [11.29ms] */
update `userprofiles` set `login_count` = 453, `last_login` = '2025-04-15 14:16:16', `userprofiles`.`updated_at` = '2025-04-15 14:16:16' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:16:16 [0.23ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:16:16 [0.46ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:16:16 [0.23ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:16:16 [0.17ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:16:16 [0.16ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:16:16 [0.17ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:16:16 [0.16ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:16:16 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:16:16 [5.1ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('c5b9a87313ebba8dd215ce0cae4eddd1287a86d7635554e4891a755e0a7ba101a9e990190b84f34c', 1, 5, '[]', 0, '2025-04-15 14:16:16', '2025-04-15 14:16:16', '2026-04-15 14:16:16');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:16:16 [0.31ms] */
select * from `oauth_access_tokens` where `id` = 'c5b9a87313ebba8dd215ce0cae4eddd1287a86d7635554e4891a755e0a7ba101a9e990190b84f34c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:16:16 [2.96ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'c5b9a87313ebba8dd215ce0cae4eddd1287a86d7635554e4891a755e0a7ba101a9e990190b84f34c';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:16:16 [1.53ms] */
select * from `oauth_access_tokens` where `id` = 'c5b9a87313ebba8dd215ce0cae4eddd1287a86d7635554e4891a755e0a7ba101a9e990190b84f34c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:16:16 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'c5b9a87313ebba8dd215ce0cae4eddd1287a86d7635554e4891a755e0a7ba101a9e990190b84f34c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:16:16 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:16:16 [0.18ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:16:16 [0.13ms] */
select * from `oauth_access_tokens` where `id` = 'c5b9a87313ebba8dd215ce0cae4eddd1287a86d7635554e4891a755e0a7ba101a9e990190b84f34c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:16:16 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:16:16 [0.83ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'HO785';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:16:16 [12.38ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'HO785' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:16:23 [1.56ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:16:23 [0.34ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:16:23 [1.73ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:16:23 [8.7ms] */
update `userprofiles` set `login_count` = 454, `last_login` = '2025-04-15 14:16:23', `userprofiles`.`updated_at` = '2025-04-15 14:16:23' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:16:23 [0.32ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:16:23 [0.7ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:16:23 [0.3ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:16:23 [0.21ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:16:23 [0.17ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:16:23 [0.15ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:16:23 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:16:23 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:16:23 [3.52ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('950bfef4b3252a86cb817a2accb7ebb5687aaec885f6da0619fc6b00da943f7d4cc68947c921bcab', 1, 5, '[]', 0, '2025-04-15 14:16:23', '2025-04-15 14:16:23', '2026-04-15 14:16:23');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:16:23 [0.46ms] */
select * from `oauth_access_tokens` where `id` = '950bfef4b3252a86cb817a2accb7ebb5687aaec885f6da0619fc6b00da943f7d4cc68947c921bcab' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:16:23 [4.7ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '950bfef4b3252a86cb817a2accb7ebb5687aaec885f6da0619fc6b00da943f7d4cc68947c921bcab';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:16:24 [1.55ms] */
select * from `oauth_access_tokens` where `id` = '950bfef4b3252a86cb817a2accb7ebb5687aaec885f6da0619fc6b00da943f7d4cc68947c921bcab' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:16:24 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '950bfef4b3252a86cb817a2accb7ebb5687aaec885f6da0619fc6b00da943f7d4cc68947c921bcab' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:16:24 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:16:24 [0.17ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:16:24 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '950bfef4b3252a86cb817a2accb7ebb5687aaec885f6da0619fc6b00da943f7d4cc68947c921bcab' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:16:24 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:16:24 [1.02ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'QL935';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:16:24 [10.84ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'QL935' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:16:30 [1.4ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:16:30 [0.31ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:16:30 [0.79ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:16:30 [3.26ms] */
update `userprofiles` set `login_count` = 455, `last_login` = '2025-04-15 14:16:30', `userprofiles`.`updated_at` = '2025-04-15 14:16:30' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:16:30 [0.24ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:16:30 [0.43ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:16:30 [0.24ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:16:30 [0.22ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:16:30 [0.23ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:16:30 [0.15ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:16:30 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:16:30 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:16:30 [5.35ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('e7bbdc053e730d7550bf1c85cbdd5c18e36eb99760eb041285148eb3e3154318f9fc46591f67da02', 1, 5, '[]', 0, '2025-04-15 14:16:30', '2025-04-15 14:16:30', '2026-04-15 14:16:30');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:16:30 [0.45ms] */
select * from `oauth_access_tokens` where `id` = 'e7bbdc053e730d7550bf1c85cbdd5c18e36eb99760eb041285148eb3e3154318f9fc46591f67da02' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:16:30 [2.75ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'e7bbdc053e730d7550bf1c85cbdd5c18e36eb99760eb041285148eb3e3154318f9fc46591f67da02';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:16:30 [1.51ms] */
select * from `oauth_access_tokens` where `id` = 'e7bbdc053e730d7550bf1c85cbdd5c18e36eb99760eb041285148eb3e3154318f9fc46591f67da02' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:16:30 [0.15ms] */
select * from `oauth_access_tokens` where `id` = 'e7bbdc053e730d7550bf1c85cbdd5c18e36eb99760eb041285148eb3e3154318f9fc46591f67da02' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:16:30 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:16:30 [0.34ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:16:30 [0.17ms] */
select * from `oauth_access_tokens` where `id` = 'e7bbdc053e730d7550bf1c85cbdd5c18e36eb99760eb041285148eb3e3154318f9fc46591f67da02' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:16:30 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:16:30 [0.16ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'BW187';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:16:30 [16.9ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'BW187' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:16:37 [1.44ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:16:37 [0.28ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:16:37 [0.58ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:16:37 [11.68ms] */
update `userprofiles` set `login_count` = 456, `last_login` = '2025-04-15 14:16:37', `userprofiles`.`updated_at` = '2025-04-15 14:16:37' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:16:37 [0.36ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:16:37 [0.75ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:16:37 [0.27ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:16:37 [0.2ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:16:37 [0.16ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:16:37 [0.14ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:16:37 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:16:37 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:16:37 [3.49ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('4f6c74d4466f3a54f1ca22512fce9db1e0fd6a0e64c9d7f5d8a2203fd7700bb71b5bfedfb74f25fb', 1, 5, '[]', 0, '2025-04-15 14:16:37', '2025-04-15 14:16:37', '2026-04-15 14:16:37');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:16:37 [0.47ms] */
select * from `oauth_access_tokens` where `id` = '4f6c74d4466f3a54f1ca22512fce9db1e0fd6a0e64c9d7f5d8a2203fd7700bb71b5bfedfb74f25fb' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:16:37 [3.24ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '4f6c74d4466f3a54f1ca22512fce9db1e0fd6a0e64c9d7f5d8a2203fd7700bb71b5bfedfb74f25fb';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:16:37 [1.52ms] */
select * from `oauth_access_tokens` where `id` = '4f6c74d4466f3a54f1ca22512fce9db1e0fd6a0e64c9d7f5d8a2203fd7700bb71b5bfedfb74f25fb' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:16:37 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '4f6c74d4466f3a54f1ca22512fce9db1e0fd6a0e64c9d7f5d8a2203fd7700bb71b5bfedfb74f25fb' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:16:37 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:16:37 [0.16ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:16:37 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '4f6c74d4466f3a54f1ca22512fce9db1e0fd6a0e64c9d7f5d8a2203fd7700bb71b5bfedfb74f25fb' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:16:37 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:16:37 [0.72ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LG563';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:16:37 [14.27ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'LG563' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:16:44 [1.47ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:16:44 [0.32ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:16:44 [1.19ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:16:44 [6.02ms] */
update `userprofiles` set `login_count` = 457, `last_login` = '2025-04-15 14:16:44', `userprofiles`.`updated_at` = '2025-04-15 14:16:44' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:16:44 [0.28ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:16:44 [0.62ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:16:44 [0.25ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:16:44 [0.2ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:16:44 [0.16ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:16:44 [0.19ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:16:44 [0.18ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:16:44 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:16:44 [3.26ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('2007e141e65787b1492374b9bfae75ff2dd9faeb2839dd38b5d99f444751f1f3db876d12bb455ff1', 1, 5, '[]', 0, '2025-04-15 14:16:44', '2025-04-15 14:16:44', '2026-04-15 14:16:44');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:16:44 [0.34ms] */
select * from `oauth_access_tokens` where `id` = '2007e141e65787b1492374b9bfae75ff2dd9faeb2839dd38b5d99f444751f1f3db876d12bb455ff1' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:16:44 [3.2ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '2007e141e65787b1492374b9bfae75ff2dd9faeb2839dd38b5d99f444751f1f3db876d12bb455ff1';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:16:44 [1.53ms] */
select * from `oauth_access_tokens` where `id` = '2007e141e65787b1492374b9bfae75ff2dd9faeb2839dd38b5d99f444751f1f3db876d12bb455ff1' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:16:44 [0.27ms] */
select * from `oauth_access_tokens` where `id` = '2007e141e65787b1492374b9bfae75ff2dd9faeb2839dd38b5d99f444751f1f3db876d12bb455ff1' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:16:44 [0.27ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:16:44 [0.28ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:16:44 [0.23ms] */
select * from `oauth_access_tokens` where `id` = '2007e141e65787b1492374b9bfae75ff2dd9faeb2839dd38b5d99f444751f1f3db876d12bb455ff1' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:16:44 [0.2ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:16:44 [0.13ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'SF258';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:16:44 [12.77ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'SF258' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:17:02 [1.43ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:17:02 [0.29ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:17:02 [0.63ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:17:02 [13.35ms] */
update `userprofiles` set `login_count` = 458, `last_login` = '2025-04-15 14:17:02', `userprofiles`.`updated_at` = '2025-04-15 14:17:02' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:17:02 [1.75ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:17:02 [1.38ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:17:02 [0.75ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:17:02 [0.31ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:17:02 [0.21ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:17:02 [1.01ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:17:02 [0.2ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:17:02 [0.16ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:17:02 [5.61ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('14e53e55c891bdf07af22b2f45e7ae613371638d8c8a354284a5b4def9d0c8d5f00584ea66c07da5', 1, 5, '[]', 0, '2025-04-15 14:17:02', '2025-04-15 14:17:02', '2026-04-15 14:17:02');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:17:02 [0.81ms] */
select * from `oauth_access_tokens` where `id` = '14e53e55c891bdf07af22b2f45e7ae613371638d8c8a354284a5b4def9d0c8d5f00584ea66c07da5' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:17:02 [4.11ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '14e53e55c891bdf07af22b2f45e7ae613371638d8c8a354284a5b4def9d0c8d5f00584ea66c07da5';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:17:02 [1.38ms] */
select * from `oauth_access_tokens` where `id` = '14e53e55c891bdf07af22b2f45e7ae613371638d8c8a354284a5b4def9d0c8d5f00584ea66c07da5' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:17:02 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '14e53e55c891bdf07af22b2f45e7ae613371638d8c8a354284a5b4def9d0c8d5f00584ea66c07da5' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:17:02 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:17:02 [0.16ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:17:02 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '14e53e55c891bdf07af22b2f45e7ae613371638d8c8a354284a5b4def9d0c8d5f00584ea66c07da5' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:17:02 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:17:02 [0.17ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'SF258';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:17:02 [0.33ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'SF258' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:17:09 [1.34ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:17:09 [0.29ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:17:09 [1.75ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:17:09 [6.7ms] */
update `userprofiles` set `login_count` = 459, `last_login` = '2025-04-15 14:17:09', `userprofiles`.`updated_at` = '2025-04-15 14:17:09' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:17:09 [0.37ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:17:09 [0.63ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:17:09 [0.26ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:17:09 [0.18ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:17:09 [0.12ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:17:09 [0.14ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:17:09 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:17:09 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:17:09 [4.69ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('93636ee903ffb709a5444ff0c9be6960c094cfd3b062a26c834a3fa4b3baff2970ffbd2dd0faec20', 1, 5, '[]', 0, '2025-04-15 14:17:09', '2025-04-15 14:17:09', '2026-04-15 14:17:09');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:17:09 [0.51ms] */
select * from `oauth_access_tokens` where `id` = '93636ee903ffb709a5444ff0c9be6960c094cfd3b062a26c834a3fa4b3baff2970ffbd2dd0faec20' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:17:09 [3.21ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '93636ee903ffb709a5444ff0c9be6960c094cfd3b062a26c834a3fa4b3baff2970ffbd2dd0faec20';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:17:09 [1.45ms] */
select * from `oauth_access_tokens` where `id` = '93636ee903ffb709a5444ff0c9be6960c094cfd3b062a26c834a3fa4b3baff2970ffbd2dd0faec20' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:17:09 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '93636ee903ffb709a5444ff0c9be6960c094cfd3b062a26c834a3fa4b3baff2970ffbd2dd0faec20' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:17:09 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:17:09 [0.19ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:17:09 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '93636ee903ffb709a5444ff0c9be6960c094cfd3b062a26c834a3fa4b3baff2970ffbd2dd0faec20' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:17:09 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:17:09 [0.14ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'HO785';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:17:09 [0.32ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'HO785' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:17:56 [1.37ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:17:56 [0.29ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:17:56 [0.94ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:17:56 [12.72ms] */
update `userprofiles` set `login_count` = 460, `last_login` = '2025-04-15 14:17:56', `userprofiles`.`updated_at` = '2025-04-15 14:17:56' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:17:56 [0.35ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:17:56 [0.81ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:17:56 [0.23ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:17:56 [0.2ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:17:56 [0.17ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:17:56 [0.21ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:17:56 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:17:56 [0.19ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:17:56 [4.61ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('eab47542b74ffe6844c6aadd620c377cdb704a2f4bb0261b2f5213fa78fb2903fb02416f928b1160', 1, 5, '[]', 0, '2025-04-15 14:17:56', '2025-04-15 14:17:56', '2026-04-15 14:17:56');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:17:56 [0.36ms] */
select * from `oauth_access_tokens` where `id` = 'eab47542b74ffe6844c6aadd620c377cdb704a2f4bb0261b2f5213fa78fb2903fb02416f928b1160' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:17:56 [3.02ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'eab47542b74ffe6844c6aadd620c377cdb704a2f4bb0261b2f5213fa78fb2903fb02416f928b1160';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:17:56 [1.47ms] */
select * from `oauth_access_tokens` where `id` = 'eab47542b74ffe6844c6aadd620c377cdb704a2f4bb0261b2f5213fa78fb2903fb02416f928b1160' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:17:56 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'eab47542b74ffe6844c6aadd620c377cdb704a2f4bb0261b2f5213fa78fb2903fb02416f928b1160' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:17:56 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:17:56 [0.16ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:17:56 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'eab47542b74ffe6844c6aadd620c377cdb704a2f4bb0261b2f5213fa78fb2903fb02416f928b1160' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:17:56 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:17:56 [0.14ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LG563';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:17:56 [0.33ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'LG563' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:19:47 [1.49ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:19:47 [0.28ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:19:47 [0.34ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:19:47 [11.7ms] */
update `userprofiles` set `login_count` = 461, `last_login` = '2025-04-15 14:19:47', `userprofiles`.`updated_at` = '2025-04-15 14:19:47' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:19:47 [0.29ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:19:47 [0.49ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:19:47 [0.18ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:19:47 [0.17ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:19:47 [0.14ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:19:47 [0.16ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:19:47 [0.16ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:19:47 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:19:47 [3.12ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('93142cd6e168c1736ea5c8921fb3552b5fb9761ab980db348601270d34c51fe25a595f7383772ed9', 1, 5, '[]', 0, '2025-04-15 14:19:47', '2025-04-15 14:19:47', '2026-04-15 14:19:47');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:19:47 [0.3ms] */
select * from `oauth_access_tokens` where `id` = '93142cd6e168c1736ea5c8921fb3552b5fb9761ab980db348601270d34c51fe25a595f7383772ed9' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:19:47 [2.79ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '93142cd6e168c1736ea5c8921fb3552b5fb9761ab980db348601270d34c51fe25a595f7383772ed9';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:19:47 [1.56ms] */
select * from `oauth_access_tokens` where `id` = '93142cd6e168c1736ea5c8921fb3552b5fb9761ab980db348601270d34c51fe25a595f7383772ed9' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:19:47 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '93142cd6e168c1736ea5c8921fb3552b5fb9761ab980db348601270d34c51fe25a595f7383772ed9' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:19:47 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:19:47 [0.16ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:19:47 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '93142cd6e168c1736ea5c8921fb3552b5fb9761ab980db348601270d34c51fe25a595f7383772ed9' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:19:47 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:19:47 [0.58ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Lg563';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:19:48 [14.28ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Lg563' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:21:08 [1.41ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:21:08 [0.3ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:21:08 [0.62ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:21:08 [12.71ms] */
update `userprofiles` set `login_count` = 462, `last_login` = '2025-04-15 14:21:08', `userprofiles`.`updated_at` = '2025-04-15 14:21:08' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:21:08 [0.34ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:21:08 [0.6ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:21:08 [0.25ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:21:08 [0.17ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:21:08 [0.13ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:21:08 [0.14ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:21:08 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:21:08 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:21:08 [5.35ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('5410c000f5a9bbf19faeae603db52f85bd57ff10208e1f533cc9497c22462950beff6e0f68c3a8e5', 1, 5, '[]', 0, '2025-04-15 14:21:08', '2025-04-15 14:21:08', '2026-04-15 14:21:08');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:21:08 [0.3ms] */
select * from `oauth_access_tokens` where `id` = '5410c000f5a9bbf19faeae603db52f85bd57ff10208e1f533cc9497c22462950beff6e0f68c3a8e5' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:21:08 [2.67ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '5410c000f5a9bbf19faeae603db52f85bd57ff10208e1f533cc9497c22462950beff6e0f68c3a8e5';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:21:08 [1.48ms] */
select * from `oauth_access_tokens` where `id` = '5410c000f5a9bbf19faeae603db52f85bd57ff10208e1f533cc9497c22462950beff6e0f68c3a8e5' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:21:08 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '5410c000f5a9bbf19faeae603db52f85bd57ff10208e1f533cc9497c22462950beff6e0f68c3a8e5' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:21:08 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:21:08 [0.17ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:21:08 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '5410c000f5a9bbf19faeae603db52f85bd57ff10208e1f533cc9497c22462950beff6e0f68c3a8e5' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:21:08 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:21:08 [0.18ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Lg563';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:21:08 [0.44ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Lg563' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:21:17 [1.59ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:21:17 [0.29ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:21:17 [1.48ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:21:17 [6.35ms] */
update `userprofiles` set `login_count` = 463, `last_login` = '2025-04-15 14:21:17', `userprofiles`.`updated_at` = '2025-04-15 14:21:17' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:21:17 [0.2ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:21:17 [0.42ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:21:17 [0.21ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:21:17 [0.18ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:21:17 [0.14ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:21:17 [0.16ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:21:17 [0.16ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:21:17 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:21:17 [4.39ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('62608a7811c9f7601f353538d5ec1b72d47d68203e0cdcc10605e3dfb8951efea49d8c643d4485ec', 1, 5, '[]', 0, '2025-04-15 14:21:17', '2025-04-15 14:21:17', '2026-04-15 14:21:17');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:21:17 [0.45ms] */
select * from `oauth_access_tokens` where `id` = '62608a7811c9f7601f353538d5ec1b72d47d68203e0cdcc10605e3dfb8951efea49d8c643d4485ec' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:21:17 [3.67ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '62608a7811c9f7601f353538d5ec1b72d47d68203e0cdcc10605e3dfb8951efea49d8c643d4485ec';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:21:17 [1.46ms] */
select * from `oauth_access_tokens` where `id` = '62608a7811c9f7601f353538d5ec1b72d47d68203e0cdcc10605e3dfb8951efea49d8c643d4485ec' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:21:17 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '62608a7811c9f7601f353538d5ec1b72d47d68203e0cdcc10605e3dfb8951efea49d8c643d4485ec' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:21:17 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:21:17 [0.18ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:21:17 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '62608a7811c9f7601f353538d5ec1b72d47d68203e0cdcc10605e3dfb8951efea49d8c643d4485ec' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:21:17 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:21:17 [0.14ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Lg563';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:21:17 [0.35ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Lg563' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:21:17 [1.61ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:21:17 [0.3ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:21:17 [0.33ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:21:17 [5.75ms] */
update `userprofiles` set `login_count` = 464, `userprofiles`.`updated_at` = '2025-04-15 14:21:17' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:21:17 [0.2ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:21:17 [0.41ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:21:17 [0.16ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:21:17 [0.13ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:21:17 [0.12ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:21:17 [0.23ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:21:17 [0.22ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:21:17 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:21:17 [4.17ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('d68aa5d1de6ed0868959937d9119ed54009223196486e21d332721c8c1f84c9c4d12d93aa97bb118', 1, 5, '[]', 0, '2025-04-15 14:21:17', '2025-04-15 14:21:17', '2026-04-15 14:21:17');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:21:17 [0.43ms] */
select * from `oauth_access_tokens` where `id` = 'd68aa5d1de6ed0868959937d9119ed54009223196486e21d332721c8c1f84c9c4d12d93aa97bb118' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:21:17 [2.65ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'd68aa5d1de6ed0868959937d9119ed54009223196486e21d332721c8c1f84c9c4d12d93aa97bb118';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 1 - 2025-04-15 14:21:17 [1.76ms] */
select * from `oauth_access_tokens` where `id` = 'd68aa5d1de6ed0868959937d9119ed54009223196486e21d332721c8c1f84c9c4d12d93aa97bb118' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 2 - 2025-04-15 14:21:17 [0.27ms] */
select * from `oauth_access_tokens` where `id` = 'd68aa5d1de6ed0868959937d9119ed54009223196486e21d332721c8c1f84c9c4d12d93aa97bb118' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 3 - 2025-04-15 14:21:17 [0.19ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 4 - 2025-04-15 14:21:17 [0.17ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 5 - 2025-04-15 14:21:17 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'd68aa5d1de6ed0868959937d9119ed54009223196486e21d332721c8c1f84c9c4d12d93aa97bb118' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 6 - 2025-04-15 14:21:17 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 7 - 2025-04-15 14:21:17 [338.89ms] */
select count(*) as aggregate from `payment` where `external_payment_reference_no` = 'CO250415.1403.D29643';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 8 - 2025-04-15 14:21:17 [0.29ms] */
select * from `payment_method` where `name` = 'eDahab' and `payment_method`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 9 - 2025-04-15 14:21:17 [0.44ms] */
select * from `invoice` where `id` in (502393,  502394) and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 10 - 2025-04-15 14:21:17 [5.83ms] */
insert into `Payment` (`payment_amount`, `payment_date`, `external_payment_reference_no`, `payment_method_id`, `paid_by`, `paid_by_mobile`, `payment_collected_by`, `district_id`, `updated_by`, `created_by`, `created_at`, `updated_at`) values (109.0, '2025-04-15 14:21:17', 'CO250415.1403.D29643', 2, 'MAXAMED XASAN FAARAX KUNLE', 659000137, 1, 1, 1, 1, '2025-04-15 14:21:17', '2025-04-15 14:21:17');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 11 - 2025-04-15 14:21:17 [0.38ms] */
select * from `Payment` where `id` = 177848 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 12 - 2025-04-15 14:21:17 [3.13ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('Payment', '{"attributes":{"payment_method_id":2,"payment_amount":"109.00","payment_date":"2025-04-15 14:21:17","external_payment_reference_no":"CO250415.1403.D29643","payment_receipt_number":null,"siinpay_payref_number":null,"paid_by":"MAXAMED XASAN FAARAX KUNLE","paid_by_mobile":"659000137","district_id":1,"migration_id":null,"payment_collected_by":1}}', 1, 'App\Models\User', 177848, 'Modules\Transaction\Entities\Payment', 'created', '2025-04-15 14:21:17', '2025-04-15 14:21:17');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 13 - 2025-04-15 14:21:17 [3.29ms] */
insert into `invoice_payment` (`created_at`, `invoice_id`, `payment_id`, `updated_at`) values ('2025-04-15 14:21:17', 502393, 177848, '2025-04-15 14:21:17');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 14 - 2025-04-15 14:21:17 [0.4ms] */
select * from `invoice` where `invoice`.`id` = 502393 and `invoice`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 15 - 2025-04-15 14:21:17 [0.49ms] */
select `Payment`.*, `invoice_payment`.`invoice_id` as `pivot_invoice_id`, `invoice_payment`.`payment_id` as `pivot_payment_id`, `invoice_payment`.`created_at` as `pivot_created_at`, `invoice_payment`.`updated_at` as `pivot_updated_at` from `Payment` inner join `invoice_payment` on `Payment`.`id` = `invoice_payment`.`payment_id` where `invoice_payment`.`invoice_id` = 502393 and `Payment`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 16 - 2025-04-15 14:21:17 [0.58ms] */
select * from `invoice_item` where `invoice_item`.`invoice_id` = 502393 and `invoice_item`.`invoice_id` is not null and `invoice_item`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 17 - 2025-04-15 14:21:17 [4.24ms] */
update `invoice` set `invoice_amount` = 71, `outstanding_balance` = 0, `discounts` = 0, `total_invoice_amount` = 71, `status` = 'PAID', `invoice`.`updated_at` = '2025-04-15 14:21:17' where `id` = 502393;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 18 - 2025-04-15 14:21:17 [0.28ms] */
select * from `invoice` where `id` = 502393 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 19 - 2025-04-15 14:21:17 [3.18ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('invoice', '{"attributes":{"outstanding_balance":"0.00","status":"PAID"},"old":{"outstanding_balance":"71.00","status":"OPEN"}}', 1, 'App\Models\User', 502393, 'Modules\Transaction\Entities\Invoice', 'updated', '2025-04-15 14:21:17', '2025-04-15 14:21:17');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 20 - 2025-04-15 14:21:18 [745.02ms] */
select * from `transaction` where `invoice_id` = 502393 and `transaction`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 21 - 2025-04-15 14:21:18 [11.54ms] */
update `vehicle_tax` set `status` = 'PAID', `vehicle_tax`.`updated_at` = '2025-04-15 14:21:18' where `id` = 416867 and `vehicle_tax`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 22 - 2025-04-15 14:21:18 [0.32ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 23 - 2025-04-15 14:21:18 [0.61ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 24 - 2025-04-15 14:21:18 [0.21ms] */
select * from `roles` where `roles`.`id` = 5 and `roles`.`id` is not null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 25 - 2025-04-15 14:21:18 [2.76ms] */
select * from `transaction` where `transaction`.`id` = 526725 and `transaction`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 26 - 2025-04-15 14:21:18 [0.25ms] */
select * from `service_workflow` where `service_workflow`.`id` = 2 and `service_workflow`.`id` is not null and `service_workflow`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 27 - 2025-04-15 14:21:18 [0.22ms] */
select * from `service` where `service`.`id` = 2 and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 28 - 2025-04-15 14:21:18 [0.21ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 29 - 2025-04-15 14:21:18 [3.2ms] */
insert into `transaction_workflow` (`transaction_id`, `action`, `action_date`, `role_id`, `user_id`, `comments`, `updated_by`, `created_by`, `created_at`, `updated_at`) values (526725, 'APPROVED', '2025-04-15 14:21:18', 5, 1, null, 1, 1, '2025-04-15 14:21:18', '2025-04-15 14:21:18');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 30 - 2025-04-15 14:21:18 [0.23ms] */
select * from `workflow_definition` where `workflow_id` = 2 and `step_number` = 3 and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 31 - 2025-04-15 14:21:18 [0.43ms] */
update `transaction` set `current_workflow_state_id` = 8, `status` = 'INPROGRESS', `transaction`.`updated_at` = '2025-04-15 14:21:18' where `id` = 526725;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 32 - 2025-04-15 14:21:18 [0.19ms] */
select * from `service` where `service`.`id` = 2 and `service`.`id` is not null and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 33 - 2025-04-15 14:21:18 [0.34ms] */
select * from `invoice` where `invoice`.`id` = 502393 and `invoice`.`id` is not null and `invoice`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 34 - 2025-04-15 14:21:18 [0.76ms] */
select * from `vehicle_tax` where `transaction_id` = 526725 and `vehicle_tax`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 35 - 2025-04-15 14:21:18 [4.64ms] */
insert into `invoice_payment` (`created_at`, `invoice_id`, `payment_id`, `updated_at`) values ('2025-04-15 14:21:18', 502394, 177848, '2025-04-15 14:21:18');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 36 - 2025-04-15 14:21:18 [0.5ms] */
select * from `invoice` where `invoice`.`id` = 502394 and `invoice`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 37 - 2025-04-15 14:21:18 [0.35ms] */
select `Payment`.*, `invoice_payment`.`invoice_id` as `pivot_invoice_id`, `invoice_payment`.`payment_id` as `pivot_payment_id`, `invoice_payment`.`created_at` as `pivot_created_at`, `invoice_payment`.`updated_at` as `pivot_updated_at` from `Payment` inner join `invoice_payment` on `Payment`.`id` = `invoice_payment`.`payment_id` where `invoice_payment`.`invoice_id` = 502394 and `Payment`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 38 - 2025-04-15 14:21:18 [1.88ms] */
select * from `invoice_item` where `invoice_item`.`invoice_id` = 502394 and `invoice_item`.`invoice_id` is not null and `invoice_item`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 39 - 2025-04-15 14:21:18 [3.75ms] */
update `invoice` set `invoice_amount` = 38, `outstanding_balance` = 0, `discounts` = 0, `total_invoice_amount` = 38, `status` = 'PAID', `invoice`.`updated_at` = '2025-04-15 14:21:18' where `id` = 502394;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 40 - 2025-04-15 14:21:18 [0.61ms] */
select * from `invoice` where `id` = 502394 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 41 - 2025-04-15 14:21:18 [6.23ms] */
insert into `activity_log` (`log_name`, `properties`, `causer_id`, `causer_type`, `subject_id`, `subject_type`, `description`, `updated_at`, `created_at`) values ('invoice', '{"attributes":{"outstanding_balance":"0.00","status":"PAID"},"old":{"outstanding_balance":"38.00","status":"OPEN"}}', 1, 'App\Models\User', 502394, 'Modules\Transaction\Entities\Invoice', 'updated', '2025-04-15 14:21:18', '2025-04-15 14:21:18');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 42 - 2025-04-15 14:21:19 [922.89ms] */
select * from `transaction` where `invoice_id` = 502394 and `transaction`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 43 - 2025-04-15 14:21:19 [5.69ms] */
update `vehicle_tax` set `status` = 'PAID', `vehicle_tax`.`updated_at` = '2025-04-15 14:21:19' where `id` = 416868 and `vehicle_tax`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 44 - 2025-04-15 14:21:19 [0.24ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 45 - 2025-04-15 14:21:19 [0.2ms] */
select * from `roles` where `roles`.`id` = 5 and `roles`.`id` is not null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 46 - 2025-04-15 14:21:19 [0.44ms] */
select * from `transaction` where `transaction`.`id` = 526726 and `transaction`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 47 - 2025-04-15 14:21:19 [0.22ms] */
select * from `service_workflow` where `service_workflow`.`id` = 2 and `service_workflow`.`id` is not null and `service_workflow`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 48 - 2025-04-15 14:21:19 [0.23ms] */
select * from `service` where `service`.`id` = 2 and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 49 - 2025-04-15 14:21:19 [0.22ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 50 - 2025-04-15 14:21:19 [2.81ms] */
insert into `transaction_workflow` (`transaction_id`, `action`, `action_date`, `role_id`, `user_id`, `comments`, `updated_by`, `created_by`, `created_at`, `updated_at`) values (526726, 'APPROVED', '2025-04-15 14:21:19', 5, 1, null, 1, 1, '2025-04-15 14:21:19', '2025-04-15 14:21:19');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 51 - 2025-04-15 14:21:19 [0.21ms] */
select * from `workflow_definition` where `workflow_id` = 2 and `step_number` = 3 and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 52 - 2025-04-15 14:21:19 [0.42ms] */
update `transaction` set `current_workflow_state_id` = 8, `status` = 'INPROGRESS', `transaction`.`updated_at` = '2025-04-15 14:21:19' where `id` = 526726;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 53 - 2025-04-15 14:21:19 [0.14ms] */
select * from `service` where `service`.`id` = 2 and `service`.`id` is not null and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 54 - 2025-04-15 14:21:19 [0.53ms] */
select * from `invoice` where `invoice`.`id` = 502394 and `invoice`.`id` is not null and `invoice`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/make_payments
   Query 55 - 2025-04-15 14:21:19 [0.29ms] */
select * from `vehicle_tax` where `transaction_id` = 526726 and `vehicle_tax`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:27:49 [1.4ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:27:49 [0.16ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:27:49 [0.39ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:27:49 [6.48ms] */
update `userprofiles` set `login_count` = 465, `last_login` = '2025-04-15 14:27:49', `userprofiles`.`updated_at` = '2025-04-15 14:27:49' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:27:49 [0.24ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:27:49 [0.59ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:27:49 [0.23ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:27:49 [0.87ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:27:49 [3.45ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:27:49 [0.27ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:27:49 [0.19ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:27:49 [0.16ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:27:49 [6.9ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('6272b4dac225a86ab2bde459d6e2f905ef461bd12a9ce8d3802ba02db0ca3d0cd5a4c1a96a3f5560', 1, 5, '[]', 0, '2025-04-15 14:27:49', '2025-04-15 14:27:49', '2026-04-15 14:27:49');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:27:49 [0.33ms] */
select * from `oauth_access_tokens` where `id` = '6272b4dac225a86ab2bde459d6e2f905ef461bd12a9ce8d3802ba02db0ca3d0cd5a4c1a96a3f5560' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:27:49 [2.89ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '6272b4dac225a86ab2bde459d6e2f905ef461bd12a9ce8d3802ba02db0ca3d0cd5a4c1a96a3f5560';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:27:49 [1.61ms] */
select * from `oauth_access_tokens` where `id` = '6272b4dac225a86ab2bde459d6e2f905ef461bd12a9ce8d3802ba02db0ca3d0cd5a4c1a96a3f5560' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:27:49 [0.18ms] */
select * from `oauth_access_tokens` where `id` = '6272b4dac225a86ab2bde459d6e2f905ef461bd12a9ce8d3802ba02db0ca3d0cd5a4c1a96a3f5560' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:27:49 [0.17ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:27:49 [0.22ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:27:49 [0.17ms] */
select * from `oauth_access_tokens` where `id` = '6272b4dac225a86ab2bde459d6e2f905ef461bd12a9ce8d3802ba02db0ca3d0cd5a4c1a96a3f5560' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:27:49 [0.16ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:27:49 [0.21ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Sf258';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:27:49 [15.15ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Sf258' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-04-15 14:28:36 [1.53ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 2 - 2025-04-15 14:28:36 [0.31ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-04-15 14:28:36 [1.5ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 1 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 4 - 2025-04-15 14:28:36 [11.66ms] */
update `userprofiles` set `login_count` = 466, `last_login` = '2025-04-15 14:28:36', `userprofiles`.`updated_at` = '2025-04-15 14:28:36' where `id` = 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-04-15 14:28:36 [0.26ms] */
select * from `users` where `email` = 'superadmin@puntlandgov.org' and `users`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 6 - 2025-04-15 14:28:36 [0.47ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-04-15 14:28:36 [0.2ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (1) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-04-15 14:28:36 [0.18ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-04-15 14:28:36 [0.21ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-04-15 14:28:36 [0.14ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-04-15 14:28:36 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-04-15 14:28:36 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-04-15 14:28:36 [3.91ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('75852dd508bc4fbbe5f49e1cd4c5d2879a8e26232014505f17a19ba89c8c26e7c0eaf3b2ae59b688', 1, 5, '[]', 0, '2025-04-15 14:28:36', '2025-04-15 14:28:36', '2026-04-15 14:28:36');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-04-15 14:28:36 [0.31ms] */
select * from `oauth_access_tokens` where `id` = '75852dd508bc4fbbe5f49e1cd4c5d2879a8e26232014505f17a19ba89c8c26e7c0eaf3b2ae59b688' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-04-15 14:28:36 [2.75ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '75852dd508bc4fbbe5f49e1cd4c5d2879a8e26232014505f17a19ba89c8c26e7c0eaf3b2ae59b688';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-04-15 14:28:36 [1.68ms] */
select * from `oauth_access_tokens` where `id` = '75852dd508bc4fbbe5f49e1cd4c5d2879a8e26232014505f17a19ba89c8c26e7c0eaf3b2ae59b688' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-04-15 14:28:36 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '75852dd508bc4fbbe5f49e1cd4c5d2879a8e26232014505f17a19ba89c8c26e7c0eaf3b2ae59b688' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-04-15 14:28:36 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-04-15 14:28:36 [0.16ms] */
select * from `users` where `id` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-04-15 14:28:36 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '75852dd508bc4fbbe5f49e1cd4c5d2879a8e26232014505f17a19ba89c8c26e7c0eaf3b2ae59b688' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-04-15 14:28:36 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-04-15 14:28:36 [0.14ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'Sf258';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-04-15 14:28:36 [0.43ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `license_plate` = 'Sf258' and `invoice`.`status` in ('OPEN', 'PARTIAL_PAID') and `term`.`year` <= 2025 and `term`.`quarter` <= 2 and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/login
   Query 1 - 2025-04-15 14:39:08 [1.69ms] */
select * from `users` where `email` = 'admin@admin.com' and `status` = 1 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/login
   Query 2 - 2025-04-15 14:39:08 [0.49ms] */
select * from `users` where `id` = 2 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/login
   Query 3 - 2025-04-15 14:39:08 [0.97ms] */
select * from `userprofiles` where `userprofiles`.`user_id` = 2 and `userprofiles`.`user_id` is not null and `userprofiles`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/login
   Query 4 - 2025-04-15 14:39:08 [7.67ms] */
update `userprofiles` set `login_count` = 564, `last_login` = '2025-04-15 14:39:08', `userprofiles`.`updated_at` = '2025-04-15 14:39:08' where `id` = 2;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/login
   Query 5 - 2025-04-15 14:39:08 [0.51ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/login
   Query 6 - 2025-04-15 14:39:08 [0.43ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/login
   Query 7 - 2025-04-15 14:39:08 [0.42ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 1 - 2025-04-15 14:39:09 [1.74ms] */
select * from `users` where `id` = 2 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 2 - 2025-04-15 14:39:09 [0.65ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 3 - 2025-04-15 14:39:09 [0.51ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 4 - 2025-04-15 14:39:09 [0.49ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 5 - 2025-04-15 14:39:09 [107.54ms] */
select count(*) as aggregate from `party` where `party`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 6 - 2025-04-15 14:39:09 [18.94ms] */
select count(*) as aggregate from `party` where `created_at` > '2025-04-15' and `party`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 7 - 2025-04-15 14:39:09 [255.18ms] */
select count(*) as aggregate from `vehicle` where `vehicle`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 8 - 2025-04-15 14:39:09 [30.54ms] */
select count(*) as aggregate from `vehicle` where `created_at` > '2025-04-15' and `vehicle`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 9 - 2025-04-15 14:39:09 [169.93ms] */
select sum(`payment_amount`) as aggregate from `Payment` inner join `invoice_payment` on `invoice_payment`.`payment_id` = `payment`.`id` inner join `invoice` on `invoice_payment`.`invoice_id` = `invoice`.`id` inner join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` where `transaction`.`service_id` = 1 and `transaction`.`status` = 'END' and `payment_date` > '2025-04-14' and `Payment`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 10 - 2025-04-15 14:39:09 [46.72ms] */
select sum(`payment_amount`) as aggregate from `Payment` inner join `invoice_payment` on `invoice_payment`.`payment_id` = `payment`.`id` inner join `invoice` on `invoice_payment`.`invoice_id` = `invoice`.`id` inner join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` where `transaction`.`service_id` = 2 and `transaction`.`status` = 'END' and `payment_date` > '2025-04-14' and `Payment`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 11 - 2025-04-15 14:39:10 [603.39ms] */
select sum(`outstanding_balance`) as aggregate from `invoice` inner join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` where `transaction`.`service_id` = 1 and `invoice`.`invoice_amount` <> 0.00 and `due_date` < '2025-04-15' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org
   Query 12 - 2025-04-15 14:39:12 [1892.44ms] */
select sum(`outstanding_balance`) as aggregate from `invoice` inner join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` where `transaction`.`service_id` = 2 and `invoice`.`invoice_amount` <> 0.00 and `due_date` < '2025-04-15' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/impersonate/5
   Query 1 - 2025-04-15 14:40:34 [1.41ms] */
select * from `users` where `id` = 2 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/impersonate/5
   Query 2 - 2025-04-15 14:40:34 [0.47ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/impersonate/5
   Query 3 - 2025-04-15 14:40:34 [0.32ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/impersonate/5
   Query 4 - 2025-04-15 14:40:34 [0.51ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/impersonate/5
   Query 5 - 2025-04-15 14:40:34 [0.83ms] */
select * from `users` where `users`.`id` = 5 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 1 - 2025-04-15 14:40:34 [2.43ms] */
select * from `users` where `id` = 5 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 2 - 2025-04-15 14:40:34 [0.71ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 3 - 2025-04-15 14:40:34 [0.31ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 4 - 2025-04-15 14:40:34 [0.41ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'permissions';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 5 - 2025-04-15 14:40:34 [1.02ms] */
select * from `service` where `service`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 6 - 2025-04-15 14:40:34 [0.58ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 7 - 2025-04-15 14:40:34 [1.52ms] */
select `roles`.*, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` = 5 and `model_has_roles`.`model_type` = 'App\Models\User' limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 8 - 2025-04-15 14:40:34 [0.59ms] */
select `roles`.*, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` = 5 and `model_has_roles`.`model_type` = 'App\Models\User' order by `created_at` desc limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 9 - 2025-04-15 14:40:35 [937.77ms] */
select count(*) as aggregate from `transaction` inner join `workflow_definition` on `workflow_definition`.`id` = `transaction`.`current_workflow_state_id` where `workflow_definition`.`role_id` in (5) and `transaction`.`one_time_tax` <> 'Y' and `transaction`.`parent_id` is null and `workflow_definition`.`role_id` = 5 and `deliver_district_id` = 37 and `status` != 'CANCELED' and `transaction`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 10 - 2025-04-15 14:40:36 [914.99ms] */
select `transaction`.* from `transaction` inner join `workflow_definition` on `workflow_definition`.`id` = `transaction`.`current_workflow_state_id` where `workflow_definition`.`role_id` in (5) and `transaction`.`one_time_tax` <> 'Y' and `transaction`.`parent_id` is null and `workflow_definition`.`role_id` = 5 and `deliver_district_id` = 37 and `status` != 'CANCELED' and `transaction`.`deleted_at` is null order by `transaction`.`created_at` desc limit 10 offset 0;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 11 - 2025-04-15 14:40:36 [0.22ms] */
select * from `service` where `service`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 12 - 2025-04-15 14:40:36 [1.24ms] */
select * from `service_workflow` where `service_workflow`.`id` = 2 and `service_workflow`.`id` is not null and `service_workflow`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 13 - 2025-04-15 14:40:36 [1.16ms] */
select * from `service` where `service`.`id` = 2 and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 14 - 2025-04-15 14:40:36 [0.26ms] */
select * from `service` where `service`.`id` = 2 and `service`.`id` is not null and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 15 - 2025-04-15 14:40:36 [0.89ms] */
select * from `vehicle` where `vehicle`.`id` = 10 and `vehicle`.`id` is not null and `vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 16 - 2025-04-15 14:40:36 [0.7ms] */
select * from `party` where `party`.`id` = 36537 and `party`.`id` is not null and `party`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 17 - 2025-04-15 14:40:36 [1.38ms] */
select * from `person` where `person`.`id` = 36537 and `person`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 18 - 2025-04-15 14:40:36 [0.92ms] */
select * from `party_vehicle` where `party_vehicle`.`id` = 74744 and `party_vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 19 - 2025-04-15 14:40:36 [0.79ms] */
select * from `classification_type` where `classification_type`.`id` = 2 and `classification_type`.`id` is not null and `classification_type`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 20 - 2025-04-15 14:40:36 [0.22ms] */
select * from `sub_category` where `sub_category`.`id` = 4 and `sub_category`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 21 - 2025-04-15 14:40:36 [0.37ms] */
select * from `transaction_workflow` where `transaction_workflow`.`transaction_id` = 574437 and `transaction_workflow`.`transaction_id` is not null and `transaction_workflow`.`deleted_at` is null order by `created_at` desc limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 22 - 2025-04-15 14:40:36 [0.14ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 23 - 2025-04-15 14:40:36 [0.13ms] */
select * from `roles` where `roles`.`id` = 5 and `roles`.`id` is not null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 24 - 2025-04-15 14:40:36 [0.32ms] */
select * from `transaction_workflow` where `transaction_id` = 574437 and `transaction_workflow`.`deleted_at` is null order by `action_date` desc limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 25 - 2025-04-15 14:40:36 [0.18ms] */
select * from `service_workflow` where `service_workflow`.`id` = 2 and `service_workflow`.`id` is not null and `service_workflow`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 26 - 2025-04-15 14:40:36 [0.15ms] */
select * from `service` where `service`.`id` = 2 and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 27 - 2025-04-15 14:40:36 [0.15ms] */
select * from `service` where `service`.`id` = 2 and `service`.`id` is not null and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 28 - 2025-04-15 14:40:36 [0.18ms] */
select * from `vehicle` where `vehicle`.`id` = 10 and `vehicle`.`id` is not null and `vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 29 - 2025-04-15 14:40:36 [0.17ms] */
select * from `party` where `party`.`id` = 36537 and `party`.`id` is not null and `party`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 30 - 2025-04-15 14:40:36 [0.18ms] */
select * from `person` where `person`.`id` = 36537 and `person`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 31 - 2025-04-15 14:40:36 [0.17ms] */
select * from `party_vehicle` where `party_vehicle`.`id` = 74744 and `party_vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 32 - 2025-04-15 14:40:36 [0.15ms] */
select * from `classification_type` where `classification_type`.`id` = 2 and `classification_type`.`id` is not null and `classification_type`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 33 - 2025-04-15 14:40:36 [0.15ms] */
select * from `sub_category` where `sub_category`.`id` = 4 and `sub_category`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 34 - 2025-04-15 14:40:36 [0.29ms] */
select * from `transaction_workflow` where `transaction_workflow`.`transaction_id` = 574438 and `transaction_workflow`.`transaction_id` is not null and `transaction_workflow`.`deleted_at` is null order by `created_at` desc limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 35 - 2025-04-15 14:40:36 [1.17ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 36 - 2025-04-15 14:40:36 [0.62ms] */
select * from `roles` where `roles`.`id` = 5 and `roles`.`id` is not null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 37 - 2025-04-15 14:40:36 [0.29ms] */
select * from `transaction_workflow` where `transaction_id` = 574438 and `transaction_workflow`.`deleted_at` is null order by `action_date` desc limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 38 - 2025-04-15 14:40:36 [0.15ms] */
select * from `service_workflow` where `service_workflow`.`id` = 2 and `service_workflow`.`id` is not null and `service_workflow`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 39 - 2025-04-15 14:40:36 [0.12ms] */
select * from `service` where `service`.`id` = 2 and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 40 - 2025-04-15 14:40:36 [0.12ms] */
select * from `service` where `service`.`id` = 2 and `service`.`id` is not null and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 41 - 2025-04-15 14:40:36 [0.14ms] */
select * from `vehicle` where `vehicle`.`id` = 10 and `vehicle`.`id` is not null and `vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 42 - 2025-04-15 14:40:36 [0.13ms] */
select * from `party` where `party`.`id` = 36537 and `party`.`id` is not null and `party`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 43 - 2025-04-15 14:40:36 [0.15ms] */
select * from `person` where `person`.`id` = 36537 and `person`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 44 - 2025-04-15 14:40:36 [0.14ms] */
select * from `party_vehicle` where `party_vehicle`.`id` = 74744 and `party_vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 45 - 2025-04-15 14:40:36 [0.12ms] */
select * from `classification_type` where `classification_type`.`id` = 2 and `classification_type`.`id` is not null and `classification_type`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 46 - 2025-04-15 14:40:36 [0.14ms] */
select * from `sub_category` where `sub_category`.`id` = 4 and `sub_category`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 47 - 2025-04-15 14:40:36 [0.24ms] */
select * from `transaction_workflow` where `transaction_workflow`.`transaction_id` = 574439 and `transaction_workflow`.`transaction_id` is not null and `transaction_workflow`.`deleted_at` is null order by `created_at` desc limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 48 - 2025-04-15 14:40:36 [0.13ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 49 - 2025-04-15 14:40:36 [0.13ms] */
select * from `roles` where `roles`.`id` = 5 and `roles`.`id` is not null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 50 - 2025-04-15 14:40:36 [0.3ms] */
select * from `transaction_workflow` where `transaction_id` = 574439 and `transaction_workflow`.`deleted_at` is null order by `action_date` desc limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 51 - 2025-04-15 14:40:36 [0.17ms] */
select * from `service_workflow` where `service_workflow`.`id` = 2 and `service_workflow`.`id` is not null and `service_workflow`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 52 - 2025-04-15 14:40:36 [0.18ms] */
select * from `service` where `service`.`id` = 2 and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 53 - 2025-04-15 14:40:36 [0.15ms] */
select * from `service` where `service`.`id` = 2 and `service`.`id` is not null and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 54 - 2025-04-15 14:40:36 [0.16ms] */
select * from `vehicle` where `vehicle`.`id` = 10 and `vehicle`.`id` is not null and `vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 55 - 2025-04-15 14:40:36 [0.17ms] */
select * from `party` where `party`.`id` = 36537 and `party`.`id` is not null and `party`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 56 - 2025-04-15 14:40:36 [0.17ms] */
select * from `person` where `person`.`id` = 36537 and `person`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 57 - 2025-04-15 14:40:36 [0.17ms] */
select * from `party_vehicle` where `party_vehicle`.`id` = 74744 and `party_vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 58 - 2025-04-15 14:40:36 [0.15ms] */
select * from `classification_type` where `classification_type`.`id` = 2 and `classification_type`.`id` is not null and `classification_type`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 59 - 2025-04-15 14:40:36 [0.15ms] */
select * from `sub_category` where `sub_category`.`id` = 4 and `sub_category`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 60 - 2025-04-15 14:40:36 [0.4ms] */
select * from `transaction_workflow` where `transaction_workflow`.`transaction_id` = 574440 and `transaction_workflow`.`transaction_id` is not null and `transaction_workflow`.`deleted_at` is null order by `created_at` desc limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 61 - 2025-04-15 14:40:36 [0.18ms] */
select * from `workflow_definition` where `workflow_definition`.`id` = 6 and `workflow_definition`.`id` is not null and `workflow_definition`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 62 - 2025-04-15 14:40:36 [0.16ms] */
select * from `roles` where `roles`.`id` = 5 and `roles`.`id` is not null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 63 - 2025-04-15 14:40:36 [0.35ms] */
select * from `transaction_workflow` where `transaction_id` = 574440 and `transaction_workflow`.`deleted_at` is null order by `action_date` desc limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 64 - 2025-04-15 14:40:36 [0.2ms] */
select * from `service_workflow` where `service_workflow`.`id` = 2 and `service_workflow`.`id` is not null and `service_workflow`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 65 - 2025-04-15 14:40:36 [0.16ms] */
select * from `service` where `service`.`id` = 2 and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 66 - 2025-04-15 14:40:36 [0.15ms] */
select * from `service` where `service`.`id` = 2 and `service`.`id` is not null and `service`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 67 - 2025-04-15 14:40:36 [0.18ms] */
select * from `vehicle` where `vehicle`.`id` = 10 and `vehicle`.`id` is not null and `vehicle`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 68 - 2025-04-15 14:40:36 [0.14ms] */
select * from `party` where `party`.`id` = 36537 and `party`.`id` is not null and `party`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): GET https://testtra.puntlandgov.org/w/wkflw
   Query 69 - 2025-04-15 14:40:36 [0.15ms] */
