diff --git a/module/VuFind/src/VuFind/ILS/Driver/KohaRest.php b/module/VuFind/src/VuFind/ILS/Driver/KohaRest.php index be665acd8e1a552e6a9642c50b5509ed5831b861..caae3fa06aea0f3b1b586be56ece001f885e5eab 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/KohaRest.php +++ b/module/VuFind/src/VuFind/ILS/Driver/KohaRest.php @@ -638,7 +638,9 @@ class KohaRest extends \VuFind\ILS\Driver\AbstractBase implements public function getHolding($id, array $patron = null) { - $this->debug("Function getHolding($id, " . implode(",",$patron) . ") called"); + $this->debug( + "Function getHolding($id, " . implode(",", $patron) . ") called" + ); $started = microtime(true); @@ -922,79 +924,81 @@ class KohaRest extends \VuFind\ILS\Driver\AbstractBase implements $row = $sql = $sqlStmt = ''; try { $id = $patron['id']; - $sql = "SELECT al.amount*100 as amount, al.amountoutstanding*100 as balance, al.accounttype as fine, " . - " al.date as createdat, items.biblionumber as id, al.description as title " . + $sql = "SELECT al.amount*100 as amount, " . + "al.amountoutstanding*100 as balance, al.accounttype as fine, " . + "al.date as createdat, items.biblionumber as id, " . + "al.description as title " . "FROM `accountlines` al " . "LEFT JOIN items USING (itemnumber) " . "WHERE al.borrowernumber = :id "; - if (!$this->db) { - $this->initDB(); - } + if (!$this->db) { + $this->initDB(); + } $sqlStmt = $this->db->prepare($sql); $sqlStmt->execute([':id' => $id]); foreach ($sqlStmt->fetchAll() as $row) { - switch ($row['fine']) - { - case 'A': - $fineValue = "Account Management Fee"; - break; - case 'C': - $fineValue = "Credit"; - break; - case "CR": - $fineValue = "Credit for Returning Lost Book"; - break; - case "Copie": - $fineValue = "Copier Fee"; - break; - case 'F': - $fineValue = "Overdue Fine"; - break; - case "FFOR": - $fineValue = "Forgiven Overdue Fine"; - break; - case "FOR": - $fineValue = "Forgiven"; - break; - case "FU": - $fineValue = "Overdue Fine"; - break; - case 'L': - $fineValue = "Lost Item"; - break; - case "LR": - $fineValue = "Lost and Returned"; - break; - case 'M': - $fineValue = "Sundry"; - break; - case 'N': - $fineValue = "New Card"; - break; - case 'O': - $fineValue = "Overdue Fine"; - break; - case "Pay": - $fineValue = "Payment"; - break; - case "REF": - $fineValue = "Refund"; - break; - case "Rent": - $fineValue = "Rental Fee"; - break; - case "Rep": - $fineValue = "Replacement"; - break; - case "Res": - $fineValue = "Reserve Charge"; - break; - case 'W': - $fineValue = "Charge Written Off"; - break; - default: - $fineValue = "Unknown Charge"; - break; + switch ($row['fine']) + { + case 'A': + $fineValue = "Account Management Fee"; + break; + case 'C': + $fineValue = "Credit"; + break; + case "CR": + $fineValue = "Credit for Returning Lost Book"; + break; + case "Copie": + $fineValue = "Copier Fee"; + break; + case 'F': + $fineValue = "Overdue Fine"; + break; + case "FFOR": + $fineValue = "Forgiven Overdue Fine"; + break; + case "FOR": + $fineValue = "Forgiven"; + break; + case "FU": + $fineValue = "Overdue Fine"; + break; + case 'L': + $fineValue = "Lost Item"; + break; + case "LR": + $fineValue = "Lost and Returned"; + break; + case 'M': + $fineValue = "Sundry"; + break; + case 'N': + $fineValue = "New Card"; + break; + case 'O': + $fineValue = "Overdue Fine"; + break; + case "Pay": + $fineValue = "Payment"; + break; + case "REF": + $fineValue = "Refund"; + break; + case "Rent": + $fineValue = "Rental Fee"; + break; + case "Rep": + $fineValue = "Replacement"; + break; + case "Res": + $fineValue = "Reserve Charge"; + break; + case 'W': + $fineValue = "Charge Written Off"; + break; + default: + $fineValue = "Unknown Charge"; + break; } $transactionLst[] = [ @@ -1004,7 +1008,9 @@ class KohaRest extends \VuFind\ILS\Driver\AbstractBase implements 'fine' => $fineValue, 'balance' => $row['balance'], 'createdate' => $row['createdat'], - 'duedate' => date_format(new \DateTime($row['duedate']), "m/d/Y"), + 'duedate' => date_format( + new \DateTime($row['duedate']), "m/d/Y" + ), 'duedate' => "N/A", 'id' => isset($row['id']) ? $row['id'] : -1, ];