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
@@ -0,0 +1,56 @@
::use 'design.mtt'::
<!--
<style>
.calDiv{
width:14.28%;
background:grey;
padding:2px;
height:50px;
border:solid 1px black;
display:inline-block;
}
</style>
<div class="col-md-12">
<div class="article">
<h2>::_("Calendar")::</h2>
<div class="calDiv"></div><div class="calDiv"></div><div class="calDiv"></div><div class="calDiv"></div><div class="calDiv"></div><div class="calDiv"></div><div class="calDiv"></div>
</div>
</div>
-->
<div class="col-md-12">
<div class="article">
<h2>Calendrier</h2>
<div style="-webkit-column-count: 3;-moz-column-count: 3;column-count: 3;">
::foreach c calendar::
::if c.d.getTime() < now::
::set col="0.3"::
::else::
::set col="1"::
::end::
<div style="opacity: ::col::;margin-bottom:8px;">
::hDate(c.d)::<br/>
::foreach e c.events::
<div style="margin-left:16px;margin-right:16px;width:12px;height:8px;display:inline-block;background: ::intToHex(e.color,6)::;"></div><b> ::e.name:: </b><br/>
::end::
</div>
::end::
</div>
</div>
</div>
::end::
@@ -0,0 +1,57 @@
::use 'design.mtt'::
::set c = contract::
<div class="col-md-3">
<div class="block">
<ul>
<li><a href="/contractAdmin/products/::c.id::">::_("Products")::</a></li>
<li><a href="/contractAdmin/distributions/::c.id::">::_("Deliveries")::</a></li>
<li><a href="/contractAdmin/orders/::c.id::">::_("Orders")::</a></li>
</ul>
</div>
</div>
<div class="col-md-9">
<div class="article">
<span class="title" style="margin-bottom: 18px;display: block;">::c.name:: - ::c._vendor.name::</span>
<div class="container">
<div class="span4">
<b>Produits</b>
<table class="table">
::foreach p c.getProducts()::
<tr>
<td>::p.name::</td>
<td>$$edit(modifier,/product/edit/::p.id::)</td>
</tr>
::end::
</table>
$$insert(Nouveau produit,/product/insert)
</div>
<div class="span4">
<b>::_("Deliveries")::</b>
<table class="table">
::foreach d c.getDistribs()::
<tr>
<td>::d.date.toString()::</td>
<td>$$edit(modifier,/distribution/edit/::d.id::) </td>
</tr>
::end::
</table>
$$insert(Nouvelle livraison,/distribution/insert)
</div>
</div>
<hr/>
</div>
</div>
::end::
+149
View File
@@ -0,0 +1,149 @@
::use 'design.mtt'::
<div class="col-md-12">
<!-- Distributions to validate -->
<div class="article text-center" ::cond multidistribs.length>0:: style="max-height:400px;overflow-y: auto;">
<h2>::_("Distributions to validate")::</h2>
<p>::_("You need to validate these distributions which took place recently")::</p>
::foreach m multidistribs::
<p>
::if(!m.isConfirmed())::
<a href="/distribution/validate/::m.getDate().toString().substr(0,10)::/::m.getPlace().id::" class="btn btn-primary">
::dDate(m.getDate())::, ::m.getPlace().name::
</a>
::if (isAdmin)::
<a href="/distribution/autovalidate/::m.getDate().toString().substr(0,10)::/::m.getPlace().id::" class="btn btn-danger">Admin : Autovalidate</a>
::end::
::elseif(isAdmin)::
<a class="btn btn-default disabled">
<span class="glyphicon glyphicon-ok"></span> ::dDate(m.getDate())::, ::m.getPlace().name::
</a>
<a href="/distribution/unvalidate/::m.getDate().toString().substr(0,10)::/::m.getPlace().id::" class="btn btn-danger">Admin : Unvalidate</a>
::end::
</p>
::end::
</div>
<div class="article" id="contracts">
<h2>
::if getParam("old")::
::_("Old contracts")::
::else::
::_("Contracts")::
::end::
</h2>
<table class="table">
::foreach c contracts::
::if c.endDate!=null && c.endDate.getTime() < Date.now().getTime()::
::set class = "disabled"::
::elseif c.startDate!=null && c.startDate.getTime() > Date.now().getTime()::
::set class = "disabled"::
::else::
::set class = ""::
::end::
<tr class="::class::" >
<td>
::if c._vendor._image!=null::
<div class="productImg" style="background-image:url('::file(c._vendor._image)::');width:48px;height:48px;" ></div>
::end::
</td>
<td>::c._vendor.name::</td>
<td>
<b>::c.name::</b>
</td>
<td style="font-size:0.9em;">
du ::hDate(c.startDate)::<br/>
au ::hDate(c.endDate)::
</td>
<td>
<div class="btn-group" role="group">
$$edit(::_("Manage")::,/contractAdmin/view/::c.id::)
::if user.canManageAllContracts()::
$$delete(::_("Del.||short version of delete")::,/contract/delete/::c.id::?token=::token::)
::end::
</div>
</td>
</tr>
::end::
</table>
::if user.canManageAllContracts()::
$$insert(::_("New contract")::,/contract/insert/)
::end::
<a href="/contractAdmin?old=1" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-folder-close"></span> ::_("Old contracts")::</a>
<a href="/contractAdmin/calendar" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-calendar"></span> ::_("Calendar")::</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="true">
::_("Global orders view")::
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="/contractAdmin/ordersByDate"><span class="glyphicon glyphicon-list"></span> ::_("Same day")::</a></li>
<li><a href="/contractAdmin/ordersByTimeFrame"><span class="glyphicon glyphicon-list"></span> ::_("Timeframe")::</a></li>
</ul>
</div>
</div>
</div>
<div class="col-md-6">
<div class="article" id="vendors">
<h2>::_("Farmers")::</h2>
<table class="table">
::foreach v vendors::
<tr>
<td>
::if v._image!=null::
<div class="productImg" style="background-image:url('::file(v._image)::');width:48px;height:48px;"></div>
::end::
</td>
<td><b>::v.name::</b></td>
<td>
<div class="btn-group" role="group">
$$edit(::_("Edit")::,/vendor/edit/::v.id::)
<a href="/vendor/addImage/::v.id::" class="btn btn-default btn-sm"> <span class="glyphicon glyphicon-picture"></span> ::_("Picture")::</a>
::if user.isAmapManager():: $$delete(,/vendor/delete/::v.id::?token=::token::) ::end::
</div>
</td>
</tr>
::end::
</table>
$$insert(::_("New farmer")::,/vendor/insert/)
</div>
</div>
<div class="col-md-6">
<div class="article" id="places">
<h2>::_("Delivery places")::</h2>
<table class="table">
::foreach p places::
<tr>
<td><b>::p.name::</b></td>
<td>
$$edit(::_("Edit")::,/place/edit/::p.id::)
::if user.isAmapManager():: $$delete(::_("Del.||short version for delete")::,/place/delete/::p.id::?token=::token::) ::end::
</td>
</tr>
::end::
</table>
$$insert(::_("New delivery place")::,/place/insert/)
</div>
</div>
::end::
@@ -0,0 +1,82 @@
::use 'contractadmin/design.mtt'::
<h2>::_("Distributions")::</h2>
<table class="table">
::foreach d deliveries::
::if d.date!=null && d.date.getTime() < Date.now().getTime()::
::set style = "opacity:0.5;"::
::else::
::set style = ""::
::end::
<tr style="::style::" >
<td>
::if d.distributionCycleId!=null::
<img src="/img/icons/arrow_refresh.png" style="opacity:0.5;" />
::end::
::set da = getDate(d.date)::
::if d.end!=null::
::set e = getDate(d.end)::
::end::
::da.dow:: ::da.d:: ::da.m:: de ::da.h+":"+da.i::
::if d.end!=null::
à ::e.h+":"+e.i::
::end::
</td>
<td>
::d._place.name::
</td>
<td>
<div class="btn-group">
$$edit(::_("Edit")::,/distribution/edit/::d.id::)
$$delete(::_("Delete")::,/distribution/delete/::d.id::)
<a href="/distribution/list/::d.id::" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-print"></span>&nbsp;::_("Distribution list")::</a>
</div>
</td>
</tr>
::end::
</table>
<table ::cond cycles.length>0:: class="table">
<tr>
<th>::_("Distribution cycle")::</th>
<th></th>
</tr>
::foreach c cycles::
<tr>
<td><b>
::switch c.cycleType::
::case:: ::_("Weekly")::
::case:: ::_("Monthly")::
::case:: ::_("Every 2 weeks")::
::case:: ::_("Every 3 weeks")::
::end::
</b>
: Du ::hDate(c.startDate):: au ::hDate(c.endDate)::
</td>
<td>
$$delete(::_("Del.")::,::"/distribution/deleteCycle/"+c.id::)
</td>
</tr>
::end::
</table>
$$insert(::_("One time distribution")::,/distribution/insert/::c.id::)
$$insert(::_("Distribution cycle")::,/distribution/insertCycle/::c.id::)
<a href="/contractAdmin/distributionp/::c.id::" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-user"></span> ::_("Distributions engagement")::
</a>
<a href="/contractAdmin/distributions/::c.id::?old=1" class="btn btn-default btn-sm">
::_("Old distributions")::
</a>
::end::
+44
View File
@@ -0,0 +1,44 @@
::use 'design.mtt'::
<div class="col-md-12">
<h2>::c.name:: - ::c._vendor.name::</h2>
</div>
<div class="col-md-3">
<div class="article">
<ul id="subnav" class="nav nav-pills nav-stacked">
<li id="default" ::attr class if(nav[1]=="view") 'active'::>
<a href="/contractAdmin/view/::c.id::">::_("Summary")::</a></li>
<li id="edit">
<a href="/contract/edit/::c.id::">::_("Edit contract")::</a></li>
<li id="products" ::attr class if(nav[1]=="products") 'active'::>
<a href="/contractAdmin/products/::c.id::">::_("Products")::</a></li>
<li id="deliveries" ::attr class if(nav[1]=="distributions") 'active'::>
<a href="/contractAdmin/distributions/::c.id::">::_("Distributions")::</a></li>
<li id="orders" ::attr class if(nav[1]=="orders") 'active'::>
<a href="/contractAdmin/orders/::c.id::">::_("Orders")::</a></li>
<li id="stats">
<a href="/contractAdmin/stats/::c.id::">::_("Stats")::</a></li>
::if navbar!=null::
<hr/>
::foreach i navbar::
<li ::attr class if(nav[1]==i.id) 'active'::>
<a href="::i.link::">
<span ::cond i.icon:: class="glyphicon glyphicon-::i.icon::" ></span>
::i.name::</a>
</li>
::end::
::end::
</ul>
</div>
</div>
<div class="col-md-9">
<div class="article">
::raw __content__::
</div>
</div>
::end::
@@ -0,0 +1,60 @@
::use 'contractadmin/design.mtt'::
<h2>::_("Participate to deliveries")::</h2>
<div>
::_("This page allows to see if members have participated to deliveries enough.")::
</div>
<div style="margin:16px 0 16px 0;text-align:center;" class="alert-warning">
<strong>::raw __("::distribs:: deliveries requiring ::distributorNum:: person(s)",{distribs:distribs,distributorNum:distributorNum})::,<br/>
::users:: ::_("person(s) using this contract"):: <br/>
= ::num:: ::_("participations to deliveries to do per family.")::</strong>
</div>
<table class="table table-bordered">
<tr>
<th class="col-md-5">::_("Suscriber")::</th>
<th class="col-md-5">::raw _("Number of attendances to deliveries")::</th>
<th class="col-md-2"></th>
</tr>
::foreach p participations::
<tr>
<td>
::p.user.getCoupleName()::
</td>
<td>
::p.count::
</td>
<td>
::if p.count>=numRounded::
<img src="/img/icons/accept.png" /> OK
::else::
<img src="/img/icons/stop.png" /> ::_("Insufficient")::
::end::
</td>
</tr>
::end::
</table>
::if(extParticipations.length>0)::
<hr/>
<table class="table table-bordered">
<tr>
<th class="col-md-5">::_("Member without order in this contract")::</th>
<th class="col-md-5">::raw _("Number of attendances to deliveries")::</th>
<th class="col-md-2"></th>
</tr>
::foreach p extParticipations::
<tr>
<td>::p.user.getCoupleName()::</td>
<td>::p.count::</td>
<td></td>
</tr>
::end::
</table>
::end::
::end::
+148
View File
@@ -0,0 +1,148 @@
::use 'contractadmin/design.mtt'::
::if u==null::
<h3>::_("Key-in an order")::</h3>
::else::
<h3>::_("Key-in an order for"):: ::u.getCoupleName()::</h3>
::end::
::if distribution!=null::
<p>::_("For the delivery of the"):: <b>::hDate(distribution.date)::</b></p>
::end::
<form name="order" id="order" method="POST" action="" class="form-horizontal">
<input type="hidden" name="token" value="::token::"/>
::if distribution!=null::
<input type="hidden" name="distribution" value="::distribution.id::" />
::end::
::if u==null ::
<div class="form-group">
<label for="user" class="control-label col-md-2 text-left">::_("Member:")::</label>
<div class="col-md-10">
<select name="user" id="user" class="form-control">
::foreach uu users::
<option value="::uu.value::">::uu.label::</option>
::end::
</select>
</div>
</div>
::end::
<br/>
<table class="table table-bordered">
<tr>
<th></th>
<th>::_("Product")::</th>
<th>::_("Price")::</th>
<th>::_("Quantity")::</th>
<th ::cond !user._amap.hasPayments()::>::_("Status")::</th>
::if distribution==null::<th>::_("Alternately with :")::</th>::end::
</tr>
::set total = 0::
::foreach uo userOrders::
<tr>
<td>
::if uo.product.active==false::
<img src="::uo.product.getImage()::" style="width:32px;height:32px;opacity:0.3;" />
::else::
<img src="::uo.product.getImage()::" style="width:32px;height:32px;" />
::end::
</td>
<td>
::if uo.product.active==false::
<span style="color:#AAA;">::uo.product.getName():: ::_("(inactive)")::</span>
::else::
::uo.product.getName()::
::end::
</td>
<td>
::formatNum(uo.product.price)::&nbsp;::currency()::
</td>
<td>
::if uo.order==null::
::set q = 0::
::else::
::set q = uo.order.quantity::
::end::
::set total = total+(q*uo.product.price)::
<input type="text" class="form-control input-sm" name="product::uo.product.id::" id="product::uo.product.id::" value="::q::" />
</td>
<!-- "paid" checkbox only if payments are not enabled -->
<td class="paid" ::cond !user._amap.hasPayments()::>
::_("Paid:")::
::if uo.order!=null::
<input type="checkbox" name="paid::uo.product.id::" value="1" ::attr checked (uo.order.paid==true ):: />
::else::
<input type="checkbox" name="paid::uo.product.id::" value="1" />
::end::
</td>
<td ::cond distribution==null::>
<select name="user2::uo.product.id::" class="form-control input-sm" style="width:150px;display:inline-block;">
<option value="0">-</option>
::foreach uu users::
<option value="::uu.value::" ::attr selected (uo.order!=null && uo.order._user2!=null && uo.order._user2.id==uu.value)::>::uu.label::</option>
::end::
</select>
<input data-toggle="tooltip" title="::_("Reverse the alternation")::" type="checkbox" name="invert::uo.product.id::" value="1" ::attr checked (uo.order!=null && uo.order.hasInvertSharedOrder()==true ):: />
</td>
</tr>
::end::
::set extra = 0::
::if c.hasPercentageOnOrders()::
<tr>
<th></th>
<th>::_("Total order")::</th>
<th>::total::::currency()::</th>
<th></th>
<th></th>
</tr>
<tr>
<th></th>
<td>::c.percentageName:: (::c.percentageValue::%)</td>
::set extra = total*(c.percentageValue/100)::
<td>::extra::::currency()::</td>
<th></th>
<th></th>
</tr>
::end::
<tr>
<th></th>
<th>::_("Total")::</th>
<th>::total+extra::::currency()::</th>
<th></th>
<th ::cond !user._amap.hasPayments()::>
<a href="#" id="checkButton">::_("Check all")::</a>
<script language="javascript">
var globalCheck = true;
var checkEverything = function(e){
var boxes = $("td.paid :checkbox");
boxes.attr("checked",globalCheck);
globalCheck=!globalCheck;
e.preventDefault();
};
$("#checkButton").click(checkEverything);
</script>
</th>
</tr>
</table>
<input type="submit" class="btn btn-primary" value="::_("Validate the order")::" name="submit" id="submit" />
</form>
::end::
+214
View File
@@ -0,0 +1,214 @@
::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)::&nbsp;::currency()::
</td>
<td>
::formatNum(m.subTotal)::&nbsp;::currency()::
</td>
<td>
<!-- frais -->
::if m.percentageValue!=null::
<a href="#" data-toggle="tooltip" data-placement="top" title="::m.percentageName:: : ::m.percentageValue:: %">
::formatNum(m.fees)::&nbsp;::currency()::
</a>
::end::
</td>
<td>
<!-- total -->
::formatNum(m.total)::&nbsp;::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)::
&nbsp;&nbsp;&nbsp;&nbsp;
::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)::&nbsp;::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::
@@ -0,0 +1,172 @@
::use 'design.mtt'::
<div class="col-md-12">
<div class="article">
<div class="text-center">
<h3>
Distribution du ::hDate(date)::
</h3>
<h4><span class="glyphicon glyphicon-map-marker"></span>::place::</h4>
<br/>
<!--::if(confirmed)::
::_("Validated")::
::else::
::_("Not validated")::
::end::-->
</div>
<div class="text-center">
<a href="/distribution/listByDate/::date.toString().substr(0,10)::/::place.id::/csv" class="btn btn-default btn-sm"> <span class="glyphicon glyphicon-list-alt"></span> ::_("CSV Export"):: </a>
<a href="/distribution/listByDate/::date.toString().substr(0,10)::/::place.id::" class="btn btn-default btn-sm"> <span class="glyphicon glyphicon-print"></span> ::_("Attendance sheet"):: </a>
::if ctotal::
<a href="/contractAdmin/ordersByDate/::date.toString().substr(0,10)::/::place.id::" class="btn btn-default btn-sm">::_("Totals per member")::</a>
::else::
<a href="/contractAdmin/ordersByDate/::date.toString().substr(0,10)::/::place.id::?ctotal=1" class="btn btn-default btn-sm">::_("Sub-totals per contract")::</a>
::end::
<a href="/contractAdmin/vendorsByDate/::date.toString().substr(0,10)::/::place.id::" class="btn btn-default btn-sm">::_("Totals per supplier")::</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;">
::set basket = getBasket(m.userId,place.id,date)::
<div class="basketNumber" ::cond basket!=null:: >
<i class="fa fa-shopping-basket" aria-hidden="true"></i> ::_("Num"):: ::basket.num::
</div>
::m.userName::
::if m.userName2!=null::
<span class="glyphicon glyphicon-refresh"></span> ::_("alternately with"):: ::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)::
<span style="color:#AAA">::_("Canceled")::</span>
::else::
::raw m.smartQt::
::end::
</td>
<td class="ref">
$$nullSafe(::m.productRef::)
</td>
<td>
::short(m.productName,40)::
</td>
<td>
::formatNum(m.productPrice)::&nbsp;::currency()::
</td>
<td>
::formatNum(m.subTotal)::&nbsp;::currency()::
</td>
<td>
<!-- fees -->
::if m.percentageValue!=null::
<a href="#" data-toggle="tooltip" data-placement="top" title="::m.percentageName:: : ::m.percentageValue:: %">
::formatNum(m.fees)::&nbsp;::currency()::
</a>
::end::
</td>
<td>
<!-- total -->
::formatNum(m.total)::&nbsp;::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)::&nbsp;::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)::&nbsp;::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)::&nbsp;::currency()::</th>
<th></th>
</tr>
</table>
</div>
</div>
::end::
@@ -0,0 +1,70 @@
::use 'contractadmin/design.mtt'::
<h3>::_("Summary table per product")::</h3>
::if distribution!=null::
<p>
::set date = hDate(distribution.date)::
::raw __("Delivery of the <b>::date::</b>",{date:date})::
</p>
::end::
<p>
::_("Be careful, if the price of the product was modified during the sale, every order of a member is taken into account with the price as it was at the time of the creation of the order")::
</p>
::set total = 0::
<table class="table table-bordered table-hover" style="width:100%;">
<tr>
<th>::_("Weight/Vol.")::</th>
<th>::_("Quantities")::</th>
<th>::_("Product")::</th>
<th>::_("Reference")::</th>
<th>::_("Unit Price incl. VAT")::</th>
<th>::_("Total")::</th>
</tr>
::foreach m orders::
<tr>
<td>
::raw m.weightOrVolume::
</td>
<td>
::formatNum(m.quantity)::
</td>
<td>
::m.pname::
</td>
<td class="ref">
$$nullSafe(::m.ref::)
</td>
<td>
::formatNum(m.priceTTC)::&nbsp;::currency()::
</td>
<td>
::formatNum(m.totalTTC)::&nbsp;::currency()::
::set total = total + m.totalTTC::
</td>
</tr>
::end::
<tr style="background:#DDD;">
<th colspan="5">Total</th>
<th>::formatNum(total)::&nbsp;::currency()::</th>
</tr>
</table>
::if distribution!=null::
$$export(/contractAdmin/ordersByProduct/::c.id::?csv=1&d=::distribution.id::)
<a href="/contractAdmin/ordersByProductList/::c.id::?d=::distribution.id::" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-list"></span> ::_("Order form")::</a>
::else::
$$export(/contractAdmin/ordersByProduct/::c.id::?csv=1)
<a href="/contractAdmin/ordersByProductList/::c.id::" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-list"></span> ::_("Order form")::</a>
::end::
::end::
@@ -0,0 +1,89 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Bon de commande</title>
<link href="/css/print.css" rel="stylesheet"/>
</head>
<body>
<table class="table table-bordered table-hover" style="width:100%;">
<tr>
<td>
::if group._image!=null::
<img src="::file(group._image)::" style="margin:auto;height:150px;" class="thumbnail" />
::end::
</td>
<td>
<h1>::group.name::</h1>
::if distribution!=null::
<h2>Livraison du <b>::hDate(distribution.date)::</b></h2>
::end::
<h2>::c.name:: - ::c._vendor.name::</h2>
</td>
<td>
::set cv = c._vendor::
::if cv._image!=null::
<img src="::file(cv._image)::" class="thumbnail" style="margin:auto;height:150px;" />
::end::
</td>
</tr>
</table>
<p>
::set cc = c._contact::
::set cv = c._vendor::
<b>Responsable contrat : </b> ::cc.firstName:: ::cc.lastName::, ::cc.email::,
::if cc.phone!=null :: ::cc.phone:: ::end::
</p>
<p>
<b>Producteur : </b>::cv.name:: ,
::if cv.email!=null :: ::cv.email:: ::end::,
::if cv.phone!=null :: ::cv.phone:: ::end::
</p>
<p>
<h3>::_("Summary table per product")::</h3>
::_("Be careful, if the price of the product was modified during the sale, every order of a member is taken into account with the price as it was at the time of the creation of the order")::
</p>
::set total = 0::
<table class="table table-bordered table-hover" style="width:100%;">
<tr style="border-top: 2px solid #AAA;">
<th>::_("Weight/Vol.")::</th>
<th>::_("Quantities")::</th>
<th>::_("Product")::</th>
<th>::_("Reference")::</th>
<th>::_("Unit price incl. VAT")::</th>
<th>::_("Total")::</th>
</tr>
::foreach m orders::
<tr style="border-top: 2px solid #AAA;">
<td>
::raw m.weightOrVolume::
</td>
<td>
::formatNum(m.quantity)::
</td>
<td>
::m.pname::
</td>
<td>
$$nullSafe(::m.ref::)
</td>
<td>
::formatNum(m.priceTTC)::&nbsp;::currency()::
</td>
<td>
::formatNum(m.totalTTC)::&nbsp;::currency()::
::set total = total + m.totalTTC::
</td>
</tr>
::end::
<tr style="background:#DDD;">
<th colspan="5">::_("Total")::</th>
<th>::formatNum(total)::&nbsp;::currency()::</th>
</tr>
</table>
<p class="hidden"><i>::_("Push \"Control + P\" to print this page.")::</i></p>
</body>
</html>
@@ -0,0 +1,146 @@
::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)::&nbsp;::currency()::
</td>
<td>
::formatNum(m.subTotal)::&nbsp;::currency()::
</td>
<td>
<!-- fees -->
::if m.percentageValue!=null::
<a href="#" data-toggle="tooltip" data-placement="top" title="::m.percentageName:: : ::m.percentageValue:: %">
::formatNum(m.fees)::&nbsp;::currency()::
</a>
::end::
</td>
<td>
<!-- total -->
::formatNum(m.total)::&nbsp;::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)::&nbsp;::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)::&nbsp;::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)::&nbsp;::currency()::</th>
<th></th>
</tr>
</table>
</div>
</div>
::end::
+156
View File
@@ -0,0 +1,156 @@
::use 'contractadmin/design.mtt'::
<h3>::_("Products")::</h3>
<div>
<p>
$$insert(::_("New product")::,/product/insert/::c.id::)
<a href="/product/import/::c.id::" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-list-alt"></span> ::_("Import from Excel/CSV")::</a>
::if !c._amap.hasTaxonomy()::
<a ::cond c.type==1:: href="/product/categorize/::c.id::" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-tag"></span> ::_("Categories")::</a>
::end::
</p>
</div>
<script>
//enable checked products
var enableProducts = function(){
var ids = _.getCheckboxesId('form.products');
if(ids.length==0){
alert("::_("You need to select at least one product to perform this action")::");
}else{
var l = document.location;
l.href = l.protocol +"//"+ l.host + l.pathname + "?enable="+ ids.join("|");
}
};
//disable checked products
var disableProducts = function(){
var ids = _.getCheckboxesId('form.products');
if(ids.length==0){
alert("::_("You need to select at least one product to perform this action")::");
}else{
var l = document.location;
l.href = l.protocol +"//"+ l.host + l.pathname + "?disable="+ ids.join("|");
}
};
//check input when click row
/*var clickRow = function(x){
x.children[0].children[0].checked = !x.children[0].children[0].checked;
}*/
//check all
var check = function(){
var inputs = document.querySelectorAll('form.products input');
var value = inputs[0].checked==true;
for ( i of inputs ) {
i.checked = !value;
}
}
</script>
<form method="GET" class="products">
<table class="table table-striped table-hover">
<tr>
<th></th>
<th></th>
<th>::_("Product ID||id or reference of a product")::</th>
<th>::_("Name")::</th>
<th>::_("Price")::</th>
<th></th>
::if c.hasStockManagement()::
<th>::_("Stock")::</th>
::end::
<th></th>
</tr>
::foreach p c.getProducts(false)::
::if p.active==false::
::set opacity=0.4::
::else::
::set opacity=1::
::end::
<tr style="opacity: ::opacity::" onclick="/*clickRow(this)*/">
<td>
<input type="checkbox" name="checkbox" value="::p.id::" />
</td>
<td>
<img src="::p.getImage()::" style="width:64px;height:64px;" />
</td>
<td class="ref">$$nullSafe(::p.ref::)</td>
<td>
<b>::p.name::</b>
::if p._unitType!=null && p.qt!=null::
::p.qt::&nbsp;::unit(p._unitType,false)::
::end::
::if !c._amap.hasTaxonomy()::
<div>
::foreach c p.getCategories()::
<span class='tag' style='background-color: ::c.getColor()::;'>::c.name::</span>
::end::
</div>
::else::
<div class="detail">
::p.getFullCategorization().join(" / ")::
</div>
::end::
<div>
::if p.organic ::<img src="/img/AB.png" style="display:inline-block"/>::end::
::if p.variablePrice ::<img src="/img/weight.png" style="display:inline-block"/>::end::
</div>
</td>
<td>::formatNum(p.price)::&nbsp;::currency()::</td>
<td>
::if c.hasStockManagement() ::
::if p.stock==null::
-
::else::
::if p.stock <= 10::
<span style="color:red;font-weight:bold;">
::p.stock::
</span>
::else::
::p.stock::
::end::
::end::
::end::
</td>
<td>
<div class="btn-group" role="group">
$$edit(::_("Edit")::,/product/edit/::p.id::)
<a href="/product/addImage/::p.id::" class="btn btn-default btn-sm"> <span class="glyphicon glyphicon-picture"></span> ::_("Picture")::</a>
$$delete(::_("Del.")::,/product/delete/::p.id::?token=::token::)
</div>
</td>
</tr>
::end::
</table>
</form>
<p>
<div class="btn-group" role="group">
<a onclick="check();" class="btn btn-default btn-sm btn-noAntiDoubleClick"> ::_("Check all")::</a>
</div>
<div class="btn-group" role="group">
<a class="btn btn-default btn-sm" onclick="enableProducts()"><span class="glyphicon glyphicon-check"></span> ::_("Enable")::</a>
<a class="btn btn-default btn-sm" onclick="disableProducts()"><span class="glyphicon glyphicon-unchecked"></span> ::_("Disable")::</a>
</div>
</p>
::end::
@@ -0,0 +1,53 @@
::use 'contractadmin/design.mtt'::
::if distributions.length>0::
<h3>::_("Orders")::</h3>
<table class="table table-bordered table-hover table-striped">
<tr>
<th>::_("Date")::</th>
<th>::_("Location")::</th>
<th></th>
</tr>
::foreach d distributions::
::if d.date!=null && d.date.getTime() < Date.now().getTime()::
::set style = "opacity:0.5;"::
::else::
::set style = ""::
::end::
<tr style="::style::" >
<td>::hDate(d.date)::</td>
<td>::d._place.name::</td>
<td>
<a href="/contractAdmin/orders/::c.id::?d=::d.id::" class="btn btn-default">
<span class="glyphicon glyphicon-list"></span>
::_("Orders")::
</a>
</td>
</tr>
::end::
</table>
::else::
<div class="alert alert-danger">
<b>Aucune distribution prochainement.</b><br/>
<a href="/contractAdmin/distributions/::c.id::">::_("Click here to manage deliveries")::</a>
</div>
::end::
<div>
<a href="?old=1" class="btn btn-default btn-sm">
::_("Old orders")::
</a>
</div>
::end::
+63
View File
@@ -0,0 +1,63 @@
::use 'contractadmin/design.mtt'::
<div>
<a href="/contractAdmin/stats/::c.id::/?stat=0">
::_("Seniority of subscribers")::
</a> |
<a href="/contractAdmin/stats/::c.id::/?stat=1">
::_("Sharing between orders")::
</a><br/>
</div>
::if stat==0::
<h3>
::__("Seniority of subscribers of ::contract::",{contract:c.name})::
</h3>
<table class="table" style="width:50%;">
<tr>
<th>::_("Number")::</th>
<th>::_("Year")::</th>
</tr>
::foreach a anciennete::
<tr>
<td>::a.cnt::</td>
<td>::a.uyear::</td>
</tr>
::end::
</table>
::end::
::if stat==1::
<h3>::_("Sharing between orders of"):: "::c.name::"</h3>
<table class="table">
<tr>
<th>::_("Quantity")::</th>
<th>::_("Product")::</th>
<th>::_("Total price")::</th>
<th>::_("% of orders")::</th>
</tr>
::foreach r repartition::
<tr>
<td>::r.quantity::</td>
<td>::r.name::</td>
<td>::r.quantity*r.price:: ::currency()::</td>
<td>::r.percent:: %</td>
</tr>
::end::
<tr>
<th colspan="2">Total: ::totalQuantity:: ::_("products")::</th>
<th>::totalPrice:: ::currency()::</th>
<th></th>
</tr>
</table>
$$export(/contractAdmin/stats/::c.id::?csv=1&stat=1)
::end::
::end::
+27
View File
@@ -0,0 +1,27 @@
::use 'contractadmin/design.mtt'::
<h3>::_("Products")::</h3>
<table class="table">
::foreach p c.getProducts()::
<tr>
<td>
<img src="::p.getImage()::" style="width:64px;height:64px;" />
</td>
<td>$$nullSafe(::p.ref::)</td>
<td>::p.name::</td>
<td>::p.stock::</td>
<td>
$$edit(modifier,/product/edit/::p.id::)
</td>
</tr>
::end::
</table>
::end::
@@ -0,0 +1,61 @@
::use 'design.mtt'::
<div class="col-md-12">
<div class="article">
<h2>::_("Global view of orders - delivery of"):: ::hDate(date)::</h2>
<hr/>
::foreach o orders::
::set total = 0::
<table class="table table-bordered table-hover table-striped" style="width:100%;">
<tr>
<th colspan="5">
<!--<div class="pull-right">$$export(::"/contractAdmin/ordersByProduct/"+o.contract.id+"?csv=1&d="+o.distrib.id::)</div>-->
<h4>::o.contract.name:: - ::o.contract._vendor.name::</h4>
</th>
</tr>
<tr>
<th>::_("Quantities")::</th>
<th>::_("Product")::</th>
<th>::_("Reference")::</th>
<th>::_("Unit price incl. VAT")::</th>
<th>::_("Total")::</th>
</tr>
::foreach m o.orders::
<tr>
<td class="col-md-1">
::m.quantity::
</td>
<td class="col-md-5">
::m.pname::
</td>
<td class="col-md-3">
$$nullSafe(::m.ref::)
</td>
<td class="col-md-2">
::formatNum(m.priceTTC)::&nbsp;::currency()::
</td>
<td class="col-md-2">
::formatNum(m.totalTTC)::&nbsp;::currency()::
::set total = total + m.totalTTC::
</td>
</tr>
::end::
<tr style="background:#DDD;">
<th colspan="4">Total</th>
<th>::formatNum(total)::&nbsp;::currency()::</th>
</tr>
</table>
::end::
</div>
</div>
::end::
@@ -0,0 +1,68 @@
::use 'design.mtt'::
<div class="col-md-12">
<div class="article">
<h2>::_("Global view of orders - from"):: ::hDate(from):: ::_("to"):: ::hDate(to)::</h2>
<div class="text-center">
$$export(/contractAdmin/vendorsByTimeFrame/::from.toString().substr(0,10)::/::to.toString().substr(0,10)::?csv=1)
</div>
<hr/>
::foreach o orders::
::set total = 0::
<table class="table table-bordered table-hover table-striped" style="width:100%;">
<tr>
<th colspan="6">
<!--<div class="pull-right">$$export(::"/contractAdmin/ordersByProduct/"+o.contract.id+"?csv=1&d="+o.distrib.id::)</div>-->
<h4>::o.contract.name:: - ::o.contract._vendor.name::</h4>
</th>
</tr>
<tr>
<th>::_("Quantities")::</th>
<th>::_("Product")::</th>
<th>::_("Reference")::</th>
<th>::_("Unit price incl. VAT")::</th>
<th>::_("Total HT")::</th>
<th>::_("Total TTC")::</th>
</tr>
::foreach m o.orders::
<tr>
<td class="col-md-1">
::formatNum(m.quantity)::
</td>
<td class="col-md-4">
::m.pname::
</td>
<td class="col-md-1 ref">
$$nullSafe(::m.ref::)
</td>
<td class="col-md-2">
::formatNum(m.priceTTC)::&nbsp;::currency()::
</td>
<td class="col-md-2">
::formatNum(m.totalHT)::&nbsp;::currency()::
</td>
<td class="col-md-2">
::formatNum(m.totalTTC)::&nbsp;::currency()::
</td>
::set total = total + m.totalTTC::
</tr>
::end::
<tr style="background:#DDD;">
<th colspan="5">::_("Total")::</th>
<th>::formatNum(total)::&nbsp;::currency()::</th>
</tr>
</table>
::end::
</div>
</div>
::end::
+70
View File
@@ -0,0 +1,70 @@
::use 'contractadmin/design.mtt'::
<h3>::_("Summary")::</h3>
<table class="table table-bordered" style="width:400px;">
<tr>
<td>
::_("Contract type")::
</td>
<td>
::if contract.type==0::
::_("CSA Contract")::
::else::
::_("Variable order contract")::
::end::
</td>
</tr>
<tr>
<td>::_("Start date")::</td>
<td>::hDate(contract.startDate)::</td>
</tr>
<tr>
<td>::_("End date")::</td>
<td>::hDate(contract.endDate)::</td>
</tr>
</table>
<div>
$$edit(::_("Edit")::,/contract/edit/::c.id::)
::if user.isAmapManager()::
$$edit(::_("Duplicate")::,/contractAdmin/duplicate/::c.id::)
::end::
</div>
<hr/>
<h4>::_("Farmer")::</h4>
<table class="table table-bordered" style="width:400px;">
<tr>
<td>::_("Name")::</td>
<td><b>::contract._vendor.name::</b></td>
</tr>
<tr>
<td>::_("Email")::</td>
<td>$$nullSafe(::contract._vendor.email::)</td>
</tr>
<tr>
<td>::_("Phone")::</td>
<td>$$nullSafe(::contract._vendor.phone::)</td>
</tr>
</table>
<h4><a href="/contractAdmin/products/::c.id::">::_("Products")::</a></h4>
<div style="max-height:400px;overflow:auto;">
<table class="table table-bordered" style="width:400px;">
::foreach p contract.getProducts(true)::
<tr>
<td><img src="::p.getImage()::" style="width:32px;height:32px;" /> </td>
<td>::p.getName()::</td>
<td>::formatNum(p.price)::&nbsp;::currency()::</td>
</tr>
::end::
</table>
</div>
::end::