Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

user_common.php File Reference

Common functions. More...

Go to the source code of this file.

Functions

 GetTvaRate ($p_cn, $p_tva_id)
 Return the rate of the p_tva_id.
 ComputeTotalVat ($p_cn, $a_fiche, $a_quant, $a_price, $ap_vat, $all=false)
 Compute the vat, the fiche.f_id are in a_fiche the quantity in a_quant.
 ComputeVat ($p_cn, $p_fiche, $p_quant, $p_price, $p_vat)
 Compute the vat for only one elt, the fiche.f_id are in p_fiche the quantity in p_quant.
 GetTvaPoste ($p_cn, $p_tva_id, $p_cred)
 Get the account of tva_rate.tva_poste return the credit or the debit account.
 InsertJrnx ($p_cn, $p_type, $p_user, $p_jrn, $p_poste, $p_date, $p_amount, $p_grpt, $p_periode, $p_qcode="")
 Insert into the table Jrn.
 InsertJrn ($p_cn, $p_date, $p_echeance, $p_jrn, $p_comment, $p_amount, $p_grpt, $p_periode)
 Insert into the table Jrnx.
 ListJrn ($p_cn, $p_jrn, $p_where="", $p_array=null, $p_value=0, $p_paid=0)
 show all the lines of the asked jrn
 InsertStockGoods ($p_cn, $p_j_id, $p_good, $p_quant, $p_type)
 Insert data into stock_goods,.
 withStock ($p_cn, $p_f_id)
 return true if we manage stock for it value is stored in attr_value
 VerifyOperationDate ($p_cn, $p_periode, $p_date)
 Verify if the date is a valid date the date is in the default period the period is not closed.
 InsertRapt ($p_cn, $jr_id, $jr_id2)
 Insert into jrn_rapt the concerned operations.
 DeleteRapt ($p_cn, $jr_id, $jr_id2)
 Insert into jrn_rapt the concerned operations.
 GetConcerned ($p_cn, $jr_id)
 Return an array of the concerned operation.
 GetGrpt ($p_cn, $p_jr_id)
 Return the jr_grpt_id from jrn where jr_id = $p_jr_id.
 UpdateComment ($p_cn, $p_jr_id, $p_comment)
 Update comment in jrn.
 isValid ($p_cn, $p_grpt_id)
 test if a jrn op is valid
 jrn_navigation_bar ($p_offset, $p_line, $p_size=0, $p_page=1)
 Create a navigation_bar (pagesize).


Detailed Description

Common functions.

Definition in file user_common.php.


Function Documentation

ComputeTotalVat p_cn,
a_fiche,
a_quant,
a_price,
ap_vat,
all = false
 

Compute the vat, the fiche.f_id are in a_fiche the quantity in a_quant.

Parameters:
$p_cn database connection
$a_fiche fiche id array
$a_quantity array
$a_price array
$ap_vat Array of tva id
$all = false if we reduce VAT
Returns:
: array a[tva_id] = amount vat

Definition at line 68 of file user_common.php.

References $a, $a_vat, $flag, $idx, $r, $tva_id, echo_debug(), GetTvaRate(), and isNumber().

Referenced by RecordInvoice(), and RecordSell().

ComputeVat p_cn,
p_fiche,
p_quant,
p_price,
p_vat
 

Compute the vat for only one elt, the fiche.f_id are in p_fiche the quantity in p_quant.

Parameters:
$p_cn database connection
$p_fiche fiche id int
$p_quantity int
$p_price float
$p_tva_id 
Returns:
the amount of vat

Definition at line 171 of file user_common.php.

References $a, $a_vat, $tva_id, echo_debug(), GetTvaRate(), and isNumber().

Referenced by RecordInvoice(), and RecordSell().

DeleteRapt p_cn,
jr_id,
jr_id2
 

Insert into jrn_rapt the concerned operations.

DeleteRapt($p_cn,$jr_id,$jr_id2)

parm :

  • p_cn database connection

