::use 'design.mtt'::

Distribution du ::hDate(date)::

::place::



::set total = 0:: ::set subtotal = 0:: ::set contractTotal = 0:: ::foreach m orders:: ::set i = repeat.m.index:: ::if orders[i-1]==null || m.userName != orders[i-1].userName || m.userName2 != orders[i-1].userName2:: ::end:: ::if ctotal && (orders[i+1]==null || m.contractName != orders[i+1].contractName || m.userName != orders[i+1].userName ):: ::set contractTotal = 0:: ::end:: ::if (orders[i+1]==null || m.userName != orders[i+1].userName) :: ::if subtotal!=0:: ::set subtotal = 0:: ::end:: ::end:: ::end::
::set basket = getBasket(m.userId,place.id,date)::
::_("Num"):: ::basket.num::
::m.userName:: ::if m.userName2!=null:: ::_("alternately with"):: ::m.userName2:: ::end:: ::set contractTotal = 0::
::_("Contract"):: ::_("Qty"):: ::_("Ref"):: ::_("Product"):: ::_("U.P."):: ::_("Sub-total"):: ::_("Fees"):: ::_("Total"):: ::_("Paid")::
::short(m.contractName,40):: ::if(m.quantity==0 && m.canceled):: ::_("Canceled"):: ::else:: ::raw m.smartQt:: ::end:: $$nullSafe(::m.productRef::) ::short(m.productName,40):: ::formatNum(m.productPrice):: ::currency():: ::formatNum(m.subTotal):: ::currency():: ::if m.percentageValue!=null:: ::formatNum(m.fees):: ::currency():: ::end:: ::formatNum(m.total):: ::currency():: ::set total = total + m.total:: ::set subtotal = subtotal + m.total:: ::set contractTotal = contractTotal + m.total:: ::if m.paid==true:: ::_("Paid"):: ::else:: ::_("Not paid"):: ::end::
Total ::m.contractName:: ::formatNum(contractTotal):: ::currency()::
::_("Total member"):: ::formatNum(subtotal):: ::currency()::
::_("Total of all orders:"):: ::formatNum(total):: ::currency()::
::end::