20require_once NOALYSS_INCLUDE.
'/constant.php';
21require_once NOALYSS_INCLUDE.
'/lib/user_common.php';
46 parent::__construct($p_cn,
$p_id) ;
54 $this->poste=($p_poste==0)?$this->poste:$p_poste;
55 $sql=
"select * from vw_client where poste_comptable=$1";
56 $Res=$this->
cn->exec_sql(
$sql,array($this->poste));
62 $this->
id=
$row[
'f_id'];
63 $this->street=
$row[
'rue'];
64 $this->cp=
$row[
'code_postal'];
65 $this->country=
$row[
'pays'];
66 $this->vat_number=
$row[
'tva_num'];
81 $cond_sql=
" and A.j_date = B.j_date and extract(year from A.j_date) ='$p_year'";
83 $aCustomer=$this->
cn->get_array(
'select f_id,name,quick_code,tva_num,poste_comptable from vw_client '.
84 " where tva_num !='' ");
96 $CUSTOMER=$c->p_value;
104 foreach ($aCustomer as
$l )
108 $customer=
$l[
'quick_code'];
109 $a_Res[$customer][
'name']=
$l[
'name'];
110 $a_Res[$customer][
'vat_number']=
$l[
'tva_num'];
111 $a_Res[$customer][
'amount']=0;
112 $a_Res[$customer][
'tva']=0;
113 $a_Res[$customer][
'poste_comptable']=
$l[
'poste_comptable'];
117 $sql=
"select distinct j_grpt
120 join jrnx as B using (j_grpt)
122 A.j_qcode = '".$l[
'quick_code'].
"' and
123 B.j_poste::text like '".$SOLD.
"%'
142 $Res2=$this->
cn->exec_sql(
"select j_poste,j_montant,j_debit from jrnx where j_grpt=$1",[$row1[
'j_grpt']]);
152 if ( substr(
$e[
'j_poste'],0, strlen($SOLD))===$SOLD)
154 $amount=(
$e[
'j_debit']==
'f')?
$e[
'j_montant']:
$e[
'j_montant']*-1;
156 if ( substr(
$e[
'j_poste'],0, strlen($TVA))===$TVA)
158 $tva=(
$e[
'j_debit']==
'f')?
$e[
'j_montant']:
$e[
'j_montant']*-1;
162 $a_Res[$customer][
'amount']=(isset($a_Res[$customer][
'amount']))?$a_Res[$customer][
'amount']:0;
163 $a_Res[$customer][
'amount']+=
$amount;
167 $a_Res[$customer][
'tva']=(isset($a_Res[$customer][
'tva']))?$a_Res[$customer][
'tva']:0;
168 $a_Res[$customer][
'tva']+=$tva;
172 $a_Res[$customer][
'customer']=$customer;
Manage the table parm_code which contains the custom parameter for the module accountancy.
class Customer are a specific kind of card
get_by_account($p_poste=0)
Get all info contains in the view thanks to the poste elt (account)
__construct($p_cn, $p_id=0)
Constructor /* only a db connection is needed.
VatListing($p_year)
Get all the info for making a vat listing for the vat administration.
static fetch_all($ret)
wrapper for the function pg_fetch_all
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...