<commit_before><?php
/**
 * Web Module Administrative Invoice Queue
 *
 * @author <NAME> <<EMAIL>>
 */

use \Skeleton\Core\Web\Template;
use \Skeleton\Core\Web\Module;
use \Skeleton\Core\Web\Session;
use \Skeleton\Pager\Web\Pager;

class Web_Module_Sales_Invoice_Queue extends Module {
	/**
	 * Login required
	 *
	 * @access protected
	 * @var bool $login_required
	 */
	protected $login_required = true;

	/**
	 * Template
	 *
	 * @access protected
	 * @var string $template
	 */
	protected $template = 'sales/invoice/queue.twig';

	/**
	 * Display method
	 *
	 * @access public
	 */
	public function display() {
		$template = Template::get();

		$pager = new Pager('invoice_queue');

		if (isset($_POST['status'])) {
			if ($_POST['status'] == 'processed') {
				$pager->add_condition('processed_to_invoice_item_id', 'IS NOT', NULL);
			} elseif ($_POST['status'] == 'unprocessed') {
				$pager->add_condition('processed_to_invoice_item_id', 'IS', NULL);
			}
		} else {
			$pager->add_condition('processed_to_invoice_item_id', 'IS', NULL);
		}

		$pager->add_sort_permission('id');
		$pager->add_sort_permission('price');
		$pager->add_sort_permission('qty');
		$pager->add_sort_permission('description');
		$pager->add_sort_permission('customer.company');
		$pager->add_sort_permission('processed_to_invoice_item_id');

		if (isset($_POST['search'])) {
			$search_fields = [
				'invoice_queue.description',
				'customer.company',
				'customer.lastname'
			];<commit_msg>add 'deleted' condition to invoice_queue pager<commit_after><?php
/**
 * Web Module Administrative Invoice Queue
 *
 * @author <NAME> <<EMAIL>>
 */

use \Skeleton\Core\Web\Template;
use \Skeleton\Core\Web\Module;
use \Skeleton\Core\Web\Session;
use \Skeleton\Pager\Web\Pager;

class Web_Module_Sales_Invoice_Queue extends Module {
	/**
	 * Login required
	 *
	 * @access protected
	 * @var bool $login_required
	 */
	protected $login_required = true;

	/**
	 * Template
	 *
	 * @access protected
	 * @var string $template
	 */
	protected $template = 'sales/invoice/queue.twig';

	/**
	 * Display method
	 *
	 * @access public
	 */
	public function display() {
		$template = Template::get();

		$pager = new Pager('invoice_queue');

		if (isset($_POST['status'])) {
			if ($_POST['status'] == 'processed') {
				$pager->add_condition('processed_to_invoice_item_id', 'IS NOT', NULL);
			} elseif ($_POST['status'] == 'unprocessed') {
				$pager->add_condition('processed_to_invoice_item_id', 'IS', NULL);
			}
		} else {
			$pager->add_condition('processed_to_invoice_item_id', 'IS', NULL);
		}
		$pager->add_condition('deleted', 'IS', NULL);

		$pager->add_sort_permission('id');
		$pager->add_sort_permission('price');
		$pager->add_sort_permission('qty');
		$pager->add_sort_permission('description');
		$pager->add_sort_permission('customer.company');
		$pager->add_sort_permission('processed_to_invoice_item_id');

		if (isset($_POST['search'])) {
			$search_fields = [
				'invoice_queue.description',
				'customer.company',
				'customer.lastname'
			];
{'fraction_non_alphanumeric': 0.1705630556470201, 'fraction_numerical': 0.0, 'mean_word_length': 4.4640287769784175, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '659392', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1025, 'n_words': 174}