This commit is contained in:
Regis Houssin 2006-02-16 18:00:51 +00:00
parent d9a9492264
commit e2fe91096c

View File

@ -279,7 +279,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
if ($propalid)
{
$sql = 'SELECT s.nom, s.prefix_comm, s.idp, p.price, p.remise, p.remise_percent, p.tva, p.total, p.ref, p.fk_cond_reglement, fk_mode_reglement, '.$db->pdate('p.datep').' as dp, c.id as statut, c.label as lst';
$sql = 'SELECT s.nom, s.prefix_comm, s.idp, p.price, p.remise, p.remise_percent, p.tva, p.total, p.ref, p.fk_cond_reglement, p.fk_mode_reglement, '.$db->pdate('p.datep').' as dp, c.id as statut, c.label as lst';
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p, '.MAIN_DB_PREFIX.'c_propalst as c';
$sql .= ' WHERE p.fk_soc = s.idp AND p.fk_statut = c.id';
$sql .= ' AND p.rowid = '.$propalid;
@ -300,6 +300,17 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
$soc = new Societe($db);
$soc->fetch($obj->idp);
if ($propalid)
{
$cond_reglement_id = $obj->fk_cond_reglement;
$mode_reglement_id = $obj->fk_mode_reglement;
}
else
{
$cond_reglement_id = $soc->cond_reglement;
$mode_reglement_id = $soc->mode_reglement;
}
$nbrow=4;
if ($conf->projet->enabled) $nbrow++;
@ -332,12 +343,12 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
// Conditions de réglement
print '<tr><td nowrap>'.$langs->trans('PaymentConditions').'</td><td>';
$html->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id');
$html->select_conditions_paiements($cond_reglement_id,'cond_reglement_id');
print '</td></tr>';
// Mode de réglement
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
$html->select_types_paiements($soc->mode_reglement,'mode_reglement_id');
$html->select_types_paiements($mode_reglement_id,'mode_reglement_id');
print '</td></tr>';
if ($conf->projet->enabled)