Merged revisions 3017-3033 via svnmerge from

file:///home/developper/svn/phpcompta/branches/rel500

........
  r3018 | danydb | 2010-04-16 12:45:48 +0200 (Fri, 16 Apr 2010) | 4 lines
  
  Quick_writing
  =============
  Advanced->direct writing remove the flag direct_write
........
  r3019 | danydb | 2010-04-16 13:11:06 +0200 (Fri, 16 Apr 2010) | 7 lines
  
  Advanced->Periode
  ==================
  * give the number of operation
  * do not propose to remove a used periode
  * fix cosmetic
  * add confirm for "cloture" and "remove"
........
  r3020 | danydb | 2010-04-16 15:31:03 +0200 (Fri, 16 Apr 2010) | 2 lines
  
  IPoste : add documentation : sample of code
........
  r3021 | danydb | 2010-04-16 15:31:32 +0200 (Fri, 16 Apr 2010) | 2 lines
  
  Iposte update doc : typo
........
  r3022 | danydb | 2010-04-16 21:12:47 +0200 (Fri, 16 Apr 2010) | 2 lines
  
  Add info for error
........
  r3023 | danydb | 2010-04-17 00:37:08 +0200 (Sat, 17 Apr 2010) | 2 lines
  
  ac_common.php add a function h2info
........
  r3024 | danydb | 2010-04-17 01:19:21 +0200 (Sat, 17 Apr 2010) | 2 lines
  
  Button is not printed
........
  r3025 | danydb | 2010-04-17 01:20:14 +0200 (Sat, 17 Apr 2010) | 2 lines
  
  extension :Logout button and name plugin is not printed
........
  r3026 | danydb | 2010-04-17 01:40:01 +0200 (Sat, 17 Apr 2010) | 1 line
  
  Appearance : improve disable html elt appearance
........
  r3027 | danydb | 2010-04-17 01:43:05 +0200 (Sat, 17 Apr 2010) | 1 line
  
  Periode : improve usuability
........
  r3028 | danydb | 2010-04-17 01:43:21 +0200 (Sat, 17 Apr 2010) | 1 line
  
  Fix several bugs in itva_popup
........
  r3029 | danydb | 2010-04-17 14:12:47 +0200 (Sat, 17 Apr 2010) | 2 lines
  
  New Manuel for windows
........
  r3030 | danydb | 2010-04-17 15:18:25 +0200 (Sat, 17 Apr 2010) | 6 lines
  
  
  Document modele
  ===============
  New : can decide if a document must be used with the ledger of sales, purchase or follow up
........
  r3031 | danydb | 2010-04-18 00:05:25 +0200 (Sun, 18 Apr 2010) | 1 line
  
  Add function tr
........
  r3032 | danydb | 2010-04-18 00:06:15 +0200 (Sun, 18 Apr 2010) | 1 line
  
  Correct style : you can now click on the selected menu
........
  r3033 | danydb | 2010-04-18 19:58:24 +0200 (Sun, 18 Apr 2010) | 3 lines
  
  
  scripts.js : add function deleteRow(tablename, object) to use with IButton
........
This commit is contained in:
Dany De Bontridder 2010-04-19 09:24:02 +00:00
parent 9ac52c4ce6
commit a7999c308a
24 changed files with 198 additions and 84 deletions

BIN
doc/installation-window.odt Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,8 @@
begin;
alter table document_modele add md_affect varchar(3) default null;
update document_modele set md_affect='ACH' where md_type=10;
update document_modele set md_affect='VEN' where md_type=4;
update document_modele set md_affect='GES' where md_type is null;
alter table document_modele alter md_affect set not null;
update version set val=72;
commit;

View file

