New: Gestion des avoirs la saisie des factures

This commit is contained in:
Laurent Destailleur 2006-04-04 00:42:21 +00:00
parent daa2c673ba
commit 868b0110aa
2 changed files with 4 additions and 40 deletions

View File

@ -350,18 +350,18 @@ if ($socidp > 0)
// Remise permanente
print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
print $langs->trans("CustomerRelativeDiscount");
print $langs->trans("CustomerRelativeDiscountShort");
print '<td><td align="right">';
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
print '</td></tr></table>';
print '</td><td colspan="3">'.$objsoc->remise_client."&nbsp;%</td>";
print '</td><td colspan="3">'.($objsoc->remise_client?$objsoc->remise_client.'%':$langs->trans("DiscountNone")).'</td>';
print '</tr>';
// Remise avoirs
print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding">';
print '<tr><td nowrap>';
print $langs->trans("CustomerAbsoluteDiscount");
print $langs->trans("CustomerAbsoluteDiscountShort");
print '<td><td align="right">';
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
print '</td></tr></table>';
@ -370,7 +370,7 @@ if ($socidp > 0)
$amount_discount=$objsoc->getcurrentDiscount();
if ($amount_discount < 0) dolibarr_print_error($db,$societe->error);
if ($amount_discount > 0) print $amount_discount.'&nbsp;'.$langs->trans("Currency".$conf->monnaie);
else print $langs->trans("None");
else print $langs->trans("DiscountNone");
print '</td>';
print '</tr>';

View File

@ -281,42 +281,6 @@ class Facture
}
/*
* \todo Plus utilisé. A reprendre dans validation facture
*/
function _affect_remise_exceptionnelle()
{
$error = 0;
$this->db->begin();
$sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except';
$sql .= ' SET fk_facture = '.$this->id.',';
$sql .= " amount_ht = '".price2num($remise)."'";
$sql .= ' WHERE rowid ='.$this->remise_exceptionnelle[0];
$sql .= ' AND fk_soc ='. $this->socidp;
if (! $this->db->query( $sql))
{
$error++;
}
if ($reliquat > 0)
{
}
if (! $error)
{
$this->db->commit();
}
else
{
$this->db->rollback();
}
return $error;
}
/**
* \brief Recupére l'objet facture et ses lignes de factures
* \param rowid id de la facture a récupérer