55 if (is_array($pa_ledger) == FALSE) {
59 $this->ma_ledger=$pa_ledger;
60 $this->m_from=$p_from;
62 $this->m_mode=$p_mode;
63 $this->filter_operation=
'all';
80 if (! in_array(
$ledger_type,[
'ACH',
'ODS',
'VEN',
'FIN'])) {
172 $nb_ledger=count($pa_ledger);
185 for (
$i=0;
$i<$nb_ledger;
$i++)
188 $type_next=
$ledger->get_type();
191 if ($type_next!=
$type)
203 $ret->set_filter_operation($p_paid);
214 $ret->set_filter_operation($p_paid);
231 if ($p_jrn_type==
'ODS')
237 $name=$this->
db->get_value(
'select ad_value from fiche_detail where ad_id=1 and f_id=$1',
239 $first_name=$this->
db->get_value(
'select ad_value from fiche_detail where ad_id=32 and f_id=$1',
241 return $name.
' '.$first_name;
255 $tiers=$this->
db->get_value(
'select max(qs_client) '
256 .
'from quant_sold join jrnx using (j_id) '
257 .
'join jrn on (jr_grpt_id=j_grpt) where jrn.jr_id=$1',
261 $tiers=$this->
db->get_value(
'select max(qp_supplier) '
262 .
' from quant_purchase '
263 .
' join jrnx using (j_id) '
264 .
' join jrn on (jr_grpt_id=j_grpt) '
265 .
' where jrn.jr_id=$1',
270 $tiers=$this->
db->get_value(
'select qf_other from quant_fin where jr_id=$1',
274 if ($this->
db->count()==0)
286 static $not_done=TRUE;
289 $prepare_query->prepare_reconcile_date();
314 abstract function get_row($p_limit, $p_offset);
328 $sql_filter=
" and (jr_date_paid is not null or jr_rapt ='paid' ) ";
331 $sql_filter=
" and (jr_date_paid is null and coalesce(jr_rapt,'x') <> 'paid' ) ";
334 throw new Exception(
_(
"Filtre invalide",5));
367 $str_ledger=join(
',',$this->ma_ledger);
368 $count=$this->
db->get_value(
"select count(*)
370 join jrnx using (j_id)
371 join jrn on (jr_grpt_id=j_grpt)
372 where jr_tech_per>=$1 and jr_tech_per <=$2
373 and jr_def_id in ($str_ledger) ",[$this->m_from,$this->m_to]);
389 $prepare=$this->
db->is_prepare(
"supp_tax_info");
390 if ( $prepare ==
false ){
391 $this->
db->prepare(
"supp_tax_info",
"
393 case when j.j_debit is false and jd.jrn_def_type='ACH' then 0-j_montant
394 when j.j_debit is true and jd.jrn_def_type='VEN' then 0-j_montant
395 else j.j_montant end j_montant,
401 join acc_other_tax using (ac_id)
402 join jrnx j using (j_id)
403 join jrn_def jd on (j.j_jrn_def=jd.jrn_def_id)
408 $data=$this->get_data();
413 $ret=$this->
db->execute(
"supp_tax_info",array(
$data[
$i][
"jr_grpt_id"]));
418 $this->set_data(
$data);
record_log($p_message)
Record an error message into the log file of the server or in the log folder of NOALYSS Record also t...
_("actif, passif,charge,...")
display financial operations in HTML , PDF or CSV
manage the list of operation when we need several ledger with a different type or from Misceleaneous ...
Display the operations for Purchase.
Acc_Ledger_History : Manage the list (history) of operations for display.
Display history of operation.
set_ledger_type($ledger_type)
set_from($m_from)
setter m_from (periode id)
get_ledger()
setter / getter
get_filter_operation()
Filter operation.
$m_to
Ending Periode : periode.p_id.
set_m_mode($m_mode)
Setter.
export_html()
call the right function , depending of m_mode
export_oneline_html()
display operation on one line m_mode=L
set_to($m_to)
setter m_to (periode id)
$data
Contains data see acc_ledger_history_financial->get_row.
$m_from
Starting Periode : periode.p_id.
has_other_tax()
count the number of addition tax for the ledger
get_tiers($p_jrn_type, $jr_id)
Retrieve the third : supplier for purchase, customer for sale, bank for fin,.
export_accounting_html()
display accounting of operations m_mode=A
set_filter_operation($filter_operation)
Filter operation ,.
build_filter_operation()
Build a SQL clause to filter operation depending if they are paid, unpaid or no filter.
export_extended_html()
display extended details of operation m_mode=E
$filter_operation
type of ledger VEN , ACH , ODS, FIN
get_from()
setter / getter
set_a_ledger($ma_ledger)
setter ma_ledger (array of jrn_def_id)
get_tiers_id($p_jrn_type, $jr_id)
Return the f_id of the tiers , called by get_tiers.
static factory(Database $cn, $pa_ledger, $p_from, $p_to, $p_mode, $p_paid)
Build the right object.
$m_mode
mode of export L : one line, E accounting writing , D : Detail
prepare_reconcile_date()
Prepare the query for fetching the linked operation @staticvar int $prepare.
__construct(Database $cn, $pa_ledger, $p_from, $p_to, $p_mode)
get_mode()
setter / getter
export_detail_html()
display detail of operations m_mode=D
add_additional_tax_info()
add additional info about additional tax.
$ma_ledger
Array of ledger id : jrn_def.jrn_def_id.
get_row($p_limit, $p_offset)
Class for jrn, class acc_ledger for manipulating the ledger AND some acc.
static fetch_all($ret, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_all
contains the class for connecting to Noalyss
contains prepared query used in different classes of the application