noalyss Version-9
|
Public Member Functions | |
__construct ($p_cn, $p_id) | |
add_card ($p_filter, $p_id_update) | |
Return a button to create new card, depending of the ledger. More... | |
button_copy_operation () | |
Show a button to create an operation identical to the recorded one. More... | |
button_new_operation () | |
Create a button to encode a new operation into the same ledger. More... | |
check_currency ($p_qcode_payment, $p_currency_id) | |
When we write a record for the payment at the same time as a sale or a purchase, to have a bank saldo reliable , all the bank operation must be in the same currency Operation = Currency 1 and Bank = Currency 2 then it must failed , except if currency 2 (of the bank is the default currency. More... | |
check_currency_setting ($p_currency_code) | |
Check that the currency code does exist and the setting of the folder is correct. More... | |
check_payment ($e_mp, $e_mp_qcode) | |
check if the payment method is valid More... | |
check_periode () | |
Check if a Dossier is using the check on the periode, if true than the user has to enter the date and the periode, it is a security check. More... | |
check_strict () | |
Check if a Dossier is using the strict mode or not. More... | |
compute_internal_code ($p_grpt) | |
compute the internal code of the saved operation and set the $this->jr_internal to the computed value More... | |
confirm ($p_array, $p_readonly=false) | |
show the result of the array to confirm before inserting More... | |
convert_from_follow ($p_ag_id) | |
create_document ($internal, $p_array) | |
create the invoice and saved it as attachment to the operation, More... | |
CurrencyInput ($p_currency_code, $p_currency_rate, $p_eur_amount) | |
Create a select from value for currency and add javascript to update $p_currency_rate and $p_eur_amount. More... | |
delete () | |
let you delete a operation More... | |
delete_ledger () | |
delete a ledger IF it doesn't contain anything More... | |
display_additional_tax ($p_additional_tax, $p_amount) | |
in confirm screen , display the compute value for additional tax @parameter $p_additional_tax acc_other_tax.ac_id More... | |
display_ledger () | |
display detail of a ledger More... | |
display_negative_warning ($p_amount) | |
If the amount is positive and the ledger expects a negative amount, il will return the saved warning. More... | |
display_warning ($pa_msg, $p_warning) | |
Display warning contained in an array. More... | |
existing_vat () | |
return the used VAT code with a rate > 0 More... | |
get_all_fiche_def () | |
retrieve all the card for this type of ledger, make them into a string separated by comma More... | |
get_class_def () | |
retrieve the jrn_def_class_deb and return it More... | |
get_currency () | |
returns the code iso of the default currency for this ledger More... | |
get_customer_late () | |
get info from customer not yet paid More... | |
get_customer_now () | |
get info from customer to pay today More... | |
get_default_card ($p_ledger_type, $p_side) | |
Return an array of default card for the ledger type given. More... | |
get_fiche_def () | |
retrieve the jrn_def_fiche and return them into a array index deb, cred More... | |
get_first ($p_type, $p_access=3) | |
get the first ledger More... | |
get_id ($p_internal) | |
retrieve the jr_id thanks the internal code, do not change anything to the current object More... | |
get_is_loaded () | |
get_last ($p_limit) | |
return the last p_limit operation into an array More... | |
get_last_date () | |
get the date of the last operation More... | |
get_last_pj () | |
get_ledger_id () | |
Set the jrn_def.jrn_def_id. More... | |
get_min_row () | |
get_name () | |
Return the name of a ledger. More... | |
get_operation ($p_from, $p_to) | |
retrieve operation from jrn More... | |
get_operation_date ($p_date, $p_ledger_type, $sql_op) | |
Get operation from the ledger type before, after or with the given date . More... | |
get_other_amount ($p_jr_id) | |
get the amount of vat for a given jr_grpt_id from the table quant_purchase More... | |
get_propertie () | |
Get the properties of a journal. More... | |
get_rowSimple ($p_from, $p_to, $pa_ledger=[], $trunc=0, $p_limit=-1, $p_offset=-1) | |
Get simplified row from ledger Call Acc_Ledger_History_Generic:get_rowSimple. More... | |
get_solde ($p_from, $p_to) | |
get the saldo of a ledger for a specific period More... | |
get_supplier_late () | |
get info from supplier not yet paid More... | |
get_supplier_now () | |
get info from supplier to pay today More... | |
get_tiers ($p_jrn_type, $jr_id) | |
Retrieve the third : supplier for purchase, customer for sale, bank for fin,. More... | |
get_tiers_id ($p_jrn_type, $jr_id) | |
Return the f_id of the tiers , called by get_tiers. More... | |
get_type () | |
Return the type of a ledger (ACH,VEN,ODS or FIN) or GL. More... | |
guess_pj () | |
guess what the next pj should be More... | |
has_other_tax () | |
returns true if the ledger has an additional tax More... | |
has_quantity () | |
Check if a ledger is enabled , 1 for yes and 0 if disabled. More... | |
inc_seq_pj () | |
increment the sequence for the pj More... | |
input ($p_array=null, $p_readonly=0) | |
Show the form to encode your operation. More... | |
input_additional_tax () | |
form : display additional tax available for this ledger and value, set 2 values : checkbox if tax applies and value More... | |
input_extra_info () | |
input_new () | |
display screen to enter a new ledger More... | |
input_paid ($p_selected, $p_amount=0, $p_date="", $p_comm="") | |
Create the section payment. More... | |
is_closed ($p_periode) | |
check if the current ledger is closed More... | |
is_enable () | |
Check if a ledger is enabled , 1 for yes and 0 if disabled. More... | |
listing () | |
listing of all ledgers More... | |
previous_amount ($p_to) | |
retrieve amount of previous periode More... | |
previous_other_tax ($p_to) | |
retrieve the previous amount More... | |
reverse ($p_date, $p_label) | |
reverse the operation by creating the opposite one, the result is to avoid it it must be done in More... | |
save ($p_array=null) | |
save the operation into the jrnx,jrn, , CA and pre_def More... | |
save_followup ($s_related_action) | |
attach action-followups to an operation, More... | |
save_new ($array) | |
Insert a new ledger , member variable like jrn_def_id will changed. More... | |
search_group ($p_what, $p_value) | |
retreive the jr_grpt_id from a ledger More... | |
select_default_currency () | |
create a select button to set the default currency for a ledger used only for empty financial ledger More... | |
select_depot ($p_readonly, $p_repo) | |
Let you select the repository before confirming a sale or a purchase. More... | |
select_ledger ($p_type="ALL", $p_access=3, $enable=TRUE) | |
Show a select list of the ledgers you can access in writing, reading or simply accessing. More... | |
set_currency_id () | |
retrieve currency_id from database More... | |
set_is_loaded ($is_loaded) | |
set_ledger_id ($p_id) | |
Set the jrn_def.jrn_def_id. More... | |
set_quantity ($p_value) | |
set quantity for the ledger to 1 or 0, More... | |
update ($array=null) | |
update a ledger More... | |
update_internal_code ($p_internal) | |
update_paid ($p_array) | |
Update the paiment in the list of operation. More... | |
use_quant_table ($p_grpt_id, $p_jrn_type) | |
Check if the operation is used in the table quant*. More... | |
vat_operation ($p_jr_id) | |
get the amount of vat for a given jr_grpt_id from the table quant_purchase More... | |
verify_ledger ($array) | |
Verify before update. More... | |
verify_operation ($p_array) | |
verify that the operation can be saved More... | |
Static Public Member Functions | |
static | array_cat () |
create an array of the existing cat, to be used in a checkbox form More... | |
static | next_number ($p_cn, $p_type) |
retrieve the next number for this type of ledger More... | |
static | test_me ($pCase='') |
this function is intended to test this class More... | |
Data Fields | |
$currency_id | |
!< default number of rows by default 10 More... | |
$db | |
!< jrn_def.jrn_def_id More... | |
$id | |
$ledger_type | |
!< row of the ledger More... | |
$nb | |
!< type of the ledger ACH ODS FIN VEN or GL More... | |
$row | |
!< database connextion More... | |
Protected Member Functions | |
find_label ($p_value) | |
Retrieve the label of an accounting. More... | |
verify_autonumber ($p_array) | |
compare given receipt number and suggested one, if different , it means that the user enters a receipt number if e_pj or e_pj_suggest is not set or empty , or if both are equals then will return true, it returns only if they exist and are different More... | |
warn_manual_receipt ($p_array) | |
warn if the suggested receipt and receipt are different , it means that the user tried to number himself More... | |
Protected Attributes | |
$is_loaded | |
!< is_loaded true the ledger definition is loaded or false, it is not More... | |
Definition at line 34 of file acc_ledger.class.php.
Acc_Ledger::__construct | ( | $p_cn, | |
$p_id | |||
) |
$p_cn | database connexion |
$p_id | jrn.jrn_def_id |
Reimplemented in Acc_Ledger_Fin, Acc_Ledger_Purchase, and Acc_Ledger_Sale.
Definition at line 51 of file acc_ledger.class.php.
References $id, $jrn_def_name, $p_id, db, jrn_def_id, MAX_ARTICLE, and nb().
Acc_Ledger::add_card | ( | $p_filter, | |
$p_id_update | |||
) |
Return a button to create new card, depending of the ledger.
$p_filter | string : filter for adding : deb, cred or -1 for filter depending of the ledger |
$p_id_update | string |
Definition at line 3341 of file acc_ledger.class.php.
References Icon_Action\icon_add().
Referenced by Acc_Ledger_Fin\input(), input(), and Acc_Ledger_Sale\input().
|
static |
create an array of the existing cat, to be used in a checkbox form
Definition at line 2469 of file acc_ledger.class.php.
References $r.
Referenced by Acc_Balance\filter_cat().
Acc_Ledger::button_copy_operation | ( | ) |
Show a button to create an operation identical to the recorded one.
It is a form POST since it is a limit with get
Definition at line 3301 of file acc_ledger.class.php.
References $http, $i, $nb, HtmlInput\hidden(), HtmlInput\post_to_hidden(), and HtmlInput\submit().
Acc_Ledger::button_new_operation | ( | ) |
Create a button to encode a new operation into the same ledger.
Definition at line 3288 of file acc_ledger.class.php.
References $_REQUEST, $url, and HtmlInput\button_anchor().
Acc_Ledger::check_currency | ( | $p_qcode_payment, | |
$p_currency_id | |||
) |
When we write a record for the payment at the same time as a sale or a purchase, to have a bank saldo reliable , all the bank operation must be in the same currency Operation = Currency 1 and Bank = Currency 2 then it must failed , except if currency 2 (of the bank is the default currency.
string | $p_qcode_payment | Qcode of the payment card |
int | $p_currency_id | currency id of the sale/purchase operation |
Exception |
Definition at line 1861 of file acc_ledger.class.php.
Referenced by Acc_Ledger_Purchase\verify_operation(), and Acc_Ledger_Sale\verify_operation().
Acc_Ledger::check_currency_setting | ( | $p_currency_code | ) |
Check that the currency code does exist and the setting of the folder is correct.
int | $p_currency_code |
Exception |
Definition at line 1821 of file acc_ledger.class.php.
Referenced by Acc_Ledger_Purchase\verify_operation(), and Acc_Ledger_Sale\verify_operation().
Acc_Ledger::check_payment | ( | $e_mp, | |
$e_mp_qcode | |||
) |
check if the payment method is valid
$e_mp | is the value and $e_mp_qcode is the quickcode |
Definition at line 1938 of file acc_ledger.class.php.
References $array, $poste, ATTR_DEF_ACCOUNT, and db.
Referenced by Acc_Ledger_Purchase\verify_operation(), and Acc_Ledger_Sale\verify_operation().
Acc_Ledger::check_periode | ( | ) |
Check if a Dossier is using the check on the periode, if true than the user has to enter the date and the periode, it is a security check.
Definition at line 1806 of file acc_ledger.class.php.
Referenced by Acc_Ledger_Fin\confirm(), confirm(), Acc_Ledger_Sale\confirm(), Acc_Ledger_Fin\input(), input(), Acc_Ledger_Sale\input(), Acc_Ledger_Fin\insert(), Acc_Ledger_Purchase\insert(), Acc_Ledger_Sale\insert(), Acc_Ledger_Fin\verify_operation(), Acc_Ledger_Purchase\verify_operation(), and Acc_Ledger_Sale\verify_operation().
Acc_Ledger::check_strict | ( | ) |
Check if a Dossier is using the strict mode or not.
Definition at line 1791 of file acc_ledger.class.php.
Referenced by Acc_Ledger_Fin\verify_operation(), Acc_Ledger_Purchase\verify_operation(), and Acc_Ledger_Sale\verify_operation().
Acc_Ledger::compute_internal_code | ( | $p_grpt | ) |
compute the internal code of the saved operation and set the $this->jr_internal to the computed value
$p_grpt | id in jr_grpt_ |
Definition at line 1337 of file acc_ledger.class.php.
Referenced by Acc_Ledger_Fin\insert(), Acc_Ledger_Purchase\insert(), Acc_Ledger_Sale\insert(), and reverse().
Acc_Ledger::confirm | ( | $p_array, | |
$p_readonly = false |
|||
) |
show the result of the array to confirm before inserting
$p_array | array from the form |
Reimplemented in Acc_Ledger_Fin, Acc_Ledger_Purchase, and Acc_Ledger_Sale.
Definition at line 629 of file acc_ledger.class.php.
References $anc, $class, $count, $currency, $date_limit, $default_currency, $desc, $e_date, $g_parameter, $g_user, $http, $i, $msg, $op, $p_array, $p_readonly, $ret, $span, ATTR_DEF_ACCOUNT, ATTR_DEF_NAME, check_periode(), db, display_warning(), get_type(), guess_pj(), h, Anc_Plan\hidden(), HtmlInput\hidden(), nbm(), td(), tr(), UPDRECEIPT, verify_operation(), warn_manual_receipt(), and with_concerned.
Referenced by input().
Acc_Ledger::convert_from_follow | ( | $p_ag_id | ) |
Definition at line 3197 of file acc_ledger.class.php.
References $array, $g_user, $i, $qcode, db, isNumber(), and nb().
Acc_Ledger::create_document | ( | $internal, | |
$p_array | |||
) |
create the invoice and saved it as attachment to the operation,
$internal | is the internal code |
$p_array | is normally the $_POST |
Definition at line 1912 of file acc_ledger.class.php.
References $doc, $p_array, $sql, db, h, and noalyss_strlentrim().
Referenced by Acc_Ledger_Purchase\insert(), and Acc_Ledger_Sale\insert().
Acc_Ledger::CurrencyInput | ( | $p_currency_code, | |
$p_currency_rate, | |||
$p_eur_amount | |||
) |
Create a select from value for currency and add javascript to update $p_currency_rate and $p_eur_amount.
string | DOMID $p_currency_code |
string | DOMID $p_currency_rate |
string | DOMID $p_eur_amount |
Definition at line 3408 of file acc_ledger.class.php.
References $currency, $select, $type, db, elseif, get_type(), and Dossier\id().
Referenced by input(), and Acc_Ledger_Sale\input().
Acc_Ledger::delete | ( | ) |
let you delete a operation
the attached document is not deleted
Normally it should be named delete_operation, cause the id is the ledger_id (jrn_def_id) and not the operation id
Definition at line 168 of file acc_ledger.class.php.
Acc_Ledger::delete_ledger | ( | ) |
delete a ledger IF it doesn't contain anything
cannot delete |
Definition at line 3080 of file acc_ledger.class.php.
References $e, db, jrn_def_id, and record_log().
Acc_Ledger::display_additional_tax | ( | $p_additional_tax, | |
$p_amount | |||
) |
in confirm screen , display the compute value for additional tax @parameter $p_additional_tax acc_other_tax.ac_id
Definition at line 3525 of file acc_ledger.class.php.
References $label, $out, $row, $title, cn, h, and h2().
Acc_Ledger::display_ledger | ( | ) |
display detail of a ledger
Definition at line 2564 of file acc_ledger.class.php.
References $card, $cn, $code, $db, $default_currency, $description, $f_id, $hidden, $jrn_def_description, $jrn_def_name, $name, $pj_seq, $type, db, get_fiche_def(), get_last_pj(), HtmlInput\hidden(), isNumber(), noalyss_explode(), and select_default_currency().
Acc_Ledger::display_negative_warning | ( | $p_amount | ) |
If the amount is positive and the ledger expects a negative amount, il will return the saved warning.
int | $p_amount | amount to check |
Exception | 1 if invalid ledger |
Definition at line 3451 of file acc_ledger.class.php.
Referenced by Acc_Ledger_Sale\confirm().
Acc_Ledger::display_warning | ( | $pa_msg, | |
$p_warning | |||
) |
Display warning contained in an array.
Definition at line 190 of file acc_ledger.class.php.
Referenced by confirm().
Acc_Ledger::existing_vat | ( | ) |
return the used VAT code with a rate > 0
Definition at line 2047 of file acc_ledger.class.php.
References $array, db, and get_type().
|
protected |
Retrieve the label of an accounting.
$p_value | tmp_pcmn.pcm_val |
Definition at line 3246 of file acc_ledger.class.php.
References db.
Acc_Ledger::get_all_fiche_def | ( | ) |
retrieve all the card for this type of ledger, make them into a string separated by comma
Definition at line 1757 of file acc_ledger.class.php.
Acc_Ledger::get_class_def | ( | ) |
retrieve the jrn_def_class_deb and return it
Definition at line 607 of file acc_ledger.class.php.
References $r, $res, $sql, db, and DatabaseCore\fetch_all().
Acc_Ledger::get_currency | ( | ) |
returns the code iso of the default currency for this ledger
Definition at line 3437 of file acc_ledger.class.php.
References db.
Referenced by Acc_Ledger_Fin\confirm().
Acc_Ledger::get_customer_late | ( | ) |
get info from customer not yet paid
Definition at line 3191 of file acc_ledger.class.php.
References $array, and get_operation_date().
Acc_Ledger::get_customer_now | ( | ) |
get info from customer to pay today
Definition at line 3182 of file acc_ledger.class.php.
References $array, and get_operation_date().
Acc_Ledger::get_default_card | ( | $p_ledger_type, | |
$p_side | |||
) |
Return an array of default card for the ledger type given.
$p_ledger_type | VEN ACH ODS or FIN |
$p_side | D for Debit or C for credit or NA No Applicable |
Definition at line 1678 of file acc_ledger.class.php.
Referenced by input_new().
Acc_Ledger::get_fiche_def | ( | ) |
retrieve the jrn_def_fiche and return them into a array index deb, cred
param
return return an array ('deb'=> ,'cred'=>)
Definition at line 586 of file acc_ledger.class.php.
References $r, $res, $sql, db, and DatabaseCore\fetch_all().
Referenced by display_ledger().
Acc_Ledger::get_first | ( | $p_type, | |
$p_access = 3 |
|||
) |
get the first ledger
type |
Definition at line 1628 of file acc_ledger.class.php.
Acc_Ledger::get_id | ( | $p_internal | ) |
retrieve the jr_id thanks the internal code, do not change anything to the current object
internal | code |
Definition at line 1896 of file acc_ledger.class.php.
References $sql, $value, and db.
Referenced by Acc_Ledger_Purchase\insert(), and Acc_Ledger_Sale\insert().
Acc_Ledger::get_is_loaded | ( | ) |
Definition at line 67 of file acc_ledger.class.php.
References $is_loaded.
Referenced by Acc_Ledger_Fin\confirm(), and Acc_Ledger_Fin\insert().
Acc_Ledger::get_last | ( | $p_limit | ) |
return the last p_limit operation into an array
$p_limit | is the max of operation to return |
Definition at line 1987 of file acc_ledger.class.php.
References $array, $filter_ledger, $g_user, $sql, db, and noalyss_str_replace().
Acc_Ledger::get_last_date | ( | ) |
get the date of the last operation
Definition at line 1881 of file acc_ledger.class.php.
Referenced by Acc_Ledger_Fin\verify_operation(), Acc_Ledger_Purchase\verify_operation(), and Acc_Ledger_Sale\verify_operation().
Acc_Ledger::get_last_pj | ( | ) |
Definition at line 88 of file acc_ledger.class.php.
References $last, $ret, db, and isNumber().
Referenced by display_ledger(), and guess_pj().
Acc_Ledger::get_ledger_id | ( | ) |
Set the jrn_def.jrn_def_id.
Definition at line 125 of file acc_ledger.class.php.
References $id.
Acc_Ledger::get_min_row | ( | ) |
Definition at line 827 of file acc_ledger.class.php.
Referenced by Acc_Ledger_Fin\input(), input(), and Acc_Ledger_Sale\input().
Acc_Ledger::get_name | ( | ) |
Return the name of a ledger.
Definition at line 443 of file acc_ledger.class.php.
References $ledger_name, $Max, $Res, $ret, db, DatabaseCore\fetch_array(), and DatabaseCore\num_row().
Referenced by Acc_Ledger_Fin\confirm(), Acc_Ledger_Sale\confirm(), and Acc_Ledger_Fin\input().
Acc_Ledger::get_operation | ( | $p_from, | |
$p_to | |||
) |
retrieve operation from jrn
$p_from | periode (id) |
$p_to | periode (id) |
Definition at line 2024 of file acc_ledger.class.php.
Acc_Ledger::get_operation_date | ( | $p_date, | |
$p_ledger_type, | |||
$sql_op | |||
) |
Get operation from the ledger type before, after or with the given date .
The array is filtered by the ledgers granted to the user @global type $g_user
$p_date | Date (d.m.Y) | |
$p_ledger_type | VEN ACH | |
type | $sql_op | < > or = |
Exception |
Definition at line 3107 of file acc_ledger.class.php.
References $array, $filter, $g_user, $p_date, $sql, and db.
Referenced by get_customer_late(), get_customer_now(), get_supplier_late(), and get_supplier_now().
Acc_Ledger::get_other_amount | ( | $p_jr_id | ) |
get the amount of vat for a given jr_grpt_id from the table quant_purchase
the | jr_grpt_id |
Definition at line 2094 of file acc_ledger.class.php.
References $array, $ret, db, and get_type().
Acc_Ledger::get_propertie | ( | ) |
Get the properties of a journal.
Definition at line 491 of file acc_ledger.class.php.
Referenced by guess_pj().
Acc_Ledger::get_rowSimple | ( | $p_from, | |
$p_to, | |||
$pa_ledger = [] , |
|||
$trunc = 0 , |
|||
$p_limit = -1 , |
|||
$p_offset = -1 |
|||
) |
Get simplified row from ledger Call Acc_Ledger_History_Generic:get_rowSimple.
p_from | periode |
p_to | periode |
p_limit | starting line |
p_offset | number of lines |
trunc | if data must be truncated (pdf export) |
Definition at line 3146 of file acc_ledger.class.php.
References $data, $id, Print_Ledger\available_ledger(), and db.
Acc_Ledger::get_solde | ( | $p_from, | |
$p_to | |||
) |
get the saldo of a ledger for a specific period
$p_from | start period |
$p_to | end period |
Definition at line 513 of file acc_ledger.class.php.
References $array, $cred, $deb, $ledger, $line, $periode, $response, $ret, $sql, db, DatabaseCore\fetch_all(), and sql_filter_per().
Acc_Ledger::get_supplier_late | ( | ) |
get info from supplier not yet paid
Definition at line 3173 of file acc_ledger.class.php.
References $array, and get_operation_date().
Acc_Ledger::get_supplier_now | ( | ) |
get info from supplier to pay today
Definition at line 3164 of file acc_ledger.class.php.
References $array, and get_operation_date().
Acc_Ledger::get_tiers | ( | $p_jrn_type, | |
$jr_id | |||
) |
Retrieve the third : supplier for purchase, customer for sale, bank for fin,.
$p_jrn_type | type of the ledger FIN, VEN ACH or ODS |
$jr_id | jrn.jr_id |
Definition at line 2514 of file acc_ledger.class.php.
References $jr_id, $name, $tiers, db, and get_tiers_id().
Acc_Ledger::get_tiers_id | ( | $p_jrn_type, | |
$jr_id | |||
) |
Return the f_id of the tiers , called by get_tiers.
$p_jrn_type | type of the ledger FIN, VEN ACH or ODS |
$jr_id | jrn.jr_id |
Definition at line 2485 of file acc_ledger.class.php.
References $jr_id, $tiers, and db.
Referenced by get_tiers().
Acc_Ledger::get_type | ( | ) |
Return the type of a ledger (ACH,VEN,ODS or FIN) or GL.
Definition at line 133 of file acc_ledger.class.php.
References $Max, $Res, $ret, db, DatabaseCore\fetch_array(), and DatabaseCore\num_row().
Referenced by confirm(), CurrencyInput(), existing_vat(), Print_Ledger\factory(), get_other_amount(), input(), previous_amount(), previous_other_tax(), and vat_operation().
Acc_Ledger::guess_pj | ( | ) |
guess what the next pj should be
Definition at line 471 of file acc_ledger.class.php.
References $pj_seq, $prop, get_last_pj(), and get_propertie().
Referenced by confirm(), Acc_Ledger_Fin\input(), input(), and Acc_Ledger_Sale\input().
Acc_Ledger::has_other_tax | ( | ) |
returns true if the ledger has an additional tax
Definition at line 3546 of file acc_ledger.class.php.
References db.
Referenced by Acc_Ledger_Sale\confirm(), input_additional_tax(), Acc_Ledger_Purchase\insert(), and Acc_Ledger_Sale\insert().
Acc_Ledger::has_quantity | ( | ) |
Check if a ledger is enabled , 1 for yes and 0 if disabled.
Definition at line 3357 of file acc_ledger.class.php.
Acc_Ledger::inc_seq_pj | ( | ) |
increment the sequence for the pj
Definition at line 1974 of file acc_ledger.class.php.
Referenced by Acc_Ledger_Fin\insert(), Acc_Ledger_Purchase\insert(), and Acc_Ledger_Sale\insert().
Acc_Ledger::input | ( | $p_array = null , |
|
$p_readonly = 0 |
|||
) |
Show the form to encode your operation.
$p_array | if you correct or use a predef operation (default = null) |
$p_readonly | 1 for readonly 0 for writable (default 0) |
if | ledger not found |
Reimplemented in Acc_Ledger_Fin, Acc_Ledger_Purchase, and Acc_Ledger_Sale.
Definition at line 841 of file acc_ledger.class.php.
References $ac, $amount, $currency, $db, $deb, $def, $desc, $e, $e_date, $Fiche, $g_parameter, $g_user, $http, $i, $label, $nb_row, $op, $p_array, $p_readonly, $periode, $poste, $quick_code, $ret, $url, $wDate, $wLedger, add_card(), ATTR_DEF_NAME, check_periode(), confirm(), CurrencyInput(), db, exit, FICADD, get_min_row(), get_type(), guess_pj(), HtmlInput\hidden(), id, Dossier\id(), Icon_Action\infobulle(), Acc_Operation_Note\input(), Icon_Action\longer(), nb(), OPEN, record_log(), select_ledger(), Icon_Action\show_note(), span(), table, td(), tr(), UPDRECEIPT, and value.
Acc_Ledger::input_additional_tax | ( | ) |
form : display additional tax available for this ledger and value, set 2 values : checkbox if tax applies and value
Definition at line 3489 of file acc_ledger.class.php.
References $amount, $checkbox, $http, $label, $msg, $out, $row, $title, cn, h, h2(), and has_other_tax().
Referenced by Acc_Ledger_Sale\input().
Acc_Ledger::input_extra_info | ( | ) |
Definition at line 3462 of file acc_ledger.class.php.
Acc_Ledger::input_new | ( | ) |
display screen to enter a new ledger
Definition at line 2879 of file acc_ledger.class.php.
References $cn, $code, $db, $default_currency, $description, $g_user, $hidden, $http, $name, $pj_seq, $type, db, FICADD, get_default_card(), HtmlInput\hidden(), MAX_ARTICLE, and select_default_currency().
Acc_Ledger::input_paid | ( | $p_selected, | |
$p_amount = 0 , |
|||
$p_date = "" , |
|||
$p_comm = "" |
|||
) |
Create the section payment.
int | $p_selected | |
number | $p_amount | |
date | $p_date | or empty string |
string | $p_comm | or empty comm |
Definition at line 2864 of file acc_ledger.class.php.
Acc_Ledger::is_closed | ( | $p_periode | ) |
check if the current ledger is closed
Definition at line 1141 of file acc_ledger.class.php.
Referenced by Acc_Ledger_Fin\verify_operation(), Acc_Ledger_Purchase\verify_operation(), and Acc_Ledger_Sale\verify_operation().
Acc_Ledger::is_enable | ( | ) |
Check if a ledger is enabled , 1 for yes and 0 if disabled.
Definition at line 3350 of file acc_ledger.class.php.
References db.
Acc_Ledger::listing | ( | ) |
listing of all ledgers
Definition at line 2533 of file acc_ledger.class.php.
References $_REQUEST, $i, $Max, $r, $ret, $str_dossier, $url, db, DatabaseCore\fetch_array(), HtmlInput\filter_table(), h, and DatabaseCore\num_row().
|
static |
retrieve the next number for this type of ledger
p_cn | connx |
p_type | ledger type |
Definition at line 1616 of file acc_ledger.class.php.
Referenced by save_new().
Acc_Ledger::previous_amount | ( | $p_to | ) |
retrieve amount of previous periode
$p_to | frmo the start of the exercise until $p_to |
Definition at line 2178 of file acc_ledger.class.php.
References $array, $ledger, $max, $min, $periode, $qcode, $ret, $saldo, $sql, db, get_type(), and noalyss_bcsub().
Acc_Ledger::previous_other_tax | ( | $p_to | ) |
retrieve the previous amount
$p_to | from the start of exercice until p_to |
Definition at line 2280 of file acc_ledger.class.php.
References $amount, $max, $min, $periode, $sql, db, and get_type().
Acc_Ledger::reverse | ( | $p_date, | |
$p_label | |||
) |
reverse the operation by creating the opposite one, the result is to avoid it it must be done in
$p_date | is the date of the reversed op |
if | date is invalid or other prob |
Definition at line 223 of file acc_ledger.class.php.
References $e, $g_user, $id, $j_id, $l, $let, $p_date, $per, $Res, $row, $seq, $sql, compute_internal_code(), db, isDate(), jr_id, and record_log().
Acc_Ledger::save | ( | $p_array = null | ) |
save the operation into the jrnx,jrn, , CA and pre_def
$p_array |
Save the file is any
Definition at line 1357 of file acc_ledger.class.php.
Acc_Ledger::save_followup | ( | $s_related_action | ) |
attach action-followups to an operation,
string | $s_related_action | action.ag_id separated by comma |
Definition at line 3472 of file acc_ledger.class.php.
Acc_Ledger::save_new | ( | $array | ) |
Insert a new ledger , member variable like jrn_def_id will changed.
array | $array | normally $_POST Array
(
[gDossier] => 25
[ac] => CFG/MACC/CFGLED
[p_jrn] => -1
[p_action] => jrn
[sa] => add
[p_jrn_deb_max_line] => 10
[p_ech_lib] => echeance
[p_jrn_type] => VEN
[p_jrn_name] => test
[p_jrn_class_deb] =>
[bank] =>
[negative_amount] => 0
[negative_warning] => Attention, ce journal doit utiliser des montants négatifs
[p_jrn_quantity] => 1
[min_row] => 5
[p_description] =>
[jrn_def_pj_pref] => A
[defaultCurrency] => 0
[ACH_FICHECRED] => Array(fd_id)
[ACH_FICHEDEB] => Array (fd_id)
[VEN_FICHEDEB] => Array (fd_id)
[VEN_FICHECRED] => Array (fd_id)
[ODS_FICHEDEB] => Array(fd_id)
[FIN_FICHEDEB] => Array(fd_id)
[ defaultCurrency] =>"int" only for Financial if there is no operation
)
|
Definition at line 3021 of file acc_ledger.class.php.
References $a, $array, $result, db, jrn_def_id, jrn_def_name, and next_number().
Acc_Ledger::search_group | ( | $p_what, | |
$p_value | |||
) |
retreive the jr_grpt_id from a ledger
$p_what | the column to seek possible values are
|
$p_value | the value of the col. |
Definition at line 2009 of file acc_ledger.class.php.
References db.
Acc_Ledger::select_default_currency | ( | ) |
create a select button to set the default currency for a ledger used only for empty financial ledger
Definition at line 2660 of file acc_ledger.class.php.
References $currency_id, $default_currency, $nb_operation, and db.
Referenced by display_ledger(), and input_new().
Acc_Ledger::select_depot | ( | $p_readonly, | |
$p_repo | |||
) |
Let you select the repository before confirming a sale or a purchase.
Returns an empty string if the company doesn't use stock
Let you select the repository before confirming a sale or a purchase. @global type $g_parameter check if company is using stock
type | $p_readonly | |
type | $p_repo |
Definition at line 3262 of file acc_ledger.class.php.
References $g_parameter, $p_readonly, $r, $sel, db, and HtmlInput\select_stock().
Referenced by Acc_Ledger_Sale\confirm().
Acc_Ledger::select_ledger | ( | $p_type = "ALL" , |
|
$p_access = 3 , |
|||
$enable = TRUE |
|||
) |
Show a select list of the ledgers you can access in writing, reading or simply accessing.
$p_type | = ALL or the type of the ledger (ACH,VEN,FIN,ODS) |
$p_access | =3 for READ and WRITE, 2 for write and 1 for readonly |
Boolean | TRUE all ledger are selected, or FALSE only enable |
Definition at line 552 of file acc_ledger.class.php.
References $array, $g_user, $id, $idx, $p_type, $ret, $select, $value, and h.
Referenced by Acc_Ledger_Fin\input(), input(), and Acc_Ledger_Sale\input().
Acc_Ledger::set_currency_id | ( | ) |
retrieve currency_id from database
Definition at line 80 of file acc_ledger.class.php.
References db.
Acc_Ledger::set_is_loaded | ( | $is_loaded | ) |
Definition at line 72 of file acc_ledger.class.php.
References $is_loaded.
Acc_Ledger::set_ledger_id | ( | $p_id | ) |
Set the jrn_def.jrn_def_id.
integer | $p_id |
Definition at line 116 of file acc_ledger.class.php.
References $id, $p_id, and jrn_def_id.
Acc_Ledger::set_quantity | ( | $p_value | ) |
set quantity for the ledger to 1 or 0,
Definition at line 3365 of file acc_ledger.class.php.
|
static |
this function is intended to test this class
Definition at line 2331 of file acc_ledger.class.php.
References $_GET, $_POST, $_REQUEST, $a, $array, $cn, $e, $id, $ledger, $op, $p_post, alert(), HtmlInput\button(), Dossier\connect(), exit, html_page_start(), NOALYSS_ADMINISTRATOR, print, record_log(), and HtmlInput\submit().
Acc_Ledger::update | ( | $array = null | ) |
update a ledger
type | $array | normally post // Example for a financial ledger
[p_jrn] => 83
[sa] => detail
[gDossier] => 25
[p_jrn_deb_max_line] => 10
[p_ech_lib] => echeance
[p_jrn_type] => FIN
[p_jrn_name] => Banque Privée
[bank] => BANQUE
[min_row] => 5
[p_description] => Compte fermé
[jrn_def_pj_pref] => BP19-
[jrn_def_pj_seq] => 0
[jrn_enable] => 0
[FIN_FICHEDEB] =>array(fd_id)
[defaultCurrency] => 0 // if there is no operation
[action_frm] => update
|
Definition at line 2772 of file acc_ledger.class.php.
References $a, $array, $http, $nb_operation, $Res, $result, db, jrn_def_id, and jrn_def_name.
Acc_Ledger::update_internal_code | ( | $p_internal | ) |
Definition at line 1664 of file acc_ledger.class.php.
Referenced by Acc_Ledger_Fin\insert(), and Acc_Ledger_Purchase\insert().
Acc_Ledger::update_paid | ( | $p_array | ) |
Update the paiment in the list of operation.
$p_array | is normally $_GET |
Definition at line 1640 of file acc_ledger.class.php.
Acc_Ledger::use_quant_table | ( | $p_grpt_id, | |
$p_jrn_type | |||
) |
Check if the operation is used in the table quant*.
integer | $p_grpt_id | |
string | $p_jrn_type | ledger's type ACH, VEN,ODS or FIN |
Definition at line 3376 of file acc_ledger.class.php.
Acc_Ledger::vat_operation | ( | $p_jr_id | ) |
get the amount of vat for a given jr_grpt_id from the table quant_purchase
the | jr_grpt_id |
Definition at line 2130 of file acc_ledger.class.php.
References $array, db, and get_type().
|
protected |
compare given receipt number and suggested one, if different , it means that the user enters a receipt number if e_pj or e_pj_suggest is not set or empty , or if both are equals then will return true, it returns only if they exist and are different
$p_array | same structure as input |
Definition at line 3563 of file acc_ledger.class.php.
References $p_array, and noalyss_trim().
Referenced by warn_manual_receipt().
Acc_Ledger::verify_ledger | ( | $array | ) |
Verify before update.
type | 'p_jrn' => string '3' (length=1)
'sa' => string 'detail' (length=6)
'gDossier' => string '82' (length=2)
'p_jrn_deb_max_line' => string '10' (length=2)
'p_ech_lib' => string 'echeance' (length=8)
'p_jrn_type' => string 'ACH' (length=3)
'p_jrn_name' => string 'Achat' (length=5)
'jrn_def_pj_pref' => string 'ACH' (length=3)
'jrn_def_pj_seq' => string '0' (length=1)
'FICHECRED' =>array(fd_id)
'FICHEDEB' =>array(fd_id)
'update' => string 'Sauve' (length=5
|
is | throw is test are not valid |
Definition at line 2692 of file acc_ledger.class.php.
References $a, $array, $e, $http, $p_jrn, $result, db, isNumber(), and record_log().
Acc_Ledger::verify_operation | ( | $p_array | ) |
verify that the operation can be saved
$p_array | array of data same layout that the $_POST from show_form |
the | getcode value is 1 incorrect balance, 2 date invalid, 3 invalid amount, 4 the card is not in the range of permitted card, 5 not in the user's period, 6 closed period |
Reimplemented in Acc_Ledger_Fin, Acc_Ledger_Purchase, and Acc_Ledger_Sale.
Definition at line 1160 of file acc_ledger.class.php.
Referenced by confirm().
|
protected |
warn if the suggested receipt and receipt are different , it means that the user tried to number himself
$p_array | same structure as input |
Definition at line 3578 of file acc_ledger.class.php.
References $p_array, span(), and verify_autonumber().
Referenced by confirm(), and Acc_Ledger_Sale\confirm().
Acc_Ledger::$currency_id |
!< default number of rows by default 10
Definition at line 42 of file acc_ledger.class.php.
Referenced by Acc_Ledger_Fin\insert(), and select_default_currency().
Acc_Ledger::$db |
!< jrn_def.jrn_def_id
Definition at line 38 of file acc_ledger.class.php.
Referenced by display_ledger(), Acc_Ledger_Fin\input(), input(), Acc_Ledger_Sale\input(), and input_new().
Acc_Ledger::$id |
Definition at line 37 of file acc_ledger.class.php.
Referenced by __construct(), get_ledger_id(), get_rowSimple(), reverse(), select_ledger(), set_ledger_id(), and test_me().
|
protected |
!< is_loaded true the ledger definition is loaded or false, it is not
Definition at line 44 of file acc_ledger.class.php.
Referenced by get_is_loaded(), and set_is_loaded().
Acc_Ledger::$ledger_type |
!< row of the ledger
Definition at line 40 of file acc_ledger.class.php.
Acc_Ledger::$nb |
!< type of the ledger ACH ODS FIN VEN or GL
Definition at line 41 of file acc_ledger.class.php.
Referenced by button_copy_operation(), Acc_Ledger_Fin\verify_operation(), Acc_Ledger_Purchase\verify_operation(), and Acc_Ledger_Sale\verify_operation().
Acc_Ledger::$row |
!< database connextion
Definition at line 39 of file acc_ledger.class.php.
Referenced by display_additional_tax(), get_min_row(), input_additional_tax(), Acc_Ledger_Fin\insert(), Acc_Ledger_Purchase\insert(), Acc_Ledger_Sale\insert(), and reverse().