[11/05/2025] On remplace les modules Colissimo par le combo ColissimoHomeDelivery + ColissimoPickupPoint + ColissimoLabel
This commit is contained in:
@@ -0,0 +1,166 @@
|
||||
{javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
|
||||
<script src='{$asset_url}'></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/libs/underscore-min.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
var config = {
|
||||
'urlAdd': '{url path="/admin/module/ColissimoHomeDelivery/price-slice/save"}',
|
||||
'urlDelete': '{url path="/admin/module/ColissimoHomeDelivery/price-slice/delete"}',
|
||||
'urlSave': '{url path="/admin/module/ColissimoHomeDelivery/price-slice/save"}'
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
var checkboxes = [];
|
||||
|
||||
// Price slice
|
||||
var tpl = _.template($("#tpl-slice").html());
|
||||
|
||||
var showMessage = function showMessage(message) {
|
||||
$('#colissimo_home_delivery_dialog')
|
||||
.find('.modal-body')
|
||||
.html(message)
|
||||
.end()
|
||||
.modal("show");
|
||||
};
|
||||
|
||||
var getSliceData = function getSliceData($slice) {
|
||||
var data = {
|
||||
id: $slice.data("id"),
|
||||
area: $slice.data("area"),
|
||||
shipping: $slice.find(".js-slice-shipping").first().val(),
|
||||
maxPrice: $slice.find(".js-slice-max-price").first().val(),
|
||||
maxWeight: $slice.find(".js-slice-max-weight").first().val()
|
||||
};
|
||||
|
||||
return data;
|
||||
};
|
||||
|
||||
// add new slice
|
||||
$('.js-slice-add').on('click', function(){
|
||||
var $slice = $(this).parents('tr').first();
|
||||
var data = getSliceData($slice);
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
url: config.urlAdd
|
||||
}).done(function(data, textStatus, jqXHR){
|
||||
var sliceHtml = '';
|
||||
if (data.success) {
|
||||
// reset form
|
||||
$slice.find('input').val('');
|
||||
// add slice
|
||||
sliceHtml = tpl(data.slice);
|
||||
|
||||
$(sliceHtml).insertBefore($slice);
|
||||
} else {
|
||||
showMessage(data.message.join('<br>'));
|
||||
}
|
||||
}).fail(function(jqXHR, textStatus, errorThrown){
|
||||
console.log(jqXHR);
|
||||
showMessage(jqXHR.responseText);
|
||||
});
|
||||
});
|
||||
|
||||
// save new slice
|
||||
$('.slices').on('click', '.js-slice-save', function(){
|
||||
var $slice = $(this).parents('tr').first();
|
||||
var data = getSliceData($slice);
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
url: config.urlAdd
|
||||
}).done(function(data, textStatus, jqXHR){
|
||||
if (!data.success) {
|
||||
showMessage(data.message.join('<br>'));
|
||||
} else {
|
||||
var sliceHtml = tpl(data.slice);
|
||||
$(sliceHtml).insertBefore($slice);
|
||||
$slice.remove();
|
||||
// $slice.find('.js-slice-save').removeClass('btn-success');
|
||||
}
|
||||
}).fail(function(jqXHR, textStatus, errorThrown){
|
||||
console.log(jqXHR);
|
||||
showMessage(jqXHR.responseText);
|
||||
});
|
||||
});
|
||||
|
||||
$('.slices').on('change', '.js-slice input', function() {
|
||||
$(this).parents('tr').first().find('.js-slice-save').addClass('btn-success');
|
||||
});
|
||||
|
||||
// delete new slice
|
||||
$('.slices').on('click', '.js-slice-delete', function(){
|
||||
var $slice = $(this).parents('tr').first();
|
||||
var data = getSliceData($slice);
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
url: config.urlDelete
|
||||
}).done(function(data, textStatus, jqXHR){
|
||||
var sliceHtml = '';
|
||||
if (data.success) {
|
||||
$slice.remove();
|
||||
} else {
|
||||
showMessage(data.message);
|
||||
}
|
||||
}).fail(function(jqXHR, textStatus, errorThrown){
|
||||
console.log(jqXHR);
|
||||
showMessage(jqXHR.responseText);
|
||||
});
|
||||
});
|
||||
|
||||
// add new slice
|
||||
$('.js-slice input').on('change', function(){
|
||||
|
||||
});
|
||||
|
||||
$(".freeshipping-activation-ColissimoHomeDelivery").bootstrapSwitch();
|
||||
|
||||
$(".freeshipping-activation-ColissimoHomeDelivery").on("switch-change", function(e, data){
|
||||
var is_checked = data.value;
|
||||
var form = $("#freeshippingform");
|
||||
$('body').append('<div class="modal-backdrop fade in" id="loading-event"><div class="loading"></div></div>');
|
||||
$.ajax({
|
||||
url: form.attr('action'),
|
||||
type: form.attr('method'),
|
||||
data: form.serialize(),
|
||||
}).done(function(){
|
||||
$("#loading-event").remove();
|
||||
}).fail(function(jqXHR, textStatus, errorThrown){
|
||||
$('#freeshipping-failed-body').html(jqXHR.responseJSON.error);
|
||||
$("#freeshipping-failed").modal("show");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$("#freeshippingform").submit(function(e, data){
|
||||
var form = $("#freeshippingform");
|
||||
$('body').append('<div class="modal-backdrop fade in" id="loading-event"><div class="loading"></div></div>');
|
||||
$.ajax({
|
||||
url: form.attr('action'),
|
||||
type: form.attr('method'),
|
||||
data: form.serialize(),
|
||||
}).done(function(){
|
||||
$("#loading-event").remove();
|
||||
}).fail(function(jqXHR, textStatus, errorThrown){
|
||||
$('#freeshipping-failed-body').html(jqXHR.responseJSON.error);
|
||||
$("#freeshipping-failed").modal("show");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,286 @@
|
||||
{if isset($smarty.get.tab)}
|
||||
{$tab=$smarty.get.tab}
|
||||
{else}
|
||||
{$tab='prices-dom'}
|
||||
{/if}
|
||||
<style>
|
||||
input[type=number]
|
||||
{
|
||||
min-width:100px;
|
||||
}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<ul id="tabbed-menu" class="nav nav-tabs">
|
||||
<li class="{if $tab eq "prices-dom"}active{/if}"><a data-toggle="tab" href="#prices-dom">{intl l="Price slices (Dom)" d='colissimo.home.delivery.bo.default'}</a> </li>
|
||||
<li class="{if $tab eq "config"}active{/if}"><a data-toggle="tab" href="#config">{intl l="Configuration" d='colissimo.home.delivery.bo.default'}</a> </li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<!-- I have no idea why but I can't delete this without breaking the page -->
|
||||
<div id="labels" class="tab-pane {if $tab eq "labels"}active{/if} form-container">
|
||||
</div>
|
||||
|
||||
<div id="config" class="tab-pane {if $tab eq "config"}active{/if} form-container">
|
||||
<br>
|
||||
<div class="title">
|
||||
{intl l="Colissimo Web service configuration" d='colissimo.home.delivery.bo.default'}
|
||||
</div>
|
||||
|
||||
{form name="colissimo.homedelivery.configuration.form"}
|
||||
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
||||
|
||||
<form action="{url path="/admin/module/ColissimoHomeDelivery/configure"}" method="post">
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{include file = "includes/inner-form-toolbar.html"
|
||||
hide_flags = true
|
||||
page_url = "{url path='/admin/module/ColissimoHomeDelivery'}"
|
||||
close_url = "{url path='/admin/modules'}"
|
||||
}
|
||||
|
||||
{if $form_error}
|
||||
<div class="alert alert-danger">{$form_error_message}</div>
|
||||
{/if}
|
||||
|
||||
{if $smarty.get.success}
|
||||
<div class="alert alert-success">Les données de configuration ont été mises à jour.</div>
|
||||
{/if}
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="panel-title">{intl d='colissimo.home.delivery.bo.default' l="Configuration du service"}</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row" style="margin-top: 20px;">
|
||||
<div class="col-md-6">
|
||||
{render_form_field field="colissimo_home_delivery_username" value=$colissimo_home_delivery_username}
|
||||
{render_form_field field="colissimo_home_delivery_password" value=$colissimo_home_delivery_password}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{render_form_field field="affranchissement_endpoint_url" value=$affranchissement_endpoint_url}
|
||||
{render_form_field field="activate_detailed_debug" value=$activate_detailed_debug}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{/form}
|
||||
|
||||
</div>
|
||||
|
||||
<div id="prices-dom" class="tab-pane {if $tab eq "prices-dom"}active{/if} form-container">
|
||||
<br>
|
||||
<div class="title">
|
||||
{intl l="Price slices for domicile delivery" d='colissimo.home.delivery.bo.default'}
|
||||
</div>
|
||||
|
||||
<!-- ********* FREE SHIPPING BUTTON ********* -->
|
||||
|
||||
<div class="row">
|
||||
<!-- checkbox free shipping -->
|
||||
{assign var="isColissimoHomeDeliveryFreeshipping" value=0}
|
||||
{form name="colissimo.homedelivery.freeshipping.form"}
|
||||
<form action='{url path="/admin/module/ColissimoHomeDelivery/freeshipping"}' method="post" id="freeshippingform">
|
||||
<div class="col-md-4">
|
||||
{form_hidden_fields form=$form}
|
||||
{form_field form=$form field="freeshipping"}
|
||||
<label>
|
||||
{intl l="Activate total free shipping " d="colissimo.home.delivery.bo.default"}
|
||||
</label>
|
||||
<div class="switch-small freeshipping-activation-ColissimoHomeDelivery" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok-circle'></i>" data-off-label="<i class='glyphicon glyphicon-remove-circle'></i>">
|
||||
{loop type="colissimo.homedelivery.freeshipping" name="freeshipping_colissimo_home_delivery"}
|
||||
<input type="checkbox" name="{$name}" value="true" {if $FREESHIPPING_ACTIVE}checked{assign var="isColissimoHomeDeliveryFreeshipping" value=1}{/if} />
|
||||
{/loop}
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
<div class="col-md-6" id="freeshipping-from">
|
||||
<div class="input-group">
|
||||
{form_field form=$form field="freeshipping_from"}
|
||||
{loop type="colissimo.homedelivery.freeshipping" name="freeshipping_colissimo_home_delivery"}
|
||||
<span class="input-group-addon {if $FREESHIPPING_FROM}alert-success{/if}">{intl l="Or activate free shipping from (€) :" d="colissimo.home.delivery.bo.default"}</span>
|
||||
<input type="number" name="{$name}" class="form-control" value="{$value}" step="0.01">
|
||||
{/loop}
|
||||
{/form_field}
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="submit">{intl l="Save"}</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{/form}
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<!-- **************************************** -->
|
||||
|
||||
<div class="alert alert-info">
|
||||
{intl l="You can create price slices by specifying a maximum cart weight and/or a maximum cart price." d='colissimo.home.delivery.bo.default'}
|
||||
{intl l="The slices are ordered by maximum cart weight then by maximum cart price." d='colissimo.home.delivery.bo.default'}
|
||||
{intl l="If a cart matches multiple slices, it will take the last slice following that order." d='colissimo.home.delivery.bo.default'}
|
||||
{intl l="If you don't specify a cart weight in a slice, it will have priority over the slices with weight." d='colissimo.home.delivery.bo.default'}
|
||||
{intl l="If you don't specify a cart price in a slice, it will have priority over the other slices with the same weight." d='colissimo.home.delivery.bo.default'}
|
||||
{intl l="If you specify both, the cart will require to have a lower weight AND a lower price in order to match the slice." d='colissimo.home.delivery.bo.default'}
|
||||
</div>
|
||||
|
||||
<div class="slices form-container">
|
||||
{loop type="module" name="colissimo_home_delivery_id" code="ColissimoHomeDelivery"}
|
||||
{loop type="area" name="area_loop" module_id=$ID backend_context=true}
|
||||
{$area_id=$ID}
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<label class="clearfix">
|
||||
<small>{intl d='colissimo.home.delivery.bo.default' l="Area : "}</small> {$NAME}
|
||||
</label>
|
||||
</th>
|
||||
|
||||
<th width="40%">
|
||||
<div id="area-freeshipping-{$area_id}" {if $isColissimoHomeDeliveryFreeshipping eq 1} style="display:none;" {/if}>
|
||||
<form action="{url path="/admin/module/ColissimoHomeDelivery/area_freeshipping"}" method="post">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon {if $area_id }alert-success{/if}">{intl l="Activate free shipping from (€) :" d="colissimo.home.delivery.bo.default"}</span>
|
||||
<input type="hidden" name="area-id" value="{$area_id}">
|
||||
<input type="hidden" name="delivery-mode" value="{$deliveryModeId}">
|
||||
|
||||
{ifloop rel="area_freeshipping"}
|
||||
{loop type="colissimo.homedelivery.area.freeshipping" name="area_freeshipping" area_id=$area_id}
|
||||
<input type="number" step="0.01" name="cart-amount" class="form-control" value="{$CART_AMOUNT}">
|
||||
{/loop}
|
||||
{/ifloop}
|
||||
{elseloop rel="area_freeshipping"}
|
||||
<input type="number" step="0.01" name="cart-amount" class="form-control" value="">
|
||||
{/elseloop}
|
||||
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="submit">{intl l="Save"}</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-3">{intl l="Weight up to ... kg" d='colissimo.home.delivery.bo.default'}</th>
|
||||
<th class="col-md-3">{intl l="Untaxed Price up to ... ($)" d='colissimo.home.delivery.bo.default'}</th>
|
||||
<th class="col-md-5">{intl l="Shipping Price ($)" d='colissimo.home.delivery.bo.default'}</th>
|
||||
<th class="col-md-1">{intl l="Actions" d='colissimo.home.delivery.bo.default'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{loop type="colissimo.homedelivery.price-slices" name="colissimo_home_delivery_area_$ID" area_id={$area_id} }
|
||||
<tr class="js-slice" data-area="{$area_id}" data-id="{$SLICE_ID}" >
|
||||
<th class="col-md-3">
|
||||
<input type="text" data-field="max-weight" class="form-control js-slice-max-weight" value="{$MAX_WEIGHT}" data-old="{$MAX_WEIGHT}" />
|
||||
</th>
|
||||
<th class="col-md-3">
|
||||
<input type="text" data-field="max-price" class="form-control js-slice-max-price" value="{$MAX_PRICE}" data-old="{$MAX_PRICE}" />
|
||||
</th>
|
||||
<th class="col-md-5">
|
||||
<input type="text" data-field="shipping" class="form-control js-slice-shipping" value="{$SHIPPING}" data-old="{$SHIPPING}" />
|
||||
</th>
|
||||
<th class="col-md-1">
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" role="ADMIN" module="customdelivery" access="UPDATE"}
|
||||
<a class="btn btn-default btn-xs js-slice-save" title="{intl d='colissimo.home.delivery.bo.default' l='Save this price slice'}">
|
||||
<span class="glyphicon glyphicon-floppy-disk"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
{loop type="auth" name="can_change" role="ADMIN" module="customdelivery" access="DELETE"}
|
||||
<a class="btn btn-default btn-xs js-slice-delete" title="{intl d='colissimo.home.delivery.bo.default' l='Delete this price slice'}" data-id="{$ID}">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{* New slice *}
|
||||
{loop type="auth" name="can_change" role="ADMIN" module="colissimohomedelivery" access="CREATE"}
|
||||
<tr class="js-slice-new" data-area="{$area_id}" data-id="0">
|
||||
<th class="col-md-3">
|
||||
<input type="text" data-field="max-weight" class="form-control js-slice-max-weight" value="" />
|
||||
</th>
|
||||
<th class="col-md-3">
|
||||
<input type="text" data-field="max-price" class="form-control js-slice-max-price" value="" />
|
||||
</th>
|
||||
<th class="col-md-5">
|
||||
<input type="text" data-field="shipping" class="form-control js-slice-shipping" value="" />
|
||||
</th>
|
||||
<th class="col-md-1">
|
||||
<a class="btn btn-default btn-xs js-slice-add" title="{intl d='colissimo.home.delivery.bo.default' l='Add this price slice'}" >
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
</th>
|
||||
</tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{/loop}
|
||||
{elseloop rel="area_loop"}
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-warning">
|
||||
{intl d='colissimo.home.delivery.bo.default' l="You should first attribute shipping zones to the modules: "}
|
||||
<a href="{url path="/admin/configuration/shipping_zones/update/$module_id"}">
|
||||
{intl d='colissimo.home.delivery.bo.default' l="manage shipping zones"}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{/elseloop}
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include
|
||||
file = "includes/generic-warning-dialog.html"
|
||||
|
||||
dialog_id = "colissimo_home_delivery_dialog"
|
||||
dialog_title = {intl d='colissimo.home.delivery.bo.default' l="Message"}
|
||||
dialog_body = ""
|
||||
}
|
||||
|
||||
{* JS Templates *}
|
||||
<script id="tpl-slice" type="text/html">
|
||||
<tr class="js-slice" data-area="<%=areaId %>" data-id="<%=id %>">
|
||||
<th class="col-md-3">
|
||||
<input type="text" data-field="max-weight" class="form-control js-slice-max-weight" value="<%=maxWeight %>" data-old="<%=maxWeight %>" />
|
||||
</th>
|
||||
<th class="col-md-3">
|
||||
<input type="text" data-field="max-price" class="form-control js-slice-max-price" value="<%=maxPrice %>" data-old="<%=maxPrice %>" />
|
||||
</th>
|
||||
<th class="col-md-5">
|
||||
<input type="text" data-field="shipping" class="form-control js-slice-shipping" value="<%=shipping %>" data-old="<%=shipping %>" />
|
||||
</th>
|
||||
<th class="col-md-1">
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" role="ADMIN" module="colissimohomedelivery" access="UPDATE"}
|
||||
<a class="btn btn-default btn-xs js-slice-save" title="{intl d='colissimo.home.delivery.bo.default' l='Save this price slice'}">
|
||||
<span class="glyphicon glyphicon-floppy-disk"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
{loop type="auth" name="can_change" role="ADMIN" module="colissimohomedelivery" access="DELETE"}
|
||||
<a class="btn btn-default btn-xs js-slice-delete" title="{intl d='colissimo.home.delivery.bo.default' l='Delete this price slice'}" data-id="<%=id %>">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
{extends file="email-layout.tpl"}
|
||||
|
||||
{* Do not provide a "Open in browser" link *}
|
||||
{block name="browser"}{/block}
|
||||
{* No pre-header *}
|
||||
{block name="pre-header"}{/block}
|
||||
|
||||
{* Subject *}
|
||||
{block name="email-subject"}{intl l="Your order confirmation Nº %ref" ref={$order_ref}}{/block}
|
||||
|
||||
{* Title *}
|
||||
{block name="email-title"}{/block}
|
||||
|
||||
{* Content *}
|
||||
{block name="email-content"}
|
||||
|
||||
{loop type="customer" name="customer.politesse" id={$customer_id} current="0"}
|
||||
{assign var="customerRef" value=$REF}
|
||||
|
||||
<p>{if {$TITLE} == 9}{intl l="Dear Mr. "}
|
||||
{else}{intl l="Dear Ms. "}
|
||||
{/if}
|
||||
{$FIRSTNAME} {$LASTNAME},
|
||||
</p>
|
||||
|
||||
{/loop}
|
||||
|
||||
<p>{intl l="We are pleased to inform you that your order number"} {$order_ref} {intl l="has been shipped on"} {format_date date=$update_date output="date"} {intl l="with the tracking number"} <strong>{$package}</strong>.</p>
|
||||
|
||||
<p>{intl l='<a href="https://www.colissimo.fr/portail_colissimo/suivreResultat.do?parcelnumber=%package">Click here</a> to track your shipment. You can also enter the tracking number on <a href="https://www.laposte.fr/outils/suivre-vos-envois">https://www.laposte.fr/outils/suivre-vos-envois</a>' package=$package}</p>
|
||||
<p>{intl l='Thank you for your shopping with us and hope to see you soon on <a href="#">www.yourshop.com</a>'}</p>
|
||||
<p>{intl l="Your on-line store Manager"}<br/>
|
||||
{intl l="Your shop"}</p>
|
||||
{/block}
|
||||
@@ -0,0 +1 @@
|
||||
{intl l="Please display this message in HTML"}
|
||||
@@ -0,0 +1,417 @@
|
||||
{*************************************************************************************/
|
||||
/* This file is part of the Thelia package. */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : dev@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* For the full copyright and license information, please view the LICENSE.txt */
|
||||
/* file that was distributed with this source code. */
|
||||
/*************************************************************************************}
|
||||
|
||||
{* -- Define some stuff for Smarty ------------------------------------------ *}
|
||||
{assign var="store_name" value={config key="store_name"}}
|
||||
{assign var="store_description" value={config key="store_description"}}
|
||||
{assign var="store_phone" value={config key="store_phone"}}
|
||||
{assign var="store_email" value={config key="store_email"}}
|
||||
{assign var="store_description" value={config key="store_description"}}
|
||||
|
||||
{assign var="store_address1" value={config key="store_address1"}}
|
||||
{assign var="store_address2" value={config key="store_address2"}}
|
||||
{assign var="store_address3" value={config key="store_address3"}}
|
||||
{assign var="store_zipcode" value={config key="store_zipcode"}}
|
||||
{assign var="store_city" value={config key="store_city"}}
|
||||
{assign var="store_country_code" value={config key="store_country_code"}}
|
||||
|
||||
{loop type="country" name="store_country_name_loop" id="$store_country_code"}
|
||||
{assign var="store_country_name" value=$TITLE}
|
||||
{/loop}
|
||||
|
||||
{assign var="lang_code" value={lang attr="code"}}
|
||||
{assign var="lang_locale" value={lang attr="locale"}}
|
||||
{if not $store_name}{assign var="store_name" value={intl l='Thelia V2'}}{/if}
|
||||
{if not $store_description}{assign var="store_description" value={$store_name}}{/if}
|
||||
|
||||
{* Set the default translation domain, that will be used by {intl} when the 'd' parameter is not set *}
|
||||
{default_translation_domain domain='pdf.mfk'}
|
||||
|
||||
{* Declare assets directory, relative to template base directory *}
|
||||
{declare_assets directory='assets'}
|
||||
{literal}
|
||||
|
||||
<style>
|
||||
|
||||
body, table, .footer {
|
||||
font-size: 10px;
|
||||
color: #000;
|
||||
line-height: 12px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
font-size: 10px;
|
||||
|
||||
}
|
||||
|
||||
.logo img {
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
tr {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.borders {
|
||||
border: 0.2px solid #9d9d9c;
|
||||
}
|
||||
|
||||
.titre-container {
|
||||
margin-bottom: 5mm;
|
||||
}
|
||||
|
||||
.titre-container .titre {
|
||||
font-size: 5mm;
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
{
|
||||
hook name = "invoice.css"
|
||||
}
|
||||
|
||||
.goods tr td, .goods tr th {
|
||||
padding: 1mm;
|
||||
}
|
||||
|
||||
.recap p {
|
||||
margin: 2mm 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
{/literal}
|
||||
<page backtop="10mm" backleft="10mm" backright="10mm" backbottom="10mm">
|
||||
<page_header>
|
||||
|
||||
</page_header>
|
||||
|
||||
<page_footer>
|
||||
<div class="footer">
|
||||
{intl l="{$store_name} - {$store_address1} - Phone : {$store_phone}"}
|
||||
|
||||
<br>
|
||||
{intl l="{$store_description} - Legal numbers (ex: SIRET)"}
|
||||
<br>
|
||||
{intl l="Shop - Email : {$store_email} - Phone : {$store_phone}"}
|
||||
</div>
|
||||
</page_footer>
|
||||
|
||||
{$taxes = []}
|
||||
|
||||
{loop name="order.invoice" type="order" id=$order_id customer="*"}
|
||||
|
||||
{loop name="currency.order" type="currency" id=$CURRENCY}
|
||||
{assign "orderCurrency" $ISOCODE}
|
||||
{assign "orderCurrencySymbol" $SYMBOL}
|
||||
{/loop}
|
||||
|
||||
<table>
|
||||
<col style="width: 60%; padding: 0; margin: 0; padding-right: 2mm;">
|
||||
<col style="width: 40%; padding: 0; margin: 0; padding-left: 2mm;">
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<table>
|
||||
<col style="width: 100%; padding: 2mm;">
|
||||
<tr>
|
||||
<td class="borders titre">Sender</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="borders">
|
||||
<p>
|
||||
{$store_name}
|
||||
{$store_address1}<br>
|
||||
{if $store_address2!=null} {$store_address2} <br> {/if}
|
||||
{if $store_address3!=null} {$store_address3} <br> {/if}
|
||||
{$store_zipcode} {$store_city}<br>
|
||||
{$store_country}<br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="titre-container">
|
||||
<div class="titre">Commercial Invoice</div>
|
||||
Date: {format_date date=$INVOICE_DATE output="date"}<br>
|
||||
Invoice number: {$REF}
|
||||
</div>
|
||||
<div class="bloc-adresse">
|
||||
<table>
|
||||
<col style="width: 50%; padding: 0; margin: 0; padding-right: 2mm;">
|
||||
<col style="width: 50%; padding: 0; margin: 0; padding-left: 2mm;">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<col style="width: 100%; padding: 2mm;">
|
||||
<tr>
|
||||
<td class="borders titre">Delivery address</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="borders" height="92">
|
||||
<p>
|
||||
{loop type="order_address" name="delivery_address" id=$DELIVERY_ADDRESS}
|
||||
{loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG} {/loop} {$FIRSTNAME} {$LASTNAME}
|
||||
<br/>
|
||||
{if ! empty($COMPANY)}
|
||||
{$COMPANY}
|
||||
<br/>
|
||||
{/if}
|
||||
{$ADDRESS1} {$ADDRESS2} {$ADDRESS3}
|
||||
<br/>
|
||||
{$ZIPCODE} {$CITY}
|
||||
<br/>
|
||||
{loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}
|
||||
<br/>
|
||||
{$PHONE}
|
||||
{/loop}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<table>
|
||||
<col style="width: 100%; padding: 2mm;">
|
||||
<tr>
|
||||
<td class="borders titre">Invoice address</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="borders" height="92">
|
||||
<p>
|
||||
{loop type="order_address" name="delivery_address" id=$INVOICE_ADDRESS}
|
||||
{loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG} {/loop}{$FIRSTNAME} {$LASTNAME}
|
||||
<br/>
|
||||
{if ! empty($COMPANY)}
|
||||
{$COMPANY}
|
||||
<br/>
|
||||
{/if}
|
||||
{$ADDRESS1} {$ADDRESS2} {$ADDRESS3}
|
||||
<br/>
|
||||
{$ZIPCODE} {$CITY}
|
||||
<br/>
|
||||
{loop type="country" name="country_delivery" id=$COUNTRY}{$TITLE}{/loop}
|
||||
<br/>
|
||||
{$PHONE} {$MOBILE}
|
||||
{/loop}
|
||||
<br/>
|
||||
{loop type="customer" name="customer_email" id=$CUSTOMER current="0"}
|
||||
{$EMAIL}
|
||||
{/loop}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{$totalValue = $TOTAL_TAXED_AMOUNT - $POSTAGE_UNTAXED}
|
||||
{$itemCount = 0}
|
||||
|
||||
<!-- le tableau des produits -->
|
||||
<table class="goods" cellspacing="0" cellpadding="0" style="padding-top: 20px; width: 100%; margin-bottom: 0;">
|
||||
<col style="width: 40%;"/>
|
||||
<col style="width: 5%; "/>
|
||||
<col style="width: 10%;"/>
|
||||
<col style="width: 13%;"/>
|
||||
<col style="width: 15%;"/>
|
||||
<col style="width: 7%;"/>
|
||||
<col style="width: 10%;"/>
|
||||
|
||||
<tr class="table-1">
|
||||
<td class="borders titre">{intl l="Full Description of Goods"}</td>
|
||||
<td class="borders titre right">{intl l="Quantity"}</td>
|
||||
<td class="borders titre right">{intl l="Unit value"}</td>
|
||||
<td class="borders titre right">{intl l="Subtotal value"}</td>
|
||||
<td class="borders titre right">{intl l="Unit net weight"}</td>
|
||||
<td class="borders titre">{intl l="Country"}</td>
|
||||
<td class="borders titre">{intl l="Comm. code"}</td>
|
||||
</tr>
|
||||
|
||||
{loop type="order_product" name="order-products" order=$ID}
|
||||
{if $WAS_IN_PROMO == 1}
|
||||
{assign "realPrice" $PROMO_PRICE}
|
||||
{assign "realTax" $PROMO_PRICE_TAX}
|
||||
{assign "realTaxedPrice" $TAXED_PROMO_PRICE}
|
||||
{else}
|
||||
{assign "realPrice" $PRICE}
|
||||
{assign "realTax" $PRICE_TAX}
|
||||
{assign "realTaxedPrice" $TAXED_PRICE}
|
||||
{/if}
|
||||
|
||||
{if $realTax==null}
|
||||
{assign "realTax" 0}
|
||||
{/if}
|
||||
|
||||
{$taxes[{$TAX_RULE_TITLE}][] = $realTax * $QUANTITY}
|
||||
|
||||
<tr class="table-2">
|
||||
<td class="borders" style="line-height:14px;">
|
||||
|
||||
{$itemCount = $itemCount + $QUANTITY}
|
||||
|
||||
{$TITLE}
|
||||
{ifloop rel="combinations"}
|
||||
<br>
|
||||
{loop type="order_product_attribute_combination" name="combinations" order_product=$ID}
|
||||
- {$ATTRIBUTE_TITLE} - {$ATTRIBUTE_AVAILABILITY_TITLE}
|
||||
<br>
|
||||
{/loop}
|
||||
{/ifloop}
|
||||
|
||||
{loop type="marquage.orderproduct" name="gravures" order_product_id=$ID}
|
||||
{loop type="marquage.police" name="police" id=$POLICE}
|
||||
{$nomPolice = $NOM}
|
||||
{/loop}
|
||||
<br/>
|
||||
{intl l='Engraving '}:
|
||||
<br/>
|
||||
- {intl l='Font '}: {$nomPolice}
|
||||
<br/>
|
||||
- {intl l='Position '}: {$POSITION}
|
||||
<br/>
|
||||
- {intl l='Style '}: {$TYPE}
|
||||
<br/>
|
||||
- {intl l='Your text '}: {$TEXTE}
|
||||
{/loop}
|
||||
|
||||
</td>
|
||||
<td class="borders right">{$QUANTITY}</td>
|
||||
<td class="borders right">{format_money number=$realTaxedPrice symbol=$orderCurrencySymbol}</td>
|
||||
<td class="borders right">{format_money number={$realTaxedPrice * $QUANTITY} symbol=$orderCurrencySymbol}</td>
|
||||
<td class="borders right">{$WEIGHT}</td>
|
||||
<td class="borders">France</td>
|
||||
<td class="borders"> </td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{loop type="mfk.selection.order" name="cadeaux_et_message_cadeau" order_id=$order_id}
|
||||
{if ! empty($ECHANTILLON_1) || ! empty($ECHANTILLON_2)}
|
||||
{$prixEchantillons = floatval({config key="tarif_echantillons_export"})}
|
||||
<tr class="table-2">
|
||||
<td class="borders" style="line-height:14px;">{intl l="Free samples "}: {$ECHANTILLON_1}
|
||||
, {$ECHANTILLON_2}</td>
|
||||
<td class="borders right">1</td>
|
||||
<td class="borders right">{format_money number=$prixEchantillons}</td>
|
||||
<td class="borders right">{format_money number=$prixEchantillons}</td>
|
||||
<td class="borders right"></td>
|
||||
<td class="borders">France</td>
|
||||
<td class="borders"> </td>
|
||||
|
||||
{$totalValue = $totalValue + $prixEchantillons}
|
||||
{$itemCount = $itemCount + 1}
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if ! empty($CADEAU)}
|
||||
{$prixCadeau = floatval({config key="tarif_cadeau_export"})}
|
||||
<tr class="table-2">
|
||||
<td class="borders" style="line-height:14px;">{intl l="Your gift "}: {$CADEAU}</td>
|
||||
<td class="borders right">1</td>
|
||||
<td class="borders right">{format_money number=$prixCadeau}</td>
|
||||
<td class="borders right">{format_money number=$prixCadeau}</td>
|
||||
<td class="borders right"></td>
|
||||
<td class="borders">France</td>
|
||||
<td class="borders"> </td>
|
||||
|
||||
{* A changer si besoin *}
|
||||
{$totalValue = $totalValue + $prixCadeau}
|
||||
{$itemCount = $itemCount + 1}
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{/loop}
|
||||
</table>
|
||||
|
||||
{if $POSTAGE_TAX_RULE_TITLE}
|
||||
{$taxes[$POSTAGE_TAX_RULE_TITLE][] = $POSTAGE_TAX}
|
||||
{/if}
|
||||
|
||||
<table class="recap" align="right" cellspacing="0" cellpadding="0" style="width: 100%;">
|
||||
<col style="width: 40%; padding: 2mm;"/>
|
||||
<col style="width: 30%; padding: 2mm;"/>
|
||||
<col style="width: 30%; padding: 2mm;"/>
|
||||
<tr>
|
||||
<td style="border-right: 0.2px solid #9d9d9c;"> </td>
|
||||
<td class="borders">
|
||||
<p>Total declared value : {format_money number={$totalValue} symbol=$orderCurrency}</p>
|
||||
<p>Total units: {$itemCount}</p>
|
||||
</td>
|
||||
<td class="borders">
|
||||
<p>Total Net Weight: {$WEIGHT} kg(s)</p>
|
||||
{* Mettre une estimation du poids brut *}
|
||||
<p>Total Gross Weight: {$WEIGHT + 0} kg(s)</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table class="recap" align="right" cellspacing="0" cellpadding="0" style="width: 100%; margin-top: 10mm">
|
||||
<col style="width: 50%; padding: 2mm;"/>
|
||||
<col style="width: 50%; padding: 2mm;"/>
|
||||
<tr>
|
||||
<td>
|
||||
<p>Type of Export: permanent</p>
|
||||
<p>Reason for Export</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Currency Code :{$orderCurrency}</p>
|
||||
<p>Terms of Trade : DAP</p>
|
||||
<p>City Name of liability</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table class="recap" align="right" cellspacing="0" cellpadding="0" style="width: 100%; margin-top: 10mm">
|
||||
<col style="width: 50%; padding: 2mm;"/>
|
||||
<col style="width: 50%; padding: 2mm;"/>
|
||||
<tr>
|
||||
<td>
|
||||
<p>Signature: {intl l="Sender's name"}</p>
|
||||
<p>Airwaybill Number:</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>Company Stamp: {$store_name}</p>
|
||||
<p>{$store_zipcode} {$store_city}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
{/loop}
|
||||
</page>
|
||||
Reference in New Issue
Block a user