Current File : /home/karenpetzb/application/modules/backoffice/views/scripts/command/edit.phtml |
<?php
$facture = $this->facture;
$caddy = $facture['CADDY'];
?>
<script type="text/javascript">
$(function(){
$("#showallproduct_public_button").bind({
click: function() {
openUrls($("#showallproductcontent_public"));
}
});
$("#showallproduct_admin_button").bind({
click: function() {
openUrls($("#showallproductcontent_admin"));
}
});
});
function openUrls(element) {
var $mainlink = element.children();
$mainlink.each(function(i){
window.open($(this).attr("href"), '_blank');
});
}
</script>
<style>
.adminBoxCommand {
float: left;
width: 700px;
margin: 10px 0 0 0;
border: 1px solid red;
}
.bill_body {
clear:both;
width: 800px;
margin: 20px auto 0 auto;
}
.bill_header {
float: left;
width: 800px;
}
.bill_company {
float: left;
}
.bill_company_logo {
margin: 10px 0 10px 10px;
width: 94px;
height: 121px;
}
.bill_idents {
float: right;
width: 550px;
}
.bill_idents_opt1 {
float: left;
width: 120px;
height: 50px;
margin: 0 0 0 10px;
}
.bill_idents_opt21 {
float: left;
width: 120px;
height: 25px;
background-color: #e7e7e7;
margin: 0 0 0 0;
text-align: center;
border: solid 1px black;
color: #000000;
font-weight: bold;
}
.bill_idents_opt31 {
float: left;
width: 120px;
height: 24px;
margin: 1px 0 0 0;
text-align: center;
border: solid 1px black;
color: #000000;
font-weight: bold;
}
.bill_idents_opt22 {
float: left;
width: 250px;
height: 25px;
background-color: #e7e7e7;
margin: 0 0 0 0;
text-align: center;
border: solid 1px black;
color: #000000;
font-weight: bold;
}
.bill_idents_opt32 {
float: left;
width: 250px;
height: 24px;
margin: 1px 0 0 0;
text-align: center;
border: solid 1px black;
color: #000000;
font-weight: bold;
}
.bill_text {
color: #000000;
font-weight: bold;
}
.bill_text2 {
color: #000000;
font-weight: bold;
line-height: 25px;
}
.bill_text3 {
color: #000000;
font-size: 11px;
}
.bill_address {
float: left;
width: 700px;
margin: 10px 0 0 0;
}
.bill_address_opt {
float: left;
width: 300px;
margin: 0 0 0 50px;
}
.bill_address_opt1 {
float: left;
width: 300px;
height: 25px;
background-color: #e7e7e7;
margin: 0 0 0 0;
text-align: center;
border: solid 1px black;
color: #000000;
font-weight: bold;
}
.bill_address_opt2 {
float: left;
width: 250px;
margin: 10px 0 0 20px;
}
.bill_line {
line-height: 25px;
}
.bill_line2 {
line-height: 20px;
}
.bill_caddy {
float: left;
width: 800px;
height: auto;
margin: 10px 0 0 0;
}
.bill_facture {
float: left;
width: 800px;
}
.bill_buy {
float: left;
width: 500px;
}
.bill_user_paiement_box {
width: 450px;
margin: 5px 0 0 0;
padding: 0 10px 10px 10px;
border: 2px #000000 solid;
}
.bill_detail {
float: right;
width: 250px;
height: 130px;
border: solid 1px black;
margin: 10px 0 0 0;
}
.bill_footer {
float: left;
width: 800px;
margin: 20px 0 0 0;
}
.bill_footer2 {
float: left;
width: 800px;
text-align: center;
margin: 0 0 20px 0;
}
</style>
<div class="table-box hidden-print">
<table class="table">
<thead>
<tr>
<th class="col-md-4" colspan="2"><?php echo $this->titlePage; ?></th>
</tr>
</thead>
<tbody>
<?php echo $this->render("alert_tr.phtml"); ?>
<tr>
<td class="col-md-6">
<div class="btn-group">
<a class="btn btn-primary"
target="_blank" href="<?php echo $this->baseUrl; ?>/backoffice/user/edit/id/<?php echo $facture['USER_ID']; ?>"><span class="glyphicon glyphicon-user"></span> Fiche client</a>
<button class="btn btn-primary" id="showallproduct_public_button"><i class="glyphicon glyphicon-eye-open"></i> Voir tous les produits</button>
<button class="btn btn-primary" id="showallproduct_admin_button"><i class="glyphicon glyphicon-cog"></i> Configurer tous les produits</button>
<a class="btn btn-primary" href="#" onclick="window.print();return false;"><i class="glyphicon glyphicon-print"></i> Imprimer</a>
</div>
<div style="display: none;" id="showallproductcontent_public"><?php
$extracted = array();
foreach($caddy as $row) {
if (!in_array($row['PRODUCTID'], $extracted)) {
array_push($extracted, $row['PRODUCTID']); ?> <a target="_blank"
href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($row['NAVNOM_URLPARENTS'], $row['NAVPRODUCTNOM'], $row['PRODUCTID']); ?>"></a>
<?php
}
} ?></div>
<div style="display: none;" id="showallproductcontent_admin"><?php $extracted = array();
foreach($caddy as $row) {
if (!in_array($row['PRODUCTID'], $extracted)) {
array_push($extracted, $row['PRODUCTID']); ?> <a target="_blank"
href="<?php echo $this->baseUrl; ?>/backoffice/product/edit/showProduct/<?php echo $row['PRODUCTID']; ?>"></a>
<?php
}
} ?>
</div>
</td>
<td class="col-md-6">
<div class="col-md-12 no-space-top">
<form action="<?php echo $this->baseUrl; ?>/backoffice/command/edit/" method="POST" name="setSTATUTForm">
<div class="col-md-6 no-space-top">
<select name="statut" class="form-control">
<option value="1" <?php if ($facture['STATUT']==1) { echo 'selected'; }?>>Commande - En attente</option>
<option value="4" <?php if ($facture['STATUT']==4) { echo 'selected'; }?>>Commande - En traitement</option>
<option value="2" <?php if ($facture['STATUT']==2) { echo 'selected'; }?>>Commande - En livraison</option>
<option value="3" <?php if ($facture['STATUT']==3) { echo 'selected'; }?>>Commande - Termine</option>
<?php if ($facture['STATUT'] != 1 && $facture['STATUT'] != 2 && $facture['STATUT'] != 3 && $facture['STATUT'] != 4) { ?>
<option value="10" <?php if ($facture['STATUT']==10) { echo 'selected'; }?>>Devis - En Attente</option>
<option value="11" <?php if ($facture['STATUT']==11) { echo 'selected'; }?>>Devis - Termine</option>
<?php } ?>
</select>
</div>
<div class="col-md-6 no-space-top">
<input type="hidden" name="idcmd" value="<?php echo $facture['ID']; ?>" />
<button class="btn btn-success" type="submit"><span class="glyphicon glyphicon-edit"></span> Modifier</button>
</div>
<?php if ($facture['STATUT']==2 || $facture['STATUT']==3){?>
<div class="col-md-12">
<div class="col-md-6 no-space-top">
<div class="col-md-6 no-space-top" style="margin-top:10px">
Suivi de livraison :
</div>
<div class="col-md-6 no-space-top">
<a href="<?php echo $this->baseUrl; ?>/backoffice/command/deliverymail/id/<?php echo $facture['ID']; ?>" class="btn btn-primary">Envoyer le mail</a>
</div>
</div>
<div class="col-md-6 no-space-top">
<div class="col-md-12 no-space-top">
<input type="text" name="delivery_trackinglink" class="form-control" placeholder="Lien d'acc�s au suivi de livraison" value="<?php echo $facture['DELIVERY_TRACKINGLINK']; ?>" />
</div>
<div class="col-md-12 no-space-top">
<input type="text" name="delivery_trackingnumber" class="form-control" placeholder="Num�ro de colis" value="<?php echo $facture['DELIVERY_TRACKINGNUMBER']; ?>" />
</div>
</div>
</div>
<?php } ?>
<?php if ($facture['STATUT']==4){?>
<div class="col-md-12 ">
<div class="col-md-8 no-space-top" style="margin-top:10px">
Commande en cours de traitement :
</div>
<div class="col-md-4 no-space-top">
<a href="<?php echo $this->baseUrl; ?>/backoffice/command/traitementmail/id/<?php echo $facture['ID']; ?>" class="btn btn-primary">Envoyer le mail</a>
</div>
</div>
<?php } ?>
</form>
</div>
<?php if ($facture['USER_MODEPAIEMENT'] == 1) { ?>
<div class="col-md-12">
<div class="col-md-6 no-space-top">Statut du paiement :</div>
<div class="col-md-6 no-space-top"><?php
if (!isset($facture['PAYMENT_STATUS'])) {
echo "N/C";
} else {
if ($facture['PAYMENT_STATUS'] == 'Completed') {
echo "Paiement �ffectu� - Completed";
} else {
echo "Paiement en attente - ".$facture['PAYMENT_STATUS'];
}
}
?></div>
</div>
<div class="col-md-12 no-space-top">
<div class="col-md-6 no-space-top">Transaction :</div>
<div class="col-md-6 no-space-top"><?php
if (!isset($facture['TXN_ID'])) {
echo "N/C";
} else {
echo $facture['TXN_ID'];
}
?></div>
</div>
<?php } ?>
<div class="col-md-12 no-space-top">
<div class="col-md-6 no-space-top">Date Fin :</div>
<div class="col-md-6 no-space-top"><?php
$mois = array('','Jan.', 'F�v.', 'Mars', 'Avril', 'Mai', 'Juin', 'Juil.', 'Ao�t', 'Sept.', 'Oct.', 'Nov.', 'D�c.');
$moisComplet = array('','Janvier', 'F�vrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Ao�t', 'Septembre', 'Octobre', 'Novembre', 'D�cembre');
if ($facture['DATEEND'] != null && $facture['DATEEND'] != '0000-00-00 00:00:00') {
$myDateEnd = new Zend_Date(strtotime($facture['DATEEND']));
echo $myDateEnd->toString("dd").' '.$mois[(int)$myDateEnd->toString('MM')].' '.$myDateEnd->toString("YYYY");
} ?></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="clearfix"></div>
<div class="bill_body">
<div class="bill_header">
<div class="bill_company">
<div class="bill_company_logo"><a href="<?php echo $this->baseUrl_SiteCommerceUrl; ?>"><img
alt="Directement � la source de la qualit�"
src="<?php echo $this->baseUrl; ?>/business/image/logo.png"
style="border: none;" /></a></div>
</div>
<div class="bill_idents">
<div class="bill_idents_opt1">
<div class="bill_idents_opt21"><span class="bill_line"><?php if ($facture['STATUT'] == 1 || $facture['STATUT'] == 2 || $facture['STATUT'] == 3) { echo 'Commande N';} else {echo 'Devis N';} ?></span>
</div>
<div class="bill_idents_opt31"><span class="bill_line"><?php echo $facture['REFERENCE']; ?></span>
</div>
</div>
<div class="bill_idents_opt1">
<div class="bill_idents_opt21"><span class="bill_line"><?php echo 'Date'; ?></span>
</div>
<div class="bill_idents_opt31"><span class="bill_line"> <?php
$myDate = new Zend_Date(strtotime($facture['DATESTART']));
echo $myDate->toString("dd").' '.$mois[(int)$myDate->toString('MM')].' '.$myDate->toString("YYYY");
?> </span></div>
</div>
<div class="bill_idents_opt1">
<div class="bill_idents_opt22"><span class="bill_line"><?php echo 'Client'; ?></span>
</div>
<div class="bill_idents_opt32"><span class="bill_line link2"><?php echo $facture['USER_EMAIL']; ?></span>
</div>
</div>
</div>
<div style="float: left; width: 800px"><span class="bill_text">Compte :
<?php echo $facture['USER_NUMCOMPTE']; ?></span><br>
<span class="bill_text">Tel : <?php echo $this->tel_contact; ?></span><br>
<span class="bill_text">Email : <?php echo $this->serviceClient_Mail; ?></span>
</div>
</div>
<div class="bill_address">
<div class="bill_address_opt">
<div class="bill_address_opt1"><span class="bill_line">Adresse de
Facturation</span></div>
<div class="bill_address_opt2"><span class="bill_text2"><?php echo $facture['FACT_RAISONSOCIAL']; ?></span><br>
<span class="bill_text2"><?php echo $facture['FACT_ADRESSE']; ?></span><br>
<span class="bill_text2"><?php echo $facture['FACT_CP'].' '.$facture['FACT_VILLE']; ?></span><br>
<span class="bill_text2"><?php echo $facture['FACT_PAYS']; ?></span></div>
</div>
<div class="bill_address_opt">
<div class="bill_address_opt1"><span class="bill_line">Adresse de
Livraison</span></div>
<div class="bill_address_opt2"><span class="bill_text2"><?php echo html_entity_decode($facture['LIV_RAISONSOCIAL']); ?></span><br>
<span class="bill_text2"><?php echo $facture['LIV_ADRESSE']; ?></span><br>
<span class="bill_text2"><?php echo $facture['LIV_CP'].' '.$facture['LIV_VILLE']; ?></span><br>
<span class="bill_text2"><?php echo $facture['LIV_PAYS']; ?></span></div>
</div>
</div>
<div class="bill_caddy">
<table style="border: 1px solid black;" cellpadding="0" cellspacing="0"
width="100%">
<tr align="center" style="background-color: #e7e7e7;">
<th class="bill_line">R�f�rence</th>
<th class="bill_line">D�signation</th>
<th class="bill_line" style="width: 60px">Dispo.</th>
<th class="bill_line">Quantit�</th>
<th class="bill_line" style="text-align:center">P.U. HT</th>
<th class="bill_line" style="display: none;">Prix Remis�</th>
<th class="bill_line">Montant HT</th>
</tr>
<?php
$index = 1;
$i = 0;
foreach($caddy as $row) {
?>
<tr>
<td colspan="6" height="1px" style="background-color: #868686"></td>
</tr>
<tr align="center" height="25px">
<td class="textTd1" width="110px"
style="text-align: center; white-space: nowrap;"><?php echo $this->escape($row['REFERENCE']);?>
</td>
<td width="450px" class="link4" style="text-align: left;"><a
target="_blank" style="color: black;"
href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($row['NAVNOM_URLPARENTS'], $row['NAVPRODUCTNOM'], $row['PRODUCTID']); ?>"><?php echo $row['DESIGNATION'];?></a>
<?php if (!empty($row['SELECTEDOPTION'])) {
echo '<br/>'.$row['SELECTEDOPTION'].'<br/>';
} ?></td>
<td class="textTd1"><?php if ((int)$row['STOCK'] == 1) { ?> <img
alt="Disponible" title="Disponible"
src="<?php echo $this->baseUrl; ?>/business/image/admin/stock11.png" />
<?php } else if ((int)$row['STOCK'] == 2) { ?> <img
alt="Disponible sous 8 jours" title="Disponible sous 8 jours"
src="<?php echo $this->baseUrl; ?>/business/image/admin/stock22.png" />
<?php } else if ((int)$row['STOCK'] == 3) { ?> <img
alt="Nous contacter" title="Nous contacter"
src="<?php echo $this->baseUrl; ?>/business/image/admin/stock33.png" />
<?php }?></td>
<td class="textTd1"><?php echo $row['QUANTITY']; ?></td>
<td class="textTd1" width="150px">
<table border="0" cellpadding="0" cellspacing="0">
<tr align="left">
<?php if ($row['isDEVIS'] == 1) {
if ($row['isPROMO'] == 0) { ?>
<td align="right"><span> <?php echo number_format($row['PROMOPRIX'], 2, ',', ' ').' ';?><span
style="color: #000000">€</span> </span><br>
<span class='oldPromoPrice'> <?php echo number_format($row['PRIX'], 2, ',', ' ').' ';?>€
</span></td>
<td width="50px"><img
src="<?php echo $this->baseUrl; ?>/business/image/admin/promo.png"
alt="Ce produit est en promotion" width="50px" /></td>
<?php } else { ?>
<td align="left" width="100%"><span> <?php echo number_format($row['PRIX'], 2, ',', ' ').' ';?>
<span style="color: #000000">€</span> </span></td>
<?php }
} else { ?>
<td align="center" colspan="2"><span class="text12" style="color:<?php echo $this->actualDesign['color'];?>"><?php echo 'sur devis'; ?></span>
</td>
<?php } ?>
</tr>
</table>
</td>
<td width="120px" style="display: none;"><?php if ($row['isPROMO'] == 1 && $row['REMISEPRIX'] > 0) { ?>
<span class="textTd1"> <?php
if ((int)$row['REMISEPRIXTAUXP'] > 0) {
echo number_format($row['REMISEPRIX'], 2, ',', ' ').' € <br>('.$this->escape($row['REMISEPRIXTAUXP']).' %)';
} else {
echo number_format($row['REMISEPRIX'], 2, ',', ' ').' €';
}
?> </span> <?php } ?></td>
<td width="120px"><span class="textTd1" style="float: right;"> <?php if ($row['isDEVIS'] == 1) {
echo number_format($row['PRIXTOTAL'], 2, ',', ' ').' €';
} ?> </span></td>
</tr>
<?php $i++; } ?>
<?php
$caddyfidelite = $facture['CADDYFIDELITE'];
foreach($caddyfidelite as $row) {
?>
<tr>
<td colspan="6">
<div style="font-weight: bold;margin:10px;">
<?php echo 'Carte de fid�lit� : '.$row['NOM'].' ('.$row['NBPOINT'].' points)'; ?>
</div>
</td>
</tr>
<?php } ?>
</table>
</div>
<div class="bill_facture">
<div class="bill_buy"><?php switch ($facture['USER_MODEPAIEMENT_TYPE']) {
case 1 : ?>
<div class="bill_user_paiement_box">
<div class="bill_text2" style="text-align: center">Mode de paiement :
Par ch�que</div>
<div style="margin-left: 10px">- Veuillez libeller votre ch�que �
l�ordre de <?php echo $this->siteName; ?></div>
<div style="margin-left: 10px">- Inscrivez le num�ro de votre commande
au dos de votre ch�que</div>
<div style="margin-left: 10px">- Puis envoyez votre r�glement �
l�adresse suivante :</div>
<br />
<div class="bill_text" style="text-align: center"><?php echo $this->siteName; ?></div>
<br />
<div class="bill_text" style="text-align: center"><?php echo $this->site_addresse3_title; ?></div>
<div class="bill_text" style="text-align: center"><?php echo $this->site_addresse3_address; ?></div>
<div class="bill_text" style="text-align: center"><?php echo $this->site_addresse3_cp; ?></div>
<br />
<div style="font-size: 10px; text-align: center">A noter : Les produits
sont exp�di�s � r�ception du ch�que</div>
</div>
<?php break;
case 2 : ?>
<div class="bill_user_paiement_box">
<div class="bill_text2" style="text-align: center">Mode de paiement :
Par virement</div>
<div>- La commande sera exp�di�e d�s le virement pr�sent sur notre
compte bancaire.</div>
<div class="bill_text">- Inscrivez votre num�ro de commande sur le
formulaire de virement</div>
<div>- Vous disposez d�un <span style="font-weight: bold;">d�lai de 15
jours</span> pour effectuer le virement sur notre compte ci-dessous
indiqu�, au d�l� de ce d�lai votre commande sera automatiquement
annul�e.</div>
<br />
<div class="bill_text">RIB : <?php echo $this->site_rib_numbers; ?></div>
<div class="bill_text">No IBAN : <?php echo $this->site_rib_iban; ?></div>
<div class="bill_text">Code BIC : <?php echo $this->site_rib_bic; ?></div>
<div class="bill_text">Nom du compte : <?php echo $this->siteName; ?></div>
<div class="bill_text">Nom et domiciliation de la banque : <?php echo $this->site_rib_bankname; ?></div>
</div>
<?php break;
default : ?> <span class="bill_text2"> <?php if (empty($facture['USER_MODEPAIEMENT_LABEL'])) { ?>
Mode de reglement : <?php
switch ($facture['USER_MODEPAIEMENT']) {
case 1 : echo " Paiement s�curis� en ligne"; break;
case 2 : echo " Contre remboursement";break;
case 3 : echo " Paiement diff�r� - 30 jours";break;
case 4 : echo " Paiement diff�r� - 45 jours";break;
case 5 : echo " Paiement diff�r� - 60 jours";break;
case 6 : echo " A r�ception de la facture";break;
}
} else {
echo $facture['USER_MODEPAIEMENT_LABEL'];
} ?> </span> <?php
break;
} ?></div>
<div class="bill_detail">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr align="right">
<td class="bill_line2">Total HT</td>
<td class="bill_line2"><?php echo number_format($facture['PRIXTOTALHTHR'], 2, ',', ' '); ?>
€</td>
</tr>
<tr align="right">
<td class="bill_line2">Remise <?php if (isset($facture['CODEREDUCTION']) && !empty($facture['CODEREDUCTION']) ) { echo " ( ".$facture['CODEREDUCTION']." ) "; } ?></td>
<td class="bill_line2"><?php echo number_format($facture['PRIXREMISEEUR'], 2, ',', ' '); ?>
€</td>
</tr>
<tr align="right">
<td class="bill_line2"><?php if (isset($facture['LIV_NOM']) && !empty($facture['LIV_NOM']) ) { echo 'Livraison en '.$facture['LIV_NOM']; } else { echo 'Frais de port'; } ?></td>
<td class="bill_line2"><?php echo number_format($facture['PRIXFRAISPORT'], 2, ',', ' '); ?>
€</td>
</tr>
<tr>
<td colspan="2" height="1px" style="background-color: #868686"></td>
</tr>
<tr align="right">
<td class="bill_text2">Net HT</td>
<td class="bill_text2"><?php echo number_format($facture['PRIXTOTALHTFP'], 2, ',', ' '); ?>
€</td>
</tr>
<tr align="right">
<td class="bill_line2">Total TVA</td>
<td class="bill_line2"><?php echo number_format($facture['PRIXTOTALTVA'], 2, ',', ' '); ?>
€</td>
</tr>
<tr>
<td colspan="2" height="1px" style="background-color: #868686"></td>
</tr>
<tr align="right">
<td class="bill_text2">NET A PAYER TTC</td>
<td class="bill_text2"><?php echo number_format($facture['PRIXTOTALTTC'], 2, ',', ' '); ?>
€</td>
</tr>
</table>
</div>
</div>
<div class="bill_footer"><span class="link18"> <input type="checkbox"
checked="checked" disabled="disabled" /> J'ai pris connaissance des
Conditions G�n�rales de Vente et les accepte sans r�serves. </span> <br />
<br />
<span class="bill_text3"> P�nalit�s de retard (taux annuel) : 9,00% </span><br>
<span class="bill_text3"> <b>RESERVE DE PROPRIETE</b> : Nous nous
r�servons la propri�t� des marchandises jusqu'au paiement du prix par
l'acheteur. Notre droit de revendication porte aussi bien sur les
marchandises que sur leur prix si elles ont d�j� �t� revendues (Loi du
12 mai 1980). </span><br>
<br>
</div>
<div class="bill_footer2"><span class="bill_text3"> <?php echo $this->site_addresse; ?>
</span><br>
<span class="bill_text3"> <?php echo $this->site_actualshort; ?> </span>
</div>
</div>