Skip to content
Snippets Groups Projects
Commit 934575ee authored by Rodolphe Quiedeville's avatar Rodolphe Quiedeville
Browse files

Gestion de la remise exceptionnelle

parent 32b61db6
No related branches found
No related tags found
No related merge requests found
<?php
/* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2003 Brian Fraval <brian@fraval.org>
*
*
* 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
......@@ -516,6 +517,35 @@ class Societe {
}
}
/**
* \brief Dfinit la socit comme un client
* \param remise montant de la remise
* \param user utilisateur qui place la remise
*
*/
function set_remise_except($remise, $user)
{
if ($this->id)
{
$remise = ereg_replace(",",".",$remise);
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_remise_except ";
$sql .= " WHERE fk_soc = " . $this->id ." AND fk_facture IS NULL;";
$this->db->query($sql);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except ";
$sql .= " ( datec, fk_soc, amount_ht, fk_user )";
$sql .= " VALUES (now(),".$this->id.",'".$remise."',".$user->id.")";
if (! $this->db->query($sql) )
{
dolibarr_print_error($this->db);
}
}
}
/**
* \brief Renvoie le nom d'une societe a partir d'un id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment