<script>
	function get_dpt() {
		show_loading();
		jQuery.ajax({
			url: app_url + 'dpt_report/get_dpt',
			type: 'POST',
			dataType: 'JSON',
			data: jQuery('#form_dpt').serialize(),
			success: function(response) {
				hide_loading();
				jQuery('#table_dpt_report tbody').html('');
				jQuery(response.data).each(function(adata, bdata) {
					var table = "";
					table += "<tr>";
					table += "	<td>";
					table += bdata.nobill;
					table += "	</td>";
					table += "	<td>";
					table += bdata.date;
					table += "	</td>";
					table += "	<td>";
					table += bdata.customer;
					table += "	</td>";
					table += "	<td align='right'>";
					table += thousand_separator(bdata.grand_total_final);
					table += "	</td>";
					table += "	<td align='right'>";
					table += thousand_separator(bdata.total_pay);
					table += "	</td>";
					table += "	<td>";
					table += bdata.cashier;
					table += "	</td>";
					table += "	<td>";
					table += bdata.status;
					table += "	</td>";
					table += "	<td>";
					table += bdata.payment_status;
					table += "	</td>";
					table += "<tr>";

					jQuery('#table_dpt_report tbody').append(table);
				});

				jQuery('.txt-total').text(thousand_separator(response.total));

				jQuery('.table-payment').html(response.table_payment);
			},
			error: function(response) {
			}
		});
	}

	get_dpt();

	jQuery("#btn_filter").on('click', function() {
		get_dpt();
	});