Ajout des modules ColissimoWs et ColissimoLabel.php

Ne pas oublier de vérifier si les tables nécessaires sont bien créées en BDD.
This commit is contained in:
2020-05-07 11:45:31 +02:00
parent 28b21af6c8
commit 649c92e52f
114 changed files with 21550 additions and 8312 deletions

View File

@@ -0,0 +1,153 @@
{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/colissimows/price-slice/save"}',
'urlDelete': '{url path="/admin/module/colissimows/price-slice/delete"}',
'urlSave': '{url path="/admin/module/colissimows/price-slice/save"}'
};
$(document).ready(function() {
var checkboxes = [];
// Price slice
var tpl = _.template($("#tpl-slice").html());
var showMessage = function showMessage(message) {
$('#colissimows_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-ColissimoWs").bootstrapSwitch();
$(".freeshipping-activation-ColissimoWs").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");
});
});
});
</script>

View File

@@ -0,0 +1,466 @@
{if isset($smarty.get.tab)}
{$tab=$smarty.get.tab}
{else}
{$tab='labels'}
{/if}
<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 "labels"}active{/if}"><a data-toggle="tab" href="#labels">{intl l="Shipping labels" d='colissimows.bo.default'}</a> </li>
<li class="{if $tab eq "prices-dom"}active{/if}"><a data-toggle="tab" href="#prices-dom">{intl l="Price slices (Dom)" d='colissimows.bo.default'}</a> </li>
<li class="{if $tab eq "config"}active{/if}"><a data-toggle="tab" href="#config">{intl l="Configuration" d='colissimows.bo.default'}</a> </li>
</ul>
<div class="tab-content">
<div id="labels" class="tab-pane {if $tab eq "labels"}active{/if} form-container">
<br>
<div class="title">
{intl l="Download and print Colissimo labels for not sent orders" d='colissimows.bo.default'}
</div>
{form name="colissimows_export_form"}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
<form action="{url path='/admin/module/colissimows/export'}" id="export-form" method="post">
{form_hidden_fields}
<div class="panel panel-default">
<div class="panel-heading clearfix">
{intl d='colissimows.bo.default' l="Order status change after processing"}
</div>
<div class="panel-body">
{form_field field="new_status"}
<div class="radio">
<label>
<input type="radio" name="{$name}" value="nochange" {if $data == "nochange"}checked{/if}>
{intl l="Do not change" d='colissimows.bo.default'}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="{$name}" value="processing" {if $data == "processing"}checked{/if}>
{intl l="Change to \"Processing\"" d='colissimows.bo.default'}
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="{$name}" value="sent" {if $data == "sent"}checked{/if}>
{intl l="Change to \"Sent\". If you choose this option, the delivery notification email is sent to the customer, and the processed order are removed from this page." d='colissimows.bo.default'}
</label>
</div>
{/form_field}
</div>
</div>
<table class="table table-condensed">
<thead>
<tr class="active">
<th>
{intl d='colissimows.bo.default' l="REF"}
</th>
<th class="text-center">
{intl d='colissimows.bo.default' l="Order date"}
</th>
<th>
{intl d='colissimows.bo.default' l="Destination"}
</th>
<th class="text-center">
{intl d='colissimows.bo.default' l="Weight"}
</th>
<th class="text-center">
{intl d='colissimows.bo.default' l="Price (with taxes)"}
</th>
<th class="text-center">
{intl d='colissimows.bo.default' l="Signature"}
</th>
<th class="text-center">
{intl d='colissimows.bo.default' l="Tracking"}
</th>
<th class="text-center">
{intl d='colissimows.bo.default' l="Label"}
</th>
<th class="text-center">
{intl d='colissimows.bo.default' l="Customs invoice"}
</th>
<th class="text-center">
{intl l="Sel." d='colissimows.bo.default'}
</th>
</tr>
</thead>
<tr>
{loop name="orders.not.sent" type="colissimows.orders-not-sent"}
{loop type="colissimows.label-info" name="label-info" order_id=$ID}
<tr id="order-{$ORDER_ID}"{if $HAS_ERROR} class="bg-warning"{/if}>
<td>
<a href="{url path="/admin/order/update/%id" id=$ID tab='bill'}" target="_blank">{$REF}</a>
</td>
<td class="text-center">
{format_date date=$CREATE_DATE}
</td>
<td>
{loop type='order_address' name='colissimows.address' backend_context=1 id=$DELIVERY_ADDRESS}
{$CITY|strtoupper} {$ZIPCODE|strtoupper}, {loop backend_context=1 type="country" name="adrctry" id=$COUNTRY}{$TITLE|strtoupper}{/loop}
{/loop}
</td>
<td class="text-center">
{form_field field="weight" value_key=$ORDER_ID}
<div class="input-group">
<input class="form-control input-sm" type="text" name="{$name}" value="{$WEIGHT}" >
<span class="input-group-addon">{intl l="kg" d='colissimows.bo.default'}</span>
</div>
{/form_field}
</td>
<td class="text-center">
{$TOTAL_TAXED_AMOUNT|string_format:"%.2f"}
</td>
<td class="text-center">
{form_field field="signed" value_key=$ORDER_ID}
<input class="form-control order_checkbox" type="checkbox" name="{$name}" {if $SIGNED} checked {/if} {if !$CAN_BE_NOT_SIGNED} disabled {/if}>
{/form_field}
</td>
<td class="text-center">
{if $TRACKING_NUMBER}
<a href="https://www.colissimo.fr/portail_colissimo/suivreResultat.do?parcelnumber={$TRACKING_NUMBER}">{$TRACKING_NUMBER}</a>
{else}
<i title="{intl l="Non disponible" d='colissimows.bo.default'}" class="glyphicon glyphicon-ban-circle"></i>
{/if}
</td>
<td class="text-center">
{if $HAS_LABEL}
<a class="btn btn-default btn-xs" href="{$LABEL_URL}" target="_blank" title="{intl d='colissimows.bo.default' l="Download label (%fmt)" fmt=$LABEL_TYPE|upper}">
<i class="glyphicon glyphicon-download-alt"></i>
</a>
{else}
<i title="{intl l="Non disponible" d='colissimows.bo.default'}" class="glyphicon glyphicon-ban-circle"></i>
{/if}
</td>
<td class="text-center">
{if $HAS_CUSTOMS_INVOICE}
<a class="btn btn-default btn-xs" href="{$CUSTOMS_INVOICE_URL}" target="_blank" title="{intl d='colissimows.bo.default' l="Download customs invoice (PDF)"}">
<i class="glyphicon glyphicon-download"></i>
</a>
{else}
-
{/if}
</td>
<td class="text-center">
{if !$HAS_LABEL}
{form_field field="order_id" value_key=$ORDER_ID}
<input type="checkbox" name="{$name}" value="{$ORDER_ID}" class="form-control order_checkbox">
{/form_field}
{else}
<a onclick="return confirm('{intl l="Do you want to clear label and tracking number for this order ?"}')" href="{url path='/admin/module/colissimows/label/clear/%orderId' orderId=$ORDER_ID}" class="btn btn-danger btn-xs" title="{intl l='Clear label'}">
<i class="glyphicon glyphicon-trash"></i>
</a>
{/if}
</td>
</tr>
{if $HAS_ERROR}
<tr class="bg-warning">
<td colspan="99" style="padding-top:0;border:none">
<i class="glyphicon glyphicon-warning-sign"></i> {intl l="Label cannot be created. Error is: " d='colissimows.bo.default'}
{$ERROR_MESSAGE nofilter}
</td>
</tr>
{/if}
{/loop}
{/loop}
</tbody>
</table>
{elseloop rel="orders.not.sent"}
<div class="alert alert-info">{intl d='colissimows.bo.default' l="There are currently no orders to ship with Colissimo"}</div>
{/elseloop}
{ifloop rel="orders.not.sent"}
<div class="pull-right">
<button type="submit" value="stay" class="btn btn-primary" title="{intl l='Process selected orders' d='colissimows.bo.default'}">{intl l='Process selected orders' d='colissimows.bo.default'}</button>
</div>
{/ifloop}
</form>
{/form}
</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='colissimows.bo.default'}
</div>
{form name="colissimows_configuration_form"}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
<form action="{url path="/admin/module/colissimows/configure"}" method="post">
{form_hidden_fields form=$form}
{include file = "includes/inner-form-toolbar.html"
hide_flags = true
page_url = "{url path='/admin/module/ColissimoWs'}"
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='colissimows.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_username" value=$colissimo_username}
{render_form_field field="colissimo_password" value=$colissimo_password}
</div>
<div class="col-md-6">
{render_form_field field="affranchissement_endpoint_url" value=$affranchissement_endpoint_url}
{render_form_field field="format_etiquette" value=$format_etiquette}
{render_form_field field="activate_detailed_debug" value=$activate_detailed_debug}
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<div class="panel-title">{intl d='colissimows.bo.default' l="Coordonnées de d'expéditeur"}</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-4">
{render_form_field field="company_name" value=$company_name}
</div>
<div class="col-md-4">
{render_form_field field="from_contact_email" value=$from_contact_email}
</div>
<div class="col-md-4">
{render_form_field field="from_phone" value=$from_phone}
</div>
<div class="col-md-6">
{render_form_field field="from_address_1" value=$from_address_1}
</div>
<div class="col-md-6">
{render_form_field field="from_address_2" value=$from_address_2}
</div>
<div class="col-md-2">
{render_form_field field="from_zipcode" value=$from_zipcode}
</div>
<div class="col-md-5">
{render_form_field field="from_city" value=$from_city}
</div>
<div class="col-md-5">
{custom_render_form_field form=$form field="from_country"}
<select {form_field_attributes field="from_country"}>
{loop type="country" name="strore_country" backend_context="true"}
{$isocode = $ISOALPHA2|strtoupper}
<option value="{$isocode}"{if $isocode == $from_country} selected{/if}>{$TITLE} ({$isocode})</option>
{/loop}
</select>
{/custom_render_form_field}
</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='colissimows.bo.default'}
</div>
<!-- ********* FREE SHIPPING BUTTON ********* -->
<div class="row">
<div class="col-md-4">
<!-- checkbox free shipping -->
{assign var="ColissimoWsFreeShipping" value=0}
{form name="colissimows.freeshipping.form"}
<form action='{url path="/admin/module/colissimows/freeshipping"}' method="post" id="freeshippingform">
{form_hidden_fields form=$form}
{form_field form=$form field="freeshipping"}
<label>
{intl l="Activate total free shipping " d="colissimows.bo.default"}
</label>
<div class="switch-small freeshipping-activation-ColissimoWs" 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="colissimows.freeshipping" name="freeshipping_colissimows"}
<input type="checkbox" name="{$name}" value="true" {if $FREESHIPPING_ACTIVE}checked{assign var="isColissimoWsFreeShipping" value=1}{/if} />
{/loop}
</div>
{/form_field}
</form>
{/form}
</div>
</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='colissimows.bo.default'}
{intl l="The slices are ordered by maximum cart weight then by maximum cart price." d='colissimows.bo.default'}
{intl l="If a cart matches multiple slices, it will take the last slice following that order." d='colissimows.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='colissimows.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='colissimows.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='colissimows.bo.default'}
</div>
<div class="slices form-container">
{loop type="module" name="colissimows_id" code="ColissimoWs"}
{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='colissimows.bo.default' l="Area : "}</small> {$NAME}
</label>
</th>
</tr>
</thead>
<thead>
<tr>
<th class="col-md-3">{intl l="Weight up to ... kg" d='colissimows.bo.default'}</th>
<th class="col-md-3">{intl l="Untaxed Price up to ... ($)" d='colissimows.bo.default'}</th>
<th class="col-md-5">{intl l="Shipping Price ($)" d='colissimows.bo.default'}</th>
<th class="col-md-1">{intl l="Actions" d='colissimows.bo.default'}</th>
</tr>
</thead>
<tbody>
{loop type="colissimows.price-slices" name="colissimows_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='colissimows.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='colissimows.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="colissimows" 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='colissimows.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='colissimows.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='colissimows.bo.default' l="manage shipping zones"}
</a>
</div>
</div>
{/elseloop}
{/loop}
</div>
</div>
{include
file = "includes/generic-warning-dialog.html"
dialog_id = "colissimows_dialog"
dialog_title = {intl d='colissimows.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="colissimows" access="UPDATE"}
<a class="btn btn-default btn-xs js-slice-save" title="{intl d='colissimows.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="colissimows" access="DELETE"}
<a class="btn btn-default btn-xs js-slice-delete" title="{intl d='colissimows.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>
{* Download zip file if we have the name in the URL parameters *}
{if $smarty.get.zip}
<iframe style="width:100%;height:20px;border:none" src="{url path="/admin/module/colissimows/labels-zip/%hash" hash={$smarty.get.zip}}"></iframe>
{/if}

View File

@@ -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}

View File

@@ -0,0 +1 @@
{intl l="Please display this message in HTML"}

View File

@@ -0,0 +1,381 @@
{*************************************************************************************/
/* 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='colissimows.bo.default'}
{* 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">&nbsp;</td>
</tr>
{/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;">&nbsp;</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=""}</p>
<p>Airwaybill Number:</p>
</td>
<td>
<p>Company Stamp: {$store_name}</p>
<p>{$store_zipcode} {$store_city}</p>
</td>
</tr>
</table>
{/loop}
</page>