trx.view.html 6.58 KB
{% extends "starter-template.html" %}

{% block content %}

{% if trx.responses %}
{% set lastResponse = trx.responses|last %}
{% endif %}

<form class="form-horizontal">

    <div class="form-group">
        <label for="inputReqId" class="col-sm-2 control-label">Request ID</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputReqId" value="{{ trx.requestId }}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputRefnum" class="col-sm-2 control-label">Supplier Refnum</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputRefnum"
                {% if lastResponse %}
                    {% if lastResponse.parsed.ciwaru.refnum %}
                    value="{{ lastResponse.parsed.ciwaru.refnum }}"
                    {% elif lastResponse.parsed.TRANSACTIONID %}
                    value="{{ lastResponse.parsed.TRANSACTIONID }}"
                    {% endif %}
                {% endif %}
                readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputWaktuTrx" class="col-sm-2 control-label">Time</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputWaktuTrx" value="{{ trx.ts }}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputPengisi" class="col-sm-2 control-label">Member ID</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputPengisi" value="{{ trx.member }}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputStoreUserName" class="col-sm-2 control-label">Member Name</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputStoreUserName" value="{{ storeuser.FULL_NAME }} ({{ storeuser.USER_NAME }})" readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputEndingBalance" class="col-sm-2 control-label">Ending Balance</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputEndingBalance" value="{{ st24trx.ENDING_BALANCE_FORMATTED }}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputNomorTujuan" class="col-sm-2 control-label">Destination</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputNomorTujuan" value="{{ trx.destination }}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputProduct" class="col-sm-2 control-label">Product</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputProduct" value="{{ trx.product }}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputRemoteProduct" class="col-sm-2 control-label">Remote Product</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputRemoteProduct" value="{{ trx.remoteProduct }}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputSellingPrice" class="col-sm-2 control-label">Selling Price</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputSellingPrice" value="{{ st24trx.PRICE_FORMATTED }}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputRC" class="col-sm-2 control-label">Response Code</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputRC"
                {% if lastResponse %}
                value="{{ trx.rc }}"
                {% endif %}
                readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputST24TransStat" class="col-sm-2 control-label">Status on ST24</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputST24TransStat" value="{{ st24trx.TRANS_STAT }}" readonly>
        </div>
    </div>


    <div class="form-group">
        <label for="inputMessage" class="col-sm-2 control-label">Supplier Message</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputMessage"
                {% if lastResponse %}
                    {% if lastResponse.parsed.ciwaru.msg %}
                    value="{{ lastResponse.parsed.ciwaru.msg }}"
                    {% elif lastResponse.parsed.MESSAGE %}
                    value="{{ lastResponse.parsed.MESSAGE }}"
                    {% endif %}
                {% endif %}
                readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputST24Message" class="col-sm-2 control-label">Message on ST24</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputST24Message" value="{{ st24trx.MASALAH }}" readonly>
        </div>
    </div>

    <div class="form-group">
        <label for="inputSMSCID" class="col-sm-2 control-label">SMSCID</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputSMSCID" value="{{ st24trx.SMSCID }}" readonly>
        </div>
    </div>

    {% if lastResponse.parsed.ciwaru.sn %}
    <div class="form-group">
        <label for="inputSN" class="col-sm-2 control-label">SN</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputSN"
                {% if lastResponse %}
                value="{{ lastResponse.parsed.ciwaru.sn }}"
                {% endif %}
                readonly>
        </div>
    </div>
    {% endif %}

    {% if lastResponse.parsed.ciwaru.balance %}
    <div class="form-group">
        <label for="inputBalance" class="col-sm-2 control-label">Balance</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="inputBalance"
                {% if lastResponse %}
                value="{{ lastResponse.parsed.ciwaru.balance }}"
                {% endif %}
                readonly>
        </div>
    </div>
    {% endif %}


</form>

<table class="table">
    {% if trx.responses %}
    {% for response in trx.responses %}
    <tr>
        <td>
            <strong>{{ response.ts }} ({{ response.supplier }}):</strong><br/>
            {{ response.raw }}
        </td>
    </tr>
    {% endfor %}
    {% endif %}

</table>

{% if session.isAdmin %}
<br>
<a class="btn btn-primary" href="/store-users/view/{{ trx.member }}">Lihat data member</a>
<a class="btn btn-primary" href="/trx/resend-report/{{ trx.requestId }}">Resend Report ke ST24</a>
{% endif %}

{% endblock %}