New: Ajout d'une fiche de Charges Sociales permettant de modifier une saisie de charge (montant, libellé) tant qu'elle n'est pas payé.

Il reste à gérer le paiement pour avoir une entrée sur le compte automatiquement (comme pour les factures).
This commit is contained in:
Laurent Destailleur 2004-05-04 22:02:27 +00:00
parent 04ba55720e
commit f0cf042e14

View File

@ -1,5 +1,6 @@
<?PHP <?PHP
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -22,26 +23,69 @@
/* /*
* La tva collectée n'est calculée que sur les factures payées. * La tva collectée n'est calculée que sur les factures payées.
* *
*
*
*
*
*
*
*/ */
class ChargeSociales { class ChargeSociales {
var $id;
var $db; var $db;
var $date_ech;
var $note; var $date_pai;
var $lib;
Function ChargeSociales($DB) { var $type;
global $config; var $lib_typ;
var $amount;
var $paye;
var $periode;
Function ChargeSociales($DB)
{
$this->db = $DB; $this->db = $DB;
return 1; return 1;
} }
/*
*
*
*/
Function fetch($id)
{
$sql = "SELECT cs.rowid,".$this->db->pdate("cs.date_ech")." as date_ech,".$this->db->pdate("cs.date_pai")." as date_pai";
$sql .=", cs.libelle as lib, cs.fk_type, cs.amount, cs.paye, cs.periode, c.libelle";
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as cs, ".MAIN_DB_PREFIX."c_chargesociales as c";
$sql .= " WHERE cs.fk_type = c.id";
$sql .=" AND cs.rowid = ".$id;
if ($this->db->query($sql))
{
if ($this->db->num_rows())
{
$obj = $this->db->fetch_object(0);
$this->id = $obj->rowid;
$this->date_ech = $obj->date_ech;
$this->date_pai = $obj->date_pai;
$this->lib = $obj->lib;
$this->type = $obj->fk_type;
$this->type_libelle = $obj->libelle;
$this->amount = $obj->amount;
$this->paye = $obj->paye;
$this->periode = $obj->periode;
return 1;
}
else
{
return 0;
}
$this->db->free();
}
else
{
print $this->db->error();
return 0;
}
}
Function solde($year = 0) { Function solde($year = 0) {
$sql = "SELECT sum(f.amount) as amount"; $sql = "SELECT sum(f.amount) as amount";