New: Some change to allow to use different warehouse in pos module

This commit is contained in:
Laurent Destailleur 2010-06-16 21:07:49 +00:00
parent d1df15878c
commit f505c21a67
4 changed files with 29 additions and 9 deletions

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -17,7 +17,7 @@
*/
/**
* \file htdocs/admin/cachdesk.php
* \file htdocs/cashdesk/admin/cashdesk.php
* \ingroup cashdesk
* \brief Setup page for cashdesk module
* \version $Id$

View File

@ -49,6 +49,10 @@ if ( $_SESSION['uid'] > 0 )
}
require_once(DOL_DOCUMENT_ROOT."/product/class/html.formproduct.class.php");
$formproduct=new FormProduct($db);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@ -94,7 +98,20 @@ if ( $_SESSION['uid'] > 0 )
<td class="label1"><?php echo $langs->trans("Password"); ?></td>
<td><input name="pwdPassword" class="texte_login" type="password" value="" /></td>
</tr>
<?php if ($conf->stock->enabled)
{
$langs->load("stocks");
print "<tr>";
print '<td class="label1">'.$langs->trans("Warehouse").'</td>';
print '<td>';
$disabled=0;
if (! empty($conf->global->CASHDESK_ID_WAREHOUSE)) $disabled=1; // If a particular stock is defined, we disable choice
print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE,'idwarehouse','',!$disabled,$disabled);
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
print '</td>';
print "</tr>";
}
?>
</table>
<span class="bouton_login"><input name="sbmtConnexion" type="submit" value="Connexion" /></span>

View File

@ -0,0 +1 @@
doc_generic_odt.modules.php

View File

@ -90,13 +90,14 @@ class FormProduct
}
/**
* \brief Retourne la liste des modes de paiements possibles
* \brief Return list of possible payments modes
* \param selected Id du mode de paiement pre-selectionne
* \param htmlname Nom de la zone select
* \param filtertype Pour filtre
* \param empty 1=peut etre vide, 0 sinon
* \param htmlname Name of html select html
* \param filtertype For filtre
* \param empty 1=Can be empty, 0 if not
* \param disabled 1=Select is disabled
*/
function selectWarehouses($selected='',$htmlname='idwarehouse',$filtertype='',$empty=0)
function selectWarehouses($selected='',$htmlname='idwarehouse',$filtertype='',$empty=0,$disabled=0)
{
global $langs,$user;
@ -104,7 +105,7 @@ class FormProduct
$this->loadWarehouses();
print '<select class="flat" name="'.$htmlname.'">';
print '<select class="flat"'.($disabled?' disabled="true"':'').' name="'.($htmlname.($disabled?'_disabled':'')).'">';
if ($empty) print '<option value="">&nbsp;</option>';
foreach($this->cache_warehouses as $id => $arraytypes)
{
@ -116,6 +117,7 @@ class FormProduct
print '</option>';
}
print '</select>';
if ($disabled) print '<input type="hidden" name="'.$htmlname.'" value="'.$selected.'">';
}
/**