noalyss
Version-9
|
Handle the ledger of sold,. More...
Public Member Functions | |
__construct ($p_cn, $p_init) | |
confirm ($p_array, $p_summary=false) | |
show the summary of the operation and propose to save it More... | |
extra_info () | |
the function extra info allows to More... | |
get_detail_sale ($p_from, $p_end, $p_filter_operation='all') | |
Retrieve data from the view v_detail_sale , gives all the row of an operation. More... | |
input ($p_array=null, $p_readonly=0) | |
display the form for entering data for invoice, More... | |
insert ($p_array=null) | |
insert into the database, it calls first the verify function, change the value of this->jr_id and this->jr_internal More... | |
verify_operation ($p_array) | |
verify that the data are correct before inserting or confirming More... | |
Public Member Functions inherited from Acc_Ledger | |
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... | |
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 is not already used 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_saldo_exercice ($p_exercice) | |
get the saldo of an exercice, used for the opening of a folder 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... | |
inc_seq_pj () | |
increment the sequence for the pj More... | |
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... | |
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_new ($array) | |
Insert a new ledger. 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... | |
update ($array='') | |
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... | |
Static Public Member Functions | |
static | heading_detail_sale () |
compute an array with the heading cells for the details, used for the export in CSV More... | |
Static Public Member Functions inherited from Acc_Ledger | |
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... | |
Additional Inherited Members | |
Data Fields inherited from Acc_Ledger | |
$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 inherited from Acc_Ledger | |
find_label ($p_value) | |
Retrieve the label of an accounting. More... | |
Protected Attributes inherited from Acc_Ledger | |
$is_loaded | |
!< is_loaded true the ledger definition is loaded or false, it is not More... | |
Handle the ledger of sold,.
throw | an exception is something is wrong |
Definition at line 36 of file acc_ledger_sold.class.php.
Acc_Ledger_Sold::__construct | ( | $p_cn, | |
$p_id | |||
) |
$p_cn | database connexion |
$p_id | jrn.jrn_def_id |
Reimplemented from Acc_Ledger.
Definition at line 38 of file acc_ledger_sold.class.php.
Acc_Ledger_Sold::confirm | ( | $p_array, | |
$p_summary = false |
|||
) |
show the summary of the operation and propose to save it
array | contains normally $_POST. It proposes also to save the Analytic accountancy |
$p_summary | false for the feedback, true to show the summary |
Reimplemented from Acc_Ledger.
Definition at line 741 of file acc_ledger_sold.class.php.
References $acompte, $amount, $anc, $date_limit, $default_currency, $fiche, $g_parameter, $i, $jr_id, $jrn_type, $op, $p_array, $p_jrn, $r, $repo, $str_code, $tot, $tot_amount, $value, ATTR_DEF_ACCOUNT, ATTR_DEF_ADRESS, ATTR_DEF_CITY, ATTR_DEF_CP, ATTR_DEF_NAME, Acc_Ledger\check_periode(), db, Acc_Ledger\display_negative_warning(), Acc_Ledger\get_name(), h, hb(), Anc_Plan\hidden(), HtmlInput\hidden(), id, Icon_Action\infobulle(), nbm(), HtmlInput\post_to_hidden(), Acc_Ledger\select_depot(), span(), td(), and tr().
Acc_Ledger_Sold::extra_info | ( | ) |
the function extra info allows to
Definition at line 1145 of file acc_ledger_sold.class.php.
Acc_Ledger_Sold::get_detail_sale | ( | $p_from, | |
$p_end, | |||
$p_filter_operation = 'all' |
|||
) |
Retrieve data from the view v_detail_sale , gives all the row of an operation.
$p_from | jrn.jr_tech_per from | |
type | $p_end | jrn.jr_tech_per to |
$p_filter_operation | valid option : all, paid, unpaid |
Definition at line 1524 of file acc_ledger_sold.class.php.
References $g_user, $p_end, $ret, $sql, $sql_filter, and db.
|
static |
compute an array with the heading cells for the details, used for the export in CSV
Definition at line 1565 of file acc_ledger_sold.class.php.
References $array.
Acc_Ledger_Sold::input | ( | $p_array = null , |
|
$p_readonly = 0 |
|||
) |
display the form for entering data for invoice,
$p_array | is null or you can put the predef operation or the $_POST |
Reimplemented from Acc_Ledger.
Definition at line 1184 of file acc_ledger_sold.class.php.
References $array, $currency, Acc_Ledger\$db, $def, $e, $fiche, $g_parameter, $g_user, $http, $i, $label, $op, $oPeriode, $p_array, $periode, $r, $url, $wLedger, Acc_Ledger\add_card(), ATTR_DEF_ADRESS, ATTR_DEF_CITY, ATTR_DEF_CP, ATTR_DEF_NAME, ATTR_DEF_TVA, Acc_Ledger\check_periode(), create_script(), Acc_Ledger\CurrencyInput(), db, FICADD, Acc_Ledger\get_min_row(), Acc_Ledger\guess_pj(), HtmlInput\hidden(), id, Icon_Action\infobulle(), Html_Input_Noalyss\ledger_add_item(), OPEN, and Acc_Ledger\select_ledger().
Acc_Ledger_Sold::insert | ( | $p_array = null | ) |
insert into the database, it calls first the verify function, change the value of this->jr_id and this->jr_internal
$p_array | is usually $_POST or a predefined operation |
save all vat $i contains the tva_id and value contains the vat amount if if ($g_parameter->MY_TVA_USE == 'Y' )
Date
Definition at line 244 of file acc_ledger_sold.class.php.
References $_POST, $acompte, $amount, $array, $check_periode, $dir, $e, $fiche, $file, $g_parameter, $i, $j_id, $l, $ledger, $op, $oPeriode, $p_array, $p_jrn, $poste, $prop, $r, $repo, $Res, $seq, $tot_amount, $value, ATTR_DEF_ACCOUNT, Acc_Ledger\check_periode(), Acc_Ledger\compute_internal_code(), Acc_Ledger\create_document(), db, Acc_Ledger\get_id(), h, Acc_Ledger\inc_seq_pj(), Stock_Goods\insert_goods(), jr_id, record_log(), HtmlInput\show_receipt_document(), and sql_string().
Acc_Ledger_Sold::verify_operation | ( | $p_array | ) |
verify that the data are correct before inserting or confirming
an | array (usually $_POST) |
Exception | if an error occurs |
Reimplemented from Acc_Ledger.
Definition at line 49 of file acc_ledger_sold.class.php.
References $a_poste, $array, $fiche, $g_parameter, $g_user, $i, $max, $min, Acc_Ledger\$nb, $oPeriode, $p_array, $p_jrn, $per, $poste, $tva_rate, ATTR_DEF_ACCOUNT, Acc_Ledger\check_currency(), Acc_Ledger\check_currency_setting(), check_parameter(), Acc_Ledger\check_payment(), Acc_Ledger\check_periode(), Acc_Ledger\check_strict(), cmpDate(), db, Acc_Ledger\get_last_date(), Acc_Ledger\is_closed(), isDate(), and isNumber().