@ -64,7 +64,7 @@ if ( $only_plugin != 'P' ) {
$msg=_('Retour au tableau de bord');
$hidden=dossier::hidden().HtmlInput::phpsessid();
echo <<<EOF
<div style="position:absolute;top:3px;left:3px">
<div style="position:absolute;top:3px;left:3px" class="noprint">
<form method="get" action="access.php" style="display:inline">
$hidden
<input type="SUBMIT" value="$msg">

View file

@ -61,32 +61,36 @@ function search_poste(obj) {
var queryString="?gDossier="+dossier;
queryString+="&PHPSESSID="+phpsessid;
queryString+="&op=sf";
if ( obj.jrn) { queryString+="&j="+obj.jrn;}
if ( obj.account) { queryString+="&c="+obj.account;}
if ( obj.label) { queryString+="&l="+obj.label;}
if ( obj.bracket) { queryString+="&b="+obj.bracket;}
if( obj.noquery) {queryString+="&nq";}
if( obj.no_overwrite) {queryString+="&nover";}
if( obj.bracket) {queryString+="&bracket";}
if ( ! obj.noquery) {
if( obj.query) {queryString+="&q="+obj.query;}
else {
if ($(obj).account) {
var e=$(obj).account;
queryString+="&q="+$(e).value;
try {
if ( obj.jrn) { queryString+="&j="+obj.jrn;}
if ( obj.account) { queryString+="&c="+obj.account;}
if ( obj.label) { queryString+="&l="+obj.label;}
if ( obj.bracket) { queryString+="&b="+obj.bracket;}
if( obj.noquery) {queryString+="&nq";}
if( obj.no_overwrite) {queryString+="&nover";}
if( obj.bracket) {queryString+="&bracket";}
if ( ! obj.noquery) {
if( obj.query) {queryString+="&q="+obj.query;}
else {
if ($(obj).account) {
var e=$(obj).account;
var str_account=$(e).value;
queryString+="&q="+str_account;
}
}
}
}
}
queryString+="&ctl="+obj.ipopup;
var action=new Ajax.Request ( 'ajax_poste.php',
{
method:'get',
parameters:queryString,
onFailure:errorPoste,
onSuccess:result_poste_search
}
);
queryString+="&ctl="+obj.ipopup;
queryString=encodeURI(queryString);
var action=new Ajax.Request ( 'ajax_poste.php',
{
method:'get',
parameters:queryString,
onFailure:errorPoste,
onSuccess:result_poste_search
}
);
} catch (e) { alert(e.getMessage());}
}
/**
*@brief when you submit the form for searching a accounting item

View file

@ -23,7 +23,19 @@
* \brief javascript script, always added to every page
*
*/
/**
*@brief delete a row from a table (tb) the input button send the this
as second parameter
*/
function deleteRow(tb,obj) {
if (confirm('Confirmez effacement'))
{
var td=obj.parentNode;
var tr=td.parentNode;
var lidx=tr.rowIndex;
g(tb).deleteRow(lidx);
}
}
/*!\brief remove trailing and heading space
* \param the string to modify
* \return string without heading and trailing space
@ -295,7 +307,7 @@ function popup_select_tva(obj) {
onSuccess:success_popup_select_tva
}
);
} catch (e) {alert(e.message);}
} catch (e) {alert("popup_select_tva "+e.message);}
}
/**
*@brief display the popup with vat and explanations
@ -312,7 +324,7 @@ function success_popup_select_tva(req) {
var code_html=getNodeText(nodeXml);
code_html=unescape_xml(code_html);
$(name_ctl).innerHTML=code_html;
} catch (e) {alert(e.message);}
} catch (e) {alert("success_popup_select_tva "+e.message);}
}
/**
@ -332,7 +344,7 @@ function set_tva_label(obj) {
onSuccess:success_set_tva_label
}
);
} catch (e) {alert(e.message);}
} catch (e) {alert("set_tva_label "+e.message);}
}
/**
*@brief display the popup with vat and explanations
@ -348,6 +360,6 @@ function success_set_tva_label(req) {
var label_code=code[0].firstChild.nodeValue;
var label_value=value[0].firstChild.nodeValue;
set_value(label_code,label_value);
} catch (e) {alert(e.message);}
} catch (e) {alert("success_set_tva_label "+e.message);}
}
}

View file

@ -289,7 +289,12 @@ a.mtitle {
color: blue;
}
td.selectedcell a.mtitle {
font-size:1em;
text-decoration:none;
display:block;
color:white;
}
a.dossier {
font-size:10px;
text-decoration:none;
@ -733,5 +738,12 @@ span.todo {
text-align: left;
background-color:yellow;
}
input[disabled], textarea[disabled], option[disabled], optgroup[disabled], select[disabled] {
-moz-user-focus:ignore;
-moz-user-input:disabled;
background-color:white;
color:blue;
cursor:inherit;
}
/* </style> */

View file

@ -291,7 +291,12 @@ a.mtitle {
color: blue;
}
td.selectedcell a.mtitle {
font-size:1em;
text-decoration:none;
display:block;
color:white;
}
a.dossier {
font-size:10px;
text-decoration:none;
@ -736,4 +741,12 @@ span.todo {
background-color:yellow;
}
input[disabled], textarea[disabled], option[disabled], optgroup[disabled], select[disabled] {
-moz-user-focus:ignore;
-moz-user-input:disabled;
background-color:lightgrey;
color:black;
cursor:inherit;
}
/* </style> */

View file

@ -296,7 +296,12 @@ a.mtitle {
display:block;
color:blue;
}
td.selectedcell a.mtitle {
font-size:1em;
text-decoration:none;
display:block;
color:white;
}
a.mtitle:hover {
text-decoration:none;
display:block;
@ -720,4 +725,13 @@ span.todo {
background-color:yellow;
}
input[disabled], textarea[disabled], option[disabled], optgroup[disabled], select[disabled] {
-moz-user-focus:ignore;
-moz-user-input:disabled;
background-color:white;
color:blue;
cursor:inherit;
}
/* </style> */

View file

@ -34,13 +34,14 @@ function h($p_string) { return htmlspecialchars($p_string);}
function hi($p_string) { return '<i>'.htmlspecialchars($p_string).'</i>';}
function hb($p_string) { return '<b>'.htmlspecialchars($p_string).'</b>';}
function th($p_string) { return '<th>'.htmlspecialchars($p_string).'</th>';}
function h2info($p_string) { return '<h2 class="info">'.htmlspecialchars($p_string).'</h2>';}
/*!\brief surrond the string with td
*\param string
*\param class to use
* \return string surrounded by td
*/
function td($p_string,$p_class=''){ return '<td class="'.$p_class.'" >'.$p_string.'</td>';}
function tr($p_string,$p_class=''){ return '<tr class="'.$p_class.'" >'.$p_string.'</tr>';}
/*!\brief escape correctly php string to javascript */
function j($p_string) { $a=preg_replace("/\r?\n/", "\\n", addslashes($p_string)); return $a;}
/*!
@ -323,7 +324,7 @@ function ShowItem($p_array,$p_dir='V',$class="mtitle",$class_ref="mtitle",$defau
$set=$href[3];
if ( $set == $default )
$ret.='<tr><TD CLASS="selectedcell">'.$href[1].'</TD></tr>';
$ret.='<TR><TD CLASS="selectedcell"><A class="'.$class_ref.'" HREF="'.$href[0].'" title="'.$title.'">'.$href[1].'</A></TD></TR>';
else
$ret.='<TR><TD CLASS="'.$class.'"><A class="'.$class_ref.'" HREF="'.$href[0].'" title="'.$title.'">'.$href[1].'</A></TD></TR>';
}
@ -343,9 +344,7 @@ function ShowItem($p_array,$p_dir='V',$class="mtitle",$class_ref="mtitle",$defau
$set=$href[3];
if ( $default=== $href[0]||$set===$default ) {
$ret.='<TD CLASS="selectedcell">'.$href[1].'</TD>';
$ret.='<TD CLASS="selectedcell"><A class="'.$class_ref.'" HREF="'.$href[0].'" title="'.$title.'">'.$href[1].'</A></TD>';
} else {
$ret.='<TD CLASS="'.$class.'"><A class="'.$class_ref.'" HREF="'.$href[0].'" title="'.$title.'">'.$href[1].'</A></TD>';
}

View file

@ -1232,7 +1232,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger {
$r.=_("Ajoutez une pièce justificative ");
$r.=$file->input("pj","");
if ( $this->db->count_sql("select md_id,md_name from document_modele where md_type=10") > 0 )
if ( $this->db->count_sql("select md_id,md_name from document_modele where md_affect='ACH'") > 0 )
{
$r.='<hr>';
@ -1242,7 +1242,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger {
$doc_gen->name="gen_doc";
$doc_gen->value=$this->db->make_array(
"select md_id,md_name ".
" from document_modele where md_type=10");
" from document_modele where md_affect='ACH'");
$r.=$doc_gen->input().'<br>';
}
$r.='<br>';

View file

@ -749,7 +749,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$r.=_("Ajoutez une pièce justificative ");
$r.=$file->input("pj","");
if ( $this->db->count_sql("select md_id,md_name from document_modele where md_type=4") > 0 )
if ( $this->db->count_sql("select md_id,md_name from document_modele where md_affect='VEN'") > 0 )
{
@ -759,7 +759,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$doc_gen->name="gen_doc";
$doc_gen->value=$this->db->make_array(
"select md_id,md_name ".
" from document_modele where md_type=4");
" from document_modele where md_affect='VEN'");
$r.=$doc_gen->input().'<br>';
}
$r.='<br>';

View file

@ -433,6 +433,16 @@ de donn&eacute;es");
return false;
return true;
}
/**
*@brief check if the large object exists
*@param $p_oid of the large object
*@return return true if the large obj exist or false if not
*/
function exist_blob($p_oid) {
$r=$this->get_value('select count(loid) from pg_largeobject where loid=$1'
,array($p_oid) );
if ($r > 0) return true; else return false;
}
/*
*!\brief test if a view exist
* \return true if the view. exist otherwise false

View file

@ -540,7 +540,7 @@ class Document
$qcode=isset($_REQUEST['qcode_dest'])?$_REQUEST['qcode_dest']:$_REQUEST['e_client'];
$tiers->get_by_qcode($qcode,false);
$p=$tiers->strAttribut(ATTR_DEF_ACCOUNT);
$poste=new Poste($this->db,$p);
$poste=new Acc_Account_Ledger($this->db,$p);
$r=$poste->get_solde(' true' );
break;
case 'CUST_NAME':

View file

@ -35,6 +35,7 @@ class Document_modele {
var $md_lob; /*!< $md_lob Document file */
var $md_sequence; /*!< $md_sequence sequence name (autogenerate) */
var $sequence; /*!< $sequence sequence number used by the create sequence start with */
var $md_affect; /*!< $md_affect if you can use it in VEN for sale, ACH for purchase or GES for follow-up */
//Constructor parameter = database connexion
function Document_modele($p_cn,$p_id=-1) {
$this->cn=$p_cn;
@ -50,14 +51,19 @@ class Document_modele {
*/
function myList() {
$s=dossier::get();
$sql="select md_id,md_name,dt_value from document_modele join document_type on(dt_id=md_type)";
$sql="select md_id,md_name,md_affect,dt_value from document_modele join document_type on(dt_id=md_type)";
$Res=$this->cn->exec_sql($sql);
$all=Database::fetch_all($Res);
if ( Database::num_row($Res) == 0 ) return "";
$r='<p><form method="post">';
$r.=dossier::hidden();
$r.="<table>";
$r.="<tr> <th> Nom </th> <th>Type</Th><th>Fichier</th><th> Effacer</th>";
$r.="<tr> ";
$r.=th(_('Nom'));
$r.=th(_('Catégorie'));
$r.=th(_('Affect.'));
$r.=th(_('Fichier'));
$r.=th(_('Effacer'));
$r.="</tr>";
foreach ( $all as $row) {
$r.="<tr>";
@ -67,6 +73,7 @@ class Document_modele {
$r.="<td>";
$r.=$row['dt_value'];
$r.="</td>";
$r.=td(h($row['md_affect']));
$r.="<td>";
$r.='<A HREF="show_document_modele.php?md_id='.$row['md_id'].'&'.$s.'">Document</a>';
$r.="</td>";
@ -115,12 +122,11 @@ class Document_modele {
{
// insert into the table document_modele
$this->name=FormatString($this->md_name);
$this->md_id=$this->cn->get_next_seq('document_modele_md_id_seq');
$sql=sprintf("insert into document_modele(md_id,md_name,md_type)
values (%d,'%s',%d)",
$this->md_id,$this->name,$this->md_type);
$Ret=$this->cn->exec_sql($sql);
$sql="insert into document_modele(md_id,md_name,md_type,md_affect)
values ($1,$2,$3,$4)";
$Ret=$this->cn->exec_sql($sql,array($this->md_id,$this->md_name,$this->md_type,$this->md_affect));
// create the sequence for this modele of document
$this->md_sequence="document_".$this->cn->get_next_seq("document_seq");
// if start is not equal to 0 and he's a number than the user
@ -191,7 +197,8 @@ class Document_modele {
$res=$this->cn->exec_sql($sql);
$r=Database::fetch_array($res,0);
// if a lob is found
if ( strlen ($r['md_lob']) != 0 )
if ( strlen ($r['md_lob']) &&
$this->cn->exist_blob($r['md_lob']) )
{
// we remove it first
$this->cn->lo_unlink($r['md_lob']);
@ -229,13 +236,26 @@ class Document_modele {
$r.="<tr><td> Nom </td><td>".$t->input()."</td>";
$r.="</tr>";
$r.="<tr><td>Type de document </td>";
$r.="<tr><td>Catégorie de document </td>";
$w=new ISelect();
$w->name="md_type";
$w->value=$this->cn->make_array('select dt_id,dt_value from document_type');
$r.="<td>".$w->input()."</td></tr>";
$r.='<tr>';
$r.=td(_('Affectation'));
$waffect=new ISelect();
$waffect->name='md_affect';
$waffect->value=array(
array('value'=>'ACH','label'=>_('Uniquement journaux achat')),
array('value'=>'VEN','label'=>_('Uniquement journaux vente')),
array('value'=>'GES','label'=>_('Partie gestion'))
);
$r.=td($waffect->input());
$r.='</tr>';
$f=new IFile();
$f->name="doc";
$r.="<tr><td>fichier</td><td> ".$f->input()."</td></tr>";
@ -256,10 +276,10 @@ class Document_modele {
/*!\brief load the value of a document_modele,the ag_id variable must be set
*/
function load() {
$array=$this->cn->get_array("SELECT md_id, md_name, md_lob, md_type, md_filename, md_mimetype".
$array=$this->cn->get_array("SELECT md_id, md_name, md_lob, md_type, md_filename, md_mimetype,md_affect".
" FROM document_modele where md_id=$1",array($this->md_id));
if ( count($array) == 0 ) return null;
foreach ( array('md_name', 'md_lob','md_type', 'md_filename', 'md_mimetype') as $idx) {
foreach ( array('md_name', 'md_lob','md_type', 'md_filename', 'md_mimetype','md_affect') as $idx) {
$this->$idx=$array[0][$idx];
}
}

View file

@ -49,12 +49,20 @@ require_once('function_javascript.php');
* - query value to seek
*\see ajax_poste.php
*\code
// must be done BEFORE any FORM
require_once('class_iposte.php');
echo IPoste::ipopup('ipop_account');
// The popup
$value->set_attribute('ipopup','ipop_account');
// the input text to update
$value->set_attribute('account','p_value');
// In the FORM
$text=new IPoste('field');
$text->value=$p_res[$i]['pvalue'];
$text->set_attribute('ipopup','ipop_account');
$text->set_attribute('gDossier',Dossier::id());
$text->set_attribute('phpsessid',$_REQUEST['phpsessid']);
$text->set_attribute('jrn',0);
$text->set_attribute('account','field');
\endcode
*/
class IPoste extends HtmlInput

View file

@ -66,11 +66,18 @@ require_once('class_ispan.php');
$r.=$this->dbutton();
if ( isset($this->code)){
if ( $this->cn != NULL){
/* check if tva_id == integer */
if (trim($this->value)!='' && isNumber($this->value)==1 && strpos($this->value,',') === false)
$this->code->value=$this->cn->get_value('select tva_label from tva_rate where tva_id=$1',
array($this->value));;
}
$r.=$this->code->input();
$this->set_attribute('jcode',$this->code->name);
$this->set_attribute('gDossier',dossier::id());
$this->set_attribute('ctl',$this->name);
$r.=$this->get_js_attr();
}
return $r;
@ -104,7 +111,13 @@ require_once('class_ispan.php');
$res=sprinf($r,$this->name,$this->value,$this->name);
return $res;
}
public function add_label($p_code) {
/**
*@brief add a field to show the selected tva's label
*@param $p_code is the name of the label where you can see the label of VAT
*@param $p_cn is a database connection if NULL it doesn't seek in the database
*/
public function add_label($p_code,$p_cn=null) {
$this->cn=$p_cn;
$this->code=new ISpan($p_code);
}
static public function test_me()

View file

@ -157,8 +157,10 @@ class Periode {
$str_dossier=dossier::get();
if ( $this->jrn_def_id==0 ) {
$Res=$this->cn->exec_sql("select p_id,to_char(p_start,'DD.MM.YYYY') as date_start,to_char(p_end,'DD.MM.YYYY') as date_end,p_central,p_closed,p_exercice
from parm_periode order by p_start,p_end");
$Res=$this->cn->exec_sql("select p_id,to_char(p_start,'DD.MM.YYYY') as date_start,to_char(p_end,'DD.MM.YYYY') as date_end,p_central,p_closed,p_exercice,
(select count(jr_id) as count_op from jrn where jr_tech_per = p_id) as count_op
from parm_periode
order by p_start,p_end");
$Max=Database::num_row($Res);
echo '<TABLE ALIGN="CENTER">';
echo "</TR>";
@ -180,16 +182,22 @@ class Periode {
$remove='<TD></TD>';
} else {
$closed='<TD class="mtitle">';
$closed.='<A class="mtitle" HREF="?p_action=periode&action=closed&p_per='.$l_line['p_id'].'&'.$str_dossier.'"> Cloturer</A>';
$closed.='<A class="mtitle" HREF="?p_action=periode&action=closed&p_per='.$l_line['p_id'].'&'.$str_dossier.'" onclick="return confirm(\''._('Confirmez cloture').' ?\')"> Cloturer</A>';
$change='<TD class="mtitle">';
$change.='<A class="mtitle" HREF="?p_action=periode&action=change_per&p_per='.
$l_line['p_id']."&p_date_start=".$l_line['date_start'].
"&p_date_end=".$l_line['date_end']."&p_exercice=".
$l_line['p_exercice']."&$str_dossier\"> Changer</A>";
$remove='<TD class="mtitle">';
$remove.='<A class="mtitle" HREF="?p_action=periode&action=delete_per&p_per='.
$l_line['p_id']."&$str_dossier\"> Efface</A>";
if ($l_line['count_op'] == 0 ) {
$remove.='<A class="mtitle" HREF="?p_action=periode&action=delete_per&p_per='.
$l_line['p_id']."&$str_dossier\" onclick=\"return confirm('"._('Confirmez effacement ?')."')\" > Efface</A>";
} else {
$remove.=sprintf(_('Nombre opération %d'),$l_line['count_op']);
}
$remove.='</td>';
}
echo "$closed";
echo $change;

View file

@ -26,7 +26,7 @@
require_once ('config.inc.php');
require_once('constant.security.php');
define ("DBVERSION",71);
define ("DBVERSION",72);
define ("MAX_COMPTE",4);
define ('MAX_ARTICLE',9);

View file

@ -43,6 +43,7 @@ if ( $sub_action=='add_document')
$doc->md_id=-1; // because it is a new model
$doc->md_type=$_POST['md_type'];
$doc->start=$_POST['start_seq'];
$doc->md_affect=$_POST['md_affect'];
$doc->Save();
}
//-----------------------------------------------------

View file

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

View file

@ -50,7 +50,8 @@ if ( $action=="change_per") {
echo '</FORM></TR>';
echo "</TABLE>";
// $choose="yes";
echo HtmlInput::button_anchor(_('Retour'),'?p_action=periode&'.Dossier::get());
exit();
}
if ( isset ($_POST["conf_chg_per"] ) ) {
$User->can_request(PARPER);
@ -61,16 +62,15 @@ if ( isset ($_POST["conf_chg_per"] ) ) {
strlen (trim($p_exercice)) == 0 ||
(string) $p_exercice != (string)(int) $p_exercice)
{
echo "<H2 class=\"error\"> Valeurs invalides</H2>";
return;
}
alert(_('Valeurs invalides'));
} else {
$Res=$cn->exec_sql(" update parm_periode ".
"set p_start=to_date('". $p_date_start."','DD.MM.YYYY'),".
" p_end=to_date('". $p_date_end."','DD.MM.YYYY'),".
" p_exercice='".$p_exercice."'".
" where p_id=".$p_per);
}
$choose="yes";
}
@ -79,8 +79,7 @@ if ( isset ($_POST["add_per"] )) {
extract($_POST);
$obj=new Periode($cn);
if ( $obj->insert($p_date_start,$p_date_end,$p_exercice) == 1 ){
echo "<H2 class=\"error\"> Valeurs invalides</H2>";
return;
alert(_('Valeurs invalides'));
}
$choose="yes";
@ -103,7 +102,7 @@ if ( $action== "delete_per" ) {
$p_per=$_GET["p_per"];
// Check if the periode is not used
if ( $cn->count_sql("select * from jrnx where j_tech_per=$p_per") != 0 ) {
echo '<h2 class="error"> Désolé mais cette période est utilisée</h2>';
alert(' Désolé mais cette période est utilisée');
} else
{
$Res=$cn->exec_sql("delete from parm_periode where p_id=$p_per");

View file

@ -39,13 +39,8 @@ $user->can_request(PARPREDE,1);
" jrn_def order by jrn_def_name");
// Show a list of ledger
$sa=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"";
$sel->selected=$sa;
$sel->selected=(isset($_REQUEST['jrn']))?$_REQUEST['jrn']:-1;
echo 'Choississez un journal '.$sel->input();
$wCheck=new ICheckBox();
if ( isset($_REQUEST['direct'])) {
$wCheck->selected=true;
}
echo 'Ecriture directe'.$wCheck->input('direct');
echo dossier::hidden();
$hid=new IHidden();
@ -58,8 +53,6 @@ $user->can_request(PARPREDE,1);
// if $_REQUEST[sa] == del delete the predefined operation
if ( $sa == 'del') {
$op=new Pre_operation($cn);
if ( isset($_REQUEST['direct']))
$op->od_direct='t';
$op->od_id=$_REQUEST['od_id'];
$op->delete();
$sa='jrn';