Merged revisions 2939-2962 via svnmerge from

svn+ssh://danydb@svn/svn/phpcompta/branches/rel500

........
  r2940 | danydb | 2010-02-11 19:20:28 +0100 (Thu, 11 Feb 2010) | 1 line
  
  Acc_Payment : "paiement par" is getting simpler
........
  r2941 | danydb | 2010-02-11 19:41:39 +0100 (Thu, 11 Feb 2010) | 1 line
  
  Add a logout button to extension
........
  r2942 | danydb | 2010-02-11 20:49:25 +0100 (Thu, 11 Feb 2010) | 1 line
  
  Translation dutch
........
  r2943 | danydb | 2010-02-12 11:40:28 +0100 (Fri, 12 Feb 2010) | 1 line
  
  Add dutch translation
........
  r2944 | danydb | 2010-02-12 17:09:59 +0100 (Fri, 12 Feb 2010) | 1 line
  
   Fix Bug : in quick writing you have now access to the listing
........
  r2945 | danydb | 2010-02-13 14:11:36 +0100 (Sat, 13 Feb 2010) | 1 line
  
  Bug : it is not possible to change the limit of paiment : Fixed
........
  r2946 | danydb | 2010-02-13 14:12:05 +0100 (Sat, 13 Feb 2010) | 1 line
  
  remove debug
........
  r2947 | danydb | 2010-02-13 14:26:27 +0100 (Sat, 13 Feb 2010) | 2 lines
  
  Update Documentation
........
  r2948 | danydb | 2010-02-13 17:27:07 +0100 (Sat, 13 Feb 2010) | 1 line
  
  Correction bilan belge
........
  r2949 | danydb | 2010-02-13 18:07:46 +0100 (Sat, 13 Feb 2010) | 1 line
  
  Bug fixed : cannot type a middle of payment
........
  r2950 | danydb | 2010-02-13 18:12:49 +0100 (Sat, 13 Feb 2010) | 1 line
  
  Fixed Bug: the amount in quant_sold in not rounded
........
  r2951 | danydb | 2010-02-13 19:31:17 +0100 (Sat, 13 Feb 2010) | 1 line
  
  Add translation for payment
........
  r2952 | danydb | 2010-02-13 19:40:32 +0100 (Sat, 13 Feb 2010) | 1 line
  
  Fixed Bug cannot add a new account
........
  r2953 | danydb | 2010-02-21 20:31:52 +0100 (Sun, 21 Feb 2010) | 1 line
  
  Translation completed for english
........
  r2954 | danydb | 2010-02-22 23:06:47 +0100 (Mon, 22 Feb 2010) | 9 lines
  
  
  Fix bugs :
  * Security was not respected, user can write in Readonly ledgers
  * Cannot modify or delete accounting entry with more than 8 digits
  * Cannot record information when not VAT
  * VMSKeytrade failed with ExecSql
  * ledger creation : cannot save the card on deb side
........
  r2955 | danydb | 2010-02-22 23:17:33 +0100 (Mon, 22 Feb 2010) | 3 lines
  
  Improve
  Import bank must be able to import into CASH
........
  r2956 | danydb | 2010-02-23 18:16:01 +0100 (Tue, 23 Feb 2010) | 1 line
  
  Fix Bug = Feb has 28 days and every 4 years 29
........
  r2957 | danydb | 2010-02-24 21:57:04 +0100 (Wed, 24 Feb 2010) | 3 lines
  
  Fix bug : warning messages when phpcompta is installed on windows about the languages
........
  r2958 | danydb | 2010-02-25 23:37:40 +0100 (Thu, 25 Feb 2010) | 3 lines
  
  Update for windows
........
  r2959 | danydb | 2010-02-26 00:29:06 +0100 (Fri, 26 Feb 2010) | 2 lines
  
  Fix Bug : cannot give an account to a card
........
  r2960 | danydb | 2010-02-28 20:54:32 +0100 (Sun, 28 Feb 2010) | 1 line
  
  Bug Return button for IE 
........
  r2961 | danydb | 2010-02-28 20:54:51 +0100 (Sun, 28 Feb 2010) | 1 line
  
  Progress for Dutch translation
........
This commit is contained in:
Dany De Bontridder 2010-03-01 20:43:11 +00:00
parent c7036029c2
commit 6ddf85aee2
39 changed files with 1984 additions and 822 deletions

View file

@ -5,7 +5,10 @@
#
# This file is a part of PhpCompta under GPL
# Author D. DE BONTRIDDER ddebontridder@yahoo.fr
cd ..
cd html/lang/en_US/LC_MESSAGES
cd ../html/lang
cd en_US/LC_MESSAGES
msgfmt -c -v messages.po
cd ../..
cd nl_NL/LC_MESSAGES
msgfmt -c -v messages.po

View file

