From 4a0a24f4fbabb2bb73f131bfdded888826501344 Mon Sep 17 00:00:00 2001 From: Roman Khomasuridze Date: Wed, 2 Sep 2015 03:07:17 -0400 Subject: [PATCH] fixed #14 --- functions.inc.php | 2 +- page.fbilling_reports.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/functions.inc.php b/functions.inc.php index 72a02a1..f948069 100755 --- a/functions.inc.php +++ b/functions.inc.php @@ -400,7 +400,7 @@ function fbilling_generate_invoice ($src,$search_results) { # generate pdf $pdf = new PDF(); $pdf->SetFont('Arial','',12); - # fwarning, ugly things coming through! + # WARNING, ugly things coming through! # for PDF pagination, we loop through number of pages we have for ($page=0; $page < $number_of_pages; $page++) { $pdf->AddPage(); # createnew page diff --git a/page.fbilling_reports.php b/page.fbilling_reports.php index 0019f92..bf60b8b 100755 --- a/page.fbilling_reports.php +++ b/page.fbilling_reports.php @@ -38,6 +38,7 @@ if ($_REQUEST['dst'] == '' or !$_REQUEST['dst']) {$dst = 'all';} else {$dst = $_REQUEST['dst'];} $src_match = isset($_REQUEST['src_match'])?$_REQUEST['src_match']:'false'; $dst_match = isset($_REQUEST['dst_match'])?$_REQUEST['dst_match']:'false'; +$include_unanswered_calls = isset($_REQUEST['include_unanswered_calls'])?$_REQUEST['include_unanswered_calls']:'false'; $year_start = isset($_REQUEST['year_start'])?$_REQUEST['year_start']:date('Y'); $month_start = isset($_REQUEST['month_start'])?$_REQUEST['month_start']:date('m'); $day_start = isset($_REQUEST['day_start'])?$_REQUEST['day_start']:date('d'); @@ -679,6 +680,7 @@ // end reports by tenant } + // start generate invoice if ($cat == "generate_invoice") { ?> @@ -692,6 +694,7 @@ > + >
@@ -843,6 +846,9 @@ $sql = "SELECT dst,calldate,billsec,total_cost FROM billing_cdr WHERE "; $sql .= "calldate > '$calldate_start' AND calldate < '$calldate_end' AND "; $sql .= "src = '$src' "; + if ($include_unanswered_calls == 'false') { + $sql .= "and billsec > 0 "; + } $sql .= "ORDER BY calldate ASC"; $search_results = sql($sql, 'getAll', DB_FETCHMODE_ASSOC); if (count($search_results) == 0) { // no need to generate empty invoice...