|
|
::use 'contractadmin/design.mtt':: <h3>::_("Orders")::</h3> ::if distribution!=null:: ::_("Delivery of the"):: <b>::hDate(distribution.date)::</b> ::end:: <div id="orderBox"></div><!-- for react -->
<div style="margin:8px 0;">
::if distribution!=null:: <a href="/contractAdmin/edit/::c.id::?d=::distribution.id::" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus-sign"></span> ::_("New order")::</a> ::else:: <a href="/contractAdmin/edit/::c.id::" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-plus-sign"></span> ::_("New order")::</a> ::end:: ::if distribution!=null:: $$export(/contractAdmin/orders/::c.id::?csv=1&d=::distribution.id::) <a href="/contractAdmin/ordersByProduct/::c.id::?d=::distribution.id::" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-list"></span> ::_("Summary by products"):: </a>
<div class="dropdown" style="display:inline-block;"> <button class="btn btn-default btn-sm dropdown-toggle btn-noAntiDoubleClick" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="glyphicon glyphicon-print"></span> ::_("Attendance sheet"):: </button> <ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> <li><a href="/distribution/list/::distribution.id::"> ::_("Standard")::</a></li> <li><a href="/distribution/listByProductUser/::distribution.id::"> ::_("By Product-User")::</a></li> </ul> </div> ::else:: $$export(/contractAdmin/orders/::c.id::?csv=1) <a href="/contractAdmin/ordersByProduct/::c.id::" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-list"></span> ::_("Summary by products")::</a> ::end:: </div>
::if disabledProducts > 0:: $$alert( ::raw __("Be careful, there are <b>::disabledProducts::</b> order(s) containing <b>disabled products</b>.",{disabledProducts:disabledProducts}):: ) ::end::
<style> td.userRow{ font-size:120%; color:#e7e7e7; } td.userRow a{ color:white; } </style> ::set total = 0:: ::set totalAdh = 0:: <table class="table table-bordered table-hover table-condensed" style="width:100%;"> ::set name = "":: ::set name2 = ""::
::foreach m orders:: ::if m.userName != name || m.userName2 != name2:: <tr style="background-color:#666;">
<td colspan="7" style="font-size:120%;color:#e7e7e7;"> ::if distribution!=null:: ::set basket = getBasket(m.userId,distribution._place.id,distribution.date):: <div class="basketNumber" ::cond basket!=null:: > <i class="fa fa-shopping-basket" aria-hidden="true"></i> N°::basket.num:: </div> ::end:: ::m.userName:: ::if m.userName2!=null:: <span class="glyphicon glyphicon-refresh"></span> ::_("alternated with"):: ::m.userName2:: ::end:: ::set name = m.userName :: ::set name2 = m.userName2 :: ::set totalAdh = totalAdh+1:: </td> <td> <!-- ::if distribution!=null:: <a href="/contractAdmin/edit/::c.id::/::m.userId::?d=::distribution.id::" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-edit"></span> ::_("Edit")::</a> ::else:: <a href="/contractAdmin/edit/::c.id::/::m.userId::" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-edit"></span> ::_("Edit")::</a> ::end:: --> ::if distribution!=null:: <a class="btn btn-default btn-xs" onclick="_.initOrderBox(::m.userId::,::distribution.id::,::distribution._contract.id::,::distribution._contract.type::,'::escapeJS(hDate(distribution.date))::','::escapeJS(distribution._place.toString())::','::escapeJS(m.userName)::','::user.getAmap().currency::',::user.getAmap().hasPayments()::,'/contractAdmin/orders/::c.id::?d=::distribution.id::')"> <span class="glyphicon glyphicon-edit"></span> ::_("Edit"):: </a> ::else:: <a class="btn btn-default btn-xs" onclick="_.initOrderBox(::m.userId::, null, ::c.id::,::c.type::, null, null, '::escapeJS(m.userName)::','::user.getAmap().currency::',::user.getAmap().hasPayments()::,'/contractAdmin/orders/::c.id::')"> <span class="glyphicon glyphicon-edit"></span> ::_("Edit"):: </a> ::end:: </td> </tr> <tr> <th>::_("Prod. ID")::</th> <th>::_("Qty")::</th> <th>::_("Product")::</th> <th><a href="#" data-toggle="tooltip" data-placement="top" title="::_("Unit price including taxes")::">::_("U.P||price per unit")::</a></th> <th>::_("Sub-total")::</th> <th>::_("Fees")::</th> <th>::_("Total")::</th> <th>::_("Paid")::</th> </tr> ::end:: ::if m.disabled==true:: ::set class="danger":: ::else:: ::set class="":: ::end:: <tr class="::class::"> <td class="ref"> $$nullSafe(::m.productRef::) </td> <td> ::if(m.quantity==0 && m.canceled):: <span style="color:#AAA">::_("Canceled")::</span> ::else:: ::raw m.smartQt:: ::end:: </td> <td> ::m.productName:: </td> <td> ::formatNum(m.productPrice):: ::currency():: </td> <td> ::formatNum(m.subTotal):: ::currency():: </td> <td> <!-- frais --> ::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:: </td> <td> ::if !m.canceled && m.quantity!=0:: ::if m.paid==true:: <span style="color:#00AA00;">::_("Paid")::</span> ::else:: <span style="color:#DD0000;">::_("Not paid")::</span> ::end:: ::end::
::if(m.quantity==0):: ::if distribution==null:: <a href="/contractAdmin/orders/::c.id::?delete=::m.id::&token=::token::" $$confirm(::__("Do you really want to delete this order row for the product \"::productName::\" ?",{productName:m.productName})::) class="btn btn-danger btn-xs" > <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> ::_("Delete"):: </a> ::else:: <a href="/contractAdmin/orders/::c.id::?d=::distribution.id::&delete=::m.id::&token=::token::" $$confirm(::__("Do you really want to delete this order row for the product \"::productName::\" ?",{productName:m.productName})::) class="btn btn-danger btn-xs" > <span class="glyphicon glyphicon-remove" aria-hidden="true"></span> ::_("Delete"):: </a> ::end:: ::end::
</td> </tr> ::end:: <tr style="background:#DDD;"> <th colspan="6">::_("Total")::</th> <th>::formatNum(total):: ::currency()::</th> <th></th> </tr>
</table>
<div style="margin-top:18px;margin-bottom:18px;"> ::raw __("<b>::totalAdh::</b> member(s) in this distribution.",{totalAdh:totalAdh}):: </div>
::end::
|