<?php
        global $conf, $db, $langs, $buyer, $hookmanager, $drafteditable;

        if (! in_array('propalcard',$hookmanager->contextarray) && ! in_array('ordercard',$hookmanager->contextarray) && ! in_array('invoicecard',$hookmanager->contextarray)) return;

  		$element = $object->element;

		// TODO uniformiser
		if ($element == 'propal') $element = 'propale';

		if ($element == 'propale' || $element=='commande' || $element == 'facture')
		{
				print '<script type="text/javascript">

				';

				if (empty($object->array_options['options_rental_doc']))
				{
					print '
						$(document).ready(function() {
							$("#idprod").bind("change.sell", function(e) { getStockInfos(e); });
						});';
				}

				print '
					</script>';
		}