jr_id (jrn.jr_id) => jrn_rapt.jr_id

  • jr_id2 (jrn.jr_id) => jrn_rapt.jra_concerned gen :
    • none return:
  • none

Definition at line 730 of file user_common.php.

References $Res, CountSql(), echo_debug(), echo_error(), ExecSql(), and isNumber().

GetConcerned p_cn,
jr_id
 

Return an array of the concerned operation.

GetConcerned (p_cn ,jr_id)

parm :

  • database connection

jrn.jr_id gen :

  • none return:

array if something is found

Definition at line 761 of file user_common.php.

References $i, $l, $n, $r, $Res, $sql, and ExecSql().

Referenced by ListJrn(), and UpdateJrn().

GetGrpt p_cn,
p_jr_id
 

Return the jr_grpt_id from jrn where jr_id = $p_jr_id.

GetGrpt($p_cn,$p_jr_id)

parm :

  • $p_jr_id jrn.jr_id

$p_cn database connection gen :

  • none return:

return the jrn.jr_grpt_id or null

Definition at line 792 of file user_common.php.

References $r, $Res, and ExecSql().

Referenced by UpdateJrn().

GetTvaPoste p_cn,
p_tva_id,
p_cred
 

Get the account of tva_rate.tva_poste return the credit or the debit account.

Parameters:
$p_cn connection
$p_tva_id tva_rate.tva_id
$p_cred type ( d or credit)
Returns:
return the credit or the debit account null if error

Definition at line 210 of file user_common.php.

References $a, $Res, echo_error(), and ExecSql().

Referenced by RecordInvoice(), and RecordSell().

GetTvaRate p_cn,
p_tva_id
 

Return the rate of the p_tva_id.

Parameters:
$p_cn database connection
$p_tva_id tva.tva_id
Returns:
an array containing the rate and the label the tva rate or null if a problem occured

Definition at line 39 of file user_common.php.

References $r, $Res, and ExecSql().

Referenced by ComputeTotalVat(), ComputeVat(), FormAchView(), FormVenteView(), and Document::Replace().

InsertJrn p_cn,
p_date,
p_echeance,
p_jrn,
p_comment,
p_amount,
p_grpt,
p_periode
 

Insert into the table Jrnx.

