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.
 
 
 
 
 
 

284 lines
8.0 KiB

::use 'design.mtt'::
<div class="col-md-12">
<div class="article">
<div class="text-center">
<h3>
::_("Validate the delivery of the"):: ::hDate(date)::
</h3>
<h4
><span class="glyphicon glyphicon-map-marker"></span>::place::
</h4>
</div>
::set total = 0::
<table class="table table-condensed table-bordered">
<tr style="background-color:#DDD;">
<th colspan="9" class="text-center">Commande</th>
</tr>
<tr class="head">
<td colspan="9">
<div class="basketNumber" ::cond basket!=null:: >
<i class="fa fa-shopping-basket" aria-hidden="true"></i> N°::basket.num::
</div>
::member.getName()::
</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>
::foreach o orders::
<tr>
<td>
<a href="/contractAdmin/view/::o.contractId::">
::short(o.contractName,40)::
</a>
</td>
<td>
::raw o.smartQt:
</td>
<td>
$$nullSafe(::o.productRef::)
</td>
<td>
::short(o.productName,40)::
</td>
<td>
::formatNum(o.productPrice)::&nbsp;::currency()::
</td>
<td>
::formatNum(o.subTotal)::&nbsp;::currency()::
</td>
<td>
<!-- fees -->
::if o.percentageValue!=null::
<a href="#" data-toggle="tooltip" data-placement="top" title="::o.percentageName:: : ::o.percentageValue:: %">
::formatNum(o.fees)::&nbsp;::currency()::
</a>
::end::
</td>
<td>
<!-- total -->
::formatNum(o.total)::&nbsp;::currency()::
::set total = total + o.total::
</td>
<td>
$$check(::o.paid::)
</td>
</tr>
::end::
<tr class="subrow">
<th colspan="7" class="text-right">::_("Total ordered")::</th>
<th>::formatNum(total)::&nbsp;::currency()::</th>
<th></th>
</tr>
</table>
::if (user._amap.hasShopMode())::
<!-- PAYMENT CHECK FOR SHOP MODE -->
<table class="table table-condensed table-bordered">
<tr style="background-color:#DDD;">
<th colspan="9" class="text-center">::_("Payment")::</th>
</tr>
::set op = basket.getOrderOperation(false)::
::if op!=null::
<tr>
$$operation(::op::)
<td></td>
</tr>
::set tpaid = 0::
::foreach tt op.getRelatedPayments()::
<tr>
$$operation(::tt::)
::if !tt.pending::
::set tpaid = tpaid + tt.amount::
::end::
<td>
::if(tt.pending)::
<a href="/validate/::date::/::place.id::/::member.id::/validateOp/::tt.id::?token=::token::" class="btn btn-primary btn-sm">
<span class="glyphicon glyphicon-ok"></span>
::_("This payment was received")::
</a>
$$delete(::_("Del.")::,/validate/::date::/::place.id::/::member.id::/deleteOp/::tt.id::?token=::token::)
::end::
</td>
</tr>
::end::
::set amount = numClean(op.amount)::
::set tpaid = numClean(tpaid)::
<!-- total -->
<tr style="background-color:#DDD;">
<td colspan="2"></td>
<th class="text-right">::_("Total paid")::</th>
<th>
::tpaid::&nbsp;::currency()::
</th>
<td colspan="2">
</td>
</tr>
::else::
<tr><td>
<div class="alert alert-danger text-center" style="width:50%;margin:auto;">
::_("This order has been made when payments were disabled")::
</div>
</td></tr>
::end::
</table>
<!-- credit / debit / ok message -->
::if(tpaid!=null && amount!=null)::
::if(tpaid+amount != 0)::
::set class="danger"::
::else::
::set class="success"::
::end::
<div class="alert alert-::class:: text-center" style="width:50%;margin:12px auto">
::if(tpaid+amount > 0)::
$$check(::false::)
::set str = Math.abs(tpaid+amount)+"&nbsp;"+currency()::
::raw __("Paid too much, credit of ::amount::",{amount:str})::
::elseif(tpaid+amount < 0)::
$$check(::false::)
::_("Missing"):: ::Math.abs(tpaid+amount):: ::currency()::
::else::
$$check(::true::) ::_("Everything is allright !")::
::end::
</div>
::end::
<p class="text-center" ::cond op!=null::>
$$insert(::_("Key-in a refund")::,/validate/::date::/::place.id::/::member.id::/addRefund/)
$$insert(::_("Key-in a payment")::,/validate/::date::/::place.id::/::member.id::/addPayment/)
</p>
<p class="text-center">
<!--
::if(op!=null && tpaid+op.amount < 0)::
<a href="" class="btn btn-default btn-lg disabled">
<span class="glyphicon glyphicon-ok"></span>
::_("Validate this order")::
</a>
<div class="alert alert-danger text-center" style="width:50%;margin:auto;">
::raw _("You cannot validate this order because the amount paid<br/> by the member does not correspond to the total amount of his order!")::
</div>
::else::
-->
<a href="/validate/::date::/::place.id::/::member.id::/validate/?token=::token::" class="btn btn-primary btn-lg">
<span class="glyphicon glyphicon-ok"></span>
::_("Validate this order")::
</a>
<!--::end::-->
</p>
::else::
<!-- PAYMENT CHECK FOR STANDARD MODE -->
<table class="table table-condensed table-bordered">
<tr style="background-color:#DDD;">
<th colspan="9" class="text-center">
Solde de l'adhérent <a href="/member/payments/::member.id::" target="_blank" class="btn btn-default btn-xs">::_("Details")::</a>
</th>
</tr>
::foreach op operations::
<tr>
$$operation(::op::)
<td>
::if(op.pending && op.type==2)::
<a href="/validate/::date::/::place.id::/::member.id::/validateOp/::op.id::?token=::token::" class="btn btn-primary btn-sm">
<span class="glyphicon glyphicon-ok"></span>
::_("This payment has been received")::
</a>
$$delete(Suppr.,/validate/::date::/::place.id::/::member.id::/deleteOp/::op.id::?token=::token::)
::end::
</td>
</tr>
::end::
<tr style="font-size:1.3em;">
<td colspan="2"></td>
<td>Solde&nbsp;:</td>
::if balance<0::
::set color = "C00"::
::else::
::set color = "0C0"::
::end::
<td style="color:#::color::;">
::balance::&nbsp;::currency()::
</td>
<td></td>
</tr>
</table>
<p class="text-center">
$$insert(::_("Key-in a refund")::,/validate/::date::/::place.id::/::member.id::/addRefund/)
$$insert(::_("Key-in a payment")::,/validate/::date::/::place.id::/::member.id::/addPayment/)
</p>
<p class="text-center">
::if(balance < 0)::
<a href="" class="btn btn-default btn-lg disabled">
<span class="glyphicon glyphicon-ok"></span>
::_("Validate this order")::
</a>
<div class="alert alert-danger text-center" style="width:50%;margin:auto;">
::raw _("You cannot validate this order<br/>because the balance of the member is negative")::
</div>
::else::
<a href="/validate/::date::/::place.id::/::member.id::/validate/?token=::token::" class="btn btn-primary btn-lg">
<span class="glyphicon glyphicon-ok"></span>
::_("Validate this order")::
</a>
::end::
</p>
::end::
<!-- END -->
<p class="text-center">
<a href="/distribution/validate/::date::/::place.id::" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-chevron-left"></span> ::_("Back to the delivery validation")::
</a>
<a href="/member/payments/::member.id::" target="_blank" class="btn btn-default btn-sm">::_("Payment history of this member")::</a>
</p>
</div>
</div>
::end::