svn+ssh://danydb@svn/svn/phpcompta/branches/rel500
........
r2906 | danydb | 2010-01-27 15:16:08 +0100 (Wed, 27 Jan 2010) | 2 lines
Cosmetic for html popup
........
r2907 | danydb | 2010-01-27 15:28:03 +0100 (Wed, 27 Jan 2010) | 5 lines
Fix typo translation
Fix Bug : cannot save extension in IE, probably because the same scripts are included several times
........
r2908 | danydb | 2010-01-28 13:56:37 +0100 (Thu, 28 Jan 2010) | 5 lines
Fix Bug In getNodeText when retrieving data for Internet Explorer,
it fails if the xmlNode.firstChild.nodeValue does not contains data.
It is directly set to undefined
........
r2909 | danydb | 2010-01-29 12:20:24 +0100 (Fri, 29 Jan 2010) | 2 lines
Generate invoice : update the comment of the entry only if there were no comment
........
r2910 | danydb | 2010-01-29 19:39:11 +0100 (Fri, 29 Jan 2010) | 6 lines
Improve User
============
Status only plugin means that the user can use only the plugin and can't access to
anything else.
........
r2911 | danydb | 2010-01-29 19:42:38 +0100 (Fri, 29 Jan 2010) | 1 line
Bug import Dexia
........
r2912 | danydb | 2010-01-31 16:24:22 +0100 (Sun, 31 Jan 2010) | 3 lines
For insert_jrnx, the desc is now in the function, we don't need anymore to update after inserting
........
r2913 | danydb | 2010-01-31 16:33:55 +0100 (Sun, 31 Jan 2010) | 4 lines
Fix bug : cannot see operation in quick_writing
cause : the p_action must be set to ALL, it wasn't for quick_writing
........
r2914 | danydb | 2010-02-02 14:52:37 +0100 (Tue, 02 Feb 2010) | 4 lines
Code cleaning
Bug : in ledger of sale, we have twice the possibility to add~ or generate document, and only for invoice (type 4)
Solution : fix the function Acc_Ledger_Purchase::extra_info (type of document = 10), remove extra code
........
r2915 | danydb | 2010-02-05 01:01:11 +0100 (Fri, 05 Feb 2010) | 4 lines
Improve : search_card you can also find a card thanks is tva_num
Documentation doxygen improved
........
r2916 | danydb | 2010-02-05 11:18:36 +0100 (Fri, 05 Feb 2010) | 2 lines
when inserting into ledger_sold the test to check the attach was wrong
........
r2917 | danydb | 2010-02-05 14:45:33 +0100 (Fri, 05 Feb 2010) | 2 lines
Extension : add the possibility to use ajax
........
r2918 | danydb | 2010-02-06 14:25:22 +0100 (Sat, 06 Feb 2010) | 1 line
rewrite the function encodeJSON, hide and show for doxygen
........
r2919 | danydb | 2010-02-06 14:26:07 +0100 (Sat, 06 Feb 2010) | 1 line
remove error where _SESSION is expired
........
r2920 | danydb | 2010-02-06 14:26:49 +0100 (Sat, 06 Feb 2010) | 1 line
In ITva_Select add the display
........
r2921 | danydb | 2010-02-06 14:27:47 +0100 (Sat, 06 Feb 2010) | 1 line
Cosmetic
........
r2922 | danydb | 2010-02-06 14:27:49 +0100 (Sat, 06 Feb 2010) | 1 line
IPopup add a new property drag to make the ipopup dragguable or not
........
r2923 | danydb | 2010-02-06 14:35:28 +0100 (Sat, 06 Feb 2010) | 5 lines
Middle of payment
=================
Feature : add or remove middle of payment
........
r2924 | danydb | 2010-02-06 18:17:15 +0100 (Sat, 06 Feb 2010) | 7 lines
Card
----
A same card can now have 2 different sides (debit or credit)
usefull to have only one card for a customer and a supplier
........
r2925 | danydb | 2010-02-06 18:23:03 +0100 (Sat, 06 Feb 2010) | 1 line
Add the sql script for the double accounting
........
r2926 | danydb | 2010-02-06 19:29:29 +0100 (Sat, 06 Feb 2010) | 2 lines
Update documentation
........
r2927 | danydb | 2010-02-06 20:37:12 +0100 (Sat, 06 Feb 2010) | 4 lines
Fiche_def
========
Permit to have 2 accouting as class_base
........
r2928 | danydb | 2010-02-06 20:56:00 +0100 (Sat, 06 Feb 2010) | 1 line
Bug : FK from stock prevent the removal of a card
........
r2929 | danydb | 2010-02-06 21:14:10 +0100 (Sat, 06 Feb 2010) | 1 line
removeless useless test
........
r2930 | danydb | 2010-02-07 00:55:03 +0100 (Sun, 07 Feb 2010) | 1 line
Improve appearance extension
........
r2931 | danydb | 2010-02-07 00:56:28 +0100 (Sun, 07 Feb 2010) | 2 lines
remove debug
........
r2932 | danydb | 2010-02-07 01:16:51 +0100 (Sun, 07 Feb 2010) | 1 line
Improve appearance extension
........
r2933 | danydb | 2010-02-07 01:19:08 +0100 (Sun, 07 Feb 2010) | 1 line
Improve appearance extension
........
r2934 | danydb | 2010-02-07 01:30:31 +0100 (Sun, 07 Feb 2010) | 1 line
Improve appearance extension
........
r2935 | danydb | 2010-02-07 02:36:25 +0100 (Sun, 07 Feb 2010) | 1 line
Version PHP5.3 : split is obsolete and replace by explode
........
r2936 | danydb | 2010-02-07 04:56:17 +0100 (Sun, 07 Feb 2010) | 1 line
remove owner
........
r2937 | danydb | 2010-02-08 22:34:07 +0100 (Mon, 08 Feb 2010) | 1 line
typo
........
r2938 | danydb | 2010-02-08 22:34:28 +0100 (Mon, 08 Feb 2010) | 1 line
Start translation for Dutch
........
204 lines
6.3 KiB
PHP
204 lines
6.3 KiB
PHP
<?php
|
|
/*
|
|
* This file is part of PhpCompta.
|
|
*
|
|
* PhpCompta is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* PhpCompta is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with PhpCompta; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*/
|
|
// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
|
|
/* $Revision$ */
|
|
/*! \file
|
|
* \brief Show and let modify ledger parameter
|
|
*/
|
|
require_once("class_itext.php");
|
|
require_once('class_dossier.php');
|
|
require_once('class_acc_ledger.php');
|
|
/* javascript for the search poste */
|
|
require_once('class_ipopup.php');
|
|
echo js_include('accounting_item.js');
|
|
echo js_include('prototype.js');
|
|
echo js_include('scriptaculous.js');
|
|
echo js_include('effects.js');
|
|
echo js_include('controls.js');
|
|
echo js_include('dragdrop.js');
|
|
|
|
/* ipopup for search poste */
|
|
echo IPoste::ipopup('ipop_account');
|
|
|
|
$gDossier=dossier::id();
|
|
|
|
include_once ("ac_common.php");
|
|
html_page_start($_SESSION['g_theme']);
|
|
require_once('class_database.php');
|
|
/* Admin. Dossier */
|
|
$cn=new Database($gDossier);
|
|
include_once ("class_user.php");
|
|
$User=new User($cn);
|
|
$User->Check();
|
|
$User->check_dossier($gDossier);
|
|
|
|
|
|
$User->can_request(PARJRN);
|
|
|
|
if ( isset( $_REQUEST['p_jrn'] )) {
|
|
$p_jrn=$_REQUEST['p_jrn'];
|
|
} else {
|
|
echo '<h2 class="error">'._('Journal inexistant').'</h2>';
|
|
exit();
|
|
}
|
|
//--------------------------------------------------
|
|
// remove ledger
|
|
//--------------------------------------------------
|
|
if ( isset($_POST["efface"])) {
|
|
if ( $cn->count_sql("select * from jrn where jr_def_id=".$_POST['p_jrn']." limit 3") == 0 )
|
|
{
|
|
$cn->exec_sql("delete from jrn_def where jrn_def_id=$1",array($_POST['p_jrn']));
|
|
} else {
|
|
alert(_("Impossible d\'effacer ce journal.\n Il est utilisé\n"));
|
|
}
|
|
}
|
|
|
|
|
|
//--------------------------------------------------
|
|
// Update ledger
|
|
If ( isset ($_POST["update"] )) {
|
|
if ( !isset($_POST["p_jrn_name"]) ) {
|
|
echo '<H2 CLASS="error">'._('Un paramètre manque').'</H2>';
|
|
}
|
|
else {
|
|
if ( isset ($_POST['p_ech']) && $_POST['p_ech'] == 'no' ) {
|
|
$p_ech='false';
|
|
$p_ech_lib='null';
|
|
} else {
|
|
$p_ech='true';
|
|
$p_ech_lib="'".$_POST['p_ech_lib']."'";
|
|
}
|
|
|
|
if ( strlen(trim($_POST['p_jrn_deb_max_line'])) == 0 ||
|
|
(string) (int)$_POST['p_jrn_deb_max_line'] != (string)$_POST['p_jrn_deb_max_line'] ||
|
|
$_POST['p_jrn_deb_max_line'] <= 0
|
|
)
|
|
$l_deb_max_line=1;
|
|
else
|
|
$l_deb_max_line=$_POST['p_jrn_deb_max_line'];
|
|
|
|
$l_cred_max_line=$l_deb_max_line;
|
|
|
|
$p_jrn_name=$_POST['p_jrn_name'];
|
|
if (strlen(trim($p_jrn_name))==0) return;
|
|
$p_jrn_name=FormatString($p_jrn_name);
|
|
$p_jrn_fiche_deb="";
|
|
$p_jrn_fiche_cred="";
|
|
|
|
if ( isset ($_POST["FICHEDEB"])) {
|
|
$p_jrn_fiche_deb=join(",",$_POST["FICHEDEB"]);
|
|
}
|
|
if ( isset ($_POST["FICHECRED"])) {
|
|
$p_jrn_fiche_cred=join(",",$_POST["FICHECRED"]);
|
|
}
|
|
$Sql="update jrn_def set jrn_def_name=$1,jrn_def_class_deb=$2,jrn_def_class_cred=$3,
|
|
jrn_deb_max_line=$4,jrn_cred_max_line=$5,jrn_def_ech=$6,jrn_def_ech_lib=$7,jrn_def_fiche_deb=$8,
|
|
jrn_def_fiche_cred=$9, jrn_def_pj_pref=upper($10)
|
|
where jrn_def_id=$11";
|
|
$sql_array=array(
|
|
$p_jrn_name,$_POST['p_jrn_class_deb'],$_POST['p_jrn_class_deb'],
|
|
$l_deb_max_line,$l_cred_max_line,
|
|
$p_ech,$p_ech_lib,
|
|
$p_jrn_fiche_deb,$p_jrn_fiche_cred,
|
|
$_POST['jrn_def_pj_pref'],
|
|
$_GET['p_jrn']
|
|
);
|
|
echo_debug($Sql);
|
|
$Res=$cn->exec_sql($Sql,$sql_array);
|
|
$Res=$cn->alter_seq("s_jrn_pj".$_GET['p_jrn'],$_POST['jrn_def_pj_seq']);
|
|
}
|
|
}
|
|
echo '<div class="lmenu">';
|
|
MenuJrn();
|
|
echo '</div>';
|
|
?>
|
|
<script language="javascript">
|
|
function m_confirm() {
|
|
return confirm ("Etes-vous sur de vouloir effacer ce journal ?");
|
|
}
|
|
</script>
|
|
|
|
<?php
|
|
$Res=$cn->exec_sql("select jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,".
|
|
"jrn_deb_max_line,jrn_cred_max_line,jrn_def_code".
|
|
",jrn_def_type,jrn_def_ech, jrn_def_ech_lib,jrn_def_fiche_deb,jrn_def_fiche_cred".
|
|
" from jrn_def where".
|
|
" jrn_def_id=".$_REQUEST['p_jrn']);
|
|
if ( Database::num_row($Res) == 0 ) exit();
|
|
|
|
|
|
$l_line=Database::fetch_array($Res,0);
|
|
$sessid = $_REQUEST['PHPSESSID'];
|
|
|
|
/* Load all the properties of the ledger */
|
|
$Ledger=new Acc_Ledger($cn,$_REQUEST['p_jrn']);
|
|
$prop=$Ledger->get_propertie();
|
|
$type=$prop['jrn_def_type'];
|
|
$name=$prop['jrn_def_name'];
|
|
$code=$prop['jrn_def_code'];
|
|
/* widget for searching an account */
|
|
$wSearch=new IPoste();
|
|
$wSearch->set_attribute('ipopup','ipop_account');
|
|
$wSearch->set_attribute('account','p_jrn_class_deb');
|
|
$wSearch->set_attribute('no_overwrite','1');
|
|
$wSearch->set_attribute('noquery','1');
|
|
$wSearch->name="p_jrn_class_deb";
|
|
$wSearch->size=40;
|
|
$wSearch->value=$prop['jrn_def_class_deb'];
|
|
$search=$wSearch->input();
|
|
|
|
|
|
$wPjPref=new IText();
|
|
$wPjPref->name='jrn_def_pj_pref';
|
|
$wPjPref->value=$prop['jrn_def_pj_pref'];
|
|
$pj_pref=$wPjPref->input();
|
|
$wPjSeq=new IText();
|
|
$wPjSeq->value=$Ledger->get_last_pj();
|
|
$wPjSeq->name='jrn_def_pj_seq';
|
|
$pj_seq=$wPjSeq->input();
|
|
|
|
$name=$l_line['jrn_def_name'];
|
|
|
|
/* construct all the hidden */
|
|
$hidden= HtmlInput::hidden('p_jrn',$_GET['p_jrn']);
|
|
$hidden.= HtmlInput::hidden('p_action','jrn');
|
|
$hidden.= HtmlInput::hidden('sa','detail');
|
|
$hidden.= dossier::hidden();
|
|
$hidden.=HtmlInput::hidden('p_jrn_deb_max_line',10);
|
|
$hidden.=HtmlInput::hidden('p_ech_lib','echeance');
|
|
$hidden.=HtmlInput::phpsessid();
|
|
|
|
/* Load the card */
|
|
$card=$Ledger->get_fiche_def();
|
|
$rdeb=explode(',',$card['deb']);
|
|
$rcred=explode(',',$card['cred']);
|
|
|
|
|
|
echo '<div class="u_redcontent">';
|
|
echo '<form method="POST">';
|
|
echo $hidden;
|
|
require_once('template/param_jrn.php');
|
|
echo '<INPUT TYPE="SUBMIT" VALUE="Sauve" name="update">
|
|
<INPUT TYPE="RESET" VALUE="Reset">
|
|
<INPUT TYPE="submit" name="efface" value="Efface" onClick="return m_confirm();">';
|
|
|
|
echo '</FORM>';
|
|
echo "</DIV>";
|
|
html_page_stop();
|
|
?>
|