Skip to content

Instantly share code, notes, and snippets.

@xmorave2
Created May 29, 2019 07:33
Show Gist options
  • Save xmorave2/a7b17d4a304d2ea87f58ffa8d4da61d1 to your computer and use it in GitHub Desktop.
Save xmorave2/a7b17d4a304d2ea87f58ffa8d4da61d1 to your computer and use it in GitHub Desktop.
MVS výstupy
ověřená hodnota v kategorii WITHDRAWN:
11 = Zrušená MVS
SELECT
CONCAT('<a href=\"/cgi-bin/koha/circ/circulation.pl?borrowernumber=',s.borrowernumber, '\">',b.firstname, ' ', b.surname, '</a>') AS "Ctenar",
s.issuedate AS "Datum pujceni",
s.date_due AS "Termin vraceni",
CONCAT_WS('','<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',i.biblionumber,'\">', l.title, " od ", l.author, '</a>') as Dokument,
i.itemnotes_nonpublic AS "Poznamka"
FROM
items i
JOIN biblio l ON l.biblionumber = i.biblionumber
JOIN issues s ON i.itemnumber = s.itemnumber
JOIN borrowers b ON s.borrowernumber = b.borrowernumber
WHERE i.itype = "MVS"
ORDER BY s.date_due
SELECT
CONCAT_WS('','<a href=\"/cgi-bin/koha/circ/circulation.pl?borrowernumber=',s.borrowernumber, '\">',b.firstname, ' ', b.surname, '</a>') as "Knihovna",
s.issuedate as "Vypujceno dne",
s.date_due as "Pujceno do",
CONCAT_WS('','<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',i.biblionumber,'\">', l.title, " od ", l.author, '</a>') as Dokument
FROM
issues s
JOIN items i ON s.itemnumber = i.itemnumber
JOIN borrowers b ON s.borrowernumber = b.borrowernumber
JOIN biblio l ON l.biblionumber = i.biblionumber
WHERE b.categorycode = "K"
SELECT
CONCAT('<a href=\"/cgi-bin/koha/circ/circulation.pl?borrowernumber=',s.borrowernumber, '\">',b.firstname, ' ', b.surname, '</a>') AS "Ctenar",
i.dateaccessioned AS "Objednano dne",
CONCAT_WS('','<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',i.biblionumber,'\">', l.title, " od ", l.author, '</a>') as Dokument,
i.itemnotes_nonpublic AS "Poznamka",
CONCAT_WS('', '<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', i.biblionumber, '&itemnumber=', i.itemnumber, '#edititem" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Upravit jednotku</a>') as Akce
FROM
items i
JOIN biblio l ON l.biblionumber = i.biblionumber
JOIN reserves s ON l.biblionumber = s.biblionumber
JOIN borrowers b ON s.borrowernumber = b.borrowernumber
WHERE i.itype = "MVS"
AND (i.issues IS NULL OR i.issues = 0) AND s.priority != "W"
AND i.withdrawn != 11
ORDER BY i.dateaccessioned
SELECT
CONCAT('<a href=\"/cgi-bin/koha/circ/circulation.pl?borrowernumber=',s.borrowernumber, '\">',b.firstname, ' ', b.surname, '</a>') AS "Ctenar",
i.dateaccessioned AS "Objednano dne",
CONCAT_WS('','<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',i.biblionumber,'\">', l.title, " od ", l.author, '</a>') as Dokument,
i.itemnotes_nonpublic AS "Poznamka",
CONCAT_WS('', '<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', i.biblionumber, '&itemnumber=', i.itemnumber, '#edititem" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Upravit jednotku</a>') as Akce
FROM
items i
JOIN biblio l ON l.biblionumber = i.biblionumber
LEFT JOIN old_reserves s ON l.biblionumber = s.biblionumber
LEFT JOIN borrowers b ON s.borrowernumber = b.borrowernumber
WHERE i.itype = "MVS"
AND (i.issues IS NULL OR i.issues = 0)
AND i.withdrawn = 11
ORDER BY i.dateaccessioned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment