23 if (empty($conf) || !is_object($conf)) {
24 print "Error, template page can't be called as URL";
30 <!-- BEGIN PHP TEMPLATE STOCKCORRECTION.TPL.PHP -->
33 if ($object->element ==
'product') $productref = $object->ref;
35 $langs->load(
"productbatch");
38 if (empty($id)) $id = $object->id;
40 print '<script type="text/javascript" language="javascript">
41 jQuery(document).ready(function() {
44 if (jQuery("#mouvement").val() == \'0\') jQuery("#unitprice").removeAttr("disabled");
45 else jQuery("#unitprice").prop("disabled", true);
48 jQuery("#mouvement").change(function() {
57 print '<form action="'.$_SERVER[
"PHP_SELF"].
'?id='.$id.
'" method="post">'.
"\n";
61 print '<input type="hidden" name="token" value="'.newToken().
'">';
62 print '<input type="hidden" name="action" value="correct_stock">';
63 print '<input type="hidden" name="backtopage" value="'.$backtopage.
'">';
64 print '<table class="border centpercent">';
68 if ($object->element ==
'product') {
69 print '<td class="fieldrequired">'.$langs->trans(
"Warehouse").
'</td>';
71 $ident = (
GETPOST(
"dwid") ?
GETPOST(
"dwid",
'int') : (
GETPOST(
'id_entrepot') ?
GETPOST(
'id_entrepot',
'int') : ($object->element ==
'product' && $object->fk_default_warehouse ? $object->fk_default_warehouse :
'ifone')));
72 if (empty($ident) && !empty($conf->global->MAIN_DEFAULT_WAREHOUSE)) $ident = $conf->global->MAIN_DEFAULT_WAREHOUSE;
73 print img_picto(
'',
'stock').$formproduct->selectWarehouses($ident,
'id_entrepot',
'warehouseopen,warehouseinternal', 1, 0, 0,
'', 0, 0, null,
'minwidth100');
74 print ' <select class="button buttongen" name="mouvement" id="mouvement">';
75 print '<option value="0">'.$langs->trans(
"Add").
'</option>';
76 print '<option value="1"'.(GETPOST(
'mouvement') ?
' selected="selected"' :
'').
'>'.$langs->trans(
"Delete").
'</option>';
80 if ($object->element ==
'stock') {
81 print '<td class="fieldrequired">'.$langs->trans(
"Product").
'</td>';
84 $form->select_produits(
GETPOST(
'product_id',
'int'),
'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ?
'0' :
''), 0, 0, -1, 2,
'', 0, null, 0, 1, 0,
'maxwidth500');
85 print ' <select class="button buttongen" name="mouvement" id="mouvement">';
86 print '<option value="0">'.$langs->trans(
"Add").
'</option>';
87 print '<option value="1"'.(GETPOST(
'mouvement') ?
' selected="selected"' :
'').
'>'.$langs->trans(
"Delete").
'</option>';
91 print '<td class="fieldrequired">'.$langs->trans(
"NumberOfUnit").
'</td>';
92 print '<td><input name="nbpiece" id="nbpiece" class="maxwidth75" value="'.GETPOST(
"nbpiece").
'"></td>';
96 if (!empty($conf->global->PRODUIT_SOUSPRODUITS) && $object->element ==
'product' && $object->hasFatherOrChild(1)) {
99 print '<td colspan="3">';
100 print '<input type="checkbox" name="disablesubproductstockchange" id="disablesubproductstockchange" value="1"'.(GETPOST(
'disablesubproductstockchange') ?
' checked="checked"' :
'').
'">';
101 print ' <label for="disablesubproductstockchange">'.$langs->trans(
"DisableStockChangeOfSubProduct").
'</label>';
107 if (!empty($conf->productbatch->enabled) &&
108 (($object->element ==
'product' && $object->hasbatch())
109 || ($object->element ==
'stock'))
113 print '<td'.($object->element ==
'stock' ?
'' :
' class="fieldrequired"').
'>'.$langs->trans(
"batch_number").
'</td><td colspan="3">';
114 print '<input type="text" name="batch_number" size="40" value="'.GETPOST(
"batch_number").
'">';
118 if (empty($conf->global->PRODUCT_DISABLE_EATBY)) {
119 print '<td>'.$langs->trans(
"EatByDate").
'</td><td>';
121 print $form->selectDate($eatbyselected,
'eatby',
'',
'', 1,
"");
124 if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) {
125 print '<td>'.$langs->trans(
"SellByDate").
'</td><td>';
127 print $form->selectDate($sellbyselected,
'sellby',
'',
'', 1,
"");
135 print '<td>'.$langs->trans(
"UnitPurchaseValue").
'</td>';
136 print '<td colspan="'.(!empty($conf->projet->enabled) ?
'1' :
'3').
'"><input name="unitprice" id="unitprice" size="10" value="'.
GETPOST(
"unitprice").
'"></td>';
137 if (!empty($conf->projet->enabled))
139 print '<td>'.$langs->trans(
'Project').
'</td>';
142 $formproject->select_projects(-1,
'',
'projectid', 0, 0, 1, 0, 0, 0, 0,
'', 0, 0,
'maxwidth300');
148 $valformovementlabel = ((
GETPOST(
"label") && (
GETPOST(
'label') != $langs->trans(
"MovementCorrectStock",
''))) ?
GETPOST(
"label") : $langs->trans(
"MovementCorrectStock", $productref));
150 print '<td>'.$langs->trans(
"MovementLabel").
'</td>';
152 print '<input type="text" name="label" class="minwidth300" value="'.$valformovementlabel.
'">';
154 print '<td>'.$langs->trans(
"InventoryCode").
'</td><td><input class="maxwidth100onsmartphone" name="inventorycode" id="inventorycode" value="'.(
GETPOSTISSET(
"inventorycode") ?
GETPOST(
"inventorycode",
'alpha') :
dol_print_date(
dol_now(),
'%y%m%d%H%M%S')).
'"></td>';
161 print '<div class="center">';
162 print '<input type="submit" class="button button-save" name="save" value="'.dol_escape_htmltag($langs->trans(
"Save")).
'">';
163 print ' ';
164 print '<input type="submit" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans(
"Cancel")).
'">';
169 <!-- END PHP STOCKCORRECTION.TPL.PHP -->
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_now($mode= 'auto')
Return date for now.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_get_fiche_end($notab=0)
Return tab footer of a card.