/* Origin (request): POST https://testtra.puntlandgov.org/login
   Query 1 - 2025-05-29 08:00:27 [1.61ms] */
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 1 - 2025-05-29 08:00:33 [1.44ms] */
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/login
   Query 1 - 2025-05-29 11:00:05 [2.09ms] */
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-05-29 11:00:05 [0.37ms] */
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-05-29 11:00:05 [1.08ms] */
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-05-29 11:00:05 [6.15ms] */
update `userprofiles` set `login_count` = 2573, `last_login` = '2025-05-29 11:00:05', `userprofiles`.`updated_at` = '2025-05-29 11:00:05' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-05-29 11:00:05 [0.34ms] */
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-05-29 11:00:05 [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-05-29 11:00:05 [0.79ms] */
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-05-29 11:00:05 [0.6ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-05-29 11:00:05 [0.27ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-05-29 11:00:05 [0.6ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-05-29 11:00:05 [0.2ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-05-29 11:00:05 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-05-29 11:00:05 [3.87ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('221a2e42c886eb8c5d76ccd16c0715cd754eedd547c1f7b3527ad6541eb994ad32401489a74d140a', 154, 5, '[]', 0, '2025-05-29 11:00:05', '2025-05-29 11:00:05', '2026-05-29 11:00:05');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-05-29 11:00:05 [3.59ms] */
select * from `oauth_access_tokens` where `id` = '221a2e42c886eb8c5d76ccd16c0715cd754eedd547c1f7b3527ad6541eb994ad32401489a74d140a' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-05-29 11:00:05 [13.55ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '221a2e42c886eb8c5d76ccd16c0715cd754eedd547c1f7b3527ad6541eb994ad32401489a74d140a';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-05-29 11:00:05 [1.45ms] */
select * from `oauth_access_tokens` where `id` = '221a2e42c886eb8c5d76ccd16c0715cd754eedd547c1f7b3527ad6541eb994ad32401489a74d140a' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-05-29 11:00:05 [0.25ms] */
select * from `oauth_access_tokens` where `id` = '221a2e42c886eb8c5d76ccd16c0715cd754eedd547c1f7b3527ad6541eb994ad32401489a74d140a' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-05-29 11:00:05 [0.22ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-05-29 11:00:05 [0.29ms] */
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-05-29 11:00:05 [0.16ms] */
select * from `oauth_access_tokens` where `id` = '221a2e42c886eb8c5d76ccd16c0715cd754eedd547c1f7b3527ad6541eb994ad32401489a74d140a' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-05-29 11:00:05 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-05-29 11:00:05 [0.26ms] */
select count(*) as aggregate from `party` where `id` = 33125;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-05-29 11:00:05 [0.26ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'BS724';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-05-29 11:00:05 [1.72ms] */
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-05-29 11:00:05 [1.49ms] */
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-05-29 11:00:05 [0.17ms] */
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-05-29 11:00:05 [0.43ms] */
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-05-29 11:00:05 [7.96ms] */
update `userprofiles` set `login_count` = 2574, `userprofiles`.`updated_at` = '2025-05-29 11:00:05' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-05-29 11:00:05 [0.21ms] */
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-05-29 11:00:05 [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-05-29 11:00:05 [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 (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-05-29 11:00:05 [0.13ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-05-29 11:00:05 [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-05-29 11:00:05 [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-05-29 11:00:05 [4.63ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-05-29 11:00:05 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-05-29 11:00:05 [3.46ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('534593f1a7180e92fdf21c339ea78a777105c6629f5e18eb4e394eb82173379e5291d25f58da0035', 154, 5, '[]', 0, '2025-05-29 11:00:05', '2025-05-29 11:00:05', '2026-05-29 11:00:05');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-05-29 11:00:05 [4.04ms] */
select * from `oauth_access_tokens` where `id` = '534593f1a7180e92fdf21c339ea78a777105c6629f5e18eb4e394eb82173379e5291d25f58da0035' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-05-29 11:00:05 [3.12ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '534593f1a7180e92fdf21c339ea78a777105c6629f5e18eb4e394eb82173379e5291d25f58da0035';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-05-29 11:00:06 [1.61ms] */
select * from `oauth_access_tokens` where `id` = '534593f1a7180e92fdf21c339ea78a777105c6629f5e18eb4e394eb82173379e5291d25f58da0035' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-05-29 11:00:06 [0.16ms] */
select * from `oauth_access_tokens` where `id` = '534593f1a7180e92fdf21c339ea78a777105c6629f5e18eb4e394eb82173379e5291d25f58da0035' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-05-29 11:00:06 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-05-29 11:00:06 [0.17ms] */
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-05-29 11:00:06 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '534593f1a7180e92fdf21c339ea78a777105c6629f5e18eb4e394eb82173379e5291d25f58da0035' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-05-29 11:00:06 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-05-29 11:00:06 [0.3ms] */
select count(*) as aggregate from `party` where `id` = 64940;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-05-29 11:00:06 [0.32ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = '5656SXYVCYHC';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-05-29 11:00:06 [1.55ms] */
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-05-29 11:00:06 [4.12ms] */
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-05-29 11:00:06 [4.37ms] */
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-05-29 11:00:06 [0.89ms] */
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-05-29 11:00:06 [5.79ms] */
update `userprofiles` set `login_count` = 2575, `last_login` = '2025-05-29 11:00:06', `userprofiles`.`updated_at` = '2025-05-29 11:00:06' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-05-29 11:00:06 [0.27ms] */
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-05-29 11:00:06 [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-05-29 11:00:06 [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 (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-05-29 11:00:06 [0.13ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-05-29 11:00:06 [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-05-29 11:00:06 [2.51ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-05-29 11:00:06 [0.79ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-05-29 11:00:06 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-05-29 11:00:06 [3.75ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('dba062ad24850e1447db7ff437d2b9994c2e803b9494f1ca9a6ed3d72314c29339c91e9d77cba405', 154, 5, '[]', 0, '2025-05-29 11:00:06', '2025-05-29 11:00:06', '2026-05-29 11:00:06');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-05-29 11:00:06 [2.1ms] */
select * from `oauth_access_tokens` where `id` = 'dba062ad24850e1447db7ff437d2b9994c2e803b9494f1ca9a6ed3d72314c29339c91e9d77cba405' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-05-29 11:00:06 [10.15ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'dba062ad24850e1447db7ff437d2b9994c2e803b9494f1ca9a6ed3d72314c29339c91e9d77cba405';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-05-29 11:00:06 [1.61ms] */
select * from `oauth_access_tokens` where `id` = 'dba062ad24850e1447db7ff437d2b9994c2e803b9494f1ca9a6ed3d72314c29339c91e9d77cba405' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-05-29 11:00:06 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'dba062ad24850e1447db7ff437d2b9994c2e803b9494f1ca9a6ed3d72314c29339c91e9d77cba405' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-05-29 11:00:06 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-05-29 11:00:06 [0.18ms] */
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-05-29 11:00:06 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'dba062ad24850e1447db7ff437d2b9994c2e803b9494f1ca9a6ed3d72314c29339c91e9d77cba405' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-05-29 11:00:06 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-05-29 11:00:06 [0.22ms] */
select count(*) as aggregate from `party` where `id` = 64946;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-05-29 11:00:06 [0.32ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LIC003';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-05-29 11:00:06 [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 `invoice`.`party_id` = 64946 and `license_plate` = 'LIC003' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-05-29 11:00:07 [5.64ms] */
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-05-29 11:00:07 [0.19ms] */
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-05-29 11:00:07 [0.39ms] */
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-05-29 11:00:07 [7.53ms] */
update `userprofiles` set `login_count` = 2576, `last_login` = '2025-05-29 11:00:07', `userprofiles`.`updated_at` = '2025-05-29 11:00:07' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-05-29 11:00:07 [0.16ms] */
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-05-29 11:00:07 [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-05-29 11:00:07 [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 (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-05-29 11:00:07 [0.13ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-05-29 11:00:07 [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-05-29 11:00:07 [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-05-29 11:00:07 [4.79ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-05-29 11:00:07 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-05-29 11:00:07 [7.3ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('2f334560d689e9c1c633ba6d04922fc76d12ad111938ed443e13d40eb5a5cbcd416a8531d2121a97', 154, 5, '[]', 0, '2025-05-29 11:00:07', '2025-05-29 11:00:07', '2026-05-29 11:00:07');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-05-29 11:00:07 [4.01ms] */
select * from `oauth_access_tokens` where `id` = '2f334560d689e9c1c633ba6d04922fc76d12ad111938ed443e13d40eb5a5cbcd416a8531d2121a97' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-05-29 11:00:07 [7ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '2f334560d689e9c1c633ba6d04922fc76d12ad111938ed443e13d40eb5a5cbcd416a8531d2121a97';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-05-29 11:00:07 [1.54ms] */
select * from `oauth_access_tokens` where `id` = '2f334560d689e9c1c633ba6d04922fc76d12ad111938ed443e13d40eb5a5cbcd416a8531d2121a97' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-05-29 11:00:07 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '2f334560d689e9c1c633ba6d04922fc76d12ad111938ed443e13d40eb5a5cbcd416a8531d2121a97' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-05-29 11:00:07 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-05-29 11:00:07 [0.19ms] */
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-05-29 11:00:07 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '2f334560d689e9c1c633ba6d04922fc76d12ad111938ed443e13d40eb5a5cbcd416a8531d2121a97' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-05-29 11:00:07 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-05-29 11:00:07 [0.14ms] */
select count(*) as aggregate from `party` where `id` = 64946;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-05-29 11:00:07 [0.33ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LIC002';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-05-29 11:00:07 [0.89ms] */
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` = 64946 and `license_plate` = 'LIC002' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-05-29 11:00:08 [1.41ms] */
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-05-29 11:00:08 [17.35ms] */
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-05-29 11:00:08 [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-05-29 11:00:08 [9.58ms] */
update `userprofiles` set `login_count` = 2577, `last_login` = '2025-05-29 11:00:08', `userprofiles`.`updated_at` = '2025-05-29 11:00:08' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-05-29 11:00:08 [0.21ms] */
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-05-29 11:00:08 [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-05-29 11:00:08 [4.14ms] */
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-05-29 11:00:08 [4.1ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-05-29 11:00:08 [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-05-29 11:00: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-05-29 11:00:08 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-05-29 11:00:08 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-05-29 11:00:08 [17.18ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('f7975639cc9feb3cc77bf8147615443bba7b0c9a401ef38862500356377c8714b0fa07c4856af7e9', 154, 5, '[]', 0, '2025-05-29 11:00:08', '2025-05-29 11:00:08', '2026-05-29 11:00:08');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-05-29 11:00:08 [2.34ms] */
select * from `oauth_access_tokens` where `id` = 'f7975639cc9feb3cc77bf8147615443bba7b0c9a401ef38862500356377c8714b0fa07c4856af7e9' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-05-29 11:00:08 [2.99ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'f7975639cc9feb3cc77bf8147615443bba7b0c9a401ef38862500356377c8714b0fa07c4856af7e9';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-05-29 11:00:09 [1.51ms] */
select * from `oauth_access_tokens` where `id` = 'f7975639cc9feb3cc77bf8147615443bba7b0c9a401ef38862500356377c8714b0fa07c4856af7e9' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-05-29 11:00:09 [0.21ms] */
select * from `oauth_access_tokens` where `id` = 'f7975639cc9feb3cc77bf8147615443bba7b0c9a401ef38862500356377c8714b0fa07c4856af7e9' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-05-29 11:00:09 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-05-29 11:00:09 [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-05-29 11:00:09 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'f7975639cc9feb3cc77bf8147615443bba7b0c9a401ef38862500356377c8714b0fa07c4856af7e9' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-05-29 11:00:09 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-05-29 11:00:09 [0.27ms] */
select count(*) as aggregate from `party` where `id` = 639;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-05-29 11:00:09 [0.24ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'RTA009';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-05-29 11:00:09 [1.94ms] */
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` = 639 and `license_plate` = 'RTA009' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-05-29 11:00:10 [1.43ms] */
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-05-29 11:00:10 [0.21ms] */
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-05-29 11:00:10 [0.41ms] */
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-05-29 11:00:10 [5.95ms] */
update `userprofiles` set `login_count` = 2578, `last_login` = '2025-05-29 11:00:10', `userprofiles`.`updated_at` = '2025-05-29 11:00:10' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-05-29 11:00:10 [0.19ms] */
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-05-29 11:00:10 [0.4ms] */
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-05-29 11:00:10 [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 (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-05-29 11:00:10 [6ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-05-29 11:00:10 [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-05-29 11:00:10 [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-05-29 11:00:10 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-05-29 11:00:10 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-05-29 11:00:10 [3.1ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('b20c7ddbe5527abf1d6ec52ed3591942698c64737ed474d7cba1278d2405fbbd6d03cd9e335be3d2', 154, 5, '[]', 0, '2025-05-29 11:00:10', '2025-05-29 11:00:10', '2026-05-29 11:00:10');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-05-29 11:00:10 [2.53ms] */
select * from `oauth_access_tokens` where `id` = 'b20c7ddbe5527abf1d6ec52ed3591942698c64737ed474d7cba1278d2405fbbd6d03cd9e335be3d2' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-05-29 11:00:10 [3.1ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'b20c7ddbe5527abf1d6ec52ed3591942698c64737ed474d7cba1278d2405fbbd6d03cd9e335be3d2';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-05-29 11:00:10 [1.59ms] */
select * from `oauth_access_tokens` where `id` = 'b20c7ddbe5527abf1d6ec52ed3591942698c64737ed474d7cba1278d2405fbbd6d03cd9e335be3d2' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-05-29 11:00:10 [0.16ms] */
select * from `oauth_access_tokens` where `id` = 'b20c7ddbe5527abf1d6ec52ed3591942698c64737ed474d7cba1278d2405fbbd6d03cd9e335be3d2' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-05-29 11:00:10 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-05-29 11:00:10 [0.17ms] */
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-05-29 11:00:10 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'b20c7ddbe5527abf1d6ec52ed3591942698c64737ed474d7cba1278d2405fbbd6d03cd9e335be3d2' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-05-29 11:00:10 [0.17ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-05-29 11:00:10 [0.14ms] */
select count(*) as aggregate from `party` where `id` = 64946;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-05-29 11:00:10 [0.28ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LIC005';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-05-29 11:00:10 [6.24ms] */
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-05-29 11:00:10 [4.18ms] */
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-05-29 11:00:10 [0.49ms] */
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-05-29 11:00:10 [5.81ms] */
update `userprofiles` set `login_count` = 2579, `userprofiles`.`updated_at` = '2025-05-29 11:00:10' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-05-29 11:00:10 [0.16ms] */
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-05-29 11:00:10 [0.4ms] */
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-05-29 11:00:10 [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 (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-05-29 11:00:10 [0.13ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-05-29 11:00:10 [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-05-29 11:00:10 [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-05-29 11:00:10 [2.69ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-05-29 11:00:10 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-05-29 11:00:10 [32.67ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('5667a2d393134542f7124da9dbbe12cfe0bec25cafa7fbc00008e4a68d9759556b46fb922d84c47c', 154, 5, '[]', 0, '2025-05-29 11:00:10', '2025-05-29 11:00:10', '2026-05-29 11:00:10');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-05-29 11:00:10 [3.6ms] */
select * from `oauth_access_tokens` where `id` = '5667a2d393134542f7124da9dbbe12cfe0bec25cafa7fbc00008e4a68d9759556b46fb922d84c47c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-05-29 11:00:10 [5.68ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '5667a2d393134542f7124da9dbbe12cfe0bec25cafa7fbc00008e4a68d9759556b46fb922d84c47c';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-05-29 11:00:10 [6.91ms] */
select * from `oauth_access_tokens` where `id` = '5667a2d393134542f7124da9dbbe12cfe0bec25cafa7fbc00008e4a68d9759556b46fb922d84c47c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-05-29 11:00:10 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '5667a2d393134542f7124da9dbbe12cfe0bec25cafa7fbc00008e4a68d9759556b46fb922d84c47c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-05-29 11:00:10 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-05-29 11:00:10 [0.17ms] */
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-05-29 11:00:10 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '5667a2d393134542f7124da9dbbe12cfe0bec25cafa7fbc00008e4a68d9759556b46fb922d84c47c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-05-29 11:00:10 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-05-29 11:00:10 [0.28ms] */
select count(*) as aggregate from `party` where `id` = 36578;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-05-29 11:00:10 [0.25ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'AA584';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-05-29 11:00:10 [1.24ms] */
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` = 36578 and `license_plate` = 'AA584' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-05-29 11:00:11 [6.6ms] */
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-05-29 11:00:11 [4.44ms] */
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-05-29 11:00:11 [2.11ms] */
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-05-29 11:00:11 [2.63ms] */
update `userprofiles` set `login_count` = 2580, `last_login` = '2025-05-29 11:00:11', `userprofiles`.`updated_at` = '2025-05-29 11:00:11' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-05-29 11:00:11 [0.15ms] */
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-05-29 11:00:11 [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-05-29 11:00:11 [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 (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-05-29 11:00:11 [0.12ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-05-29 11:00:11 [0.1ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-05-29 11:00: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-05-29 11:00:11 [2.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-05-29 11:00:11 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-05-29 11:00:11 [2.7ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('82139844375241eb23b88009955716d5a3db220020868e15ce2adeedc6e5075c7c342662cb2676db', 154, 5, '[]', 0, '2025-05-29 11:00:11', '2025-05-29 11:00:11', '2026-05-29 11:00:11');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-05-29 11:00:11 [3.11ms] */
select * from `oauth_access_tokens` where `id` = '82139844375241eb23b88009955716d5a3db220020868e15ce2adeedc6e5075c7c342662cb2676db' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-05-29 11:00:11 [2.65ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '82139844375241eb23b88009955716d5a3db220020868e15ce2adeedc6e5075c7c342662cb2676db';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-05-29 11:00:12 [1.47ms] */
select * from `oauth_access_tokens` where `id` = '82139844375241eb23b88009955716d5a3db220020868e15ce2adeedc6e5075c7c342662cb2676db' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-05-29 11:00:12 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '82139844375241eb23b88009955716d5a3db220020868e15ce2adeedc6e5075c7c342662cb2676db' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-05-29 11:00:12 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-05-29 11:00:12 [0.17ms] */
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-05-29 11:00:12 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '82139844375241eb23b88009955716d5a3db220020868e15ce2adeedc6e5075c7c342662cb2676db' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-05-29 11:00:12 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-05-29 11:00:12 [0.14ms] */
select count(*) as aggregate from `party` where `id` = 64946;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-05-29 11:00:12 [0.24ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LIC1253RTA001';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-05-29 11:00:12 [0.89ms] */
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` = 64946 and `license_plate` = 'LIC1253RTA001' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-05-29 11:00:12 [1.32ms] */
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-05-29 11:00:12 [0.19ms] */
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-05-29 11:00:12 [0.36ms] */
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-05-29 11:00:12 [9.82ms] */
update `userprofiles` set `login_count` = 2581, `last_login` = '2025-05-29 11:00:12', `userprofiles`.`updated_at` = '2025-05-29 11:00:12' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-05-29 11:00:12 [5.53ms] */
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-05-29 11:00: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-05-29 11:00:12 [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 (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-05-29 11:00:12 [0.13ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-05-29 11:00:12 [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-05-29 11:00:12 [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-05-29 11:00:12 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-05-29 11:00:12 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-05-29 11:00:12 [3.4ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('c072e287e94bf97a10df92dad2a7d5fa4c52ed10660056ac413d833eebec744d461485444a4d0bfa', 154, 5, '[]', 0, '2025-05-29 11:00:12', '2025-05-29 11:00:12', '2026-05-29 11:00:12');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-05-29 11:00:12 [3.59ms] */
select * from `oauth_access_tokens` where `id` = 'c072e287e94bf97a10df92dad2a7d5fa4c52ed10660056ac413d833eebec744d461485444a4d0bfa' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-05-29 11:00:12 [2.74ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'c072e287e94bf97a10df92dad2a7d5fa4c52ed10660056ac413d833eebec744d461485444a4d0bfa';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-05-29 11:00:12 [1.39ms] */
select * from `oauth_access_tokens` where `id` = 'c072e287e94bf97a10df92dad2a7d5fa4c52ed10660056ac413d833eebec744d461485444a4d0bfa' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-05-29 11:00:12 [0.15ms] */
select * from `oauth_access_tokens` where `id` = 'c072e287e94bf97a10df92dad2a7d5fa4c52ed10660056ac413d833eebec744d461485444a4d0bfa' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-05-29 11:00:12 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-05-29 11:00:12 [0.17ms] */
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-05-29 11:00:12 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'c072e287e94bf97a10df92dad2a7d5fa4c52ed10660056ac413d833eebec744d461485444a4d0bfa' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-05-29 11:00:12 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-05-29 11:00:12 [0.26ms] */
select count(*) as aggregate from `party` where `id` = 54700;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-05-29 11:00:12 [0.24ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'YP073';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-05-29 11:00:12 [1.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 `invoice`.`party_id` = 54700 and `license_plate` = 'YP073' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-05-29 11:00:13 [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-05-29 11:00:13 [0.16ms] */
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-05-29 11:00:13 [0.33ms] */
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-05-29 11:00:13 [6.28ms] */
update `userprofiles` set `login_count` = 2582, `last_login` = '2025-05-29 11:00:13', `userprofiles`.`updated_at` = '2025-05-29 11:00:13' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-05-29 11:00:13 [0.19ms] */
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-05-29 11:00:13 [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-05-29 11:00:13 [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 (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-05-29 11:00:13 [0.13ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-05-29 11:00:13 [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-05-29 11:00:13 [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-05-29 11:00:13 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-05-29 11:00:13 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-05-29 11:00:13 [3.91ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('7f45fd0166fef0af236e92dab7c927da18267f9254e5ded7275219ceb00a3281facf064f1885005b', 154, 5, '[]', 0, '2025-05-29 11:00:13', '2025-05-29 11:00:13', '2026-05-29 11:00:13');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-05-29 11:00:13 [5.17ms] */
select * from `oauth_access_tokens` where `id` = '7f45fd0166fef0af236e92dab7c927da18267f9254e5ded7275219ceb00a3281facf064f1885005b' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-05-29 11:00:13 [3.06ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '7f45fd0166fef0af236e92dab7c927da18267f9254e5ded7275219ceb00a3281facf064f1885005b';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-05-29 11:00:13 [6.56ms] */
select * from `oauth_access_tokens` where `id` = '7f45fd0166fef0af236e92dab7c927da18267f9254e5ded7275219ceb00a3281facf064f1885005b' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-05-29 11:00:13 [0.13ms] */
select * from `oauth_access_tokens` where `id` = '7f45fd0166fef0af236e92dab7c927da18267f9254e5ded7275219ceb00a3281facf064f1885005b' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-05-29 11:00:13 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-05-29 11:00:13 [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-05-29 11:00:13 [0.13ms] */
select * from `oauth_access_tokens` where `id` = '7f45fd0166fef0af236e92dab7c927da18267f9254e5ded7275219ceb00a3281facf064f1885005b' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-05-29 11:00:13 [0.12ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-05-29 11:00:13 [0.22ms] */
select count(*) as aggregate from `party` where `id` = 99460;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-05-29 11:00:13 [6.6ms] */
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-05-29 11:00:14 [20.74ms] */
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-05-29 11:00:14 [7.15ms] */
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-05-29 11:00:14 [3.41ms] */
update `userprofiles` set `login_count` = 2583, `last_login` = '2025-05-29 11:00:14', `userprofiles`.`updated_at` = '2025-05-29 11:00:14' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-05-29 11:00:14 [0.36ms] */
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-05-29 11:00:14 [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-05-29 11:00:14 [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 (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-05-29 11:00:14 [11.3ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-05-29 11:00:14 [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-05-29 11:00:14 [0.12ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-05-29 11:00:14 [0.11ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-05-29 11:00:14 [0.11ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-05-29 11:00:14 [2.84ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('868637f88b39b780ce9c03ff2b68f04354541d7f935616053d3bab6cad99443a37b0646926ce25a9', 154, 5, '[]', 0, '2025-05-29 11:00:14', '2025-05-29 11:00:14', '2026-05-29 11:00:14');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-05-29 11:00:14 [10.36ms] */
select * from `oauth_access_tokens` where `id` = '868637f88b39b780ce9c03ff2b68f04354541d7f935616053d3bab6cad99443a37b0646926ce25a9' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-05-29 11:00:14 [2.65ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '868637f88b39b780ce9c03ff2b68f04354541d7f935616053d3bab6cad99443a37b0646926ce25a9';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-05-29 11:00:14 [1.51ms] */
select * from `oauth_access_tokens` where `id` = '868637f88b39b780ce9c03ff2b68f04354541d7f935616053d3bab6cad99443a37b0646926ce25a9' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-05-29 11:00:14 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '868637f88b39b780ce9c03ff2b68f04354541d7f935616053d3bab6cad99443a37b0646926ce25a9' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-05-29 11:00:14 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-05-29 11:00:14 [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-05-29 11:00:14 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '868637f88b39b780ce9c03ff2b68f04354541d7f935616053d3bab6cad99443a37b0646926ce25a9' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-05-29 11:00:14 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-05-29 11:00:14 [0.23ms] */
select count(*) as aggregate from `party` where `id` = 59307;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-05-29 11:00:14 [0.23ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'IF124';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-05-29 11:00:14 [1.24ms] */
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` = 59307 and `license_plate` = 'IF124' and `invoice`.`deleted_at` is null;
/*==================================================*/
