54 if (is_array($pa_ledger) == FALSE) {
58 $this->ma_ledger=$pa_ledger;
59 $this->m_from=$p_from;
61 $this->m_mode=$p_mode;
62 $this->filter_operation=
'all';
79 if (! in_array(
$ledger_type,[
'ACH',
'ODS',
'VEN',
'FIN'])) {
171 $nb_ledger=count($pa_ledger);
184 for (
$i=0;
$i<$nb_ledger;
$i++)
187 $type_next=
$ledger->get_type();
190 if ($type_next!=
$type)
202 $ret->set_filter_operation($p_paid);
213 $ret->set_filter_operation($p_paid);
230 if ($p_jrn_type==
'ODS')
236 $name=$this->
db->get_value(
'select ad_value from fiche_detail where ad_id=1 and f_id=$1',
238 $first_name=$this->
db->get_value(
'select ad_value from fiche_detail where ad_id=32 and f_id=$1',
240 return $name.
' '.$first_name;
254 $tiers=$this->
db->get_value(
'select max(qs_client) '
255 .
'from quant_sold join jrnx using (j_id) '
256 .
'join jrn on (jr_grpt_id=j_grpt) where jrn.jr_id=$1',
260 $tiers=$this->
db->get_value(
'select max(qp_supplier) '
261 .
' from quant_purchase '
262 .
' join jrnx using (j_id) '
263 .
' join jrn on (jr_grpt_id=j_grpt) '
264 .
' where jrn.jr_id=$1',
269 $tiers=$this->
db->get_value(
'select qf_other from quant_fin where jr_id=$1',
273 if ($this->
db->count()==0)
285 static $not_done=TRUE;
288 $prepare_query->prepare_reconcile_date();
313 abstract function get_row($p_limit, $p_offset);
327 $sql_filter=
" and (jr_date_paid is not null or jr_rapt ='paid' ) ";
330 $sql_filter=
" and (jr_date_paid is null and coalesce(jr_rapt,'x') <> 'paid' ) ";
333 throw new Exception(
_(
"Filtre invalide",5));
366 $str_ledger=join(
',',$this->ma_ledger);
367 $count=$this->
db->get_value(
"select count(*)
369 join jrnx using (j_id)
370 join jrn on (jr_grpt_id=j_grpt)
371 where jr_tech_per>=$1 and jr_tech_per <=$2
372 and jr_def_id in ($str_ledger) ",[$this->m_from,$this->m_to]);
388 $prepare=$this->
db->is_prepare(
"supp_tax_info");
389 if ( $prepare ==
false ){
390 $this->
db->prepare(
"supp_tax_info",
"
392 case when j.j_debit is false and jd.jrn_def_type='ACH' then 0-j_montant
393 when j.j_debit is true and jd.jrn_def_type='VEN' then 0-j_montant
394 else j.j_montant end j_montant,
400 join acc_other_tax using (ac_id)
401 join jrnx j using (j_id)
402 join jrn_def jd on (j.j_jrn_def=jd.jrn_def_id)
407 $data=$this->get_data();
412 $ret=$this->
db->execute(
"supp_tax_info",array(
$data[
$i][
"jr_grpt_id"]));
417 $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)
$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)
wrapper for the function pg_fetch_all
contains the class for connecting to Noalyss
contains prepared query used in different classes of the application