code from amapei

This commit is contained in:
cagette@ct8
2020-09-26 18:25:18 +00:00
parent 42fe367911
commit 72b4699871
1966 changed files with 220437 additions and 2 deletions
+156
View File
@@ -0,0 +1,156 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>::_("Attendance sheet")::</title>
<link href="/css/print.css" rel="stylesheet"/>
</head>
<body>
<h2>
::contract._amap.name:: -
::__("Distribution of the ::date::, from ::from:: to ::to::",{date:dDate(distrib.date),from:hHour(distrib.date),to:hHour(distrib.end)})::
</h2>
<h2>
::distrib._contract.name:: - ::distrib._contract._vendor.name::
</h2>
<p>
<span class="glyphicon glyphicon-map-marker"></span><b>::_("Place"):: : </b>
::distrib._place.toString()::, ::distrib._place.getAddress()::
</p>
<p>
::set c = contract._contact::
::set v = contract._vendor::
<b>::_("Contact in charge of the contract") :</b> ::c.firstName:: ::c.lastName::, ::c.email::, ::c.phone::
</p>
<p>
<b>::_("Farmer"):: : </b>
::v.name:: ,
::if v.email!=null :: ::v.email:: ::end::,
::if v.phone!=null :: ::v.phone:: ::end::
</p>
<p>
<b>::_("Members on duty"):: : </b>
::if distrib._distributor1!=null:: ::distrib._distributor1.getName()::, ::end::
::if distrib._distributor2!=null:: ::distrib._distributor2.getName()::, ::end::
::if distrib._distributor3!=null:: ::distrib._distributor3.getName()::, ::end::
::if distrib._distributor4!=null:: ::distrib._distributor4.getName():: ::end::
</p>
<p>::raw nl2br(distrib._contract._amap.txtDistrib)::</p>
<table class="table table-bordered table-hover" style="width:100%;">
::set total = 0:: <!-- big total -->
::set subtotal = 0:: <!-- total per user -->
::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 class="name">
<td colspan="8">
<span style="font-size:1.3em;">
::set basket = getBasket(m.userId,distrib._place.id,distrib.date)::
<span ::cond basket!=null::>N°::basket.num:: - </span>
::m.userName::
</span>
::set u = getUser(m.userId)::
::if u !=null && u.phone!=null::
- Tél. $$nullSafe(::u.phone::)
::end::
::if m.userName2 != null::
::_("alternately with")::
<span style="font-size:1.3em;">
::m.userName2::
</span>
::set u = getUser(m.userId2):
::if u !=null::
- Tél. $$nullSafe(::u.phone::)
::end::
::end::
</td>
</tr>
<tr>
<th>::_("Qty")::</th>
<th>::_("Ref")::</th>
<th>::_("Product")::</th>
<th>::_("U.P.")::</th>
<th>::_("Sub-total")::</th>
<th>::_("Fees")::</th>
<th>::_("Total")::</th>
<th>::_("Signature")::</th>
</tr>
::end::
<!-- 1 order line -->
<tr class="order">
<td>
::if(m.quantity==0 && m.canceled)::
::_("Canceled")::
::else::
::raw m.smartQt::
::end::
</td>
<td>
$$nullSafe(::m.productRef::)
</td>
<td>
::m.productName::
</td>
<td>
::formatNum(m.productPrice)::&nbsp;::currency()::
</td>
<td>
::formatNum(m.subTotal)::&nbsp;::currency()::
</td>
<td>
<!-- frais -->
::if m.percentageValue!=null::
::formatNum(m.fees)::&nbsp;::currency()::
::end::
</td>
<td>
<!-- total -->
::formatNum(m.total)::&nbsp;::currency()::
::set total = total + m.total::
::set subtotal = subtotal + m.total::
</td>
<td style="width:20%;">
</td>
</tr>
<!-- member total -->
::if (orders[i+1]==null || m.userName != orders[i+1].userName || m.userName2 != orders[i+1].userName2) ::
::if subtotal!=0::
<tr>
<td colspan="5"></td>
<td class="total text-right">::_("TOTAL")::</td>
<td class="total">::formatNum(subtotal)::&nbsp;::currency()::</td>
<td></td>
::set subtotal = 0::
</tr>
::end::
::end::
::end::
<!-- big total -->
<tr style="font-size:1.3em;">
<td class="text-right">::_("Total order:"):: </td>
<td>::formatNum(total)::&nbsp;::currency()::</td>
<td colspan="6"></td>
</tr>
</table>
<p class="hidden"><i>::_("Push on \"Control + P\" to print this page.")::</i></p>
</body>
</html>
+252
View File
@@ -0,0 +1,252 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>::_("Attendance sheet")::</title>
<link href="/css/print.css" rel="stylesheet"/>
</head>
<body>
<h1>::user._amap.name::</h1>
<h2>Livraison du ::hDate(date)::</h2>
<table style="width:100%;">
::set name = ""::
::set name2 = ""::
::set total = 0::
::set productNum = 0::
<tr>
<th>::_("Name")::</th>
<th>::_("Contact details")::</th>
<th>::_("Qty")::</th>
<th>::_("Product")::</th>
<th>::_("U.P.")::</th>
<th>::_("Fees")::</th>
<th>::_("Total")::</th>
<th>::_("Signature")::</th>
</tr>
::foreach m orders::
::if m.userName != name || m.userName2 != name2::
::set class="name"::
::else::
::set class=""::
::end::
<tr class="::class::">
<td>
::if m.userName != name || m.userName2 != name2::
::set basket = getBasket(m.userId,place.id,date)::
<span ::cond basket!=null::>::_("Num"):: ::basket.num:: - </span>
<b>::m.userName::</b>
::if m.userName2 != null::
<br />::_("alternately with"):: <b>::m.userName2::</b>
::end::
::set total = 0::
::set productNum = 0::
::end::
</td>
<td>
::if m.userName != name || m.userName2 != name2::
::set u = getUser(m.userId):
::if u !=null::
$$nullSafe(::u.phone::)
::end::
::if m.userName2 != null::
::set u = getUser(m.userId2):
::if u !=null::
<br />$$nullSafe(::u.phone::)
::end::
::end::
::end::
</td>
::set name = m.userName ::
::set name2 = m.userName2 ::
<td>
::if(m.quantity==0 && m.canceled)::
::_("Canceled")::
::else::
::raw m.smartQt::
::end::
::set productNum = productNum+m.quantity::
</td>
<td>
::m.productName::
</td>
<td>
::formatNum(m.productPrice)::&nbsp;::currency()::
</td>
<td>
::if m.fees!=null::
::formatNum(m.fees)::&nbsp;::currency()::
::end::
</td>
<td>
::formatNum(m.total)::&nbsp;::currency()::
::set total = total + m.total::
</td>
<td style="width:20%;"></td>
</tr>
<!--TOTAL-->
::set next = orders[repeat.m.index+1]::
::if next==null || next.userName!=name || next.userName2!=name2::
<tr>
<td></td>
<td></td>
<td class="total">::formatNum(productNum)::</td>
<td class="total" colspan="2"></td>
<td class="total">::_("TOTAL")::</td>
<td class="total">::formatNum(total)::&nbsp;::currency()::</td>
<td></td>
</tr>
<!-- PAIEMENTS -->
<tr ::cond user._amap.hasPayments()::>
<!-- PAYMENT CHECK FOR SHOP MODE -->
::if (user._amap.hasShopMode())::
<td></td>
<th>::_("Payment:"):: </th>
<td colspan="6">
<table style="width:100%;border:1px solid #CCC;">
::if(basket!=null)::
::set tpaid=0::
::set op = basket.getOrderOperation(false)::
::if op!=null::
::foreach p op.getRelatedPayments()::
<tr>
<td style="min-width:30px;">
::if(p.pending==true)::
<img src="/img/tick_no.png"/>
::else::
<img src="/img/tick_ok_me.png"/>
::end::
</td>
<td>
::formatNum(p.amount):: ::currency()::
::set tpaid = p.amount+tpaid::
</td>
<td>
::p.name::
</td>
</tr>
::end::
::end::
<!-- bug : 2 vars are the same but == doesnt work -->
::set total = numClean(total)::
::set tpaid = numClean(tpaid)::
::if(total!=tpaid)::
<tr style="background-color:#EEE;">
<td><img src="/img/tick_no.png"/></td>
<td>::formatNum(total-tpaid):: ::currency()::</td>
<td>
::if(total>tpaid)::
::_("To be paid"):: ::formatNum(total-tpaid):: ::currency()::
::else::
::_("Pay back"):: ::formatNum(tpaid-total):: ::currency()::
::end::
</td>
</tr>
::end::
::end::
</table>
</td>
::else::
<!-- PAYMENT CHECK FOR STANDARD MODE -->
<td></td>
::set ua = u.getUserAmap(user._amap)::
::set balance = ua.balance::
<th>::_("Balance of the member:"):: ::ua.balance:: ::currency()::</th>
<td colspan="6">
::set pending = 0::
<table style="width:100%;border:1px solid #CCC;">
<!-- payment to confirm -->
::foreach p ua.getLastOperations(5)::
::if p.type==2 && p.pending==true::
<tr>
<td style="width:30px;">
::if(p.pending==true)::
<img src="/img/tick_no.png"/>
::else::
<img src="/img/tick_ok_me.png"/>
::end::
</td>
<td>
::formatNum(p.amount):: ::currency()::
- ::p.name::
::set pending = pending + p.amount::
</td>
</tr>
::end::
::end::
<!-- need to pay more or cash back -->
::if(balance<0 && balance+pending!=0)::
<tr style="background-color:#EEE;">
<td style="width:30px;"><img src="/img/tick_no.png"/></td>
<td>
::if(balance+pending<0)::
::_("To be paid"):: ::formatNum(abs(balance+pending)):: ::currency():: pour équilibrer le solde
::else::
::_("Pay back"):: ::formatNum(balance+pending):: ::currency():: pour équilibrer le solde
::end::
</td>
</tr>
::end::
</table>
</td>
::end::
</tr>
::end::
::end::
</table>
<p>::raw nl2br(user.getAmap().txtDistrib)::</p>
<p class="hidden">
<i>::_("Push on \"Control + P\" to print this page.")::</i>
</p>
<table class="" ::cond sqlLog::>
::foreach r sqlLog::
<tr ::attr class if(r.bad) 'badSql'::>
<td>::r.t::ms</td>
<td>::r.length::</td>
<td><a href="#" onclick="javascript:alert('::r.explain::');return false;">Exp</a></td>
<td><a href="#" onclick="javascript:alert('::r.stack::');return false;">Stack</a></td>
<td>::r.sql::</td>
</tr>
::end::
</table>
</body>
</html>
@@ -0,0 +1,163 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>::_("Attendance sheet")::</title>
<link href="/css/print.css" rel="stylesheet"/>
</head>
<body>
<!-- page head-->
::fill head::
<td >
<h1 style='text-align:right;'>::user._amap.name::</h1>
<h2 style='text-align:right;'>::_("Delivery of the"):: ::hDate(date)::</h2>
</td>
::end::
<!-- table header -->
::fill tableHeader::
<tr>
<th>::_("Qty")::</th>
<th>::_("Product")::</th>
<th>::_("U.P.")::</th>
<th>::_("Fees")::</th>
<th>::_("Total")::</th>
<th>::_("Signature")::</th>
</tr>
::end::
::set name = ""::
::set name2 = ""::
::set total = 0::
::set productNum = 0::
::foreach m orders::
::if m.userName != name || m.userName2 != name2::
::if name != ""::
::raw "</table> <hr />"::
::end::
::raw "<table style='width:100%;'>" ::
<tr>
<td style='width:33%;'>
<b style="font-size:150%;">
::set basket = getBasket(m.userId,place.id,date)::
<span ::cond basket!=null::>::_("Num"):: ::basket.num:: - </span>
::m.userName::
</b>
::set total = 0::
::set productNum = 0::
</td>
<td>
::set u = getUser(m.userId):
::if u!=null && u.phone!=null::
Tél: $$nullSafe(::u.phone::)
::end::
</td>
<td style='text-align:right;'>
<b>::user._amap.name::</b>
</td>
</tr>
<tr>
<td>
::if m.userName2 != null::
::_("alternately with")::<br/>
<b>::m.userName2::</b>
::set total = 0::
::set productNum = 0::
::end::
</td>
<td>
::if m.userName2 != null::
::set u = getUser(m.userId2):
::if u !=null::
$$nullSafe(::u.phone::)
::end::
::end::
</td>
<td style='text-align:right;'>
<b>::_("Delivery of the"):: ::hDate(date)::</b>
</td>
</tr>
::raw "</table>" ::
::raw "<table style='width:100%;'>"::
::raw tableHeader::
::end::
::if m.userName != name || m.userName2 != name2::
::set class="name"::
::else::
::set class=""::
::end::
<tr class="::class::">
<td style="font-size: ::fontRatio::%;border-bottom: 2px solid #AAA;">
::if(m.quantity==0 && m.canceled)::
::_("Canceled")::
::else::
::raw m.smartQt::
::end::
::set productNum = productNum+m.quantity::
</td>
<td style="font-size: ::fontRatio::%;border-bottom: 2px solid #AAA;">
::m.productName::
</td>
<td>
::formatNum(m.productPrice)::&nbsp;::currency()::
</td>
<td>
::if m.fees!=null::
::formatNum(m.fees)::&nbsp;::currency()::
::end::
</td>
<td>
::formatNum(m.total)::&nbsp;::currency()::
::set total = total + m.total::
</td>
<td style="width:20%;"></td>
</tr>
::set name = m.userName ::
::set name2 = m.userName2 ::
<!--TOTAL-->
::set next = orders[repeat.m.index+1]::
::if next==null || next.userName!=name || next.userName2!=name2::
<tr>
<td class="total">::formatNum(productNum)::</td>
<td class="total" colspan="2"></td>
<td class="total">::_("TOTAL")::</td>
<td class="total" style="font-size: ::fontRatio::%;">::formatNum(total)::&nbsp;::currency()::</td>
<td></td>
</tr>
::end::
::end::
<p>::raw nl2br(user.getAmap().txtDistrib)::</p>
<p class="hidden"><i>::_("Push on \"Control + P\" to print this page.")::</i></p>
<table class="" ::cond sqlLog::>
::foreach r sqlLog::
<tr ::attr class if(r.bad) 'badSql'::>
<td>::r.t::ms</td>
<td>::r.length::</td>
<td><a href="#" onclick="javascript:alert('::r.explain::');return false;">Exp</a></td>
<td><a href="#" onclick="javascript:alert('::r.stack::');return false;">Stack</a></td>
<td>::r.sql::</td>
</tr>
::end::
</table>
</body>
</html>
@@ -0,0 +1,178 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>::_("Attendance sheet")::</title>
<link href="/css/print.css" rel="stylesheet"/>
</head>
<body>
<!-- page head-->
::fill head::
<td >
<h1 style='text-align:right;'>::user._amap.name::</h1>
<h2 style='text-align:right;'>::_("Delivery of the"):: ::hDate(date)::</h2>
</td>
::end::
<!-- table header -->
::fill tableHeader::
<tr>
<th>::_("Contract")::</th>
<th>::_("Qty")::</th>
<th>::_("Product")::</th>
<th>::_("U.P.")::</th>
<th>::_("Fees")::</th>
<th>::_("Total")::</th>
<th>::_("Signature")::</th>
</tr>
::end::
::set name = ""::
::set name2 = ""::
::set total = 0::
::set productNum = 0::
::set currentContract = ""::
::foreach m orders::
::if m.userName != name || m.userName2 != name2::
::if name != ""::
::raw "</table> <hr />"::
::end::
::raw "<table style='width:100%;'>" ::
<tr>
<td style='width:33%;'>
<b style="font-size:150%;">
::set basket = getBasket(m.userId,place.id,date)::
<span ::cond basket!=null::>N°::basket.num:: - </span>
::m.userName::
</b>
::set total = 0::
::set productNum = 0::
</td>
<td>
::set u = getUser(m.userId):
::if u!=null && u.phone!=null::
Tél: $$nullSafe(::u.phone::)
::end::
</td>
<td style='text-align:right;'>
<b>::user._amap.name::</b>
</td>
</tr>
<tr>
<td>
::if m.userName2 != null::
::_("alternately with")::<br/>
<b>::m.userName2::</b>
::set total = 0::
::set productNum = 0::
::end::
</td>
<td>
::if m.userName2 != null::
::set u = getUser(m.userId2):
::if u !=null::
$$nullSafe(::u.phone::)
::end::
::end::
</td>
<td style='text-align:right;'>
<b>::_("Delivery of the"):: ::hDate(date)::</b>
</td>
</tr>
::raw "</table>" ::
::raw "<table style='width:100%;'>"::
::raw tableHeader::
::end::
::if m.userName != name || m.userName2 != name2::
::set class="name"::
::set currentContract = ""::
::else::
::set class=""::
::end::
<tr class="::class::">
::if currentContract != short(m.contractName,40) ::
::if currentContract == "" ::
::set td_style="font-size:" + fontRatio + "%" ::
::else::
::set td_style="font-size:" + fontRatio + "%;border-top: 2px solid #AAA;" ::
::end::
<td style="::td_style::" >
::short(m.contractName,40)::
</td>
::set currentContract = short(m.contractName,40)::
::else::
<td> </td>
::end::
<td style="font-size: ::fontRatio::%;border-bottom: 2px solid #AAA;">
::if(m.quantity==0 && m.canceled)::
::_("Canceled")::
::else::
::raw m.smartQt::
::end::
::set productNum = productNum+m.quantity::
</td>
<td style="font-size: ::fontRatio::%;border-bottom: 2px solid #AAA;">
::m.productName::
</td>
<td>
::formatNum(m.productPrice)::&nbsp;::currency()::
</td>
<td>
::if m.fees!=null::
::formatNum(m.fees)::&nbsp;::currency()::
::end::
</td>
<td>
::formatNum(m.total)::&nbsp;::currency()::
::set total = total + m.total::
</td>
<td style="width:20%;"></td>
</tr>
::set name = m.userName ::
::set name2 = m.userName2 ::
<!--TOTAL-->
::set next = orders[repeat.m.index+1]::
::if next==null || next.userName!=name || next.userName2!=name2::
<tr>
<td style="border-top: 2px solid #AAA;"></td>
<td class="total">::formatNum(productNum)::</td>
<td class="total" colspan="2"></td>
<td class="total">::_("TOTAL")::</td>
<td class="total" style="font-size: ::fontRatio::%;">::formatNum(total)::&nbsp;::currency()::</td>
<td></td>
</tr>
::end::
::end::
<p>::raw nl2br(user.getAmap().txtDistrib)::</p>
<p class="hidden"><i>::_("Push on \"Control + P\" to print this page.")::</i></p>
<table class="" ::cond sqlLog::>
::foreach r sqlLog::
<tr ::attr class if(r.bad) 'badSql'::>
<td>::r.t::ms</td>
<td>::r.length::</td>
<td><a href="#" onclick="javascript:alert('::r.explain::');return false;">Exp</a></td>
<td><a href="#" onclick="javascript:alert('::r.stack::');return false;">Stack</a></td>
<td>::r.sql::</td>
</tr>
::end::
</table>
</body>
</html>
@@ -0,0 +1,115 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>::_("Attendance sheet")::</title>
<link href="/css/print.css" rel="stylesheet"/>
</head>
<body>
<h1>::user._amap.name::</h1>
<h2>Livraison du ::hDate(date)::</h2>
<table style="width:100%;">
::set name = ""::
::set name2 = ""::
::set total = 0::
::set productNum = 0::
<tr style="font-size:120%">
<th>::_("Name")::</th>
<th>::_("Contact details")::</th>
<th>::_("Qty")::</th>
<th>::_("Product")::</th>
<th>::_("Signature")::</th>
</tr>
::foreach m orders::
::if m.userName != name || m.userName2 != name2::
::set class="name"::
::else::
::set class=""::
::end::
<tr class="::class::">
<td style="font-size:120%">
::if m.userName != name || m.userName2 != name2::
<b>
::set basket = getBasket(m.userId,place.id,date)::
<span ::cond basket!=null::>N°::basket.num:: - </span>
::m.userName::
</b>
::if m.userName2 != null::
<br />::_("alternately with"):: <b>::m.userName2::</b>
::end::
::set total = 0::
::set productNum = 0::
::end::
</td>
<td>
::if m.userName != name || m.userName2 != name2::
::set u = getUser(m.userId):
::if u !=null::
$$nullSafe(::u.phone::)
::end::
::if m.userName2 != null::
::set u = getUser(m.userId2):
::if u !=null::
<br />$$nullSafe(::u.phone::)
::end::
::end::
::end::
</td>
::set name = m.userName ::
::set name2 = m.userName2 ::
<td>
::if(m.quantity==0 && m.canceled)::
::_("Canceled")::
::else::
::raw m.smartQt::
::end::
::set productNum = productNum+m.quantity::
</td>
<td>
::m.productName::
</td>
<td style="width:20%;"></td>
</tr>
::set next = orders[repeat.m.index+1]::
::end::
</table>
<p>::raw nl2br(user.getAmap().txtDistrib)::</p>
<p class="hidden">
<i>::_("Push on \"Control + P\" to print this page.")::</i>
</p>
<table class="" ::cond sqlLog::>
::foreach r sqlLog::
<tr ::attr class if(r.bad) 'badSql'::>
<td>::r.t::ms</td>
<td>::r.length::</td>
<td><a href="#" onclick="javascript:alert('::r.explain::');return false;">Exp</a></td>
<td><a href="#" onclick="javascript:alert('::r.stack::');return false;">Stack</a></td>
<td>::r.sql::</td>
</tr>
::end::
</table>
</body>
</html>
@@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>::_("Attendance sheet")::</title>
<link href="/css/print.css" rel="stylesheet"/>
</head>
<body>
<h2>
::contract._amap.name:: -
::__("Distribution of the ::date::, from ::from:: to ::to::",{date:dDate(distrib.date),from:hHour(distrib.date),to:hHour(distrib.end)})::
</h2>
<h2>
::distrib._contract.name:: - ::distrib._contract._vendor.name::
</h2>
<p>
<span class="glyphicon glyphicon-map-marker"></span><b>::_("Place"):: : </b>
::distrib._place.toString()::, ::distrib._place.getAddress()::
</p>
<p>
::set c = contract._contact::
::set v = contract._vendor::
<b>::_("Contact in charge of the contract") :</b> ::c.firstName:: ::c.lastName::, ::c.email::, ::c.phone::
</p>
<p>
<b>::_("Farmer"):: : </b>
::v.name:: ,
::if v.email!=null :: ::v.email:: ::end::,
::if v.phone!=null :: ::v.phone:: ::end::
</p>
<p>
<b>::_("Members on duty"):: : </b>
::if distrib._distributor1!=null:: ::distrib._distributor1.getName()::, ::end::
::if distrib._distributor2!=null:: ::distrib._distributor2.getName()::, ::end::
::if distrib._distributor3!=null:: ::distrib._distributor3.getName()::, ::end::
::if distrib._distributor4!=null:: ::distrib._distributor4.getName():: ::end::
</p>
<table class="table table-bordered table-hover" style="width:100%;">
<tr>
<th></th>
::foreach p products::
<th>
::p.name::<br/>
::p.ref::
</th>
::end::
<th>TOTAL</th>
</tr>
::foreach user users::
<tr>
<th>
::set basket = getBasket(user.id,distrib._place.id,distrib.date)::
<span ::cond basket!=null::>N°::basket.num:: - </span>
::user.getCoupleName()::
</th>
::foreach p products::
<td>
::set o = orders.get(user.id).get(p.id)::
::if(o!=null)::
::raw o.smartQt::
::end::
</td>
::end::
<th>::formatNum(totalByUser(user.id)):: ::currency()::</th>
</tr>
::end::
<tr>
<th>TOTAL</th>
::foreach p products::
<th>
::set q = totalByProduct(p.id)::
::if(p.qt!=null && (p.hasFloatQt || p.variablePrice) )::
::q * p.qt:: ::unit(p._unitType,false)::
::else::
::q::
::end::
</th>
::end::
</tr>
</table>
<p>::raw nl2br(distrib._contract._amap.txtDistrib)::</p>
<p class="hidden"><i>::_("Push on \"Control + P\" to print this page.")::</i></p>
</body>
</html>
+110
View File
@@ -0,0 +1,110 @@
::use 'design.mtt'::
<div id="content" class="col-md-12">
<div class="article">
<h2>::_("Planning of deliveries:"):: ::contract.name::</h2>
<p>
::raw _("Subscribe now by selecting checkboxes corresponding to dates which are convenient for you. The goal of attendances consists in helping during the delivery of products.")::
</p>
<div style="overflow-x:scroll;">
<table class="table table-bordered">
<tr>
<td></td>
::foreach d distribs::
::set date = getDate(d.date)::
<th style="font-size:12px;line-height:14px;text-align:center;background-color:#DED;">::date.dow::<br/>
::date.d::<br/>
::date.m::<br/>
::date.h+":"+date.i::</th>
::end::
</tr>
<!-- current user -->
<tr>
<td style="white-space: nowrap;">
<b>::user.getCoupleName()::</b>
</td>
<script>
window.reg = function(distribId,img){
$(img).hide();
$.ajax("/distribution/register?register=1&distrib="+distribId,{success:function(data){
//alert("data : "+data);
$(img).show();
img.src="/img/tick_ok_me.png";
img.onclick = function(){
unreg(distribId,img);
};
}});
};
window.unreg = function(distribId,img){
$(img).hide();
$.ajax("/distribution/register?register=0&distrib="+distribId,{success:function(data){
//alert("data : "+data+", "+$(this));
$(img).show();
img.src="/img/tick_no.png";
img.onclick = function(){
reg(distribId,img);
};
}});
};
</script>
::set me = doodle.get(user.id)::
::foreach d distribs::
<td style="text-align:center;">
::if me !=null::
::set a = me.planning.get(d.id)::
::if a!=null::
<img src="/img/tick_ok_me.png" onclick="unreg('::d.id::',this)" />
::else::
::if !d.hasEnoughDistributors()::
<img src="/img/tick_no.png" onclick="reg('::d.id::',this)" />
::else::
<span style="color: #AAA;font-size: 80%;">::_("full")::</span>
::end::
::end::
::else::
::if !d.hasEnoughDistributors()::
<img src="/img/tick_no.png" onclick="reg('::d.id::',this)" />
::else::
::_("full")::
::end::
::end::
</td>
::end::
</tr>
<!-- other users-->
::foreach doo doodle::
<tr ::cond doo.user.id!=user.id:: style="background-color:#EEE;">
<td>::doo.user.getCoupleName()::</td>
::foreach d distribs::
<td style="text-align:center;">
::set a = doo.planning.get(d.id)::
::if a!=null::
<img src="/img/tick_ok.png"/>
::end::
</td>
::end::
</tr>
::end::
</table>
</div>
<div style="text-align:right">
<a href="/" class="btn btn-default btn-lg">::_("Validate")::</a>
</div>
</div>
</div>
::end::
+92
View File
@@ -0,0 +1,92 @@
::use 'design.mtt'::
<style>
table tr td{
white-space: nowrap;
overflow-x:hidden;
}
</style>
<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>
<p>
::if(confirmed)::
<div class="alert alert-success block-center" style="width:150px;margin:auto;">
<span class="glyphicon glyphicon-ok"></span>
::_("Validated")::
</div>
::else::
<div class="alert alert-danger block-center" style="width:150px;margin:auto;">
<span class="glyphicon glyphicon-exclamation-sign"></span>
::_("Not validated")::
</div>
::end::
</p>
</div>
<p class="text-center">
<a href="/contractAdmin/ordersByDate/::date.toString().substr(0,10)::/::place.id::" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-list-alt"></span> ::_("Back to the summary sheet of orders"):: </a>
</p>
<table class="table table-bordered table-hover table-condensed" style="width:100%;">
::foreach u users::
::set basket = getBasket(u.id,place.id,date)::
::if(basket.isValidated()==true)::
::set class="success"::
::else::
::set class="danger"::
::end::
<tr class="::class::">
<td>
<div class="basketNumber" ::cond basket!=null:: >
<i class="fa fa-shopping-basket" aria-hidden="true"></i> ::_("Num"):: ::basket.num::
</div>
</td>
<td>
::u.getCoupleName()::
</td>
<td class="text-right">
::if(class=="danger")::
<a href="/validate/::date::/::place.id::/::u.id::" class="btn btn-danger">
<i class="fa fa-chevron-right" aria-hidden="true"></i>
::_("To be validated")::
</a>
::else::
<a href="/validate/::date::/::place.id::/::u.id::" class="btn">
<span class="glyphicon glyphicon-ok"></span>
::_("Validated")::
</a>
::end::
</td>
</tr>
::end::
</table>
</div>
</div>
::end::