|
|
@@ -263,17 +263,17 @@ class DailyClosing
|
|
|
//print $sql;
|
|
|
$data = $db->query($sql);
|
|
|
$result = pg_fetch_all($data);
|
|
|
- $refs = "";
|
|
|
+ $refs = [];
|
|
|
while($row = $db->fetch_object($result)){
|
|
|
- if ($refs == "") {
|
|
|
- $refs .= "'" . $row->ref . "'";
|
|
|
- } else {
|
|
|
- $refs .= ",'" . $row->ref . "'";
|
|
|
- }
|
|
|
+ $refs[] = "'".$row->ref . "'";
|
|
|
}
|
|
|
- $params = ["from" => $from, "to" => $to, "factures" => $refs];
|
|
|
+ $refs = array_unique($refs);
|
|
|
+ $refs = array_values($refs);
|
|
|
+ $refsString = implode(",", $refs);
|
|
|
+ $params = ["from" => $from, "to" => $to, "factures" => $refsString];
|
|
|
$postFields = json_encode($params);
|
|
|
- $crossShoppingFactures = $this->curlRunner('bookingapi/getPrintedFacturesRefsArray', $postFields, 'POST', true);
|
|
|
+ $crossShoppingFacturesResult = $this->curlRunner('bookingapi/getPrintedFacturesRefsArray', $postFields, 'POST', true);
|
|
|
+ $crossShoppingFactures = is_null($crossShoppingFacturesResult) ? [] : $crossShoppingFacturesResult;
|
|
|
//print_r($crossShoppingFactures);
|
|
|
print '<table id="unprintedfactureslist" style="display:none; width:100%;">';
|
|
|
print '<tr class="center unprintedfacturetr">
|