Permalink
Browse files

Fix: Add social contributions in budget

  • Loading branch information...
1 parent 82a3bd3 commit 5d95afa1497cae41c0fc93bac4ef00eac89074b3 @eldy eldy committed Jul 31, 2008
View
@@ -28,6 +28,7 @@ For users:
- Can attach several files to email when sending an invoice, order or
proposal by email.
- More informations reported in system information pages.
+- Add a budget report.
- New translation: Added spanish language.
- Added a security audit report.
- Other minor changes (features, look, fixes)
@@ -15,15 +15,13 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
*/
/**
\file htdocs/chargesociales.class.php
\ingroup facture
\brief Fichier de la classe des charges sociales
- \version $Revision$
+ \version $Id$
*/
@@ -304,11 +302,37 @@ function getNomUrl($withpicto=0,$maxlen=0)
$lien = '<a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$this->id.'">';
$lienfin='</a>';
- if ($withpicto) $result.=($lien.img_object($langs->trans("ShowBill"),'bill').$lienfin.' ');
+ if ($withpicto) $result.=($lien.img_object($langs->trans("ShowSocialContribution"),'bill').$lienfin.' ');
$result.=$lien.($maxlen?dolibarr_trunc($this->lib,$maxlen):$this->lib).$lienfin;
return $result;
}
-
+
+ /**
+ * \brief Return amount aof payments already done
+ * \return int Amount of payment already done, <0 if KO
+ */
+ function getSommePaiement()
+ {
+ $table='paiementcharge';
+ $field='amount';
+
+ $sql = 'SELECT sum(amount) as amount';
+ $sql.= ' FROM '.MAIN_DB_PREFIX.$table;
+ $sql.= ' WHERE '.$field.' = '.$this->id;
+
+ dolibarr_syslog("ChargeSociales::getSommePaiement sql=".$sql, LOG_DEBUG);
+ $resql=$this->db->query($sql);
+ if ($resql)
+ {
+ $obj = $this->db->fetch_object($resql);
+ $this->db->free($resql);
+ return $obj->amount;
+ }
+ else
+ {
+ return -1;
+ }
+ }
}
Oops, something went wrong.

0 comments on commit 5d95afa

Please sign in to comment.