';
-
- $r.= '";
- return $r;
-}
-// Creation of a new model of card
-// in the database
-if ( isset($_POST['add_modele']) and $write != 0) {
- // insert the model of card in database
- $fiche_def=new fiche_def($cn);
- $fiche_def->Add($_POST);
-}
-$r="";
-// Add a line in the card model
-if ( isset ($_POST["add_line"]) ) {
- $r= '
';
- }
- //_________________________________________________________________________
- // Display the form where you can enter
- // the property of the card model
- if ($action == "add_modele" and $write !=0) {
- echo '
';
- CreateCategory($cn,$search);
- echo '
';
- }
- //_________________________________________________________________________
- // Modify a card Model
- if ($action == "modifier" ) {
- echo '
';
- }
- //_________________________________________________________________________
- // Search a card
- if ( $action == "search" )
- {
- $sql="select distinct f_id,fd_id,av_text from fiche join jnt_fic_att_value using (f_id)
- join attr_value using (jft_id) where
- upper(av_text) like upper('%".FormatString($_GET["search_text"])."%') order by av_text,f_id";
- $all=get_array($cn,$sql);
- // test on the size
- //
- if ( sizeof($all) != 0 )
- {
- echo '
';
return;
diff --git a/html/fiche_search.php b/html/fiche_search.php
index 05722099a..2f48e7b25 100644
--- a/html/fiche_search.php
+++ b/html/fiche_search.php
@@ -20,17 +20,43 @@
/* $Revision$ */
/*! \file
* \brief Search a card in a popup window
+ *
+ * This parameter given to this file via the javascript popup windows are
+ * caller = searchcard
+ * - first when is the first call it doesn't lookup directly
+ * - search
+ * - p_jrn the ledger id
+ * - PHPSESSID
+ * - type deb only the deb card from the ledger, cred means credit only, all the card, filter all the card of the ledger
+ * - name of the control
+ * - gDossier the dossier id
+ * -the caller (what jascript function triggers this window)
+ * caller = searchcardCtrl
+ * - first
+ * - searh
+ * - p_jrn the ledger id
+ * - PHPSESSID
+ * - type deb only the deb card from the ledger, cred means credit only, all the card, filter all the card of the ledger
+ * - name of the control
+ * - ctrl the second control to set up
+ * - gDossier the dossier id
+ * -the caller (what jascript function triggers this window)
*/
include_once ("ac_common.php");
include_once ("poste.php");
include_once ("postgres.php");
include_once("jrn.php");
-/* Admin. Dossier */
-$rep=DbConnect();
+require_once('class_dossier.php');
include_once ("class_user.php");
-$User=new User($rep);
+// include_once ("check_priv.php");
+$gDossier=dossier::id();
+$cn=DbConnect($gDossier);
+
+$User=new User($cn);
$User->Check();
+$User->check_dossier($gDossier);
+
echo JS_SEARCH_CARD;
echo JS_MINTOOLKIT;
//determine focus:
@@ -44,18 +70,6 @@ if ( isset ( $_GET['search']) )
-require_once('class_dossier.php');
-$gDossier=dossier::id();
-
-include_once ("check_priv.php");
-$cn=DbConnect($gDossier);
-// Get The priv on the selected folder
-if ( $User->check_action($cn,FICHE_READ) == 0 ){
- /* Cannot Access */
- echo '
Vous n\' avez pas accès
';
- return;
-}
-
function get_list_fiche($p_cn,$get,$p_jrn)
{
$sql="select $get as fiche from jrn_def where jrn_def_id=$p_jrn";
@@ -82,23 +96,29 @@ function SetData (name_ctl,value,value_2,value_3,value_4,value_5,value_6) {
self.opener.SetData(name_ctl,value,value_2,value_3,value_4,value_5,value_6);
window.close();
}
+function setCtrl(name_ctl,value,name_ctl2,value_3) {
+ self.opener.setCtrl(name_ctl,value,name_ctl2,value_3);
+ window.close();
+ }
javascript=sprintf("NewCard('%s','%s','%s')",
- $_REQUEST['PHPSESSID'],
- $_GET['type'],
- "fic_search");
- $add_card->label="Ajout d'une fiche";
+ if ( $User->check_action(FICADD)==1) {
+ $add_card=new widget('button');
+ $add_card->javascript=sprintf("NewCard('%s','%s','%s')",
+ $_REQUEST['PHPSESSID'],
+ $_GET['type'],
+ "fic_search");
+ $add_card->label="Ajout d'une fiche";
+ }
}
foreach ($_GET as $key=>$element) {
// The value are e_name e_type e_PHPSESSID
${"e_$key"}=$element;
- echo_debug('fiche_search.php',__LINE__,"e_$key =$element ");
}
$e_fic_search=(isset ($_REQUEST['fic_search']))?$_REQUEST['fic_search']:"";
@@ -202,7 +222,7 @@ if (
$text=FormatString($row['vw_name']);
$r.="";
$qcode= $row['quick_code'] ;
-
+if ( $e_caller=='searchcard') {
$r.=sprintf ('',
"select" . $i,
$e_name,
@@ -214,6 +234,16 @@ if (
$row['tva_label'] ,
$qcode
);
+ } else {
+ $r.=sprintf ('',
+ "select" . $i,
+ $e_name,
+ $row['quick_code'] ,
+ $e_extra,
+ $text,
+ $row['quick_code']
+ );
+ }
$r.=" ".h($row['vw_name']);
if ( $row['vw_addr'] !="")
$r.=" Adresse: ".h($row['vw_addr'])." ".h($row['vw_cp'])."";
@@ -227,6 +257,6 @@ echo $r;
?>
IOValue();
+if ( $_GET['p_jrn'] != 0 && $User->check_action(FICADD)==1)echo $add_card->IOValue();
html_page_stop();
?>
diff --git a/html/fid.php b/html/fid.php
index 41c553b8f..e78d504e7 100644
--- a/html/fid.php
+++ b/html/fid.php
@@ -22,15 +22,26 @@
/*!\file
* \brief Fid for the ajax request for cards
+ *
+ * Valid parameter GET are
+ * - d type = cred, deb, all or filter (see fiche_search.php')
+ * - j is the legdger
+ * - PHPSESSID
+ * - caller give you what is the caller
+ * - caller=searchcardCtrl : p_extra contains the control to update
+ * - caller =searchcard p_extra is not used
+ * - extra extra data, its meaning depends of the caller
*/
-
+require_once('class_own.php');
require_once ("constant.php");
require_once ("postgres.php");
require_once ("user_common.php");
require_once ("debug.php");
require_once('class_dossier.php');
$gDossier=dossier::id();
+$caller=$_GET['caller'];
+$extra=$_GET['extra'];
echo_debug('fid.php',__LINE__,"Recherche fid.php".$_GET["FID"]);
$cn=DbConnect($gDossier);
@@ -71,7 +82,12 @@ if ( isset($_SESSION['isValid']) && $_SESSION['isValid'] == 1)
$array=get_array($cn,$sql, array($_GET['FID']));
echo_debug("fid",__LINE__,$array);
+ /* Different behaviour depending of the caller */
+ if ( strcmp($caller,'searchcardCtrl') === 0 ){
+ $name=$array[0]['vw_name'];
+ } else
$name=$array[0]['vw_name']." ".$array[0]['vw_addr']." ".$array[0]['vw_cp'];
+
$sell=$array[0]['vw_sell'] ;
$buy=$array[0]['vw_buy'];
$tva_id=$array[0]['tva_id'];
@@ -82,7 +98,9 @@ if ( isset($_SESSION['isValid']) && $_SESSION['isValid'] == 1)
$buy=($buy==null)?" ":str_replace('"','',$buy);
$tva_id=($tva_id==null)?" ":str_replace('"','',$tva_id);
- $a='{"answer":"ok","name":"'.$name.'","sell":"'.$sell.'","buy":"'.$buy.'","tva_id":"'.$tva_id.'","ctl":"'.$_GET['ctl'].'"}';
+
+
+ $a='{"answer":"ok","name":"'.$name.'","sell":"'.$sell.'","buy":"'.$buy.'","tva_id":"'.$tva_id.'","ctl":"'.$_GET['ctl'].'","caller":"'.$caller.'","extra":"'.$extra.'"}';
}
else
diff --git a/html/get_pj.php b/html/get_pj.php
new file mode 100644
index 000000000..09aa5d226
--- /dev/null
+++ b/html/get_pj.php
@@ -0,0 +1,57 @@
+get_propertie();
+$pj_pref=$prop["jrn_def_pj_pref"];
+$pj_seq=$Ledger->get_last_pj();
+$string='{"pj":"'.$pj_pref.$pj_seq.'"}';
+
+header("Content-type: text/json; charset: utf8",true);
+echo $string;
+
+
+?>
+
diff --git a/html/import.php b/html/import.php
index d898b8248..bb349456e 100644
--- a/html/import.php
+++ b/html/import.php
@@ -1,27 +1,27 @@
Check();
+$User->check_dossier(dossier::id());
html_page_start($User->theme);
echo JS_PROTOTYPE;
@@ -53,24 +54,24 @@ echo '
';
if ( isset( $_REQUEST['PHPSESSID'])) {
- $sessid = $_REQUEST['PHPSESSID'];
+ $sessid = $_REQUEST['PHPSESSID'];
}
// if action is set proceed to it
if ( isset ($_GET["action"]) ) {
$action=$_GET["action"];
-// menu = import cvs
+ // menu = import cvs
if ($action == "import" ) {
if(isset($_FILES['fupload'])) {
- // load the table with the cvs' content
+ // load the table with the cvs' content
echo '
';
- }
-
-}
-
-html_page_stop();
-
-?>
diff --git a/html/user_login.php b/html/user_login.php
index 4835d9400..96f300648 100644
--- a/html/user_login.php
+++ b/html/user_login.php
@@ -68,7 +68,7 @@ if ( isset ($_GET ['p_nom'])) {
}
// If admin show everything otherwise only the available dossier
-$res=u_ShowDossier($_SESSION['g_user'],$User->admin,$filtre);
+$res=u_ShowDossier($_SESSION['g_user'],$User->Admin(),$filtre);
echo $res;
?>
diff --git a/html/user_pref.php b/html/user_pref.php
index 547095c98..fd9baf2ef 100644
--- a/html/user_pref.php
+++ b/html/user_pref.php
@@ -67,16 +67,18 @@ if ( isset ( $_POST['p_size']) ) {
}
// Topmenu
+// not used for the moment
//---------------------------------------------------------------------------
// Here we put all the changes
//---------------------------------------------------------------------------
+/*
if ( isset ($_POST['val']) ){
// Change the top menu
$_SESSION['g_topmenu']=$_POST['topmenu'];
- $User->update_global_pref('TOPMENU',$_POST['topmenu']);
+ $User->update_global_pref('TOPMENU',$_POST['topmenu']);
if ( isset ($_POST['minirap'])) $User->set_mini_report($_POST['minirap']);
}
-
+*/
// show the top menu depending of the use_style
// comta style
@@ -86,7 +88,7 @@ if ( isset ($_REQUEST['gDossier']) )
if ( $_REQUEST['gDossier'] != 0 )
{
echo '
',
- $l2_line['use_first_name'],
- $l2_line['use_name'],
- $l2_line['use_login']);
- // Check if the user can access that folder
- if ( CheckDossier($l2_line['use_login'],$gDossier) == 0 ) {
- echo "
';
- require_once("poste.php");
- // find the bank account
- // NOTE : those values are in a table because
- // they are _national_ parameters
- $banque=new Acc_Parm_Code($cn,'BANQUE');
- $caisse=new Acc_Parm_Code($cn,'CAISSE');
- $vir_interne=new Acc_Parm_Code($cn,'VIREMENT_INTERNE');
- $accountSql="select distinct pcm_val::text,pcm_lib from
- tmp_pcmn
- where pcm_val::text like '".$banque->p_value."%' or pcm_val::text like '".$vir_interne->p_value."%'
- or pcm_val::text like '".$caisse->p_value."%'
- order by pcm_val::text";
- $ResAccount=ExecSql($cn,$accountSql);
- echo '
';
-
- echo "
";
- // Filter the saldo
- // on the current year
- $filter_year=" and j_tech_per in (select p_id from parm_periode where p_exercice='".$User->get_exercice()."')";
-
- // for each account
- for ( $i = 0; $i < pg_NumRows($ResAccount);$i++) {
- // get the saldo
- $l=pg_fetch_array($ResAccount,$i);
- $m=get_solde($cn,$l['pcm_val'],$filter_year);
- // print the result if the saldo is not equal to 0
- if ( $m != 0.0 ) {
- echo "
";
- echo "
".
- $l['pcm_val'].
- "
".
- "
".
- $l['pcm_lib'].
- "
"."
".
- $m.
- "
"."
";
- }
- }// for
- echo "
";
- echo "
";
- exit();
-}
-//-----------------------------------------------------
-// If a list of depense is asked
-//
-if ( $sub_action == "list")
-{
- // show the menu with the list item selected
- echo '
';
-//--------------------------------------------------------------------------------
-// use a predefined operation
-//--------------------------------------------------------------------------------
-if ( $sub_action=="use_opd" ) {
- $op=new Pre_op_fin($cn);
- $op->set_od_id($_REQUEST['pre_def']);
- $p_post=$op->compute_array();
- echo_debug(__FILE__.':'.__LINE__.'- ','p_post = ',$p_post);
- // submit button in the form
- $submit=''.
- '';
-
- $form=FormFin($cn,$_GET['p_jrn'],$User->get_periode(),$submit,$p_post,false,$p_post['nb_item']);
- echo '
';
- echo $form;
- echo '
';
- exit();
- }
-
-
-//-----------------------------------------------------
-// if we request to add an item
-// the $_POST['add_item'] is set
-// or if we ask to correct the invoice
-if ( isset ($_POST['add_item']) || isset ($_POST['correct']) )
-{
- if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) != 2 ) {
- NoAccess();
- exit -1;
- }
-
- $nb_item=$_POST['nb_item'];
- if ( isset ($_POST['add_item']))
- $nb_item++;
- // Submit button in the form
- $submit='
- ';
- $form=FormFin($cn,$p_jrn,$User->get_periode(),$submit,$_POST,false, $nb_item);
- //$form=FormFin($cn,$p_jrn,$User->get_periode(),$submit,$_POST,false, $nb_number);
-
- echo '
';
- echo $form;
- echo JS_CALC_LINE;
- echo '
';
- exit();
-}
-//-----------------------------------------------------
-// Save : record
-//
-if ( isset($_POST['save']))
-{
- if ( CheckJrn($gDossier,$_SESSION['g_user'],$p_jrn) != 2 ) {
- NoAccess();
- exit -1;
- }
-
- // we save the expense
- $r=RecordFin($cn,$_POST,$User,$p_jrn);
- $nb_number=$_POST['nb_item'];
-
- $submit='
';
return 0;
}
@@ -147,8 +138,14 @@ function CheckJrn($p_dossier,$p_user,$p_jrn,$p_detail=False)
function check_action ( $p_dossier,$p_login,$p_action_id)
{
if ( CheckIsAdmin ($p_login) ) return 1;
+ // if( is_local_admin($p_login,$p_dossier)) return 1;
+
+
$cn=DbConnect($p_dossier);
- $Res=ExecSql($cn,"select * from user_sec_act where ua_login='$p_login' and ua_act_id=$p_action_id");
+
+ /* check if user is a local admin */
+ $a="select * from user_sec_act where ua_login='$p_login' and ua_act_id=$p_action_id";
+ $Res=ExecSql($cn,$a);
$Count=pg_NumRows($Res);
if ( $Count == 0 ) return 0;
if ( $Count == 1 ) return 1;
diff --git a/include/class_acc_account_ledger.php b/include/class_acc_account_ledger.php
index 125a4eca1..524a8625b 100644
--- a/include/class_acc_account_ledger.php
+++ b/include/class_acc_account_ledger.php
@@ -58,7 +58,7 @@ class Acc_Account_Ledger {
"case when j_debit='t' then j_montant else 0 end as deb_montant,".
"case when j_debit='f' then j_montant else 0 end as cred_montant,".
" jr_comment as description,jrn_def_name as jrn_name,".
- "j_debit, jr_internal ".
+ "j_debit, jr_internal,jr_pj_number ".
" from jrnx left join jrn_def on jrn_def_id=j_jrn_def ".
" left join jrn on jr_grpt_id=j_grpt".
" where j_poste=".$this->id." and ".$periode.
@@ -252,7 +252,7 @@ function get_solde_detail($p_cond="") {
echo "
";
diff --git a/include/class_acc_compute.php b/include/class_acc_compute.php
index 976bc231c..d7a46f370 100644
--- a/include/class_acc_compute.php
+++ b/include/class_acc_compute.php
@@ -25,7 +25,9 @@
*/
/**
- * @brief this class aims to compute the
+ * @brief this class aims to compute different amount
+ *
+ * This class compute without decimal error the following amount
* - vat
* - amount without vat
* - no deductible vat
@@ -320,4 +322,4 @@ class Acc_Compute {
}
- }
\ No newline at end of file
+ }
diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php
index 3ae76bede..71b6cdf48 100644
--- a/include/class_acc_ledger.php
+++ b/include/class_acc_ledger.php
@@ -34,7 +34,6 @@ require_once ('class_periode.php');
require_once ('class_gestion_purchase.php');
require_once ('class_acc_account.php');
require_once('ac_common.php');
-
/*!\file
* \brief Class for jrn, class acc_ledger for manipulating the ledger
*/
@@ -58,6 +57,13 @@ class Acc_Ledger {
$this->row=null;
$this->nb=10;
}
+ function get_last_pj() {
+ if ( exist_sequence($this->db,"s_jrn_pj".$this->id) )
+ return getDbValue($this->db,"select last_value from s_jrn_pj".$this->id);
+ else
+ create_sequence($this->db,"s_jrn_pj".$this->id);
+ return 0;
+ }
/*!
* \brief Return the type of a ledger (ACH,VEN,ODS or FIN) or GL
*
@@ -108,9 +114,6 @@ class Acc_Ledger {
* \param $p_cent (on or off)
* \param p_limit starting line
* \param p_offset number of lines
- *
- * gen :
- * - none
* \return Array with the asked data
*
*/
@@ -135,7 +138,7 @@ class Acc_Ledger {
case j_debit when 'f' then j_montant::text else ' ' end as cred_montant,
j_debit as debit,j_poste as poste,jr_montant , ".
"coalesce(j_text,pcm_lib) as description,j_grpt as grp,
- jr_comment||' ('||jr_internal||')' as jr_comment ,
+jr_comment||' ('||jr_internal||')'||case when jr_pj_number is not null and jr_pj_number !='' then jr_pj_number else '' end as jr_comment,
j_qcode,
jr_rapt as oc, j_tech_per as periode
from jrnx left join jrn on ".
@@ -157,7 +160,7 @@ class Acc_Ledger {
c_poste as poste,
coalesce(j_text,pcm_lib) as description,
j_qcode,
- jr_comment||' ('||c_internal||')' as jr_comment,
+jr_comment||' ('||c_internal||')'||case when jr_pj_number is not null and jr_pj_number !='' then 'pj:'||coalesce(jr_pj_number,'-') else '' end as jr_comment,
jr_montant,
c_grp as grp,
c_comment as comment,
@@ -185,7 +188,7 @@ class Acc_Ledger {
case j_debit when 'f' then j_montant::text else ' ' end as cred_montant,
j_debit as debit,j_poste as poste,".
"coalesce(j_text,pcm_lib) as description,j_grpt as grp,
- jr_comment||' ('||jr_internal||')' as jr_comment,
+jr_comment||' ('||jr_internal||')'||case when jr_pj_number is not null and jr_pj_number !='' then 'pj:'||coalesce(jr_pj_number,'-') else '' end as jr_comment,
jr_montant,
j_qcode,
jr_rapt as oc, j_tech_per as periode from jrnx left join jrn on ".
@@ -205,11 +208,11 @@ class Acc_Ledger {
case c_debit when 'f' then c_montant::text else ' ' end as cred_montant,
c_debit as j_debit,
c_poste as poste,
- coalesce(j_text,pcm_lib as description),
- jr_comment||' ('||c_internal||'/ PJ :'||jr_opid||')' as jr_comment,
+ coalesce(j_text,pcm_lib) as description,
+jr_comment||' ('||c_internal||')'||case when jr_pj_number is not null and jr_pj_number !='' then 'pj:'||coalesce(jr_pj_number,'-') else '' end as jr_comment,
jr_montant,
c_grp as grp,
- c_comment||' ('||c_internal||' '||jr_opid||')' as comment,
+ c_comment||' ('||c_internal||' '||jr_opid||')'||'pj:'||coalesce(jr_pj_number,'-') as comment,
c_rapt as oc,
j_qcode,
c_periode as periode
@@ -349,7 +352,7 @@ class Acc_Ledger {
jrn.jr_id as num ,
jrn.jr_def_id as jr_def_id,
jrn.jr_montant as montant,
- substr(jrn.jr_comment,1,30) as comment,
+ substr(jrn.jr_comment,1,30)|| case when jr_pj_number is not null and jr_pj_number !='' then 'pj:'||coalesce(jr_pj_number,'-') else '' end as comment,
to_char(jrn.jr_date,'DD-MM-YYYY') as date,
jr_internal,
jrn.jr_grpt_id as grpt_id,
@@ -374,7 +377,7 @@ class Acc_Ledger {
$id ,
jrn.jr_def_id as jr_def_id,
jrn.jr_montant as montant,
- substr(jrn.jr_comment,1,30) as comment,
+ substr(jrn.jr_comment,1,30)|| case when jr_pj_number is not null and jr_pj_number !='' then 'pj:'||coalesce(jr_pj_number,'-') else '' end as comment,
to_char(jrn.jr_date,'DD-MM-YYYY') as date,
jr_internal,
jrn.jr_grpt_id as grpt_id,
@@ -422,6 +425,14 @@ class Acc_Ledger {
return $array;
}// end function get_rowSimple
+ /*!\brief guess what the next pj should be
+ */
+ function guess_pj() {
+ $prop=$this->get_propertie();
+ $pj_pref=$prop["jrn_def_pj_pref"];
+ $pj_seq=$this->get_last_pj();
+ return $pj_pref.$pj_seq;
+ }
/*!\brief Show all the operation, propose a form to select the
*ledger and the periode
*\return none
@@ -453,8 +464,8 @@ class Acc_Ledger {
$w->extra='filter';
$w->extra2='QuickCode';
$w->table=0;
- $sp= new widget("span");
- echo $sp->IOValue("qcode_label","",$qcode);
+ $sp= new widget("span");
+ echo $sp->IOValue("qcode_label","",$qcode);
echo $w->IOValue();
echo widget::submit('gl_submit','Recherche');
@@ -713,7 +724,7 @@ class Acc_Ledger {
$Res=ExecSqlParam($this->db,"select jrn_Def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_def_type,
jrn_deb_max_line,jrn_cred_max_line,jrn_def_ech,jrn_def_ech_lib,jrn_def_code,
- jrn_def_fiche_deb,jrn_def_fiche_deb
+ jrn_def_fiche_deb,jrn_def_fiche_deb,jrn_def_pj_pref
from jrn_Def
where jrn_def_id=$1",array($this->id));
$Count=pg_NumRows($Res);
@@ -866,6 +877,7 @@ class Acc_Ledger {
$ret.="
';
// Display the customer
//--
$fiche='cred';
@@ -710,6 +761,8 @@ class Acc_Ledger_Purchase extends Acc_Ledger {
$p_article= ( isset ($p_article))?$p_article:MAX_ARTICLE;
$r.=$Hid->IOValue("nb_item",$p_article);
$e_comment=(isset($e_comment))?$e_comment:"";
+ /*!\todo for the PJ we suggest the PJ Number, the pj number must also be settable in the ledger
+ setting and editable in the details popup window */
$r.="";
// Start the div for item to sell
@@ -723,11 +776,15 @@ class Acc_Ledger_Purchase extends Acc_Ledger {
$r.="
';
- $r.=' Total HTVA';
- $r.=' Total TVA';
- $r.=' Total TVAC';
+ if ( $own->MY_TVA_USE=='Y') {
+ $r.=' Total HTVA';
+ $r.=' Total TVA';
+ $r.=' Total TVAC';
+ } else
+ $r.=' Total';
+
$r.="
";
$r.=widget::button('add_item','Ajout article', ' onClick="ledger_sold_add_row()"');
@@ -857,6 +931,12 @@ class Acc_Ledger_Purchase extends Acc_Ledger {
$r.='';
$r.="";
+ /* if we suggest the pj n# the run the script */
+ if ( $own->MY_PJ_SUGGEST=='Y') {
+ $r.='';
+ }
+
+
$r.=JS_CALC_LINE;
return $r;
}
@@ -868,7 +948,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger {
function confirm($p_array) {
extract ($p_array);
$this->verify($p_array) ;
-
+
// to show a select list for the analytic
// if analytic is op (optionnel) there is a blank line
$own = new Own($this->db);
@@ -895,7 +975,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger {
$r.='
';
+ if ( $own->MY_TVA_USE=='Y') {
$r.=' Total HTVA';
$r.=' Total TVA';
$r.=' Total TVAC';
+ }
+ $r.=' Total';
$r.="
";
$r.="";
@@ -747,7 +807,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
extract ($p_array);
$this->verify($p_array) ;
- // to show a select list for the analytic
+ // to show a select list for the analytic & VAT USE
// if analytic is op (optionnel) there is a blank line
$own = new Own($this->db);
@@ -773,7 +833,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$r.='