@ -8,4 +8,4 @@
echo "Extract"
cd ..
xgettext -L PHP -j --from-code=UTF-8 -p html/lang/en_US/LC_MESSAGES/ html/*.php include/*.php include/template/*.php
xgettext -L PHP -j --from-code=UTF-8 -p html/lang/nl_NL/LC_MESSAGES/ html/*.php include/*.php include/template/*.php
xgettext -L PHP -j --from-code=UTF-8 -p html/lang/nl_NL/LC_MESSAGES/ html/*.php include/*.php include/template/*.php include/ext/stock/*.php

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,86 @@
begin;
CREATE OR REPLACE FUNCTION account_insert(p_f_id integer, p_account text)
RETURNS integer AS
$BODY$
declare
nParent tmp_pcmn.pcm_val_parent%type;
sName varchar;
nNew tmp_pcmn.pcm_val%type;
bAuto bool;
nFd_id integer;
nCount integer;
first text;
second text;
begin
if length(trim(p_account)) != 0 then
-- if there is coma in p_account, treat normally
if position (',' in p_account) = 0 then
raise info 'p_account is not empty';
select count(*) into nCount from tmp_pcmn where pcm_val=p_account::poste_comptable;
raise notice 'found in tmp_pcm %',nCount;
if nCount !=0 then
raise info 'this account exists in tmp_pcmn ';
perform attribut_insert(p_f_id,5,p_account);
else
-- account doesn't exist, create it
select av_text into sName from
attr_value join jnt_fic_att_value using (jft_id)
where
ad_id=1 and f_id=p_f_id;
nParent:=account_parent(p_account::poste_comptable);
insert into tmp_pcmn(pcm_val,pcm_lib,pcm_val_parent) values (p_account::poste_comptable,sName,nParent);
perform attribut_insert(p_f_id,5,p_account);
end if;
else
raise info 'presence of a comma';
-- there is 2 accounts separated by a comma
first := split_part(p_account,',',1);
second := split_part(p_account,',',2);
-- check there is no other coma
raise info 'first value % second value %', first, second;
if position (',' in first) != 0 or position (',' in second) != 0 then
raise exception 'Too many comas, invalid account';
end if;
perform attribut_insert(p_f_id,5,p_account);
end if;
else
raise info 'p_account is empty';
select fd_id into nFd_id from fiche where f_id=p_f_id;
bAuto:= account_auto(nFd_id);
if bAuto = true then
raise notice 'account generated automatically';
nNew:=account_compute(p_f_id);
raise notice 'nNew %', nNew;
select av_text into sName from
attr_value join jnt_fic_att_value using (jft_id)
where
ad_id=1 and f_id=p_f_id;
nParent:=account_parent(nNew);
perform account_add (nNew,sName);
perform attribut_insert(p_f_id,5,to_char(nNew,'999999999999999999999999'));
else
-- if there is an account_base then it is the default
select fd_class_base::text into nNew from fiche_def join fiche using (fd_id) where f_id=p_f_id;
if nNew is null or length(trim(nNew)) = 0 then
raise notice 'count is null';
perform attribut_insert(p_f_id,5,null);
else
perform attribut_insert(p_f_id,5,to_char(nNew,'999999999999999999999999'));
end if;
end if;
end if;
return 0;
end;
$BODY$
LANGUAGE 'plpgsql';
update version set val=69;
commit;

View file

@ -0,0 +1,49 @@
begin;
CREATE OR REPLACE FUNCTION account_update(p_f_id integer, p_account text)
RETURNS integer AS
$BODY$
declare
nMax fiche.f_id%type;
nCount integer;
nParent tmp_pcmn.pcm_val_parent%type;
sName varchar;
nJft_id attr_value.jft_id%type;
first text;
second text;
begin
if length(trim(p_account)) != 0 then
if position (',' in p_account) = 0 then
select count(*) into nCount from tmp_pcmn where pcm_val=p_account::poste_comptable;
if nCount = 0 then
select av_text into sName from
attr_value join jnt_fic_att_value using (jft_id)
where
ad_id=1 and f_id=p_f_id;
nParent:=account_parent(p_account::poste_comptable);
insert into tmp_pcmn(pcm_val,pcm_lib,pcm_val_parent) values (p_account::poste_comptable,sName,nParent);
end if;
else
raise info 'presence of a comma';
-- there is 2 accounts separated by a comma
first := split_part(p_account,',',1);
second := split_part(p_account,',',2);
-- check there is no other coma
raise info 'first value % second value %', first, second;
if position (',' in first) != 0 or position (',' in second) != 0 then
raise exception 'Too many comas, invalid account';
end if;
end if;
end if;
select jft_id into njft_id from jnt_fic_att_value where f_id=p_f_id and ad_id=5;
update attr_value set av_text=p_account where jft_id=njft_id;
return njft_id;
end;
$BODY$
LANGUAGE 'plpgsql' ;
update version set val=70;
commit;

View file

@ -53,7 +53,7 @@ include_once ("user_menu.php");
echo '<div class="u_tmenu">';
echo ShowMenuCompta("user_advanced.php?".dossier::get());
echo js_include('anc_script.js');
echo '</div>';
// Get action

View file

@ -152,7 +152,7 @@ $S5=$C40+$C41
$S6=$C50+$C51+$C52+$C53
$S7=$C54+$C55+$C56+$C57+$C58
$S8=$C490+$C491
$S9=$S1+$S3
$S9=$S1+$S3+$C3
$S10=$C10+$C11+$C12+$C13+$C14+$C15
$S11=$C160+$C161+$C162+$C163+$C164+$C165
$S12=$C17+$C42+$C43+$C44+$C45+$C46+$C47+$C48+$C492+$C493

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -207,6 +207,8 @@ if ( isset($_POST['update_record']) ) {
/* set the pj */
$acc->pj=$_POST['pj']; $acc->set_pj();
$acc->operation_update_comment($_POST['comment']);
$acc->operation_update_date_limit($_POST['e_ech']);
/* insert now the grouping */
if ( trim($_POST['rapt']) != "" ) {

View file

@ -68,7 +68,7 @@ echo $search_card->input();
echo '<form method="GET">';
echo $search_box;
echo HtmlInput::submit("viewsearch","Recherche");
echo HtmlInput::submit("viewsearch",_("Recherche"));
echo '</form>';
//-----------------------------------------------------

View file

@ -478,17 +478,45 @@ function alert($p_msg,$buffer=false)
/**
*@brief set the lang thanks the _SESSION['g_lang'] var.
*/
function set_language() {
$dir="";
$dir=setlocale(LC_MESSAGES,$_SESSION['g_lang']);
// set differently the language depending of the operating system
if( what_os() == 1 ) {
$dir=setlocale(LC_MESSAGES,$_SESSION['g_lang']);
if ( $dir == "") {
$dir=setlocale(LC_MESSAGES,"fr_FR.utf8");
echo '<span class="notice">'.$_SESSION['g_lang'].'domaine non supporté</h2>';
}
$g_lang='fr_FR.utf8';
$dir=setlocale(LC_MESSAGES,$g_lang);
echo '<span class="notice">'.$_SESSION['g_lang'].' domaine non supporté</h2>';
}
bindtextdomain('messages','./lang');
textdomain('messages');
bind_textdomain_codeset('messages','UTF8');
return;
}
// for windows
putenv('LANG='.$_SESSION['g_lang']);
$dir=setlocale(LC_ALL,$_SESSION['g_lang']);
bindtextdomain('messages','.\\lang');
textdomain('messages');
bind_textdomain_codeset('messages','UTF8');
}
?>
/**
*@brief try to determine on what os you are running the pĥpcompte
*server
*@return
* 0 it is a windows
* 1 it is a Unix like
*/
function what_os() {
$inc_path=get_include_path();
if ( strpos($inc_path,";") != 0 ) {
$os=0; /* $os is 0 for windoz */
} else {
$os=1; /* $os is 1 for unix */
}
return $os;
}
?>

View file

