/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-06-26 11:00:36 [1.7ms] */
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-26 11:00:36 [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-26 11:00:36 [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-26 11:00:36 [7.62ms] */
update `userprofiles` set `login_count` = 2889, `last_login` = '2025-06-26 11:00:36', `userprofiles`.`updated_at` = '2025-06-26 11:00:36' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-26 11:00:36 [0.32ms] */
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-26 11:00:36 [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-26 11:00:36 [0.65ms] */
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-26 11:00:36 [0.35ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-06-26 11:00:36 [0.32ms] */
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-26 11:00:36 [0.37ms] */
select * from `oauth_clients` where `oauth_clients`.`id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 11 - 2025-06-26 11:00:36 [0.32ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-26 11:00:36 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-26 11:00:36 [12.14ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('4eb9c708d02ad9bfcb66cff9abd0a7ee848ed63dfc7069f789473f00f222a109fbac7ab029266bdf', 154, 5, '[]', 0, '2025-06-26 11:00:36', '2025-06-26 11:00:36', '2026-06-26 11:00:36');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-26 11:00:36 [0.44ms] */
select * from `oauth_access_tokens` where `id` = '4eb9c708d02ad9bfcb66cff9abd0a7ee848ed63dfc7069f789473f00f222a109fbac7ab029266bdf' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-26 11:00:36 [11.69ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '4eb9c708d02ad9bfcb66cff9abd0a7ee848ed63dfc7069f789473f00f222a109fbac7ab029266bdf';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-26 11:00:36 [1.64ms] */
select * from `oauth_access_tokens` where `id` = '4eb9c708d02ad9bfcb66cff9abd0a7ee848ed63dfc7069f789473f00f222a109fbac7ab029266bdf' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-26 11:00:36 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '4eb9c708d02ad9bfcb66cff9abd0a7ee848ed63dfc7069f789473f00f222a109fbac7ab029266bdf' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-26 11:00:36 [0.23ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-26 11:00:36 [0.37ms] */
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-26 11:00:36 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '4eb9c708d02ad9bfcb66cff9abd0a7ee848ed63dfc7069f789473f00f222a109fbac7ab029266bdf' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-26 11:00:36 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-26 11:00:36 [0.29ms] */
select count(*) as aggregate from `party` where `id` = 33125;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-26 11:00:36 [0.27ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'BS724';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-26 11:00:36 [1.57ms] */
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-26 11:00:38 [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-06-26 11:00:38 [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-06-26 11:00:38 [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-06-26 11:00:38 [5.85ms] */
update `userprofiles` set `login_count` = 2890, `last_login` = '2025-06-26 11:00:38', `userprofiles`.`updated_at` = '2025-06-26 11:00:38' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-26 11:00:38 [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-26 11:00:38 [0.57ms] */
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-26 11:00:38 [0.25ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-06-26 11:00:38 [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-26 11:00:38 [0.18ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-06-26 11:00:38 [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-26 11:00:38 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-26 11:00:38 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-26 11:00:38 [7.14ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('5491ec7ee32165cc5c029b0dba8895b92ec727dd8ee4fb90b6b219bbe991d8d1aeb905cdf1fb81e8', 154, 5, '[]', 0, '2025-06-26 11:00:38', '2025-06-26 11:00:38', '2026-06-26 11:00:38');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-26 11:00:38 [0.36ms] */
select * from `oauth_access_tokens` where `id` = '5491ec7ee32165cc5c029b0dba8895b92ec727dd8ee4fb90b6b219bbe991d8d1aeb905cdf1fb81e8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-26 11:00:38 [11.26ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '5491ec7ee32165cc5c029b0dba8895b92ec727dd8ee4fb90b6b219bbe991d8d1aeb905cdf1fb81e8';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-26 11:00:38 [2.26ms] */
select * from `oauth_access_tokens` where `id` = '5491ec7ee32165cc5c029b0dba8895b92ec727dd8ee4fb90b6b219bbe991d8d1aeb905cdf1fb81e8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-26 11:00:38 [0.33ms] */
select * from `oauth_access_tokens` where `id` = '5491ec7ee32165cc5c029b0dba8895b92ec727dd8ee4fb90b6b219bbe991d8d1aeb905cdf1fb81e8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-26 11:00:38 [0.24ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-26 11:00:38 [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-06-26 11:00:38 [0.26ms] */
select * from `oauth_access_tokens` where `id` = '5491ec7ee32165cc5c029b0dba8895b92ec727dd8ee4fb90b6b219bbe991d8d1aeb905cdf1fb81e8' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-26 11:00:38 [0.25ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-26 11:00:38 [0.25ms] */
select count(*) as aggregate from `party` where `id` = 64940;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-26 11:00:38 [0.27ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = '5656SXYVCYHC';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-26 11:00:38 [0.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` = 64940 and `license_plate` = '5656SXYVCYHC' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-06-26 11:00:41 [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-26 11:00:41 [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-26 11:00:41 [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-06-26 11:00:41 [5.92ms] */
update `userprofiles` set `login_count` = 2891, `last_login` = '2025-06-26 11:00:41', `userprofiles`.`updated_at` = '2025-06-26 11:00:41' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-26 11:00:41 [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-26 11:00:41 [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-26 11:00:41 [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-26 11:00:41 [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-26 11:00:41 [0.18ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-06-26 11:00:41 [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-26 11:00:41 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-26 11:00:41 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-26 11:00:41 [3.46ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('dee272d92f452758d40b6e3431d0f82592ed61929cf391affdda9fa65cbfb666743296ad86cb7fef', 154, 5, '[]', 0, '2025-06-26 11:00:41', '2025-06-26 11:00:41', '2026-06-26 11:00:41');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-26 11:00:41 [0.39ms] */
select * from `oauth_access_tokens` where `id` = 'dee272d92f452758d40b6e3431d0f82592ed61929cf391affdda9fa65cbfb666743296ad86cb7fef' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-26 11:00:41 [3.19ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'dee272d92f452758d40b6e3431d0f82592ed61929cf391affdda9fa65cbfb666743296ad86cb7fef';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-26 11:00:41 [2.33ms] */
select * from `oauth_access_tokens` where `id` = 'dee272d92f452758d40b6e3431d0f82592ed61929cf391affdda9fa65cbfb666743296ad86cb7fef' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-26 11:00:41 [0.31ms] */
select * from `oauth_access_tokens` where `id` = 'dee272d92f452758d40b6e3431d0f82592ed61929cf391affdda9fa65cbfb666743296ad86cb7fef' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-26 11:00:41 [0.27ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-26 11:00:41 [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-26 11:00:41 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'dee272d92f452758d40b6e3431d0f82592ed61929cf391affdda9fa65cbfb666743296ad86cb7fef' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-26 11:00:41 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-26 11:00:41 [0.22ms] */
select count(*) as aggregate from `party` where `id` = 64946;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-26 11:00:41 [0.23ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LIC003';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-26 11:00:41 [0.79ms] */
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-26 11:00:42 [2.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-06-26 11:00:42 [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-26 11:00:42 [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-26 11:00:42 [5.81ms] */
update `userprofiles` set `login_count` = 2892, `last_login` = '2025-06-26 11:00:42', `userprofiles`.`updated_at` = '2025-06-26 11:00:42' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-26 11:00:42 [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-26 11:00:42 [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-26 11:00:42 [0.25ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-06-26 11:00:42 [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-26 11:00:42 [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-26 11:00:42 [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-26 11:00:42 [0.22ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-26 11:00:42 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-26 11:00:42 [3.14ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('f3472f036aa5c117b1d9c5617c28f26d40234e91d9081e40f05452e823d0aa8c30e38edcc9146b91', 154, 5, '[]', 0, '2025-06-26 11:00:42', '2025-06-26 11:00:42', '2026-06-26 11:00:42');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-26 11:00:42 [0.39ms] */
select * from `oauth_access_tokens` where `id` = 'f3472f036aa5c117b1d9c5617c28f26d40234e91d9081e40f05452e823d0aa8c30e38edcc9146b91' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-26 11:00:42 [2.96ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'f3472f036aa5c117b1d9c5617c28f26d40234e91d9081e40f05452e823d0aa8c30e38edcc9146b91';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-26 11:00:42 [1.64ms] */
select * from `oauth_access_tokens` where `id` = 'f3472f036aa5c117b1d9c5617c28f26d40234e91d9081e40f05452e823d0aa8c30e38edcc9146b91' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-26 11:00:42 [0.15ms] */
select * from `oauth_access_tokens` where `id` = 'f3472f036aa5c117b1d9c5617c28f26d40234e91d9081e40f05452e823d0aa8c30e38edcc9146b91' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-26 11:00:42 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-26 11:00:42 [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-26 11:00:42 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'f3472f036aa5c117b1d9c5617c28f26d40234e91d9081e40f05452e823d0aa8c30e38edcc9146b91' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-26 11:00:42 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-26 11:00:42 [0.14ms] */
select count(*) as aggregate from `party` where `id` = 64946;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-26 11:00:42 [0.29ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LIC002';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-26 11:00:42 [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-26 11:00:43 [1.48ms] */
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-26 11:00:43 [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-26 11:00:43 [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-26 11:00:43 [6.39ms] */
update `userprofiles` set `login_count` = 2893, `last_login` = '2025-06-26 11:00:43', `userprofiles`.`updated_at` = '2025-06-26 11:00:43' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-26 11:00:43 [0.43ms] */
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-26 11:00:43 [0.99ms] */
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-26 11:00:43 [0.38ms] */
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-26 11:00:43 [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-26 11:00:43 [0.18ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-06-26 11:00:43 [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-26 11:00:43 [0.22ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-26 11:00:43 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-26 11:00:43 [3.06ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('c1a14c870c4d943af51f3ae7e92483a6248f21718ac54cd028fd7e658fa63a4b4ff5925ab1342c7e', 154, 5, '[]', 0, '2025-06-26 11:00:43', '2025-06-26 11:00:43', '2026-06-26 11:00:43');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-26 11:00:43 [0.39ms] */
select * from `oauth_access_tokens` where `id` = 'c1a14c870c4d943af51f3ae7e92483a6248f21718ac54cd028fd7e658fa63a4b4ff5925ab1342c7e' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-26 11:00:43 [2.97ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'c1a14c870c4d943af51f3ae7e92483a6248f21718ac54cd028fd7e658fa63a4b4ff5925ab1342c7e';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-26 11:00:43 [1.6ms] */
select * from `oauth_access_tokens` where `id` = 'c1a14c870c4d943af51f3ae7e92483a6248f21718ac54cd028fd7e658fa63a4b4ff5925ab1342c7e' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-26 11:00:43 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'c1a14c870c4d943af51f3ae7e92483a6248f21718ac54cd028fd7e658fa63a4b4ff5925ab1342c7e' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-26 11:00:43 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-26 11:00:43 [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-26 11:00:43 [0.14ms] */
select * from `oauth_access_tokens` where `id` = 'c1a14c870c4d943af51f3ae7e92483a6248f21718ac54cd028fd7e658fa63a4b4ff5925ab1342c7e' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-26 11:00:43 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-26 11:00:43 [0.23ms] */
select count(*) as aggregate from `party` where `id` = 639;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-26 11:00:43 [0.23ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'RTA009';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-26 11:00:43 [0.83ms] */
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-26 11:00:44 [2.23ms] */
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-26 11:00:44 [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-26 11:00:44 [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-06-26 11:00:44 [10.93ms] */
update `userprofiles` set `login_count` = 2894, `last_login` = '2025-06-26 11:00:44', `userprofiles`.`updated_at` = '2025-06-26 11:00:44' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-26 11:00:44 [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-26 11:00:44 [0.69ms] */
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-26 11:00:44 [0.31ms] */
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-26 11:00:44 [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-26 11:00:44 [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-26 11:00:44 [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-26 11:00:44 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-26 11:00:44 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-26 11:00:44 [3.15ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('f79b4462e427ec30f33944f940b6755e6d63ffefd9044cdfc4f15c76c67872fff962dbb0a55750da', 154, 5, '[]', 0, '2025-06-26 11:00:44', '2025-06-26 11:00:44', '2026-06-26 11:00:44');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-26 11:00:44 [0.26ms] */
select * from `oauth_access_tokens` where `id` = 'f79b4462e427ec30f33944f940b6755e6d63ffefd9044cdfc4f15c76c67872fff962dbb0a55750da' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-26 11:00:44 [5.01ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = 'f79b4462e427ec30f33944f940b6755e6d63ffefd9044cdfc4f15c76c67872fff962dbb0a55750da';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-26 11:00:44 [2.29ms] */
select * from `oauth_access_tokens` where `id` = 'f79b4462e427ec30f33944f940b6755e6d63ffefd9044cdfc4f15c76c67872fff962dbb0a55750da' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-26 11:00:44 [0.27ms] */
select * from `oauth_access_tokens` where `id` = 'f79b4462e427ec30f33944f940b6755e6d63ffefd9044cdfc4f15c76c67872fff962dbb0a55750da' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-26 11:00:44 [0.25ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-26 11:00:44 [0.37ms] */
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-26 11:00:44 [0.28ms] */
select * from `oauth_access_tokens` where `id` = 'f79b4462e427ec30f33944f940b6755e6d63ffefd9044cdfc4f15c76c67872fff962dbb0a55750da' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-26 11:00:44 [1.27ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-26 11:00:44 [0.14ms] */
select count(*) as aggregate from `party` where `id` = 64946;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-26 11:00:44 [0.23ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LIC005';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-06-26 11:00:44 [2.17ms] */
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-26 11:00:44 [0.25ms] */
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-26 11:00:44 [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-26 11:00:44 [3.02ms] */
update `userprofiles` set `login_count` = 2895, `userprofiles`.`updated_at` = '2025-06-26 11:00:44' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-26 11:00:44 [0.2ms] */
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-26 11:00:44 [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-06-26 11:00:44 [0.18ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-06-26 11:00:44 [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-26 11:00:44 [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-26 11:00:44 [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-26 11:00:44 [0.15ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-26 11:00:44 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-26 11:00:44 [3.13ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('6e05cd0a1e939355f9d9f35cf967605f507cf60cf241e0b306e09cedf242a9c880fa4ae64cee3e8c', 154, 5, '[]', 0, '2025-06-26 11:00:44', '2025-06-26 11:00:44', '2026-06-26 11:00:44');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-26 11:00:44 [0.43ms] */
select * from `oauth_access_tokens` where `id` = '6e05cd0a1e939355f9d9f35cf967605f507cf60cf241e0b306e09cedf242a9c880fa4ae64cee3e8c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-26 11:00:44 [2.95ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '6e05cd0a1e939355f9d9f35cf967605f507cf60cf241e0b306e09cedf242a9c880fa4ae64cee3e8c';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-26 11:00:44 [2.31ms] */
select * from `oauth_access_tokens` where `id` = '6e05cd0a1e939355f9d9f35cf967605f507cf60cf241e0b306e09cedf242a9c880fa4ae64cee3e8c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-26 11:00:44 [0.27ms] */
select * from `oauth_access_tokens` where `id` = '6e05cd0a1e939355f9d9f35cf967605f507cf60cf241e0b306e09cedf242a9c880fa4ae64cee3e8c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-26 11:00:44 [0.26ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-26 11:00:44 [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-26 11:00:44 [0.3ms] */
select * from `oauth_access_tokens` where `id` = '6e05cd0a1e939355f9d9f35cf967605f507cf60cf241e0b306e09cedf242a9c880fa4ae64cee3e8c' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-26 11:00:44 [0.27ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-26 11:00:44 [0.24ms] */
select count(*) as aggregate from `party` where `id` = 36578;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-26 11:00:44 [0.25ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'AA584';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-26 11:00:44 [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-26 11:00:45 [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-26 11:00:45 [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-06-26 11:00:45 [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-26 11:00:45 [11.49ms] */
update `userprofiles` set `login_count` = 2896, `last_login` = '2025-06-26 11:00:45', `userprofiles`.`updated_at` = '2025-06-26 11:00:45' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-26 11:00:45 [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-06-26 11:00:45 [0.57ms] */
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-26 11:00:45 [0.25ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-06-26 11:00:45 [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-26 11:00:45 [0.18ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-06-26 11:00:45 [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-26 11:00:45 [0.24ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-26 11:00:45 [0.2ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-26 11:00:45 [3.64ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('54254ca13bee7fb1cb52c70fd16e486911a0eb5517486fa697abddd8611f0c1fe386feb792633897', 154, 5, '[]', 0, '2025-06-26 11:00:45', '2025-06-26 11:00:45', '2026-06-26 11:00:45');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-26 11:00:45 [0.51ms] */
select * from `oauth_access_tokens` where `id` = '54254ca13bee7fb1cb52c70fd16e486911a0eb5517486fa697abddd8611f0c1fe386feb792633897' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-26 11:00:45 [8.22ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '54254ca13bee7fb1cb52c70fd16e486911a0eb5517486fa697abddd8611f0c1fe386feb792633897';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-26 11:00:45 [2.6ms] */
select * from `oauth_access_tokens` where `id` = '54254ca13bee7fb1cb52c70fd16e486911a0eb5517486fa697abddd8611f0c1fe386feb792633897' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-26 11:00:45 [0.28ms] */
select * from `oauth_access_tokens` where `id` = '54254ca13bee7fb1cb52c70fd16e486911a0eb5517486fa697abddd8611f0c1fe386feb792633897' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-26 11:00:45 [0.27ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-26 11:00:45 [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-26 11:00:45 [0.28ms] */
select * from `oauth_access_tokens` where `id` = '54254ca13bee7fb1cb52c70fd16e486911a0eb5517486fa697abddd8611f0c1fe386feb792633897' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-26 11:00:45 [0.27ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-26 11:00:45 [0.26ms] */
select count(*) as aggregate from `party` where `id` = 64946;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-26 11:00:45 [0.54ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'LIC1253RTA001';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-26 11:00:45 [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` = 'LIC1253RTA001' and `invoice`.`deleted_at` is null;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-06-26 11:00:45 [2.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-26 11:00:46 [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-26 11:00:46 [0.4ms] */
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-26 11:00:46 [10.98ms] */
update `userprofiles` set `login_count` = 2897, `last_login` = '2025-06-26 11:00:46', `userprofiles`.`updated_at` = '2025-06-26 11:00:46' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-26 11:00:46 [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-26 11:00:46 [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-26 11:00:46 [0.32ms] */
select `id`, `name`, `model_has_roles`.`model_id` as `pivot_model_id`, `model_has_roles`.`role_id` as `pivot_role_id`, `model_has_roles`.`model_type` as `pivot_model_type` from `roles` inner join `model_has_roles` on `roles`.`id` = `model_has_roles`.`role_id` where `model_has_roles`.`model_id` in (154) and `model_has_roles`.`model_type` = 'App\Models\User';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 8 - 2025-06-26 11:00:46 [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-26 11:00:46 [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-26 11:00:46 [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-26 11:00:46 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-26 11:00:46 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-26 11:00:46 [3.02ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('9a6991b778f32f50cf442bb814710c99674a807eb7b0b5646f2eb925fcaa681c400f47a6e09e8c41', 154, 5, '[]', 0, '2025-06-26 11:00:46', '2025-06-26 11:00:46', '2026-06-26 11:00:46');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-26 11:00:46 [0.42ms] */
select * from `oauth_access_tokens` where `id` = '9a6991b778f32f50cf442bb814710c99674a807eb7b0b5646f2eb925fcaa681c400f47a6e09e8c41' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-26 11:00:46 [3.2ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '9a6991b778f32f50cf442bb814710c99674a807eb7b0b5646f2eb925fcaa681c400f47a6e09e8c41';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-26 11:00:46 [2.33ms] */
select * from `oauth_access_tokens` where `id` = '9a6991b778f32f50cf442bb814710c99674a807eb7b0b5646f2eb925fcaa681c400f47a6e09e8c41' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-26 11:00:46 [0.3ms] */
select * from `oauth_access_tokens` where `id` = '9a6991b778f32f50cf442bb814710c99674a807eb7b0b5646f2eb925fcaa681c400f47a6e09e8c41' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-26 11:00:46 [0.29ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-26 11:00:46 [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-06-26 11:00:46 [0.15ms] */
select * from `oauth_access_tokens` where `id` = '9a6991b778f32f50cf442bb814710c99674a807eb7b0b5646f2eb925fcaa681c400f47a6e09e8c41' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-26 11:00:46 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-26 11:00:46 [0.23ms] */
select count(*) as aggregate from `party` where `id` = 54700;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-26 11:00:46 [0.23ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'YP073';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-26 11:00:46 [1.19ms] */
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-26 11:00:46 [2.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-06-26 11:00:46 [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-26 11:00:46 [0.42ms] */
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-26 11:00:46 [6ms] */
update `userprofiles` set `login_count` = 2898, `userprofiles`.`updated_at` = '2025-06-26 11:00:46' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-26 11:00:46 [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-26 11:00:46 [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-26 11:00:46 [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-26 11:00:46 [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-26 11:00:46 [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-26 11:00:46 [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-26 11:00:46 [0.24ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-26 11:00:46 [0.13ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-26 11:00:46 [3.07ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('190a2c2afaf003af222dbf6327a9bcc205293022edf1ce84468a4bafc8baf8a95e8ddd284c8f89f6', 154, 5, '[]', 0, '2025-06-26 11:00:46', '2025-06-26 11:00:46', '2026-06-26 11:00:46');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-26 11:00:46 [0.3ms] */
select * from `oauth_access_tokens` where `id` = '190a2c2afaf003af222dbf6327a9bcc205293022edf1ce84468a4bafc8baf8a95e8ddd284c8f89f6' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-26 11:00:46 [3.02ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '190a2c2afaf003af222dbf6327a9bcc205293022edf1ce84468a4bafc8baf8a95e8ddd284c8f89f6';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-26 11:00:46 [2.37ms] */
select * from `oauth_access_tokens` where `id` = '190a2c2afaf003af222dbf6327a9bcc205293022edf1ce84468a4bafc8baf8a95e8ddd284c8f89f6' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-26 11:00:46 [0.23ms] */
select * from `oauth_access_tokens` where `id` = '190a2c2afaf003af222dbf6327a9bcc205293022edf1ce84468a4bafc8baf8a95e8ddd284c8f89f6' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-26 11:00:46 [0.22ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-26 11:00:46 [0.25ms] */
select * from `users` where `id` = 154 and `users`.`deleted_at` is null limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 5 - 2025-06-26 11:00:46 [0.22ms] */
select * from `oauth_access_tokens` where `id` = '190a2c2afaf003af222dbf6327a9bcc205293022edf1ce84468a4bafc8baf8a95e8ddd284c8f89f6' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-26 11:00:46 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-26 11:00:46 [0.27ms] */
select count(*) as aggregate from `party` where `id` = 99460;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 1 - 2025-06-26 11:00:47 [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-06-26 11:00:47 [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-06-26 11:00:47 [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-26 11:00:47 [5.98ms] */
update `userprofiles` set `login_count` = 2899, `last_login` = '2025-06-26 11:00:47', `userprofiles`.`updated_at` = '2025-06-26 11:00:47' where `id` = 154;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 5 - 2025-06-26 11:00:47 [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-26 11:00:47 [0.74ms] */
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-26 11:00:47 [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-26 11:00:47 [0.19ms] */
select exists(select * from `oauth_personal_access_clients`) as `exists`;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 9 - 2025-06-26 11:00:47 [0.18ms] */
select * from `oauth_personal_access_clients` order by `id` desc limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 10 - 2025-06-26 11:00:47 [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-26 11:00:47 [0.21ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 12 - 2025-06-26 11:00:47 [0.2ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 13 - 2025-06-26 11:00:47 [5.11ms] */
insert into `oauth_access_tokens` (`id`, `user_id`, `client_id`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) values ('0aff39c71a1a0c508f7d7b68fdb59efc7e932872dfb7f615f5f012300d9e5cb0b8dd373da3062961', 154, 5, '[]', 0, '2025-06-26 11:00:47', '2025-06-26 11:00:47', '2026-06-26 11:00:47');
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 14 - 2025-06-26 11:00:47 [0.42ms] */
select * from `oauth_access_tokens` where `id` = '0aff39c71a1a0c508f7d7b68fdb59efc7e932872dfb7f615f5f012300d9e5cb0b8dd373da3062961' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/login
   Query 15 - 2025-06-26 11:00:47 [2.99ms] */
update `oauth_access_tokens` set `name` = 'Secret' where `id` = '0aff39c71a1a0c508f7d7b68fdb59efc7e932872dfb7f615f5f012300d9e5cb0b8dd373da3062961';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 1 - 2025-06-26 11:00:47 [2.26ms] */
select * from `oauth_access_tokens` where `id` = '0aff39c71a1a0c508f7d7b68fdb59efc7e932872dfb7f615f5f012300d9e5cb0b8dd373da3062961' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 2 - 2025-06-26 11:00:47 [0.28ms] */
select * from `oauth_access_tokens` where `id` = '0aff39c71a1a0c508f7d7b68fdb59efc7e932872dfb7f615f5f012300d9e5cb0b8dd373da3062961' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 3 - 2025-06-26 11:00:47 [0.26ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 4 - 2025-06-26 11:00:47 [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-06-26 11:00:47 [0.14ms] */
select * from `oauth_access_tokens` where `id` = '0aff39c71a1a0c508f7d7b68fdb59efc7e932872dfb7f615f5f012300d9e5cb0b8dd373da3062961' limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 6 - 2025-06-26 11:00:47 [0.14ms] */
select * from `oauth_clients` where `id` = 5 limit 1;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 7 - 2025-06-26 11:00:47 [1.13ms] */
select count(*) as aggregate from `party` where `id` = 59307;
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 8 - 2025-06-26 11:00:47 [0.55ms] */
select count(*) as aggregate from `vehicle` where `license_plate` = 'IF124';
/*==================================================*/
/* Origin (request): POST https://testtra.puntlandgov.org/api/invoices
   Query 9 - 2025-06-26 11:00:47 [2.03ms] */
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;
/*==================================================*/
