Merge pull request #6126 from aspangaro/5.0-b6

Fix presentation on warehouse card
This commit is contained in:
Laurent Destailleur 2016-12-10 23:15:13 +01:00 committed by GitHub
commit f70c4e4d23
2 changed files with 30 additions and 30 deletions

View File

@ -35,7 +35,7 @@ function stock_prepare_head($object)
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT.'/product/stock/card.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/product/stock/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("WarehouseCard"); $head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card'; $head[$h][2] = 'card';
$h++; $h++;

View File

@ -193,7 +193,7 @@ if ($action == 'create')
// Ref // Ref
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td><input name="libelle" size="20" value=""></td></tr>'; print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td><input name="libelle" size="20" value=""></td></tr>';
print '<tr><td >'.$langs->trans("LocationSummary").'</td><td colspan="3"><input name="lieu" size="40" value="'.(!empty($object->lieu)?$object->lieu:'').'"></td></tr>'; print '<tr><td>'.$langs->trans("LocationSummary").'</td><td><input name="lieu" size="40" value="'.(!empty($object->lieu)?$object->lieu:'').'"></td></tr>';
// Parent entrepot // Parent entrepot
print '<tr><td>'.$langs->trans("AddIn").'</td><td>'; print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
@ -289,30 +289,29 @@ else
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint; if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint; elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
} }
// Print form confirm // Print form confirm
print $formconfirm; print $formconfirm;
// Warehouse card // Warehouse card
$linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">'; $morehtmlref='<div class="refidno">';
$morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu; $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu;
$morehtmlref.='</div>'; $morehtmlref.='</div>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref); dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'libelle', $morehtmlref);
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="fichehalfleft">'; print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Parent entrepot // Parent entrepot
$e = new Entrepot($db); $e = new Entrepot($db);
if(!empty($object->fk_parent) && $e->fetch($object->fk_parent) > 0) { if(!empty($object->fk_parent) && $e->fetch($object->fk_parent) > 0) {
print '<tr><td>'.$langs->trans("ParentWarehouse").'</td><td>'; print '<tr><td>'.$langs->trans("ParentWarehouse").'</td><td>';
print $e->getNomUrl(3); print $e->getNomUrl(3);
print '</td></tr>'; print '</td></tr>';
@ -324,32 +323,32 @@ else
$calcproductsunique=$object->nb_different_products(); $calcproductsunique=$object->nb_different_products();
$calcproducts=$object->nb_products(); $calcproducts=$object->nb_products();
// Total nb of different products // Total nb of different products
print '<tr><td>'.$langs->trans("NumberOfDifferentProducts").'</td><td>'; print '<tr><td>'.$langs->trans("NumberOfDifferentProducts").'</td><td>';
print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb']; print empty($calcproductsunique['nb'])?'0':$calcproductsunique['nb'];
print "</td></tr>"; print "</td></tr>";
// Nb of products // Nb of products
print '<tr><td>'.$langs->trans("NumberOfProducts").'</td><td>'; print '<tr><td>'.$langs->trans("NumberOfProducts").'</td><td>';
$valtoshow=price2num($calcproducts['nb'], 'MS'); $valtoshow=price2num($calcproducts['nb'], 'MS');
print empty($valtoshow)?'0':$valtoshow; print empty($valtoshow)?'0':$valtoshow;
print "</td></tr>"; print "</td></tr>";
print '</table>'; print '</table>';
print '</div>'; print '</div>';
print '<div class="fichehalfright">'; print '<div class="fichehalfright">';
print '<div class="ficheaddleft">'; print '<div class="ficheaddleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">'; print '<table class="border centpercent">';
// Value // Value
print '<tr><td class="titlefield">'.$langs->trans("EstimatedStockValueShort").'</td><td>'; print '<tr><td class="titlefield">'.$langs->trans("EstimatedStockValueShort").'</td><td>';
print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency); print price((empty($calcproducts['value'])?'0':price2num($calcproducts['value'],'MT')), 0, $langs, 0, -1, -1, $conf->currency);
print "</td></tr>"; print "</td></tr>";
// Last movement // Last movement
$sql = "SELECT max(m.datem) as datem"; $sql = "SELECT max(m.datem) as datem";
$sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql .= " FROM ".MAIN_DB_PREFIX."stock_mouvement as m";
@ -375,15 +374,15 @@ else
print $langs->trans("None"); print $langs->trans("None");
} }
print "</td></tr>"; print "</td></tr>";
print "</table>"; print "</table>";
print '</div>'; print '</div>';
print '</div>'; print '</div>';
print '</div>'; print '</div>';
print '<div class="clearboth"></div>'; print '<div class="clearboth"></div>';
dol_fiche_end(); dol_fiche_end();
@ -486,7 +485,7 @@ else
$productstatic->entity=$objp->entity; $productstatic->entity=$objp->entity;
print $productstatic->getNomUrl(1,'stock',16); print $productstatic->getNomUrl(1,'stock',16);
print '</td>'; print '</td>';
// Label // Label
print '<td>'.$objp->produit.'</td>'; print '<td>'.$objp->produit.'</td>';
@ -498,7 +497,7 @@ else
// Price buy PMP // Price buy PMP
print '<td align="right">'.price(price2num($objp->ppmp,'MU')).'</td>'; print '<td align="right">'.price(price2num($objp->ppmp,'MU')).'</td>';
// Total PMP // Total PMP
print '<td align="right">'.price(price2num($objp->ppmp*$objp->value,'MT')).'</td>'; print '<td align="right">'.price(price2num($objp->ppmp*$objp->value,'MT')).'</td>';
$totalvalue+=price2num($objp->ppmp*$objp->value,'MT'); $totalvalue+=price2num($objp->ppmp*$objp->value,'MT');
@ -580,41 +579,42 @@ else
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
print '<tr><td width="20%" class="fieldrequired">'.$langs->trans("Ref").'</td><td colspan="3"><input name="libelle" size="20" value="'.$object->libelle.'"></td></tr>'; print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Ref").'</td><td><input name="libelle" size="20" value="'.$object->libelle.'"></td></tr>';
print '<tr><td>'.$langs->trans("LocationSummary").'</td><td><input name="lieu" size="40" value="'.$object->lieu.'"></td></tr>';
print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3"><input name="lieu" size="40" value="'.$object->lieu.'"></td></tr>';
// Parent entrepot // Parent entrepot
print '<tr><td>'.$langs->trans("AddIn").'</td><td>'; print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
print $formproduct->selectWarehouses($object->fk_parent, 'fk_parent', '', 1); print $formproduct->selectWarehouses($object->fk_parent, 'fk_parent', '', 1);
print '</td></tr>'; print '</td></tr>';
// Description // Description
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td colspan="3">'; print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
// Editeur wysiwyg // Editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('desc',$object->description,'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,ROWS_5,'90%'); $doleditor=new DolEditor('desc',$object->description,'',180,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,ROWS_5,'90%');
$doleditor->Create(); $doleditor->Create();
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans('Address').'</td><td colspan="3"><textarea name="address" class="quatrevingtpercent" rows="3" wrap="soft">'; print '<tr><td>'.$langs->trans('Address').'</td><td><textarea name="address" class="quatrevingtpercent" rows="3" wrap="soft">';
print $object->address; print $object->address;
print '</textarea></td></tr>'; print '</textarea></td></tr>';
// Zip / Town // Zip / Town
print '<tr><td>'.$langs->trans('Zip').'</td><td>'; print '<tr><td>'.$langs->trans('Zip').'</td><td>';
print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6); print $formcompany->select_ziptown($object->zip,'zipcode',array('town','selectcountry_id','state_id'),6);
print '</td><td>'.$langs->trans('Town').'</td><td>'; print '</td></tr>';
print '<tr><td>'.$langs->trans('Town').'</td><td>';
print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id')); print $formcompany->select_ziptown($object->town,'town',array('zipcode','selectcountry_id','state_id'));
print '</td></tr>'; print '</td></tr>';
// Country // Country
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">'; print '<tr><td>'.$langs->trans('Country').'</td><td>';
print $form->select_country($object->country_id?$object->country_id:$mysoc->country_code,'country_id'); print $form->select_country($object->country_id?$object->country_id:$mysoc->country_code,'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
print '</td></tr>'; print '</td></tr>';
print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("Status").'</td><td>';
print '<select name="statut" class="flat">'; print '<select name="statut" class="flat">';
foreach ($object->statuts as $key => $value) foreach ($object->statuts as $key => $value)
{ {