@ -95,10 +95,10 @@ if ( $low_action == "list" )
<?php
echo dossier::hidden();
$a=(isset($_GET['query']))?$_GET['query']:"";
printf ('Recherche <input type="text" name="query" value="%s">',
printf (_('Recherche').' <input type="text" name="query" value="%s">',
$a);
?>
<input type="submit" name="submit_query" value="recherche">
<input type="submit" name="submit_query" value="<?=_('recherche')?>">
<input type="hidden" name="p_action" value="adm">
</form>
</span>

View file

@ -131,7 +131,7 @@ class Acc_Account {
function load()
{
$ret=$this->db->exec_sql("select pcm_lib,pcm_val_parent,pcm_type from
tmp_pcmn where pcm_val=".$this->pcm_val);
tmp_pcmn where pcm_val=$1",array($this->pcm_val));
$r=Database::fetch_all($ret);
if ( ! $r ) return false;
@ -164,11 +164,11 @@ class Acc_Account {
}
else {
$ret='<TABLE><TR>';
$ret.=sprintf ('<TD>Numéro de classe </TD><TD><INPUT TYPE="TEXT" name="p_val" value="%s"></TD>',$this->pcm_val);
$ret.=sprintf ('<TD>'._('Numéro de classe').' </TD><TD><INPUT TYPE="TEXT" name="p_val" value="%s"></TD>',$this->pcm_val);
$ret.="</TR><TR>";
$ret.=sprintf('<TD>Libellé </TD><TD><INPUT TYPE="TEXT" size="70" NAME="p_lib" value="%s"></TD>',h($this->pcm_lib));
$ret.=sprintf('<TD>'._('Libellé').' </TD><TD><INPUT TYPE="TEXT" size="70" NAME="p_lib" value="%s"></TD>',h($this->pcm_lib));
$ret.= "</TR><TR>";
$ret.=sprintf ('<TD>Classe Parent</TD><TD><INPUT TYPE="TEXT" name="p_parent" value="%s"></TD>',$this->pcm_val_parent);
$ret.=sprintf ('<TD>'._('Classe Parent').'</TD><TD><INPUT TYPE="TEXT" name="p_parent" value="%s"></TD>',$this->pcm_val_parent);
$ret.='</tr><tr>';
$wType->selected=$this->pcm_type;
$ret.="<td> Type de poste </td>";

View file

@ -65,21 +65,21 @@ class Acc_Bilan {
$periode_end=$this->db->make_array("select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $p_filter_year order by p_start,p_end");
$w->label="Depuis";
$w->label=_("Depuis");
$w->value=$this->from;
$w->selected=$this->from;
$r.= $w->input('from_periode',$periode_start);
$w->label=" jusque ";
$r.= td($w->input('from_periode',$periode_start));
$w->label=_(" jusque ");
$w->value=$this->to;
$w->selected=$this->to;
$r.= $w->input('to_periode',$periode_end);
$r.= td($w->input('to_periode',$periode_end));
$r.= "</TR>";
$r.="<tr>";
$mod=new ISelect();
$mod->table=1;
$mod->value=$this->db->make_array("select b_id, b_name from bilan order by b_name");
$mod->label="Choix du bilan";
$r.=$mod->input('b_id');
$mod->label=_("Choix du bilan");
$r.=td($mod->input('b_id'));
$r.="</tr>";
$r.= '</TABLE>';
return $r;

View file

@ -1429,6 +1429,12 @@ jr_comment||' ('||c_internal||')'||case when jr_pj_number is not null and jr_pj_
extract ($p_array);
$user=new User($this->db);
$tot_cred=0;$tot_deb=0;
/* check if we can write into this ledger */
$user=new User($this->db);
if ( $user->check_jrn($p_jrn) != 'W' )
throw new Exception (_('Accès interdit'),20);
/* check for a double reload */
if ( isset($mt) && $this->db->count_sql('select jr_mt from jrn where jr_mt=$1',array($mt)) != 0 )
throw new Exception ('Double Encodage',5);

View file

@ -53,6 +53,11 @@ class Acc_Ledger_Fin extends Acc_Ledger {
if ( isset($mt) && $this->db->count_sql('select jr_mt from jrn where jr_mt=$1',array($mt)) != 0 )
throw new Exception (_('Double Encodage'),5);
/* check if we can write into this ledger */
$user=new User($this->db);
if ( $user->check_jrn($p_jrn) != 'W' )
throw new Exception (_('Accès interdit'),20);
/* check if there is a customer */
if ( strlen(trim($e_bank_account)) == 0 )
throw new Exception(_('Vous n\'avez pas donné de banque'),11);
@ -237,7 +242,7 @@ class Acc_Ledger_Fin extends Acc_Ledger {
// Ledger (p_jrn)
//--
$wLedger=$this->select_ledger('FIN',3);
$wLedger=$this->select_ledger('FIN',2);
if ($wLedger == null) exit ('Pas de journal disponible');
$label=" Journal ".HtmlInput::infobulle(2) ;
@ -270,7 +275,7 @@ class Acc_Ledger_Fin extends Acc_Ledger {
$ibank->set_attribute('ipopup','ipopcard');
// name of the field to update with the name of the card
$ibank->set_attribute('label','e_bank_account');
$ibank->set_attribute('label','e_bank_account_label');
// Add the callback function to filter the card on the jrn
$ibank->set_callback('filter_card');
$ibank->set_function('fill_fin_data');

View file

@ -54,6 +54,11 @@ class Acc_Ledger_Purchase extends Acc_Ledger {
*/
public function verify($p_array) {
extract ($p_array);
/* check if we can write into this ledger */
$user=new User($this->db);
if ( $user->check_jrn($p_jrn) != 'W' )
throw new Exception (_('Accès interdit'),20);
/* check for a double reload */
if ( isset($mt) && $this->db->count_sql('select jr_mt from jrn where jr_mt=$1',array($mt)) != 0 )

View file

@ -58,6 +58,10 @@ class Acc_Ledger_Sold extends Acc_Ledger {
/* check for a double reload */
if ( isset($mt) && $this->db->count_sql('select jr_mt from jrn where jr_mt=$1',array($mt)) != 0 )
throw new Exception (_('Double Encodage'),5);
/* check if we can write into this ledger */
$user=new User($this->db);
if ( $user->check_jrn($p_jrn) != 'W' )
throw new Exception (_('Accès interdit'),20);
/* check if there is a customer */
if ( strlen(trim($e_client)) == 0 )
@ -211,9 +215,9 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$cust=new fiche($this->db);
$cust->get_by_qcode($e_client);
$sposte=$cust->strAttribut(ATTR_DEF_ACCOUNT);
// if 2 accounts, take only the debit one for the customer
//
//
if ( strpos($sposte,',') != 0 ) {
$array=explode(',',$sposte);
$poste=$array[0];
@ -303,7 +307,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$j_id, /* 2 */
${'e_march'.$i} , /* 3 */
${'e_quant'.$i}, /* 4 */
$amount, /* 5 */
round($amount,2), /* 5 */
$tva_item, /* 6 */
$idx_tva, /* 7 */
$e_client)); /* 8 */
@ -316,7 +320,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
${'e_quant'.$i}, /* 4 */
$amount, // 5
0,
0,
null,
$e_client));
} // if ( $own->MY_TVA_USE=='Y') {
@ -711,7 +715,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
/* needed for generating a invoice */
$r.=HtmlInput::hidden('qcode_dest',${'e_mp_qcode_'.$e_mp});
$r.="Payé par ".${'e_mp_qcode_'.$e_mp};
$r.=_("Payé par ").${'e_mp_qcode_'.$e_mp};
$r.='<br>';
}

View file

@ -233,6 +233,12 @@ function get_internal() {
$sql="update jrn set jr_comment=$1 where jr_id=$2";
$this->db->exec_sql($sql,array($p_text,$this->jr_id));
}
/*!\brief add a limit of payment to the operation (jrn.jr_ech) */
function operation_update_date_limit($p_text)
{
$sql="update jrn set jr_ech=to_date($1,'DD.MM.YYYY') where jr_id=$2";
$this->db->exec_sql($sql,array($p_text,$this->jr_id));
}
/*!\brief return the jrn_def_id from jrn */
function get_ledger() {
$sql="select jr_def_id from jrn where jr_id=$1";

View file

@ -279,7 +279,7 @@ class Acc_Payment
$array=$this->get_valide();
$r.=HtmlInput::hidden('gDossier',dossier::id());
$r.='<ol>';
$r.='<li ><input type="radio" name="e_mp" value="0" checked>Paiement encod&eacute; plus tard';
$r.='<li ><input type="radio" name="e_mp" value="0" checked>'._('Paiement encodé plus tard');
if ( empty($array ) == false ){
foreach ($array as $row) {
$f='';
@ -298,7 +298,7 @@ class Acc_Payment
$s=new ISpan();
$s->name=$a->name.'_label';
$f=$a->input().$s->input();
$f=_(" paiement par ").$a->input().$s->input();
}else {
/* if the qcode is not null then add a hidden variable with
the qcode */
@ -307,15 +307,11 @@ class Acc_Payment
$fiche->get_by_qcode($row->mp_qcode);
$f=HtmlInput::hidden('e_mp_qcode_'.$row->mp_id,$row->mp_qcode);
$f.=$fiche->strAttribut(ATTR_DEF_NAME);
// $f.=$fiche->strAttribut(ATTR_DEF_NAME);
}
$r.='<li><input type="radio" name="e_mp" value="'.$row->mp_id.'">';
$r.=' payement par '.$row->mp_lib.' - fiche '.$f;
$r.=$row->mp_lib.' '.$f;
/* Show in which ledger the operation will be saved */
$jrn=new Acc_Ledger($this->cn,$row->mp_jrn_def_id);
$r.=' dans le journal '.$jrn->get_name();
}
}
$r.='</ol>';

View file

@ -119,18 +119,18 @@ class Anc_Print {
$plan_id=new ISelect("pa_id");
$plan_id->value=$this->db->make_array("select pa_id, pa_name from plan_analytique order by pa_name");
$plan_id->selected=$this->pa_id;
$r.= "Plan Analytique :".$plan_id->input();
$r.=_( "Plan Analytique :").$plan_id->input();
$poste=new IText();
$poste->size=10;
$r.="Entre le poste ".$poste->input("from_poste",$this->from_poste);
$r.=_("Entre le poste ").$poste->input("from_poste",$this->from_poste);
$choose=new IButton();
$choose->name="Choix Poste";
$choose->label="Recherche";
$choose->name=_("Choix Poste");
$choose->label=_("Recherche");
$choose->javascript="onClick=search_ca('".$_REQUEST['PHPSESSID']."',".dossier::id().",'from_poste','pa_id')";
$r.=$choose->input();
$r.=" et le poste ".$poste->input("to_poste",$this->to_poste);
$r.=_(" et le poste ").$poste->input("to_poste",$this->to_poste);
$choose->javascript="onClick=search_ca('".$_REQUEST['PHPSESSID']."',".dossier::id().",'to_poste','pa_id')";
$r.=$choose->input();
$r.='<span class="notice" style="display:block">'._('Selectionnez le plan qui vous intéresse avant de cliquer sur Recherche').'</span>';

View file

@ -25,7 +25,7 @@
*/
class Calendar {
var $current_date;
private static $nb_day=array(31,29,31,30,31,30,31,31,30,31,30,31);
private static $nb_day=array(31,28,31,30,31,30,31,31,30,31,30,31);
function __construct() {
/* get the current month */
@ -33,6 +33,8 @@ class Calendar {
$this->month=$this->current_date['mon'];
$this->day=self::$nb_day[$this->month-1];
$this->year=$this->current_date['year'];
if ( $this->year % 4 == 0 && $this->month=2)
$this->day=29;
}
/*!\brief fill the array given as parameter with the data from action_gestion

View file

@ -1073,11 +1073,11 @@ Array
echo '<h2 class="info">'.$this->id." ".$name.'</h2>';
echo "<TABLE class=\"result\" width=\"100%\">";
echo "<TR>".
"<TH> Code interne </TH>".
"<TH> Date</TH>".
"<TH> Description </TH>".
"<TH> Débit </TH>".
"<TH> Crédit </TH>".
"<TH>"._('Code interne')." </TH>".
"<TH>"._('Date')."</TH>".
"<TH>"._('Description')." </TH>".
"<TH>"._('Débit')." </TH>".
"<TH>"._('Crédit')." </TH>".
"</TR>";
foreach ( $this->row as $op ) {
@ -1245,12 +1245,12 @@ function empty_attribute($p_attr) {
$r=$bar;
$r.='<table width="95%">
<TR style="background-color:lightgrey;">
<TH>Quick Code</TH>
<th>Nom</th>
<th>Adresse</th>
<th>Total d&eacute;bit</th>
<th>Total cr&eacute;dit</th>
<th>Solde</th>';
<TH>'._('Quick Code').'</TH>
<th>'._('Nom').'</th>
<th>'._('Adresse').'</th>
<th>'._('Total débit').'</th>
<th>'._('Total crédit').'</th>
<th>'._('Solde').'</th>';
$r.='</TR>';
echo_debug(__FILE__,__LINE__,$step_tiers);
if ( sizeof ($step_tiers ) == 0 )

View file

@ -69,7 +69,7 @@ if ( $low_action == "" )
if ( isset($_POST['delete'] ) )
{
if ( $User->check_action(FICADD) == 0 ) {
alert('Vous ne pouvez pas enlever de fiche');
alert(j(_('Vous ne pouvez pas enlever de fiche')));
return;
}
@ -94,10 +94,10 @@ if ( $low_action == "list" )
<?php
echo dossier::hidden();
$a=(isset($_GET['query']))?$_GET['query']:"";
printf ('Recherche <input type="text" name="query" value="%s">',
printf (_('Recherche').' <input type="text" name="query" value="%s">',
$a);
?>
<input type="submit" name="submit_query" value="recherche">
<input type="submit" name="submit_query" value="<?=_('recherche')?>">
<input type="hidden" name="p_action" value="client">
</form>
</span>

View file

@ -26,7 +26,7 @@
require_once ('config.inc.php');
require_once('constant.security.php');
define ("DBVERSION",68);
define ("DBVERSION",70);
define ("MAX_COMPTE",4);
define ('MAX_ARTICLE',9);
@ -191,12 +191,12 @@ define ("JS_PROTOTYPE",'<script language="javascript" src="js/prototype.js"></sc
// Sql string
define ("SQL_LIST_ALL_INVOICE","");
define ("SQL_LIST_UNPAID_INVOICE"," (jr_rapt is null or jr_rapt = '') and jr_valid = true and jr_ech is null"
define ("SQL_LIST_UNPAID_INVOICE"," (jr_rapt is null or jr_rapt = '') and jr_valid = true "
);
define ("SQL_LIST_UNPAID_INVOICE_DATE_LIMIT" ,"
where (jr_rapt is null or jr_rapt = '')
and to_date(to_char(jr_ech,'DD.MM.YYYY'),'DD.MM.YYYY') < to_date(to_char(now(),'DD.MM.YYYY'),'DD.MM.YYYY') and jr_ech is not null
and to_date(to_char(jr_ech,'DD.MM.YYYY'),'DD.MM.YYYY') < to_date(to_char(now(),'DD.MM.YYYY'),'DD.MM.YYYY')
and jr_valid = true" );
?>

View file

@ -123,7 +123,7 @@ if ( $sub_action == "list" )
printf ('<input type="text" name="query" value="%s">',
$a);
?>
<input type="submit" name="submit_query" value="recherche">
<input type="submit" name="submit_query" value="<?_('recherche')?>">
<input type="hidden" name="p_action" value="contact">
</form>

View file

@ -13,7 +13,9 @@ if (isset($_REQUEST['code']) ) {
}
/* show name of extension */
echo '<div style="position:absolute;right:3px;top:3px;margin:0;z-index:10">';
echo '<h2 class="error" style="padding:0px;margin:0px">'.$ext->get_parameter('name').'</h2>';
echo '<h2 class="error" style="display:inline;padding:0px;margin:0px">'.$ext->get_parameter('name').'</h2>';
echo HtmlInput::button_anchor(_('Sortie'),'logout.php?');
echo '</div>';
require_once('ext'.DIRECTORY_SEPARATOR.trim($ext->get_parameter('filepath')));
} else {
@ -22,4 +24,4 @@ if (isset($_REQUEST['code']) ) {
}
}
?>
?>

View file

@ -68,7 +68,7 @@ function ShowRecherche() {
$h=new IHidden();
echo $h->input('p_action','fiche');
echo $h->input('action','search');
echo "Recherche :".$w->input('search_text',$search_text);
echo _("Recherche :").$w->input('search_text',$search_text);
echo HtmlInput::submit('submit',_('Rechercher'));
echo '</form>';
echo '</div>';

View file

@ -403,7 +403,10 @@ $w=new ISelect();
echo $w->label." :".$w->input('import_jrn',$jrn)."<br>";
// choose the bank account
$banque=new Acc_Parm_Code($p_cn,'BANQUE');
$bq=$p_cn->make_array("select j_qcode,vw_name from vw_poste_qcode join vw_fiche_attr on (j_qcode=quick_code) where j_poste::text like '".$banque->p_value."%'");
$caisse=new Acc_Parm_Code($p_cn,'CAISSE');
$sql="select j_qcode,vw_name from vw_poste_qcode join vw_fiche_attr on (j_qcode=quick_code) where j_poste::text like ".$caisse->p_value."||'%'
or j_poste::text like ".$banque->p_value."::text||'%'";
$bq=$p_cn->make_array($sql);
$w->label='Banque';
echo "Compte en banque :".$w->input('import_bq',$bq)."<br>";
$format_csv=$p_cn->make_array("select include_file,name from format_csv_banque;");

View file

@ -30,10 +30,7 @@ require_once ('class_acc_bilan.php');
// Show the jrn and date
//-----------------------------------------------------
require_once('class_database.php');
/*$ret=$cn->make_array("select fr_id,fr_label
from formdef
order by fr_label");
*/
//-----------------------------------------------------
// Form
//-----------------------------------------------------
@ -46,7 +43,7 @@ echo HtmlInput::hidden('p_action','impress');
echo HtmlInput::hidden('type','bilan');
echo dossier::hidden();
echo $bilan->display_form ($filter_year);
echo HtmlInput::submit('verif','Verification comptabilite');
echo HtmlInput::submit('verif',_('Verification comptabilite'));
echo '</FORM>';
@ -66,12 +63,12 @@ if ( isset($_GET['verif'])) {
echo '</form>';
}
echo '<span class="notice"> Attention : si le bilan n\'est pas &eacute;quilibr&eacute;.<br> V&eacute;rifiez <ul>
<li>L\'affectation du r&eacute;sultat est fait</li>
<li>Vos comptes actifs ont un solde d&eacute;biteur (sauf les comptes dit invers&eacute;s)</li>
<li> les comptes passifs ont un solde cr&eacute;diteur (sauf les comptes dit invers&eacute;s) </li>
echo _('<span class="notice"> Attention : si le bilan n\'est pas équilibré.<br> rifiez <ul>
<li>L\'affectation du résultat est fait</li>
<li>Vos comptes actifs ont un solde débiteur (sauf les comptes dit inversés)</li>
<li> les comptes passifs ont un solde créditeur (sauf les comptes dit inversés) </li>
</ul>
Utilisez la balance des comptes pour v&eacute;rifier. </span>';
Utilisez la balance des comptes pour vérifier. </span>');
echo '</div>';
?>

View file

@ -1,4 +1,4 @@
<?php
<?php
/*
* This file is part of PhpCompta.
*
@ -37,9 +37,9 @@ require_once ('class_acc_ledger_info.php');
require_once('class_acc_reconciliation.php');
require_once('class_own.php');
/*!
/*!
* \brief Display the form to UPDATE account operation in the expert view
*
*
* \param $p_cn database connection
* \param $jr_id pk of jrn
* \param mode 1 editable, 0 for CA
@ -47,7 +47,7 @@ require_once('class_own.php');
* \return none
*
*
*/
*/
function ShowOperationExpert($p_cn,$p_jr_id,$p_mode=1)
{
@ -85,9 +85,9 @@ function ShowOperationExpert($p_cn,$p_jr_id,$p_mode=1)
$r.=$content['jr_internal'];
$r.="</h3></TD>";
$r.='</tr>';
// for upload document we need the grpt_id
// for upload document we need the grpt_id
$r.='<Input type="hidden" name="jr_grpt_id" value="'.$content['jr_grpt_id'].'">';
// comment can be changed
$r.="<TD>";
$comment=new IText();
@ -109,9 +109,9 @@ function ShowOperationExpert($p_cn,$p_jr_id,$p_mode=1)
$comment->size=10;
$r.=$comment->input();
$r.="</TD>";
if ( $content['jrn_def_type'] == 'ACH' or
if ( $content['jrn_def_type'] == 'ACH' or
$content['jrn_def_type'] == 'VEN' )
{
// Is Paid
@ -134,30 +134,30 @@ function ShowOperationExpert($p_cn,$p_jr_id,$p_mode=1)
$r.="<TR>";
if ( $content['j_debit'] == 'f' ) $r.=$col_vide;
// $r.="<TD>".$content['j_debit']."</td>";
$r.="<TD>".$content['j_poste']."</td>";
if ( $content['j_debit'] == 't' ) $r.=$col_vide;
$qc=($content['j_qcode'] != "")?" [".$content['j_qcode']."]":"";
if ( $content['j_text'] == '')
if ( $content['j_text'] == '')
$r.="<TD>".$qc.h($content['vw_name'])."</td>";
else
$r.="<TD>".$qc.h($content['j_text'])."</td>";
if ( $content['j_debit'] == 'f' ) $r.=$col_vide;
$r.="<TD>".$content['j_montant']."</td>";
if ( $content['j_debit'] == 't' ) $r.=$col_vide;
//-- add ca
//-- add ca
//
if ( $own->MY_ANALYTIC != "nu" && ereg("^[6,7]+",$content['j_poste']))
{
$r.=display_table_ca($p_cn,$count,$content['j_id'],$own,$p_mode,$content['j_montant']);
$count++;
}
$r.="</TR>";
// }// foreach ($l_array[$i] as $value=>$content)
}// for ( $i =0 ; $i < sizeof($l_array); $i++)
// }// foreach ($l_array[$i] as $value=>$content)
}// for ( $i =0 ; $i < sizeof($l_array); $i++)
if ( $p_mode == 1) {
$file=new IFile();
$file->table=1;
@ -177,19 +177,19 @@ function ShowOperationExpert($p_cn,$p_jr_id,$p_mode=1)
if ( $p_mode == 1 ) {
$r.="<hr>";
$r.= "<table>";
$r.= "<table>";
$r.="<TR>".$file->input("pj","","Pièce justificative")."</TR>";
$r.="</table>";
}
$r.="<hr>";
$r.="</table>";
$r.="Total ".$content['jr_montant']."<br>";
/* count the number of additionnal info */
$acc_jrn_info=new Acc_Ledger_Info($p_cn);
$acc_jrn_info->set_jrn_id($p_jr_id);
/* if additional info > 0 show them */
if ( $acc_jrn_info->count() > 0 ) {
$array=$acc_jrn_info->load_all();
@ -200,24 +200,24 @@ function ShowOperationExpert($p_cn,$p_jr_id,$p_mode=1)
if ( strpos($row->id_type,'OTHER') ===0) {
$r.="Autre info : ".$row->ji_value.'<br>';
}
}
}
if ( $p_mode==1) {
// show all the related operation
$rec=new Acc_Reconciliation($p_cn);
$rec->set_jr_id($content['jr_id']);
$a=$rec->get();
$sessid=$_REQUEST["PHPSESSID"];
$sessid=$_REQUEST["PHPSESSID"];
if ( $a != null ) {
$r.="<b>Operation concernée</b> <br>";
$r.= '<div style="margin-left:30px;">';
foreach ($a as $key => $element) {
$operation=new Acc_operation($p_cn);
$operation->jr_id=$element;
$r.=sprintf ('%s <INPUT TYPE="BUTTON" VALUE="Détail" onClick="modifyOperation(\'%s\',\'%s\',%d)">',
$r.=sprintf ('%s <INPUT TYPE="BUTTON" VALUE="Détail" onClick="modifyOperation(\'%s\',\'%s\',%d)">',
$operation->get_internal($p_cn,$element),
$element,
$sessid,
@ -226,33 +226,30 @@ function ShowOperationExpert($p_cn,$p_jr_id,$p_mode=1)
$content['jr_id'],$element,$sessid,$gDossier);
}//for
$r.= "</div>";
}// if ( $a != null )
}// if ( $a != null )
$search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchJrn(\''.$sessid."',".$gDossier.",'rapt','".$content['jr_montant']."')\">";
$r.= '<H2 class="info">rapprochement </H2>
$r.= '<H2 class="info">rapprochement </H2>
<INPUT TYPE="TEXT" id="rapt" name="rapt" value="">'.$search;
} // if mode == 1
$r.='<input type="hidden" name="jr_id" value="'.$content['jr_id'].'">';
return $r;
}
/*!
/*!
* \brief Display the form to UPDATE account operation in the user view
*
*
* \param $p_cn database connection
* \param $jr_id pk of jrn
* \param mode 1 editable, 0 for CA
* \return none
*
*
*/
*/
function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
{
$gDossier=dossier::id();
$gDossier=dossier::id();
$l_array=get_dataJrnJrIdUser($p_cn,$p_jr_id);
$str_dossier=dossier::get();
/* if the operation doesn't exist in the quant_xxx table then we
@ -260,7 +257,7 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
*/
if ( $l_array == null || empty($l_array) == true) {
// If the operation is not in quant_sold or quant_purchase
// If the operation is not in quant_sold or quant_purchase
// because those tables comes later
$r=ShowOperationExpert($p_cn,$p_jr_id,$p_mode);
return $r;
@ -275,7 +272,7 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
// Build the form
$col_vide="<TD></TD>";
$content=$l_array[0] ;
// for the first line
@ -288,13 +285,18 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
$r.=$content['jr_date'];
$disable=($p_mode==0)?"disabled":"";
$r.='</h3></td>';
// Limit Date
$ech=new IDate('e_ech');
$ech->value=$content['ech_fmt'];
$r.=td(_('Echéance ').$ech->input());
// Internal
// --
$r.='<td><h3>';
$r.=$content['jr_internal'];
$r.="</h3></TD>";
// for upload document we need the grpt_id
// for upload document we need the grpt_id
$r.='<Input type="hidden" name="jr_grpt_id" value="'.$content['jr_grpt_id'].'">';
$r.='</tr><tr>';
// comment can be changed
@ -305,7 +307,7 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
$comment->value=$content['jr_comment'];
$comment->size=40;
$r.='<td>'.$comment->input().'</td>';
// pj can be changed
$r.="<TD> PJ Num. ";
$comment=new IText();
@ -316,14 +318,14 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
$comment->size=10;
$r.=$comment->input();
$r.="</TD>";
// Is Paid
$r.="<TD>";
$check=( $content['jr_rapt'] != null )?"CHECKED":"UNCHECKED";
$r.='<TD>Payé <INPUT TYPE="CHECKBOX" '.$disable.' name="is_paid" '.$check.'></TD>';
$r.="</TR>";
echo_debug(__FILE__.":".__LINE__."jrn_Def_type = ".$content['jrn_def_type']);
// for others lines
$own=new Own($p_cn);
@ -335,8 +337,8 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
echo_debug(__FILE__.":".__LINE__." content['qp_supplier'] ".$content['qp_supplier']);
$client=new fiche($p_cn,$content['qp_supplier']);
$r.="Client : ".$client->getName();
echo_debug(__FILE__,__LINE__,$content);
echo_debug(__FILE__,__LINE__,$content);
/* now we get the different lines for this operation thanks */
/* the qp_internal == jr_internal */
$r.='<tr>';
@ -344,7 +346,7 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
$r.='<th>PU</th>';
$r.='<th>Quantit&eacute;</th>';
$r.='<th> Dep. priv. </th>';
if ( $own->MY_TVA_USE=='Y') {
if ( $own->MY_TVA_USE=='Y') {
$r.='<th>tva</th>';
$r.='<th>tva</th>';
$r.='<th>non ded.</th>';
@ -352,9 +354,9 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
$r.='<th>tva d impot</th>';
$r.='<th>total htva</th>';
$r.='<th>total tvac</th>';
} else
} else
$r.='<th>total</th>';
$r.='</tr>';
$object=new gestion_purchase($p_cn);
$object->qp_internal=$internal;
@ -381,7 +383,7 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
// $hid_jid=new IHidden("","p_jid_".$row->j_id,$row->j_id);
$r.=($i%2==0)?"<tr class=\"odd\">":'<tr>'; $i++;
$pu=0.0;
if ( $row->qp_price != 0.0 && $row->qp_price != 0 )
if ( $row->qp_price != 0.0 && $row->qp_price != 0 )
$pu=round(($row->qp_nd_amount+$row->qp_price)/$row->qp_quantite,2);
$r.='<td> '.$fiche->strAttribut(ATTR_DEF_NAME).'</td>';
$r.='<tD>'.$pu.'</td>';
@ -397,7 +399,7 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
}
$r.='<td align="right">'.sprintf("% 12.2f",$row->qp_price).'</td>';
$r.='<td align="right">'.sprintf("% 12.2f",$row->qp_vat+$row->qp_nd_amount+$row->qp_nd_tva+$row->qp_nd_tva_recup+$row->qp_price).'</td>';
//-- add ca
//-- add ca
//
$content['j_poste']=$fiche->strAttribut(ATTR_DEF_ACCOUNT);
@ -416,7 +418,7 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
'<td colspan="7">Total HTVA</td>'.
'<td style="text-align:right">'.sprintf('% 12.2f',$tot_amount)."</td>".
"</tr>";
if ( $tot_tva != 0 )
if ( $tot_tva != 0 )
$r.='<tr style="font-size:13px;color:green;">'.
'<td colspan="7">Total TVA</td>'.
'<td style="text-align:right;">'.sprintf('%12.2f',$tot_tva)
@ -448,18 +450,18 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
'<td style="font-size:13px;text-align:right;color:green;">'.sprintf('%12.2f',$tot_dep_priv+$tot_amount+$tot_tva+$tot_tva_nd_recup+$tot_nd+$tot_tva_nd)."</td>".
"</tr>";
}
// for selling ledger
if ( $content['jrn_def_type'] == 'VEN' )
{
echo_debug(__FILE__.":".__LINE__." content['qs_client'] ".$content['qs_client']);
$client=new fiche($p_cn,$content['qs_client']);
$r.="Client : ".$client->getName();
echo_debug(__FILE__,__LINE__,$content);
echo_debug(__FILE__,__LINE__,$content);
/* now we get the different lines for this operation thanks */
/* the qs_internal == jr_internal */
$r.'</table>';
@ -468,8 +470,8 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
$r.='<th>Nom</th>';
$r.='<th>PU</th>';
$r.='<th>Quantit&eacute;</th>';
if ($own->MY_TVA_USE == 'Y' ) {
$r.='<th>tva</th>';
if ($own->MY_TVA_USE == 'Y' ) {
$r.='<th>tva</th>';
$r.='<th>code tva</th>';
}
$r.='<th>prix</th>';
@ -500,12 +502,12 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
$r.='<td align="center">'.$row->tva_label.'</td>';
}
$r.='<td align="right">'.$row->qs_price.'</td>';
//-- add ca
//-- add ca
//
$content['j_poste']=$fiche->strAttribut(ATTR_DEF_ACCOUNT);
echo_debug(__FILE__.':'.__LINE__,'$content["j_poste"]',$content['j_poste']);
// echo "j_poste= ".$content['j_poste'];
if ( $own->MY_ANALYTIC != "nu" && ereg("^[6,7]+",$content['j_poste']))
{
@ -536,7 +538,7 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
'<td style="text-align:right;font-size:13px;color:green;">'.sprintf('%12.2f',$tot_tva)
."</td>".
"</tr>";
$r.="<tr>".
"<td>"."</td>".
"<td>"."</td>".
@ -544,7 +546,7 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
"<td>Total </td>".
'<td style="font-size:13px;color:green;">'.sprintf('%12.2f',$tot_amount+$tot_tva)."</td>".
"</tr>";
} else {
} else {
$r.='<table>';
$r.="<tr>".
"<td>"."</td>".
@ -553,13 +555,13 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
"</tr>";
}
}
$r.="</TABLE>";
$file=new IFile();
$file->table=1;
//doc
if ( $p_mode ==1 && $content['jr_pj_name'] != "")
if ( $p_mode ==1 && $content['jr_pj_name'] != "")
$r.='<tr><TD>Effacer Pj <INPUT TYPE="CHECKBOX" name="to_remove" ></TD>';
$r.="<TD>".sprintf('<A class="detail" HREF="show_pj.php?jrn=%s&jr_grpt_id=%s&'.$str_dossier.'&PHPSESSID=%s">%s</A>',
$content['jr_id'],
@ -571,7 +573,7 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
/* count the number of additionnal info */
$acc_jrn_info=new Acc_Ledger_Info($p_cn);
$acc_jrn_info->set_jrn_id($p_jr_id);
/* if additional info > 0 show them */
if ( $acc_jrn_info->count() > 0 ) {
$array=$acc_jrn_info->load_all();
@ -582,36 +584,36 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
if ( strpos($row->id_type,'OTHER') ===0) {
$r.="Autre info : ".$row->ji_value.'<br>';
}
}
}
$r.="<hr>";
if ( $p_mode == 1 ) {
$r.= "<table>";
$r.= "<table>";
$r.="<TR>".$file->input("pj","","Pièce justificative")."</TR>";
$r.="</table>";
$r.="<hr>";
$r.="</table>";
$r.="Total ".$content['jr_montant']."<br>";
// show all the related operation
$rec=new Acc_Reconciliation($p_cn);
$rec->set_jr_id($content['jr_id']);
$a=$rec->get();
$sessid=$_REQUEST["PHPSESSID"];
$sessid=$_REQUEST["PHPSESSID"];
if ( $a != null ) {
$r.="<b>Operation concernée</b> <br>";
$r.= '<div style="margin-left:30px;">';
foreach ($a as $key => $element) {
$operation=new Acc_operation($p_cn);
$operation->jr_id=$element;
$r.=sprintf ('%s <INPUT TYPE="BUTTON" VALUE="Détail" onClick="modifyOperation(\'%s\',\'%s\',%d)">',
$r.=sprintf ('%s <INPUT TYPE="BUTTON" VALUE="Détail" onClick="modifyOperation(\'%s\',\'%s\',%d)">',
$operation->get_internal(),
$element,
$sessid,
@ -621,10 +623,10 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
}//for
$r.= "</div>";
}// if ( $a != null )
$search='<INPUT TYPE="BUTTON" VALUE="Cherche" OnClick="SearchJrn(\''.$sessid."',".$gDossier.",'rapt','".$content['jr_montant']."')\">";
$r.= '<H2 class="info">rapprochement </H2>
$r.= '<H2 class="info">rapprochement </H2>
<INPUT TYPE="TEXT" id="rapt" name="rapt" value="">'.$search;
} // if p_mode==1
$r.='<input type="hidden" name="jr_id" value="'.$content['jr_id'].'">';
@ -633,9 +635,9 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
}
/*!
/*!
* \brief Get data from jrn and jrnx thanks the jr_id
*
*
*
* \param connection
* \param p_jr_id (jrn.jr_id)
@ -643,10 +645,10 @@ function ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
*
* \return array
*
*/
*/
function get_dataJrnJrId ($p_cn,$p_jr_id) {
$Res=$p_cn->exec_sql("select
$Res=$p_cn->exec_sql("select
j_text,
j_debit,
j_poste,
@ -662,13 +664,13 @@ function get_dataJrnJrId ($p_cn,$p_jr_id) {
jr_id,jr_internal, jr_rapt,jrn_def_type,
j_qcode,
jr_pj_number
from
jrnx
inner join jrn on j_grpt=jr_grpt_id
from
jrnx
inner join jrn on j_grpt=jr_grpt_id
inner join jrn_def on jrn_def.jrn_def_id=jrn.jr_def_id
left outer join tmp_pcmn on j_poste=pcm_val
where
jr_id=$p_jr_id
where
jr_id=$p_jr_id
order by j_debit desc,j_id asc");
$MaxLine=Database::num_row($Res);
echo_debug('jrn.php',__LINE__,"Found $MaxLine lines");
@ -683,7 +685,7 @@ function get_dataJrnJrId ($p_cn,$p_jr_id) {
{
$fiche=new fiche($p_cn);
$fiche->get_by_qcode($line['j_qcode']);
$array['vw_name']=$fiche->getName();
}
else
@ -711,10 +713,10 @@ function get_dataJrnJrId ($p_cn,$p_jr_id) {
}
return $ret_array;
}
/*!
/*!
* \brief Get data from quant_sold or quand_purchase for the user
* view mode
*
*
*
* \param connection
* \param p_jr_id (jrn.jr_id)
@ -722,14 +724,14 @@ function get_dataJrnJrId ($p_cn,$p_jr_id) {
*
* \return array or null if there is no value
*
*/
*/
function get_dataJrnJrIdUser ($p_cn,$p_jr_id) {
echo_debug(__FILE__.":".__LINE__."get_dataJrnJrIdUser");
$Res=$p_cn->exec_sql("select ".
"*".
" from quant_sold join jrn on (qs_internal=jr_internal) ".
"*,to_char(jr_ech,'DD-MM-YYYY') as ech_fmt".
" from quant_sold join jrn on (qs_internal=jr_internal) ".
" join jrn_def on (jr_def_id=jrn_def_id) ".
" inner join jrnx on (j_grpt=jr_grpt_id )".
" join tmp_pcmn on (pcm_val=j_poste)".
@ -740,11 +742,11 @@ function get_dataJrnJrIdUser ($p_cn,$p_jr_id) {
echo_debug('jrn.php',__LINE__,"Found $MaxLine lines");
// if no info found in quant_sold try in quant_purchase
if ( $MaxLine == 0 )
// if no info found in quant_sold try in quant_purchase
if ( $MaxLine == 0 )
{
$Res=$p_cn->exec_sql("select ".
"*".
"*,to_char(jr_ech,'DD-MM-YYYY') as ech_fmt".
" from quant_purchase join jrn on (qp_internal=jr_internal)".
" join jrn_def on (jr_def_id=jrn_def_id) ".
" inner join jrnx on (j_grpt=jr_grpt_id) ".
@ -752,9 +754,9 @@ function get_dataJrnJrIdUser ($p_cn,$p_jr_id) {
" where jr_id=$p_jr_id");
$MaxLine=Database::num_row($Res);
if ( $MaxLine == 0 ) return null;
}
@ -769,15 +771,15 @@ function get_dataJrnJrIdUser ($p_cn,$p_jr_id) {
{
$fiche=new fiche($p_cn);
$fiche->get_by_qcode($line['j_qcode']);
$array['vw_name']=$fiche->getName();
}
else
{
$array['vw_name']=$line['pcm_lib'];
}
if ( isset ($line['qs_client']))
if ( isset ($line['qs_client']))
{
/* It is an invoice */
$array['qs_client']=$line['qs_client'];
@ -802,6 +804,8 @@ function get_dataJrnJrIdUser ($p_cn,$p_jr_id) {
$array['jr_grpt_id']=$line['jr_grpt_id'];
$array['jr_pj_name']=$line['jr_pj_name'];
$array['jr_pj_number']=$line['jr_pj_number'];
$array['jrn_ech']=$line['jrn_ech'];
$array['ech_fmt']=$line['ech_fmt'];
// $array['']=$line[''];
echo_debug(__FILE__.':'.__LINE__," get_dataJrnjrIdUser ",$array);
@ -813,10 +817,10 @@ function get_dataJrnJrIdUser ($p_cn,$p_jr_id) {
* (detail of operation )
*\param $p_cn database cnx
*\param $p_seq sequence (nb item)
*\param $p_jid the concerned j_id
*\param $p_jid the concerned j_id
*\param $p_own object own
*\param $p_mode readonly or writable
*\param $p_amount amount
*\param $p_amount amount
*\return string to display
*/
function display_table_ca($p_cn,$p_seq,$p_jid,$p_own,$p_mode,$p_amount) {
@ -834,6 +838,6 @@ function display_table_ca($p_cn,$p_seq,$p_jid,$p_own,$p_mode,$p_amount) {
return '<td>'.$op->display_form_plan(null,1,$p_mode,$p_seq,$p_amount)."</TD>";
}
return "";
}
?>

View file

@ -28,6 +28,7 @@
// Bank Keytrade
//-----------------------------------------------------
$line=0;
$p_cn->set_encoding('latin1');
while (($data = fgetcsv($handle, 2000,"!")) !== FALSE) {
$num = count($data);
@ -107,7 +108,7 @@ echo "<br>";
'n')";
try
{
ExecSql($p_cn,$Sql,'latin1');
$p_cn->exec_sql($Sql);
}

View file

@ -86,8 +86,8 @@ if ( isset ($_POST["add"]) ) {
if ( isset ($_POST["FICHEDEB"])) {
$p_jrn_fiche_deb=join(",",$_POST["FICHEDEB"]);
}
if ( isset ($_POST["FICHEDEB"])) {
$p_jrn_fiche_cred=join(",",$_POST["FICHEDEB"]);
if ( isset ($_POST["FICHECRED"])) {
$p_jrn_fiche_cred=join(",",$_POST["FICHECRED"]);
}
$l_cred_max_line=$l_deb_max_line;
$cn->start();

View file

@ -174,7 +174,7 @@ for ($i=0; $i <$MaxRow; $i++) {
echo $A['pcm_val'];
echo '</td>';
echo "$td";
printf ("<A HREF=\"javascript:PcmnUpdate(%d,'%s','%s','%s','%s',%d)\">",
printf ("<A HREF=\"javascript:PcmnUpdate('%s','%s','%s','%s','%s',%d)\">",
$A['pcm_val'],
FormatString($A['pcm_lib']),
$A['pcm_val_parent'],
@ -192,7 +192,7 @@ for ($i=0; $i <$MaxRow; $i++) {
echo $td;
printf ('<A href="?p_action=pcmn&l=%d&action=del&%s">Delete</A>',$A['pcm_val'],$str_dossier);
printf ('<A href="?p_action=pcmn&l=%s&action=del&%s">Delete</A>',$A['pcm_val'],$str_dossier);
echo "</TD>";

View file

@ -56,7 +56,7 @@ if ( isset($_POST['pass_1'])
$url=$_SERVER['REQUEST_URI'];
if ( ! isset ($_REQUEST['gDossier']) )
{
echo '<A class="mtitle" href="user_login.php"><input type="button" value="Retour"></a>';
echo HtmlInput::button_anchor(_('Retour'),'user_login.php?');
} else {
echo '<h2 class="info">'._('Changez vos préférences').'</h2>';
}
@ -222,7 +222,7 @@ echo '</form>';
if ( ! $inside_dossier )
{
echo '<A class="mtitle" href="user_login.php"><input type="button" value="'._('Retour').'"></a>';
echo HtmlInput::button_anchor(_('Retour'),'user_login.php?');
}

View file

@ -177,8 +177,6 @@ if ($sa == 'l' && $id != -1) {
echo HtmlInput::submit("qwlist",_("Recherche"));
echo '</form>';
$array=$_GET;
$array["type"]=$type;
$array["p_jrn"]=$Ledger->id;
list($sql,$where)=$Ledger->build_search_sql($array);
$max_line=$cn->count_sql($sql);

View file

@ -94,10 +94,10 @@ if ( $low_action == "list" )
<?php
echo dossier::hidden();
$a=(isset($_GET['query']))?$_GET['query']:"";
printf ('Recherche <input type="text" name="query" value="%s">',
printf (_('Recherche').' <input type="text" name="query" value="%s">',
$a);
?>
<input type="submit" name="submit_query" value="recherche">
<input type="submit" name="submit_query" value="<?=_('recherche')?>">
<input type="hidden" name="p_action" value="supplier">
</form>
</span>