You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
::use 'design.mtt'::
<div class="col-md-12"> <div class="article"> <div class="text-center"> <h3>::_("Orders from the"):: ::hDate(from):: ::_("to"):: ::hDate(to)::</h3> </div> ::set uri = from.toString().substr(0,10)+"/"+to.toString().substr(0,10):: <div class="text-center"> <!--<a href="/distribution/listByDate//csv" class="btn btn-default btn-sm"> <span class="glyphicon glyphicon-list-alt"></span> ::_("CSV Export"):: </a>--> <a href="/contractAdmin/vendorsByTimeFrame/::uri::" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-list"></span> ::_("Totals per supplier")::</a> <a href="/contractAdmin/ordersByTimeFrame/::uri::?ctotal=1" class="btn btn-default btn-sm">::_("Sub-totals per contract")::</a> </div> <hr/> <table class="table table-bordered table-hover table-condensed" style="width:100%;"> ::set total = 0:: <!-- big total --> ::set subtotal = 0:: <!-- total per user --> ::set contractTotal = 0:: <!-- total per contract --> ::foreach m orders:: ::set i = repeat.m.index:: <!-- name change --> ::if orders[i-1]==null || m.userName != orders[i-1].userName || m.userName2 != orders[i-1].userName2:: <tr style="background-color:#666;"> <td colspan="9" style="font-size:120%;color:#e7e7e7;"> ::m.userName:: ::if m.userName2!=null:: <span class="glyphicon glyphicon-refresh"></span> en alternance avec ::m.userName2:: ::end:: ::set contractTotal = 0:: </td> </tr> <tr> <th>::_("Contract")::</th> <th>::_("Qty")::</th> <th>::_("Ref")::</th> <th>::_("Product")::</th> <th><a href="#" data-toggle="tooltip" data-placement="top" title="::_("Unit price incl. VAT")::">::_("U.P.")::</a></th> <th>::_("Sub-total")::</th> <th>::_("Fees")::</th> <th>::_("Total")::</th> <th>::_("Paid")::</th> </tr> ::end:: <!-- 1 order line --> <tr> <td> <a href="/contractAdmin/view/::m.contractId::"> ::short(m.contractName,40):: </a> </td> <td> ::if(m.quantity==0 && m.canceled):: ::_("Canceled"):: ::else:: ::raw m.smartQt:: ::end:: </td> <td> $$nullSafe(::m.productRef::) </td> <td> ::short(m.productName,40):: </td> <td> ::formatNum(m.productPrice):: ::currency():: </td> <td> ::formatNum(m.subTotal):: ::currency():: </td> <td> <!-- fees --> ::if m.percentageValue!=null:: <a href="#" data-toggle="tooltip" data-placement="top" title="::m.percentageName:: : ::m.percentageValue:: %"> ::formatNum(m.fees):: ::currency():: </a> ::end:: </td> <td> <!-- total --> ::formatNum(m.total):: ::currency():: ::set total = total + m.total:: ::set subtotal = subtotal + m.total:: ::set contractTotal = contractTotal + m.total:: </td> <td> ::if m.paid==true:: <span style="color:#00AA00;">::_("Paid")::</span> ::else:: <span style="color:#DD0000;">::_("Not paid")::</span> ::end:: </td> </tr> <!-- contract total --> ::if ctotal && (orders[i+1]==null || m.contractName != orders[i+1].contractName || m.userName != orders[i+1].userName ):: <tr style="background:#DDD;"> <th colspan="7" class="text-right">Total ::m.contractName::</th> <th>::formatNum(contractTotal):: ::currency()::</th> <th></th> ::set contractTotal = 0:: </tr> ::end:: <!-- member total --> ::if (orders[i+1]==null || m.userName != orders[i+1].userName) :: ::if subtotal!=0:: <tr style="border-top:2px solid #AAA;"> <th colspan="7" class="text-right">::_("Total member")::</th> <th>::formatNum(subtotal):: ::currency()::</th> <th></th> ::set subtotal = 0:: </tr> ::end:: ::end:: <!-- end orders loop --> ::end:: <!-- big total --> <tr style="background:#CCC;font-size:1.3em;"> <th colspan="7" class="text-right">::_("Total of all orders:"):: </th> <th>::formatNum(total):: ::currency()::</th> <th></th> </tr>
</table> </div> </div>
::end::
|