InsertJrn($p_cn,$p_date,$p_jrn,$p_comment,$p_amount,$p_grpt,$p_periode

parm :

  • $p_cn database connection

$p_date date

  • $p_jrn the current 'journal' (folder)
  • $p_poste the account
  • $p_amount amount to insert
  • $p_periode the concerned periode
  • $p_comment comment gen :
    • none return:

nothing

Definition at line 287 of file user_common.php.

References $Res, $sql, echo_debug(), ExecSql(), FormatString(), GetSequence(), and p_comment.

Referenced by RecordFin(), RecordInvoice(), RecordSell(), and TransferCSV().

InsertJrnx p_cn,
p_type,
p_user,
p_jrn,
p_poste,
p_date,
p_amount,
p_grpt,
p_periode,
p_qcode = ""
 

Insert into the table Jrn.

InsertJrnx($p_cn,$p_type,$p_user,$p_jrn,$p_poste,$p_date,$p_amount,$p_grpt,$p_periode

parm :

  • $p_cn database connection

$p_type debit or credit

  • $p_user the current user
  • $p_jrn the current 'journal' (folder)
  • $p_poste the account
  • $p_date
  • $p_amount amount to insert
  • $p_periode the concerned periode gen :
    • none return:

nothing

Definition at line 243 of file user_common.php.

References $Res, $sql, echo_debug(), ExecSql(), and GetSequence().

Referenced by RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), and TransferCSV().

InsertRapt p_cn,
jr_id,
jr_id2
 

Insert into jrn_rapt the concerned operations.

InsertRapt($p_cn,$jr_id,$jr_id2)

parm :

  • p_cn database connection

jr_id (jrn.jr_id) => jrn_rapt.jr_id

  • jr_id2 (jrn.jr_id) => jrn_rapt.jra_concerned gen :
    • none return:
  • none

Definition at line 699 of file user_common.php.

References $Res, CountSql(), echo_debug(), echo_error(), ExecSql(), and isNumber().

Referenced by RecordFin().

InsertStockGoods p_cn,
p_j_id,
p_good,
p_quant,
p_type
 

Insert data into stock_goods,.

InsertStockGoods($p_cn,$j_id,$a_good[$i],$a_quant[$i],'c');

parm :

  • $p_cn database connection

$p_j_id the j_id

  • $p_goods the goods
  • $p_quant quantity
  • $p_type c for credit or d for debit gen :
    • none return: none TODO ADD A DATE !!!

Definition at line 595 of file user_common.php.

References $r, $Res, $sql, echo_debug(), ExecSql(), and f_id.

Referenced by RecordInvoice(), and RecordSell().

isValid p_cn,
p_grpt_id
 

test if a jrn op is valid

isValid ($p_cn, $p_grpt_id

parm :

  • db connection

p_grpt_id gen :

  • none return: 1 is valid 0 is not valid

Definition at line 834 of file user_common.php.

References $a, $Res, echo_error(), and ExecSql().

Referenced by cl_user::cl_user().

jrn_navigation_bar p_offset,
p_line,
p_size = 0,
p_page = 1
 

Create a navigation_bar (pagesize).

jrn_navigation_bar

Parameters:
p_offset first record number
  • p_line total of returned row
  • p_size current g_pagesize
  • p_page number of the page
Returns:
string

Definition at line 861 of file user_common.php.

References $_SESSION, $e, $offset, $r, $step, $url, name, size, and value.

Referenced by action::myList(), Customer::Summary(), contact::Summary(), and ViewFiche().

ListJrn p_cn,
p_jrn,
p_where = "",
p_array = null,
p_value = 0,
p_paid = 0
 

show all the lines of the asked jrn

ListJrn($p_cn,$p_jrn,$p_wherel)

parm :

  • $p_cn database connection

$p_jrn jrn_id jrn.jrn_def_id

  • $p_where the sql query where clause
  • $p_array param. for a search
  • $p_value offset
  • $p_paid value : 0 nothing is shown, 1 check box; 2 check_box disable return: array (entryCount,generatedHTML);

Definition at line 321 of file user_common.php.

References $_SESSION, $a, $count, $h, $limit, $Max, $offset, $p_jrn, $r, $Res, $row, $sql, $tr, $User, $w, CountSql(), DbConnect(), ExecSql(), FormatString(), GetConcerned(), GetInternal(), GetJrnProp(), isDate(), and table.

UpdateComment p_cn,
p_jr_id,
p_comment
 

Update comment in jrn.

UpdateComment ($p_cn,$p_jr_id,$p_comment)

parm :

  • database conn.
    • jrn.jr_id
    • comment gen :
  • none return:
    • none

Definition at line 814 of file user_common.php.

References $Res, ExecSql(), FormatString(), and p_comment.

VerifyOperationDate p_cn,
p_periode,
p_date
 

Verify if the date is a valid date the date is in the default period the period is not closed.

VerifyOperationDate ($p_cn,$p_user,$p_date)

parm :

  • db connection

user

  • date gen :
    • none return:

null if error or date if ok

Definition at line 653 of file user_common.php.

References cmpDate(), echo_debug(), echo_error(), GetPeriode(), isDate(), and PeriodeClosed().

Referenced by FormFin(), and FormODS().

withStock p_cn,
p_f_id
 

return true if we manage stock for it value is stored in attr_value

withStock($p_cn,$p_f_id)

parm :

  • $p_cn database connection

$p_f_id fiche.f_id gen :

  • none return: none

Definition at line 630 of file user_common.php.

References $a, and getFicheAttribut().


Generated on Fri Jun 23 00:12:47 2006 for phpcompta by  doxygen 1.4.4