/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-06-28 11:00:04 [2.46ms] */
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-06-28 11:00:04 [0.28ms] */
select * from `users` where `id` = 154 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 3 - 2025-06-28 11:00:04 [1.03ms] */
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-06-28 11:00:04 [6.56ms] */
update `userprofiles` set `login_count` = 2911, `last_login` = '2025-06-28 11:00:04', `userprofiles`.`updated_at` = '2025-06-28 11:00:04' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-28 11:00:04 [0.42ms] */
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-06-28 11:00:04 [0.62ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-06-28 11:00:04 [0.52ms] */
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-06-28 11:00:04 [0.27ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-06-28 11:00:04 [0.17ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-06-28 11:00:04 [0.26ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-06-28 11:00:04 [0.25ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-28 11:00:04 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-28 11:00:04 [3.55ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('b75d4d679ac7540c0bac8b37cc7f919d27a970a5dab18ccfe667052dca886ce4101db115036cedbb', 154, 5, '[]', 0, '2025-06-28 11:00:04', '2025-06-28 11:00:04', '2026-06-28 11:00:04');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-28 11:00:04 [0.27ms] */
select * from `oauth_access_tokens` where `id` = 'b75d4d679ac7540c0bac8b37cc7f919d27a970a5dab18ccfe667052dca886ce4101db115036cedbb' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-28 11:00:04 [2.8ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'b75d4d679ac7540c0bac8b37cc7f919d27a970a5dab18ccfe667052dca886ce4101db115036cedbb';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-28 11:00:04 [2.16ms] */
select * from `oauth_access_tokens` where `id` = 'b75d4d679ac7540c0bac8b37cc7f919d27a970a5dab18ccfe667052dca886ce4101db115036cedbb' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-28 11:00:04 [0.29ms] */
select * from `oauth_access_tokens` where `id` = 'b75d4d679ac7540c0bac8b37cc7f919d27a970a5dab18ccfe667052dca886ce4101db115036cedbb' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-28 11:00:04 [0.33ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-28 11:00:04 [0.46ms] */
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-06-28 11:00:04 [0.26ms] */
select * from `oauth_access_tokens` where `id` = 'b75d4d679ac7540c0bac8b37cc7f919d27a970a5dab18ccfe667052dca886ce4101db115036cedbb' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-28 11:00:04 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-28 11:00:04 [0.28ms] */
select count(*) as aggregate from `party` where `id` = 33125;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-28 11:00:04 [0.26ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'BS724';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-28 11:00:04 [1.63ms] */
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-06-28 11:00:04 [2.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-06-28 11:00:04 [0.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-06-28 11:00:04 [0.38ms] */
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-06-28 11:00:04 [6.54ms] */
update `userprofiles` set `login_count` = 2912, `userprofiles`.`updated_at` = '2025-06-28 11:00:04' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-28 11:00:04 [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-06-28 11:00:04 [0.39ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-06-28 11:00:04 [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-06-28 11:00:04 [0.21ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-06-28 11:00:04 [0.2ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-06-28 11:00:04 [0.23ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-06-28 11:00:04 [0.23ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-28 11:00:04 [0.22ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-28 11:00:04 [3.17ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('f2eef93305888b54201d4117b0db943dc8c3a04f7e43b3143e2e079ace3e1625554948fd74e7a2ea', 154, 5, '[]', 0, '2025-06-28 11:00:04', '2025-06-28 11:00:04', '2026-06-28 11:00:04');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-28 11:00:04 [0.39ms] */
select * from `oauth_access_tokens` where `id` = 'f2eef93305888b54201d4117b0db943dc8c3a04f7e43b3143e2e079ace3e1625554948fd74e7a2ea' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-28 11:00:04 [2.84ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'f2eef93305888b54201d4117b0db943dc8c3a04f7e43b3143e2e079ace3e1625554948fd74e7a2ea';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-28 11:00:04 [2.12ms] */
select * from `oauth_access_tokens` where `id` = 'f2eef93305888b54201d4117b0db943dc8c3a04f7e43b3143e2e079ace3e1625554948fd74e7a2ea' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-28 11:00:04 [0.27ms] */
select * from `oauth_access_tokens` where `id` = 'f2eef93305888b54201d4117b0db943dc8c3a04f7e43b3143e2e079ace3e1625554948fd74e7a2ea' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-28 11:00:04 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-28 11:00:04 [0.26ms] */
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-06-28 11:00:04 [0.22ms] */
select * from `oauth_access_tokens` where `id` = 'f2eef93305888b54201d4117b0db943dc8c3a04f7e43b3143e2e079ace3e1625554948fd74e7a2ea' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-28 11:00:04 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-28 11:00:04 [0.46ms] */
select count(*) as aggregate from `party` where `id` = 64940;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-28 11:00:04 [0.37ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = '5656SXYVCYHC';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-28 11:00:04 [1.43ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `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-06-28 11:00:05 [2.1ms] */
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-06-28 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-06-28 11:00:05 [0.46ms] */
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-06-28 11:00:05 [7.69ms] */
update `userprofiles` set `login_count` = 2913, `last_login` = '2025-06-28 11:00:05', `userprofiles`.`updated_at` = '2025-06-28 11:00:05' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-28 11:00:05 [0.35ms] */
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-06-28 11:00:05 [0.59ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-06-28 11:00:05 [0.26ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-06-28 11:00:05 [0.2ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-06-28 11:00:05 [0.17ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-06-28 11:00:05 [0.21ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-06-28 11:00:05 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-28 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-06-28 11:00:05 [3.25ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('6929ef4bf6382f839b0dc0db8ce00b49904ea69ccd42d3c5e68d138a3dc9fae9ddaa5d7e300a03f8', 154, 5, '[]', 0, '2025-06-28 11:00:05', '2025-06-28 11:00:05', '2026-06-28 11:00:05');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-28 11:00:05 [0.4ms] */
select * from `oauth_access_tokens` where `id` = '6929ef4bf6382f839b0dc0db8ce00b49904ea69ccd42d3c5e68d138a3dc9fae9ddaa5d7e300a03f8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-28 11:00:05 [2.98ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '6929ef4bf6382f839b0dc0db8ce00b49904ea69ccd42d3c5e68d138a3dc9fae9ddaa5d7e300a03f8';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-28 11:00:05 [2.3ms] */
select * from `oauth_access_tokens` where `id` = '6929ef4bf6382f839b0dc0db8ce00b49904ea69ccd42d3c5e68d138a3dc9fae9ddaa5d7e300a03f8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-28 11:00:05 [0.26ms] */
select * from `oauth_access_tokens` where `id` = '6929ef4bf6382f839b0dc0db8ce00b49904ea69ccd42d3c5e68d138a3dc9fae9ddaa5d7e300a03f8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-28 11:00:05 [0.26ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-28 11:00:05 [0.23ms] */
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-06-28 11:00:05 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '6929ef4bf6382f839b0dc0db8ce00b49904ea69ccd42d3c5e68d138a3dc9fae9ddaa5d7e300a03f8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-28 11:00:05 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-28 11:00:05 [0.23ms] */
select count(*) as aggregate from `party` where `id` = 64946;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-28 11:00:05 [0.24ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LIC003';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-28 11:00:05 [0.81ms] */
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-06-28 11:00:06 [2ms] */
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-06-28 11:00:06 [0.3ms] */
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-06-28 11:00:06 [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-06-28 11:00:06 [2.99ms] */
update `userprofiles` set `login_count` = 2914, `last_login` = '2025-06-28 11:00:06', `userprofiles`.`updated_at` = '2025-06-28 11:00:06' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-28 11:00:06 [0.17ms] */
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-06-28 11:00:06 [0.42ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-06-28 11:00:06 [0.19ms] */
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-06-28 11:00:06 [0.16ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-06-28 11:00:06 [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-06-28 11:00:06 [0.15ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-06-28 11:00:06 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-28 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-06-28 11:00:06 [3.09ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('6f312a06c392a7f91f813231e858ee865ba6c32eb776ecbf4b72ab06e6a13ddb184e5b14f42c5211', 154, 5, '[]', 0, '2025-06-28 11:00:06', '2025-06-28 11:00:06', '2026-06-28 11:00:06');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-28 11:00:06 [0.52ms] */
select * from `oauth_access_tokens` where `id` = '6f312a06c392a7f91f813231e858ee865ba6c32eb776ecbf4b72ab06e6a13ddb184e5b14f42c5211' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-28 11:00:06 [3ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '6f312a06c392a7f91f813231e858ee865ba6c32eb776ecbf4b72ab06e6a13ddb184e5b14f42c5211';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-28 11:00:06 [1.46ms] */
select * from `oauth_access_tokens` where `id` = '6f312a06c392a7f91f813231e858ee865ba6c32eb776ecbf4b72ab06e6a13ddb184e5b14f42c5211' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-28 11:00:06 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '6f312a06c392a7f91f813231e858ee865ba6c32eb776ecbf4b72ab06e6a13ddb184e5b14f42c5211' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-28 11:00:06 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-28 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-06-28 11:00:06 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '6f312a06c392a7f91f813231e858ee865ba6c32eb776ecbf4b72ab06e6a13ddb184e5b14f42c5211' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-28 11:00:06 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-28 11:00:06 [0.13ms] */
select count(*) as aggregate from `party` where `id` = 64946;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-28 11:00:06 [0.23ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LIC002';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-28 11:00:06 [0.87ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `invoice`.`party_id` = 64946 and `license_plate` = 'LIC002' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-06-28 11:00:07 [1.44ms] */
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-06-28 11:00:07 [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-06-28 11:00:07 [0.48ms] */
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-06-28 11:00:07 [8.45ms] */
update `userprofiles` set `login_count` = 2915, `last_login` = '2025-06-28 11:00:07', `userprofiles`.`updated_at` = '2025-06-28 11:00:07' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-28 11:00:07 [0.31ms] */
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-06-28 11:00:07 [0.7ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-06-28 11:00:07 [0.17ms] */
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-06-28 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-06-28 11:00:07 [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-06-28 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-06-28 11:00:07 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-28 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-06-28 11:00:07 [3.04ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('9f3b3bd5944581a8c1850c6505fc8dbad17bddf0a98463b73674b6f4589e90ae084f128603d4df65', 154, 5, '[]', 0, '2025-06-28 11:00:07', '2025-06-28 11:00:07', '2026-06-28 11:00:07');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-28 11:00:07 [0.25ms] */
select * from `oauth_access_tokens` where `id` = '9f3b3bd5944581a8c1850c6505fc8dbad17bddf0a98463b73674b6f4589e90ae084f128603d4df65' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-28 11:00:07 [2.91ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '9f3b3bd5944581a8c1850c6505fc8dbad17bddf0a98463b73674b6f4589e90ae084f128603d4df65';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-28 11:00:07 [2.35ms] */
select * from `oauth_access_tokens` where `id` = '9f3b3bd5944581a8c1850c6505fc8dbad17bddf0a98463b73674b6f4589e90ae084f128603d4df65' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-28 11:00:07 [0.27ms] */
select * from `oauth_access_tokens` where `id` = '9f3b3bd5944581a8c1850c6505fc8dbad17bddf0a98463b73674b6f4589e90ae084f128603d4df65' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-28 11:00:07 [0.25ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-28 11:00:07 [0.32ms] */
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-06-28 11:00:07 [0.18ms] */
select * from `oauth_access_tokens` where `id` = '9f3b3bd5944581a8c1850c6505fc8dbad17bddf0a98463b73674b6f4589e90ae084f128603d4df65' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-28 11:00:07 [0.19ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-28 11:00:07 [0.31ms] */
select count(*) as aggregate from `party` where `id` = 639;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-28 11:00:07 [0.28ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'RTA009';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-28 11:00:07 [1.01ms] */
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-06-28 11:00:08 [2.1ms] */
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-06-28 11:00:08 [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-06-28 11:00:08 [0.38ms] */
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-06-28 11:00:08 [11.01ms] */
update `userprofiles` set `login_count` = 2916, `last_login` = '2025-06-28 11:00:08', `userprofiles`.`updated_at` = '2025-06-28 11:00:08' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-28 11:00:08 [0.5ms] */
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-06-28 11:00:08 [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-06-28 11:00:08 [0.2ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-06-28 11:00:08 [0.13ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-06-28 11:00:08 [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-06-28 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-06-28 11:00:08 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-28 11:00:08 [0.3ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-28 11:00:08 [3.5ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('417583fa7ce6fe2821dd807e33b855c0dffc16781d16b5d146cf028f2f02682ed10061a3d6267846', 154, 5, '[]', 0, '2025-06-28 11:00:08', '2025-06-28 11:00:08', '2026-06-28 11:00:08');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-28 11:00:08 [0.26ms] */
select * from `oauth_access_tokens` where `id` = '417583fa7ce6fe2821dd807e33b855c0dffc16781d16b5d146cf028f2f02682ed10061a3d6267846' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-28 11:00:08 [3.03ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '417583fa7ce6fe2821dd807e33b855c0dffc16781d16b5d146cf028f2f02682ed10061a3d6267846';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-28 11:00:08 [1.53ms] */
select * from `oauth_access_tokens` where `id` = '417583fa7ce6fe2821dd807e33b855c0dffc16781d16b5d146cf028f2f02682ed10061a3d6267846' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-28 11:00:08 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '417583fa7ce6fe2821dd807e33b855c0dffc16781d16b5d146cf028f2f02682ed10061a3d6267846' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-28 11:00:08 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-28 11:00:08 [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-06-28 11:00:08 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '417583fa7ce6fe2821dd807e33b855c0dffc16781d16b5d146cf028f2f02682ed10061a3d6267846' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-28 11:00:08 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-28 11:00:08 [0.14ms] */
select count(*) as aggregate from `party` where `id` = 64946;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-28 11:00:08 [0.25ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LIC005';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-06-28 11:00:08 [1.47ms] */
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-06-28 11:00:08 [0.2ms] */
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-06-28 11:00:08 [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-06-28 11:00:08 [3.05ms] */
update `userprofiles` set `login_count` = 2917, `userprofiles`.`updated_at` = '2025-06-28 11:00:08' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-28 11:00:08 [0.22ms] */
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-06-28 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-06-28 11:00:08 [0.17ms] */
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-06-28 11:00:08 [0.14ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-06-28 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-06-28 11:00:08 [0.15ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-06-28 11:00:08 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-28 11:00:08 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-28 11:00:08 [3.35ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('4b4b3153916411567f871979c351497298bb3b9dfe422fe8b83efd82fc1c1f1dff6f78b334d9e617', 154, 5, '[]', 0, '2025-06-28 11:00:08', '2025-06-28 11:00:08', '2026-06-28 11:00:08');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-28 11:00:08 [0.42ms] */
select * from `oauth_access_tokens` where `id` = '4b4b3153916411567f871979c351497298bb3b9dfe422fe8b83efd82fc1c1f1dff6f78b334d9e617' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-28 11:00:08 [3.18ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '4b4b3153916411567f871979c351497298bb3b9dfe422fe8b83efd82fc1c1f1dff6f78b334d9e617';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-28 11:00:08 [1.8ms] */
select * from `oauth_access_tokens` where `id` = '4b4b3153916411567f871979c351497298bb3b9dfe422fe8b83efd82fc1c1f1dff6f78b334d9e617' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-28 11:00:08 [0.27ms] */
select * from `oauth_access_tokens` where `id` = '4b4b3153916411567f871979c351497298bb3b9dfe422fe8b83efd82fc1c1f1dff6f78b334d9e617' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-28 11:00:08 [0.24ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-28 11:00:08 [0.3ms] */
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-06-28 11:00:08 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '4b4b3153916411567f871979c351497298bb3b9dfe422fe8b83efd82fc1c1f1dff6f78b334d9e617' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-28 11:00:08 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-28 11:00:08 [0.24ms] */
select count(*) as aggregate from `party` where `id` = 36578;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-28 11:00:08 [0.23ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'AA584';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-28 11:00:08 [0.99ms] */
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-06-28 11:00:09 [1.37ms] */
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-06-28 11:00:09 [0.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-06-28 11:00:09 [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-06-28 11:00:09 [6ms] */
update `userprofiles` set `login_count` = 2918, `last_login` = '2025-06-28 11:00:09', `userprofiles`.`updated_at` = '2025-06-28 11:00:09' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-28 11:00:09 [0.17ms] */
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-06-28 11:00:09 [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-06-28 11:00:09 [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-06-28 11:00:09 [0.21ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-06-28 11:00:09 [0.26ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-06-28 11:00:09 [0.23ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-06-28 11:00:09 [0.23ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-28 11:00:09 [0.23ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-28 11:00:09 [3.27ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('20867b7ee265a36d914c0c1ceb3d84eb7a94fea5b31d76cc3c53ebefd96848ff6241e676c60ffb91', 154, 5, '[]', 0, '2025-06-28 11:00:09', '2025-06-28 11:00:09', '2026-06-28 11:00:09');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-28 11:00:09 [0.29ms] */
select * from `oauth_access_tokens` where `id` = '20867b7ee265a36d914c0c1ceb3d84eb7a94fea5b31d76cc3c53ebefd96848ff6241e676c60ffb91' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-28 11:00:09 [3.02ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '20867b7ee265a36d914c0c1ceb3d84eb7a94fea5b31d76cc3c53ebefd96848ff6241e676c60ffb91';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-28 11:00:09 [1.55ms] */
select * from `oauth_access_tokens` where `id` = '20867b7ee265a36d914c0c1ceb3d84eb7a94fea5b31d76cc3c53ebefd96848ff6241e676c60ffb91' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-28 11:00:09 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '20867b7ee265a36d914c0c1ceb3d84eb7a94fea5b31d76cc3c53ebefd96848ff6241e676c60ffb91' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-28 11:00:09 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-28 11:00:09 [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-06-28 11:00:09 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '20867b7ee265a36d914c0c1ceb3d84eb7a94fea5b31d76cc3c53ebefd96848ff6241e676c60ffb91' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-28 11:00:09 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-28 11:00:09 [0.14ms] */
select count(*) as aggregate from `party` where `id` = 64946;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-28 11:00:09 [0.26ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LIC1253RTA001';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-28 11:00:09 [0.76ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `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-06-28 11:00:09 [1.89ms] */
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-06-28 11:00:09 [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-06-28 11:00:09 [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-06-28 11:00:09 [5.77ms] */
update `userprofiles` set `login_count` = 2919, `userprofiles`.`updated_at` = '2025-06-28 11:00:09' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-28 11:00:09 [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-06-28 11:00:09 [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-06-28 11:00:09 [0.17ms] */
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-06-28 11:00:09 [0.13ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-06-28 11:00:09 [0.12ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-06-28 11:00:09 [0.16ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-06-28 11:00:09 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-28 11:00:09 [0.2ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-28 11:00:09 [3.23ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('b0cb9b2d2321e6293d667d87567f5da8ea173bae340894e5837d6b709fcb2e59d98bc261c823c323', 154, 5, '[]', 0, '2025-06-28 11:00:09', '2025-06-28 11:00:09', '2026-06-28 11:00:09');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-28 11:00:09 [0.44ms] */
select * from `oauth_access_tokens` where `id` = 'b0cb9b2d2321e6293d667d87567f5da8ea173bae340894e5837d6b709fcb2e59d98bc261c823c323' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-28 11:00:09 [3.3ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'b0cb9b2d2321e6293d667d87567f5da8ea173bae340894e5837d6b709fcb2e59d98bc261c823c323';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-28 11:00:10 [1.68ms] */
select * from `oauth_access_tokens` where `id` = 'b0cb9b2d2321e6293d667d87567f5da8ea173bae340894e5837d6b709fcb2e59d98bc261c823c323' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-28 11:00:10 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'b0cb9b2d2321e6293d667d87567f5da8ea173bae340894e5837d6b709fcb2e59d98bc261c823c323' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-28 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-06-28 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-06-28 11:00:10 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'b0cb9b2d2321e6293d667d87567f5da8ea173bae340894e5837d6b709fcb2e59d98bc261c823c323' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-28 11:00:10 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-28 11:00:10 [0.36ms] */
select count(*) as aggregate from `party` where `id` = 54700;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-28 11:00:10 [0.39ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'YP073';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-28 11:00:10 [1.43ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `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-06-28 11:00:10 [1.4ms] */
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-06-28 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/login
   Query 3 - 2025-06-28 11:00:10 [0.37ms] */
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-06-28 11:00:10 [5.72ms] */
update `userprofiles` set `login_count` = 2920, `last_login` = '2025-06-28 11:00:10', `userprofiles`.`updated_at` = '2025-06-28 11:00:10' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-28 11:00:10 [0.25ms] */
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-06-28 11:00:10 [0.55ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-06-28 11:00:10 [0.27ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-06-28 11:00:10 [0.15ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-06-28 11:00:10 [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-06-28 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-06-28 11:00:10 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-28 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-06-28 11:00:10 [2.99ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('9accd40e0bddc7d8c667b6d59197155ff369bd405f84a7241a1f8df4d6c815d5867438d2c5da9e22', 154, 5, '[]', 0, '2025-06-28 11:00:10', '2025-06-28 11:00:10', '2026-06-28 11:00:10');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-28 11:00:10 [0.47ms] */
select * from `oauth_access_tokens` where `id` = '9accd40e0bddc7d8c667b6d59197155ff369bd405f84a7241a1f8df4d6c815d5867438d2c5da9e22' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-28 11:00:10 [2.84ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '9accd40e0bddc7d8c667b6d59197155ff369bd405f84a7241a1f8df4d6c815d5867438d2c5da9e22';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-28 11:00:10 [1.41ms] */
select * from `oauth_access_tokens` where `id` = '9accd40e0bddc7d8c667b6d59197155ff369bd405f84a7241a1f8df4d6c815d5867438d2c5da9e22' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-28 11:00:10 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '9accd40e0bddc7d8c667b6d59197155ff369bd405f84a7241a1f8df4d6c815d5867438d2c5da9e22' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-28 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-06-28 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-06-28 11:00:10 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '9accd40e0bddc7d8c667b6d59197155ff369bd405f84a7241a1f8df4d6c815d5867438d2c5da9e22' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-28 11:00:10 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-28 11:00:10 [0.24ms] */
select count(*) as aggregate from `party` where `id` = 99460;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-06-28 11:00:10 [2.21ms] */
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-06-28 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/login
   Query 3 - 2025-06-28 11:00:10 [0.45ms] */
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-06-28 11:00:10 [5.94ms] */
update `userprofiles` set `login_count` = 2921, `userprofiles`.`updated_at` = '2025-06-28 11:00:10' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-28 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-06-28 11:00:10 [0.48ms] */
select column_name as `column_name` from information_schema.columns where table_schema = 'prod_rta_temp' and table_name = 'roles';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 7 - 2025-06-28 11:00:10 [0.26ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-06-28 11:00:10 [0.22ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-06-28 11:00:10 [0.19ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-06-28 11:00:10 [0.22ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-06-28 11:00:10 [0.24ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-28 11:00:10 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-28 11:00:10 [3.09ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('b75263aa5eda477fdefbec9c4e498978c827c6e7dff01749f71ae00393e9e46702bf0bc0c2534f1b', 154, 5, '[]', 0, '2025-06-28 11:00:10', '2025-06-28 11:00:10', '2026-06-28 11:00:10');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-28 11:00:10 [0.4ms] */
select * from `oauth_access_tokens` where `id` = 'b75263aa5eda477fdefbec9c4e498978c827c6e7dff01749f71ae00393e9e46702bf0bc0c2534f1b' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-28 11:00:10 [2.98ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'b75263aa5eda477fdefbec9c4e498978c827c6e7dff01749f71ae00393e9e46702bf0bc0c2534f1b';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-28 11:00:11 [2.6ms] */
select * from `oauth_access_tokens` where `id` = 'b75263aa5eda477fdefbec9c4e498978c827c6e7dff01749f71ae00393e9e46702bf0bc0c2534f1b' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-28 11:00:11 [0.28ms] */
select * from `oauth_access_tokens` where `id` = 'b75263aa5eda477fdefbec9c4e498978c827c6e7dff01749f71ae00393e9e46702bf0bc0c2534f1b' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-28 11:00:11 [0.27ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-28 11:00:11 [0.31ms] */
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-06-28 11:00:11 [0.27ms] */
select * from `oauth_access_tokens` where `id` = 'b75263aa5eda477fdefbec9c4e498978c827c6e7dff01749f71ae00393e9e46702bf0bc0c2534f1b' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-28 11:00:11 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-28 11:00:11 [0.29ms] */
select count(*) as aggregate from `party` where `id` = 59307;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-28 11:00:11 [0.25ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'IF124';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-28 11:00:11 [1.11ms] */
select `invoice`.`id` as `invoice_id`, `invoice_number`, `term`.`year`, `term`.`quarter`, `invoice`.`transaction_id`, `party`.`id` as `customer_id`, CASE
                WHEN person.id IS NOT NULL THEN CONCAT(person.first_name, " ", person.second_name, " ", person.third_name, " ", person.fourth_name)
                WHEN company.id IS NOT NULL THEN company.company_name
                ELSE "No Entity Found"
                END AS customer_name, CASE
                WHEN party.phone_number_2 IS NOT NULL THEN CONCAT(party.phone_number_1," / ",party.phone_number_2)
                ELSE party.phone_number_1 END as mobile_number, `vehicle`.`license_plate`, `service`.`name` as `service_name`, `invoice`.`due_date`, `invoice`.`total_invoice_amount` as `invoice_amount`, `invoice`.`status`, `invoice`.`parent`, `invoice`.`created_at`, `invoice`.`updated_at`, CASE WHEN invoice_payment.id IS NULL THEN "Y" ELSE "N" END as make_payment from `invoice` left join `party` on `invoice`.`party_id` = `party`.`id` left join `person` on `person`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Person' left join `company` on `company`.`id` = `party`.`partyable_id` and `party`.`partyable_type` = 'Company' left join `transaction` on `invoice`.`transaction_id` = `transaction`.`id` left join `vehicle_tax` on `transaction`.`vehicle_tax_id` = `vehicle_tax`.`id` left join `term` on `vehicle_tax`.`term_id` = `term`.`id` left join `vehicle` on `transaction`.`vehicle_id` = `vehicle`.`id` left join `service` on `transaction`.`service_id` = `service`.`id` left join `invoice_payment` on `invoice_payment`.`invoice_id` = `invoice`.`id` where `invoice`.`total_invoice_amount` > 0 and `service`.`name` = 'Tax' and `vehicle_tax`.`exempt` = 'N' and `transaction`.`vehicle_tax_id` is not null and `invoice`.`parent` = 'N' and `invoice`.`party_id` = 59307 and `license_plate` = 'IF124' and `invoice`.`deleted_at` is null;
/*==================================================*/
