{{ knp_pagination_sortable(borrowed_assets, 'ISBN', 'b.isbn') }} | {{ knp_pagination_sortable(borrowed_assets, 'Title', 'b.title') }} | {{ knp_pagination_sortable(borrowed_assets, 'Author', 'b.author') }} | {{ knp_pagination_sortable(borrowed_assets, 'Genre', 'b.genre') }} | Status | |
---|---|---|---|---|---|
{{ entity.isbn|trim }} | {{ entity.title|trim }} | {{ entity.author|trim }} | {{ entity.genre|trim }} |
{% set current_loan = null %}
{% if entity.getLoans|length > 0 %}
Loaned to
{% for item in entity.getLoans %}
{% if loop.first %}
{% set current_loan = item %}
{% endif %}
{% if item.customer is not null %}{{ item.customer.firstname }} {{ item.customer.lastname }}{% endif %}. {% endfor %} {% else %} Available. {% endif %} {% if entity.scheduledLoans|length > 0 %} There are {{ entity.scheduledLoans|length }} people waiting to loan this book. {% endif %} {% set loan_pos = null %} {% for item in entity.scheduledLoans %} {% if item.customer.id == customer.id %} {% set loan_pos = loop.index %} {% endif %} {% endfor %} {% if loan_pos is not null %} You are number {{ loan_pos }} in the list. {% endif %} |
{% if current_loan is null or current_loan.customer != customer%} {% if loan_pos is null %} Request Loan {% else %} Unlist Me {% endif %} {% endif %} |
ISBN | Title | Author | Genre | Status | Loan Date | Return Date | |
---|---|---|---|---|---|---|---|
{{ entity.isbn|trim }} | {{ entity.title|trim }} | {{ entity.author|trim }} | {{ entity.genre|trim }} |
{% set current_loan = null %}
{% if entity.getLoans|length > 0 %}
Loaned to
{% for item in entity.getLoans %}
{% if loop.first %}
{% set current_loan = item %}
{% endif %}
{% if item.customer is not null %}{{ item.customer.firstname }} {{ item.customer.lastname }}{% endif %}. {% endfor %} {% endif %} {% if current_loan is not null and current_loan.customer == customer and current_dt > current_loan.returnDate %}Your loan is overdue! {% endif %} {% if entity.scheduledLoans|length > 0 %} There are {{ entity.scheduledLoans|length }} people waiting to loan this book. {% endif %} {% set loan_pos = null %} {% for item in entity.scheduledLoans %} {% if item.customer.id == customer.id %} {% set loan_pos = loop.index %} {% endif %} {% endfor %} {% if loan_pos is not null %} You are number {{ loan_pos }} in the list. {% endif %} |
{% if current_loan is not null and current_loan.customer == customer%}{{ current_loan.loanDate|date("Y-m-d") }}{% endif %} | {% if current_loan is not null and current_loan.customer == customer%}{{ current_loan.returnDate|date("Y-m-d") }}{% endif %} | {% if current_loan is null or current_loan.customer != customer %} {% if loan_pos is null %} Request Loan {% else %} Unlist Me {% endif %} {% endif %} |