New: Gestion des avoirs à la saisie des factures
This commit is contained in:
parent
daa2c673ba
commit
868b0110aa
@ -350,18 +350,18 @@ if ($socidp > 0)
|
|||||||
// Remise permanente
|
// Remise permanente
|
||||||
print '<tr><td nowrap>';
|
print '<tr><td nowrap>';
|
||||||
print '<table width="100%" class="nobordernopadding"><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 '<td><td align="right">';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
print '</td><td colspan="3">'.$objsoc->remise_client." %</td>";
|
print '</td><td colspan="3">'.($objsoc->remise_client?$objsoc->remise_client.'%':$langs->trans("DiscountNone")).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Remise avoirs
|
// Remise avoirs
|
||||||
print '<tr><td nowrap>';
|
print '<tr><td nowrap>';
|
||||||
print '<table width="100%" class="nobordernopadding">';
|
print '<table width="100%" class="nobordernopadding">';
|
||||||
print '<tr><td nowrap>';
|
print '<tr><td nowrap>';
|
||||||
print $langs->trans("CustomerAbsoluteDiscount");
|
print $langs->trans("CustomerAbsoluteDiscountShort");
|
||||||
print '<td><td align="right">';
|
print '<td><td align="right">';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$objsoc->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
@ -370,7 +370,7 @@ if ($socidp > 0)
|
|||||||
$amount_discount=$objsoc->getcurrentDiscount();
|
$amount_discount=$objsoc->getcurrentDiscount();
|
||||||
if ($amount_discount < 0) dolibarr_print_error($db,$societe->error);
|
if ($amount_discount < 0) dolibarr_print_error($db,$societe->error);
|
||||||
if ($amount_discount > 0) print $amount_discount.' '.$langs->trans("Currency".$conf->monnaie);
|
if ($amount_discount > 0) print $amount_discount.' '.$langs->trans("Currency".$conf->monnaie);
|
||||||
else print $langs->trans("None");
|
else print $langs->trans("DiscountNone");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -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
|
* \brief Recupére l'objet facture et ses lignes de factures
|
||||||
* \param rowid id de la facture a récupérer
|
* \param rowid id de la facture a récupérer
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user