Jump to content

Recommended Posts

Prestashop 1.6.0.5

 

 

 

Bonjour, 

 

Je souhaite intégrer sur le Bon de Livraison l'emplacement de mon produit dans au sein de mon stockage.

Information que l'on renseigne dans la fiche produit :  BO / Catalogue / Produit / Entrepôts / Emplacement

 

 

Le fichier à manipuler pour modifier le Bon de Livraison se situe :  Prestashop / PDF / delivery-slip.tpl

 

 

Après de nombreuse recherche sur le sujet, j'arrive à intégrer le titre Stockage et le proportionner correctement dans la barre des titres.

 

post-683679-0-26393300-1402526740_thumb.jpg

 

Je n'arrive pas à renseigner correctement le code qui me permet d'aller chercher l'information de l'emplacement dans la bonne table.

 

Je m'explique, actuellement l'action va chercher les info pour compléter le Bon de Livraison dans la table

order_details 

 

Mais les informations concernant l'emplacement du produit se trouve dans la table warehouse_product_location

 

 

je vous met donc le code que j'ai modifier :

	<!-- / CUSTOMER INFORMATIONS -->
		</td>
		<td style="width: 78%; text-align: right">
			<table style="width: 100%">
				<tr style="line-height:6px;">
					<td style="text-align: left; background-color: #4D4D4D; color: #FFF; padding-left: 10px; font-weight: bold; width: 50%">{l s='ITEMS TO BE DELIVERED' pdf='true'}</td>
<td style="background-color: #4D4D4D; color: #FFF; text-align: left; font-weight: bold; width: 20%">{l s='REFERENCE' pdf='true'}</td>
<td style="background-color: #4D4D4D; color: #FFF; text-align: center; font-weight: bold; width: 20%">{l s='STOCKAGE' pdf='true'}</td>
<td style="background-color: #4D4D4D; color: #FFF; text-align: center; font-weight: bold; width: 10%">{l s='QTY' pdf='true'}</td>
				</tr>
				{foreach $order_details as $product}
				{cycle values='#FFF,#DDD' assign=bgcolor}
				<tr style="line-height:6px;background-color:{$bgcolor};">
					<td style="text-align: left; width: 50%">{$product.product_name}</td>
					<td style="text-align: left; width: 20%">
						{if empty($product.product_reference)}
							---
						{else}
							{$product.product_reference}
						{/if}
					</td>
					<td style="text-align: left; width: 20%">
						{if empty($warehouse_product_location.warehouse_product_location)}
							---
						{else}
							{$warehouse_product_location.warehouse_product_location}
						{/if}
					</td>
					<td style="text-align: center; width: 10%">{$product.product_quantity}</td>
				</tr>
				{/foreach}
			</table>
		</td>
	</tr>
</table>

Merci d'avance pour votre aide

 

David

Link to comment
Share on other sites

  • 1 month later...

Bonjour, 

 

Je reviens ici car je n'arrive toujours pas a trouver la solution.

 

Ci-dessous je vous met ce que j'ai pu faire mais pas moyen d'afficher le lieux de stockage de mes produits sur le bon de livraison

			<!-- / CUSTOMER INFORMATIONS -->
		</td>
		<td style="width: 78%; text-align: right">
			<table style="width: 100%">
				<tr style="line-height:6px;">
					<td style="text-align: left; background-color: #4D4D4D; color: #FFF; padding-left: 10px; font-weight: bold; width: 50%">{l s='ITEMS TO BE DELIVERED' pdf='true'}</td>
					<td style="background-color: #4D4D4D; color: #FFF; text-align: left; font-weight: bold; width: 20%">{l s='REFERENCE' pdf='true'}</td>
					<td style="background-color: #4D4D4D; color: #FFF; text-align: center; font-weight: bold; width: 10%">{l s='QTY' pdf='true'}</td>
					<td style="background-color: #4D4D4D; color: #FFF; text-align: center; font-weight: bold; width: 20%">{l s='STOCKAGE' pdf='true'}</td>
				</tr>
				{foreach $order_details as $order_detail}
				{cycle values='#FFF,#DDD' assign=bgcolor}
				<tr style="line-height:6px;background-color:{$bgcolor};">
					<td style="text-align: left; width: 50%">{$order_detail.product_name}</td>
					<td style="text-align: left; width: 20%">
						{if empty($order_detail.product_reference)}
							---
						{else}
							{$order_detail.product_reference}
						{/if}
					</td>
					<td style="text-align: center; width: 10%">{$order_detail.product_quantity}</td>
					{foreach  $warehouse_product_location as $warehouse_product_location}
					<td style="text-align: center; width: 20%">
						{if empty($warehouse_product_location.location)}
							---
						{else}
							{$warehouse_product_location.location}
						{/if}
					{/foreach}
					</td>
			

Si vous avez des idée ou correction je prend.

 

Merci d'avance.

Link to comment
Share on other sites

  • 10 months later...

Bonjour,

j'ai exactement le même besoin, pour ce faire il est nessesaire de modiffier 2 fichiers :

delivery-slip.tpl dans PDF

et HTMLTemplateDeliverySlip.php dans classes/PDF

Si quelqu'un à une solution je suis également preneur.

good luck

Link to comment
Share on other sites

  • 3 months later...
  • 7 months later...
  • 1 year later...

Il faut faire un overide sur le fichier OrderInvoice.php

 

    public function getProductsDetail()
    {
        return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT *,wpl.location as warehouse_location
FROM `'._DB_PREFIX_.'order_detail` od
LEFT JOIN `'._DB_PREFIX_.'warehouse_product_location` wpl
ON wpl.id_product = od.product_id AND wpl.id_warehouse = od.id_warehouse
LEFT JOIN `'._DB_PREFIX_.'product` p
ON p.id_product = od.product_id
LEFT JOIN `'._DB_PREFIX_.'product_shop` ps ON (ps.id_product = p.id_product AND ps.id_shop = od.id_shop)
WHERE od.`id_order` = '.(int)$this->id_order.'
'.($this->id && $this->number ? ' AND od.`id_order_invoice` = '.(int)$this->id : '').' ORDER BY od.`product_name`');
    }
 
 
Et modifier le fichier delivery-slip.product-tab.tpl en y ajoutant 
 
                    {if !empty($order_detail.warehouse_location)}
                        ({$order_detail.warehouse_location})
                    {/if}
 
Très bonne soirée
Link to comment
Share on other sites

  • 1 year later...

Bonjour,

Je ne trouve pas ces fichiers sur la version Prestashop 1.6.0

Pourriez vous me dire comment ajouter la ref fournisseur et le code barre de la déclinaison du produit sur le bon livraison SVP ?

Code + chemin des fichiers à modifier seraient grandement appréciés.

Merci d'avance ça fait des heures que je parcours le forum mais les informations semblent toutes obsolètes.

Link to comment
Share on other sites

  • 1 year later...

Bonjour, je cherche à faire apparaitre sur un bon de livraison l'emplacement d'un produit ayant des déclinaisons. J'ai réussi à le faire pour un produit simple, mais pas pour un produit avec déclinaisons, alors que les emplacements stock ont bien été renseignés en BO pour chaque déclinaison. Tout cela sous PS 1.7.6.1

Merci par avance pour votre aide !

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...