<?php 

function my_invoices_cb() {
	// do_action('display_search_box', ['id' => 'pm_my_invoices', 'query_function' => 'pm_get_my_invoices']);
	if(isset($_GET['id']) && current_user_can("view_others_invoice")) {
		$user_id = $_GET['id'];
	} else {
		$session = Session::getInstance();
		$user_id = $session->id;
	}
	do_action("display_qf_search_box", [
	  	'default' => ['status' => "unpaid", 'user_idx' => $user_id],
	    'id' => "pm_qf_my_invoices",
	    'query_function' => 'pm_get_qf_my_invoices',
	    'settings' => ['autoload' => true, 'limit' => 100, 'callback' => 'initDataTableKoweb', 'callbackid' => '#invoices-table table', 'autostart' => true],
	  ]);
	do_action("pm_quick_menu");
}