[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r4796 - in phpcompta/trunk: . doc html html/admin/sql/pa
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r4796 - in phpcompta/trunk: . doc html html/admin/sql/patch html/js include include/template |
Date: |
Fri, 23 Mar 2012 21:12:58 +0100 (CET) |
Author: danydb
Date: 2012-03-23 21:12:57 +0100 (Fri, 23 Mar 2012)
New Revision: 4796
Added:
phpcompta/trunk/html/admin/sql/patch/upgrade101.sql
Modified:
phpcompta/trunk/
phpcompta/trunk/doc/manuel-fr.odt
phpcompta/trunk/doc/manuel-fr.pdf
phpcompta/trunk/html/ajax_history.php
phpcompta/trunk/html/ajax_ledger.php
phpcompta/trunk/html/js/acc_ledger.js
phpcompta/trunk/html/style-color.css
phpcompta/trunk/html/style-epad.css
phpcompta/trunk/html/style-light.css
phpcompta/trunk/html/style.css
phpcompta/trunk/include/ac_common.php
phpcompta/trunk/include/action.common.inc.php
phpcompta/trunk/include/class_acc_account_ledger.php
phpcompta/trunk/include/class_acc_ledger.php
phpcompta/trunk/include/class_acc_ledger_fin.php
phpcompta/trunk/include/class_acc_ledger_purchase.php
phpcompta/trunk/include/class_anc_grandlivre.php
phpcompta/trunk/include/class_anc_operation.php
phpcompta/trunk/include/class_calendar.php
phpcompta/trunk/include/class_document.php
phpcompta/trunk/include/class_document_modele.php
phpcompta/trunk/include/class_document_type.php
phpcompta/trunk/include/class_fiche.php
phpcompta/trunk/include/class_follow_up.php
phpcompta/trunk/include/class_lettering.php
phpcompta/trunk/include/class_todo_list.php
phpcompta/trunk/include/compta_ach.inc.php
phpcompta/trunk/include/compta_fin_rec.inc.php
phpcompta/trunk/include/compta_ven.inc.php
phpcompta/trunk/include/constant.php
phpcompta/trunk/include/template/form_ledger_fin.php
phpcompta/trunk/include/template/ledger_detail_file.php
phpcompta/trunk/include/template/ledger_detail_misc.php
phpcompta/trunk/include/template/ledger_detail_ven.php
phpcompta/trunk/include/template/letter_prop.php
phpcompta/trunk/include/template/modele_document.php
Log:
Merged revisions 4743-4748,4759-4784,4786-4791 via svnmerge from
svn+ssh://ns352270.ovh.net/svn/phpcompta/tags/rel600
........
r4743 | danydb | 2012-02-04 16:18:09 +0100 (Sat, 04 Feb 2012) | 1 line
update DBVersion
........
r4744 | danydb | 2012-02-04 16:22:52 +0100 (Sat, 04 Feb 2012) | 1 line
remove space
........
r4745 | danydb | 2012-02-04 16:44:10 +0100 (Sat, 04 Feb 2012) | 3 lines
Bug : clause from in report didn't work properly
........
r4746 | danydb | 2012-02-04 18:39:58 +0100 (Sat, 04 Feb 2012) | 1 line
sql improve : do not use comptaproc. function in select concerning lettering
........
r4747 | danydb | 2012-02-04 18:45:55 +0100 (Sat, 04 Feb 2012) | 1 line
put correct DBVERSION
........
r4748 | danydb | 2012-02-04 18:47:00 +0100 (Sat, 04 Feb 2012) | 1 line
remove useless patch
........
r4759 | danydb | 2012-02-04 23:19:55 +0100 (Sat, 04 Feb 2012) | 2 lines
Bug : remove double input in letter_deb, letter_cred
........
r4760 | danydb | 2012-02-04 23:35:13 +0100 (Sat, 04 Feb 2012) | 2 lines
Upgrade script
........
r4761 | danydb | 2012-02-07 16:50:24 +0100 (Tue, 07 Feb 2012) | 1 line
FIN : cosmetic show name of the card + align col.
........
r4762 | danydb | 2012-02-07 18:50:55 +0100 (Tue, 07 Feb 2012) | 1 line
FIN : add item , new column card name, change func for adding row
........
r4763 | danydb | 2012-02-08 17:49:44 +0100 (Wed, 08 Feb 2012) | 1 line
Improve : generate document : default argument is an array
........
r4764 | danydb | 2012-02-08 19:15:50 +0100 (Wed, 08 Feb 2012) | 2 lines
Correct probleme with date in calc
........
r4765 | danydb | 2012-02-08 19:47:08 +0100 (Wed, 08 Feb 2012) | 3 lines
Correct probleme with date in other document than CALC
New tag : DATE_CALC
........
r4766 | danydb | 2012-02-08 20:00:18 +0100 (Wed, 08 Feb 2012) | 2 lines
Double click on accounting gives the history of the accounting
........
r4767 | danydb | 2012-02-09 10:20:29 +0100 (Thu, 09 Feb 2012) | 1 line
Improve : generate document :add DATE_LIMIT_CALC to allow date formatting in
calc
........
r4768 | danydb | 2012-02-09 13:47:45 +0100 (Thu, 09 Feb 2012) | 2 lines
cosmetic : place of "Document generated
........
r4769 | danydb | 2012-02-09 14:02:13 +0100 (Thu, 09 Feb 2012) | 2 lines
cosmetic : ACH generated document use style instead of class
........
r4770 | danydb | 2012-02-09 14:09:58 +0100 (Thu, 09 Feb 2012) | 1 line
code indent
........
r4771 | danydb | 2012-02-17 01:13:36 +0100 (Fri, 17 Feb 2012) | 1 line
bug cannot update ANC (cause j_id and value from POST conflict)
........
r4772 | danydb | 2012-02-17 01:16:34 +0100 (Fri, 17 Feb 2012) | 1 line
do not clause popup if we save
........
r4773 | danydb | 2012-02-17 01:26:16 +0100 (Fri, 17 Feb 2012) | 1 line
ANC : great ledger oa_date problem (order by clause)
........
r4774 | danydb | 2012-02-20 09:24:08 +0100 (Mon, 20 Feb 2012) | 2 lines
0000525: Le contr?\195?\180le des montants analytiques d'une
?\195?\169criture ?\195?\160 plusieurs ligne (ex: salaires) en modification met
tout en rouge
........
r4775 | danydb | 2012-02-25 14:47:13 +0100 (Sat, 25 Feb 2012) | 1 line
0000528: VEN_TVAC n'est pas correctement calcul?\195?\169
........
r4776 | danydb | 2012-02-25 14:59:43 +0100 (Sat, 25 Feb 2012) | 1 line
VEN_ART_PRICE = 0 alors return ""
........
r4777 | danydb | 2012-02-25 15:14:55 +0100 (Sat, 25 Feb 2012) | 2 lines
Order by document.dt_value
........
r4778 | danydb | 2012-02-25 15:15:13 +0100 (Sat, 25 Feb 2012) | 2 lines
Order by document.dt_value
........
r4779 | danydb | 2012-02-25 15:18:12 +0100 (Sat, 25 Feb 2012) | 1 line
constant.php for prod
........
r4780 | danydb | 2012-02-25 15:42:00 +0100 (Sat, 25 Feb 2012) | 1 line
Bug with calendar
........
r4781 | danydb | 2012-02-25 15:48:43 +0100 (Sat, 25 Feb 2012) | 1 line
0000531: Tableau de bord : pense-b?\195?\170te
........
r4782 | danydb | 2012-03-14 17:16:38 +0100 (Wed, 14 Mar 2012) | 1 line
548 banquaire -> bancaire
........
r4783 | danydb | 2012-03-20 21:05:01 +0100 (Tue, 20 Mar 2012) | 1 line
Warning if account used instead of a card in ACC_LEDGER
........
r4784 | danydb | 2012-03-21 11:41:25 +0100 (Wed, 21 Mar 2012) | 1 line
0000552: Pourcentage dans une fiche 4 d?\195?\169cimales
........
r4786 | danydb | 2012-03-22 20:17:37 +0100 (Thu, 22 Mar 2012) | 1 line
0000557: Faire appara?\195?\174tre dans titre HTML le module courant
........
r4787 | danydb | 2012-03-22 20:35:42 +0100 (Thu, 22 Mar 2012) | 1 line
558 Agrandir zone document
........
r4788 | danydb | 2012-03-22 20:40:22 +0100 (Thu, 22 Mar 2012) | 1 line
558 Agrandir zone document : cosmetic background
........
r4789 | danydb | 2012-03-22 20:51:52 +0100 (Thu, 22 Mar 2012) | 1 line
558 Agrandir zone document : cosmetic background
........
r4790 | danydb | 2012-03-22 20:54:18 +0100 (Thu, 22 Mar 2012) | 1 line
Cosmetic ajout lien sous qcode client
........
r4791 | danydb | 2012-03-22 21:12:17 +0100 (Thu, 22 Mar 2012) | 1 line
Cosmetic : alignement et taille d?\195?\169tail op?\195?\169rations
........
Property changes on: phpcompta/trunk
___________________________________________________________________
Name: svnmerge-integrated
- /phpcompta/tags/rel600:1-4734,4738-4741
+ /phpcompta/tags/rel600:1-4795
Modified: phpcompta/trunk/doc/manuel-fr.odt
===================================================================
(Binary files differ)
Modified: phpcompta/trunk/doc/manuel-fr.pdf
===================================================================
(Binary files differ)
Copied: phpcompta/trunk/html/admin/sql/patch/upgrade101.sql (from rev 4791,
phpcompta/tags/rel600/html/admin/sql/patch/upgrade101.sql)
===================================================================
--- phpcompta/trunk/html/admin/sql/patch/upgrade101.sql
(rev 0)
+++ phpcompta/trunk/html/admin/sql/patch/upgrade101.sql 2012-03-23 20:12:57 UTC
(rev 4796)
@@ -0,0 +1,11 @@
+begin;
+delete from letter_deb where ld_id in (select a.ld_id from letter_deb as a
join letter_deb as b on (a.j_id=b.j_id and a.ld_id > b.ld_id));
+delete from letter_cred where lc_id in (select a.lc_id from letter_cred as a
join letter_cred as b on (a.j_id=b.j_id and a.lc_id > b.lc_id));
+
+ALTER TABLE letter_deb ADD CONSTRAINT letter_deb_j_id_key UNIQUE(j_id );
+ALTER TABLE letter_cred ADD CONSTRAINT letter_cred_j_id_key UNIQUE(j_id );
+
+
+update version set val=102;
+
+commit;
\ No newline at end of file
Modified: phpcompta/trunk/html/ajax_history.php
===================================================================
--- phpcompta/trunk/html/ajax_history.php 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/html/ajax_history.php 2012-03-23 20:12:57 UTC (rev
4796)
@@ -44,8 +44,8 @@
/* security */
if ( $user->check_dossier(dossier::id(),true) == 'X' ) exit();
+$from_div=(isset ($_REQUEST['ajax']))?1:0;
-
///////////////////////////////////////////////////////////////////////////
/* first detail for a card */
///////////////////////////////////////////////////////////////////////////
@@ -87,7 +87,7 @@
$obj="{div:'$div',f_id:'".$_GET['f_id']."',gDossier:'$dossier',select:this}";
$is=$exercice->select('p_exercice',$default,'
onchange="update_history_card('.$obj.');"');
$old="Autre exercice ".$is->input();
- }
+ }
else
{
$old='<form method="get" action="popup.php">';
@@ -108,7 +108,7 @@
echo h2info(
$fiche->getName().'['.$fiche->strAttribut(ATTR_DEF_QUICKCODE).']');
echo '<p style="text-align:center;font-size:125%">'.$detail_card.'</p>';
- if ( $fiche->HtmlTable($array,0,0)==-1){
+ if ( $fiche->HtmlTable($array,0,$from_div)==-1){
echo h2("Aucune opération pour l'exercice courant",'class="error"');
}
Modified: phpcompta/trunk/html/ajax_ledger.php
===================================================================
--- phpcompta/trunk/html/ajax_ledger.php 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/html/ajax_ledger.php 2012-03-23 20:12:57 UTC (rev
4796)
@@ -48,8 +48,8 @@
exit();
}
global $g_parameter;
-
-
+
+
$action=$_REQUEST['act'];
$jr_id=$_REQUEST['jr_id'];
$div=$_REQUEST['div']; /* the div source and target for javascript */
@@ -188,15 +188,22 @@
echo "<html><head>";
$repo=new Database();
$theme=$repo->get_value("select the_filestyle from theme where
the_name=$1",array($_SESSION['g_theme']));
- echo " <LINK REL=\"stylesheet\" type=\"text/css\" href=\"$theme\"
media=\"screen\">";
- echo "</head>";
- echo '<div class="op_detail_frame">';
+ echo "<LINK REL=\"stylesheet\" type=\"text/css\" href=\"$theme\"
media=\"screen\">";
+ if ( ! isset($_REQUEST['ajax']) ) {
+ echo "<body class=\"op_detail_frame\">";
+ echo '<div class="op_detail_frame">';
+ }else {
+ echo "<body>";
+ echo "<div>";
+ }
+ echo "<h2>Document</h2>";
if ( $access=='W')
{
echo '<FORM METHOD="POST" ENCTYPE="multipart/form-data"
id="form_file">';
+
$sp=new ISpan('file'.$div);
-
$sp->style="display:none;width:155;height:15;background-color:red;color:white;font-size:10";
+
$sp->style="display:none;background-color:red;color:white;font-size:12px";
$sp->value="Chargement";
echo $sp->input();
echo HtmlInput::hidden('act','loadfile');
@@ -209,18 +216,28 @@
}
else
{
- echo "<html><head>";
- $repo=new Database();
- $theme=$repo->get_value("select the_filestyle from theme where
the_name=$1",array($_SESSION['g_theme']));
- echo " <LINK REL=\"stylesheet\" type=\"text/css\"
href=\"$theme\" media=\"screen\">";
- echo "</head>";
- echo '<div class="op_detail_frame">';
+ echo "<html><head>";
+ if (!isset($_REQUEST['ajax']))
+ {
+ echo "<body class=\"op_detail_frame\">";
+ echo '<div class="op_detail_frame">';
+ }
+ else
+ {
+ echo "<body>";
+ echo "<div>";
+ }
+ $repo = new Database();
+ $theme = $repo->get_value("select the_filestyle
from theme where the_name=$1", array($_SESSION['g_theme']));
+ echo " <LINK REL=\"stylesheet\"
type=\"text/css\" href=\"$theme\" media=\"screen\">";
+ echo "</head>";
+ echo '<div class="op_detail_frame">';
- echo _('Aucun fichier');
- }
- echo '</div>';
- echo '</body></html>';
- exit();
+ echo _('Aucun fichier');
+ }
+ echo '</div>';
+ echo '</body></html>';
+ exit();
}
else
{
@@ -228,12 +245,20 @@
$repo=new Database();
$theme=$repo->get_value("select the_filestyle from theme where
the_name=$1",array($_SESSION['g_theme']));
echo " <LINK REL=\"stylesheet\" type=\"text/css\" href=\"$theme\"
media=\"screen\">";
- echo "</head><body>";
+ echo "</head>";
+ if ( ! isset($_REQUEST['ajax']) ) {
+ echo "<body class=\"op_detail_frame\">";
+ echo '<div class="op_detail_frame">';
+ }else {
+ echo "<body>";
+ echo "<div>";
+
+ }
+ echo "<h2>Document</h2>";
echo '<div class="op_detail_frame">';
-
$x='';
if ($access=='W')
- $x=sprintf('<a class="mtitle" style="margin-right:12"
href="ajax_ledger.php?gDossier=%d&div=%s&jr_id=%s&act=rmf" onclick="return
confirm(\'Effacer le document ?\')">enlever</a>',
+ $x=sprintf('<a class="notice"
style="margin-left:12;margin-right:12"
href="ajax_ledger.php?gDossier=%d&div=%s&jr_id=%s&act=rmf" onclick="return
confirm(\'Effacer le document ?\')">enlever</a>',
$gDossier,$div,$jr_id);
echo $x;
$filename= $obj->det->jr_pj_name;
@@ -268,15 +293,13 @@
$theme=$repo->get_value("select the_filestyle from theme where
the_name=$1",array($_SESSION['g_theme']));
echo " <LINK REL=\"stylesheet\" type=\"text/css\" href=\"$theme\"
media=\"screen\">";
echo "</head>";
+ if ( ! isset($_REQUEST['ajax']) ) echo "<body
class=\"op_detail_frame\">"; else echo "<body>";
+ echo "<h2>Document</h2>";
echo '<div class="op_detail_frame">';
- $x=sprintf('<a class="mtitle" style="margin-right:12px"
href="ajax_ledger.php?gDossier=%d&div=%s&jr_id=%s&act=rmf" onclick="return
confirm(\'Effacer le document ?\')">enlever</a>',
+ $x=sprintf('<a class="mtitle" class="notice"
style="margin-left:12;margin-right:12px"
href="ajax_ledger.php?gDossier=%d&div=%s&jr_id=%s&act=rmf" onclick="return
confirm(\'Effacer le document ?\')">enlever</a>',
$gDossier,$div,$jr_id);
echo $x;
$filename= $obj->det->jr_pj_name;
- if ( strlen($obj->det->jr_pj_name) > 20 )
- {
- $filename=substr($obj->det->jr_pj_name,1,20);
- }
$h=sprintf('<a class="mtitle"
href="show_pj.php?gDossier=%d&jrn=%d&jr_grpt_id=%d">%s</a>',
$gDossier,$ledger,$obj->det->jr_grpt_id,h($filename));
echo $h;
@@ -294,9 +317,9 @@
$repo=new Database();
$theme=$repo->get_value("select the_filestyle from theme where
the_name=$1",array($_SESSION['g_theme']));
echo " <LINK REL=\"stylesheet\" type=\"text/css\" href=\"$theme\"
media=\"screen\">";
- echo "</head>";
+ echo "</head><body class=\"op_detail_frame\">";
+ echo "<h2>Document</h2>";
echo '<div class="op_detail_frame">';
-
echo '<FORM METHOD="POST" ENCTYPE="multipart/form-data"
id="form_file">';
$sp=new ISpan('file'.$div);
$sp->style="display:none;width:155;height:15;background-color:red;color:white;font-size:10";
@@ -368,7 +391,7 @@
$cn->exec_sql("select comptaproc.jrn_add_note($1,$2)",
array($jr_id,$_POST['jrn_note']));
$rapt=$_POST['rapt'];
-
+
if ( $g_parameter->MY_UPDLAB=='Y' && isset ($_POST['j_id']))
{
$a_rowid=$_POST["j_id"];
Modified: phpcompta/trunk/html/js/acc_ledger.js
===================================================================
--- phpcompta/trunk/html/js/acc_ledger.js 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/html/js/acc_ledger.js 2012-03-23 20:12:57 UTC (rev
4796)
@@ -248,6 +248,7 @@
var tt=rowToCopy.cells[e].innerHTML;
var new_tt=tt.replace(/e_other0/g,"e_other"+nb.value);
new_tt=new_tt.replace(/e_other0_comment/g,"e_other"+nb.value+'_comment');
+ new_tt=new_tt.replace(/e_other_name0/g,"e_other_name"+nb.value);
new_tt=new_tt.replace(/e_other0_amount/g,"e_other"+nb.value+'_amount');
new_tt=new_tt.replace(/e_concerned0/g,"e_concerned"+nb.value);
new_tt=new_tt.replace(/e_other0_label/g,"e_other"+nb.value+'_label');
@@ -255,6 +256,7 @@
new_tt.evalScripts();
}
g("e_other"+nb.value).value="";
+ g("e_other_name"+nb.value).value="";
g("e_other"+nb.value+'_amount').value="0";
g("e_other"+nb.value+'_comment').value="";
g("e_concerned"+nb.value).value="";
@@ -881,7 +883,7 @@
onSuccess:infodiv
}
);
- window.close();
+ // window.close();
}
else
{
Modified: phpcompta/trunk/html/style-color.css
===================================================================
--- phpcompta/trunk/html/style-color.css 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/html/style-color.css 2012-03-23 20:12:57 UTC (rev
4796)
@@ -886,7 +886,7 @@
border-right:1px solid #b4bbc2;
padding: 5px;
}
-div.op_detail_frame {
+body.op_detail_frame ,div.op_detail_frame {
background-color:#e4e7ed;
height:100%; width:100%;
Modified: phpcompta/trunk/html/style-epad.css
===================================================================
--- phpcompta/trunk/html/style-epad.css 2012-03-23 20:05:04 UTC (rev 4795)
+++ phpcompta/trunk/html/style-epad.css 2012-03-23 20:12:57 UTC (rev 4796)
@@ -881,7 +881,7 @@
border-right:1px solid #b4bbc2;
padding: 5px;
}
-div.op_detail_frame {
+body.op_detail_frame ,div.op_detail_frame {
background-color:#e4e7ed;
height:100%; width:100%;
Modified: phpcompta/trunk/html/style-light.css
===================================================================
--- phpcompta/trunk/html/style-light.css 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/html/style-light.css 2012-03-23 20:12:57 UTC (rev
4796)
@@ -882,7 +882,7 @@
border-right:1px solid #b4bbc2;
padding: 5px;
}
-div.op_detail_frame {
+body.op_detail_frame,div.op_detail_frame {
background-color:#e4e7ed;
height:100%; width:100%;
Modified: phpcompta/trunk/html/style.css
===================================================================
--- phpcompta/trunk/html/style.css 2012-03-23 20:05:04 UTC (rev 4795)
+++ phpcompta/trunk/html/style.css 2012-03-23 20:12:57 UTC (rev 4796)
@@ -877,7 +877,7 @@
border-right:1px solid #b4bbc2;
padding: 5px;
}
-div.op_detail_frame {
+body.op_detail_frame,div.op_detail_frame {
background-color:#e4e7ed;
height:100%; width:100%;
Modified: phpcompta/trunk/include/ac_common.php
===================================================================
--- phpcompta/trunk/include/ac_common.php 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/include/ac_common.php 2012-03-23 20:12:57 UTC (rev
4796)
@@ -278,6 +278,17 @@
{
$style = "style.css";
} // end if
+ $title="PhpCompta";
+
+ if ( isset ($_REQUEST['ac'])) {
+ if (strpos($_REQUEST['ac'],'/') <> 0)
+ {
+ $m= explode('/',$_REQUEST['ac']);
+ $title=$m[count($m)-1]." ".$title;
+ }
+ else
+ $title=$_REQUEST['ac']." ".$title;
+ }
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 FINAL//EN">';
echo "<HTML>";
@@ -285,7 +296,7 @@
$p_script2 = '<script src="' . $p_script2 . '"
type="text/javascript"></script>';
echo "<HEAD>
- <TITLE>PhpCompta</TITLE>
+ <TITLE>$title</TITLE>
<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF8\">
<LINK REL=\"stylesheet\" type=\"text/css\" href=\"$style\"
media=\"screen\">
<link rel=\"stylesheet\" type=\"text/css\" href=\"style-print.css\"
media=\"print\">" .
@@ -698,15 +709,37 @@
/**
* @brief format the date, when taken from the database the format
* is MM-DD-YYYY
- * @param $p_date format YYYY-MM-DD
+ * @param $p_date format
+ * @param
* @return date in the format DD.MM.YYYY
*/
-function format_date($p_date)
+function format_date($p_date, $p_from_format =
'YYYY-MM-DD',$p_to_format='DD.MM.YYYY')
{
- $date = explode('-', $p_date);
- if (count($date) != 3)
- return $p_date;
- $str_date = $date[2] . '.' . $date[1] . '.' . $date[0];
+ if ($p_from_format == 'YYYY-MM-DD')
+ {
+ $date = explode('-', $p_date);
+ if (count($date) != 3)
+ return $p_date;
+ }
+ if ($p_from_format == 'DD.MM.YYYY')
+ {
+ $temp_date = explode('.', $p_date);
+ if (count($temp_date) != 3)
+ return $p_date;
+ $date[0] = $temp_date[2]; // 0 is year
+ $date[1] = $temp_date[1]; // 1 for month
+ $date[2] = $temp_date[0]; // 2 for day
+ }
+
+ switch ($p_to_format)
+ {
+ case 'DD.MM.YYYY':
+ $str_date = $date[2] . '.' . $date[1] . '.' . $date[0];
+ break;
+ case 'YYYY-MM-DD':
+ $str_date = $date[0] . '-' . $date[1] . '-' . $date[2];
+ break;
+ }
return $str_date;
}
Modified: phpcompta/trunk/include/action.common.inc.php
===================================================================
--- phpcompta/trunk/include/action.common.inc.php 2012-03-23 20:05:04 UTC
(rev 4795)
+++ phpcompta/trunk/include/action.common.inc.php 2012-03-23 20:12:57 UTC
(rev 4796)
@@ -56,7 +56,7 @@
{
$act->Update();
}
- $act->generate_document($_POST['doc_mod']);
+ $act->generate_document($_POST['doc_mod'],$_POST);
$sub_action='detail';
}
/* for delete */
@@ -275,7 +275,7 @@
/* type of documents */
$type_doc=new ISelect ('tdoc');
- $aTDoc=$cn->make_array('select dt_id,dt_value from document_type');
+ $aTDoc=$cn->make_array('select dt_id,dt_value from document_type order by
dt_value');
$aTDoc[]=array('value'=>'-1','label'=>_('Tous les types'));
$type_doc->value=$aTDoc;
$type_doc->selected=(isset ($_GET['tdoc']))?$_GET['tdoc']:-1;
Modified: phpcompta/trunk/include/class_acc_account_ledger.php
===================================================================
--- phpcompta/trunk/include/class_acc_account_ledger.php 2012-03-23
20:05:04 UTC (rev 4795)
+++ phpcompta/trunk/include/class_acc_account_ledger.php 2012-03-23
20:12:57 UTC (rev 4796)
@@ -315,7 +315,7 @@
* \param $let lettering of operation 0
* \return -1 if nothing is found otherwise 0
*/
- function HtmlTable($p_array=null,$let=0 )
+ function HtmlTable($p_array=null,$let=0 , $from_div=0)
{
if ( $p_array==null)$p_array=$_REQUEST;
$this->get_name();
@@ -329,13 +329,16 @@
$rep="";
echo '<h2 class="info">'.$this->id." ".$this->name.'</h2>';
- echo "<TABLE class=\"resultfooter\"
style=\"border-collapse:separate;width:100%;border-spacing:5px\">";
+ if ( $from_div == 0)
+ echo "<TABLE class=\"resultfooter\"
style=\"border-collapse:separate;width:100%;border-spacing:5px\">";
+ else
+ echo "<TABLE class=\"resultfooter\"
style=\"border-collapse:separate;width:100%;border-spacing:2px\">";
echo '<tbody>';
echo "<TR>".
- "<TH> Date</TH>".
- "<TH> n° de pièce </TH>".
- "<TH> Code interne </TH>".
- "<TH> Description </TH>".
+ "<TH style=\"text-align:left\"> Date</TH>".
+ "<TH style=\"text-align:left\"> n° de pièce </TH>".
+ "<TH style=\"text-align:left\"> Code interne </TH>".
+ "<TH style=\"text-align:left\"> Description </TH>".
"<TH style=\"text-align:right\"> Débit </TH>".
"<TH style=\"text-align:right\"> Crédit </TH>".
th('Prog.','style="text-align:right"').
@@ -345,6 +348,7 @@
$progress=0;$sum_deb=0;$sum_cred=0;
bcscale(2);
$old_exercice="";
+ $idx=0;
foreach ( $this->row as $op )
{
$vw_operation=sprintf('<A class="detail"
style="text-decoration:underline"
HREF="javascript:modifyOperation(\'%s\',\'%s\')" >%s</A>',
@@ -381,9 +385,11 @@
$progress=bcadd($progress,$tmp_diff);
$sum_cred=bcadd($sum_cred,$op['cred_montant']);
$sum_deb=bcadd($sum_deb,$op['deb_montant']);
+ if ($idx%2 == 0) $class='class="odd"'; else $class='
class="even"';
+ $idx++;
- echo "<TR>".
- "<TD>".format_date($op['j_date'])."</TD>".
+ echo "<TR $class>".
+ "<TD>".smaller_date(format_date($op['j_date']))."</TD>".
td(h($op['jr_pj_number'])).
"<TD>".$vw_operation."</TD>".
"<TD>".h($op['description'])."</TD>".
@@ -606,6 +612,16 @@
$sql=substr($sql,0,strlen($sql)-2);
return $sql;
}
+ /**
+ * Find the card which is using the current account
+ * @return an array of f_id
+ */
+ function find_card()
+ {
+ $sql="select f_id from fiche_detail where ad_id=$1 and
ad_value=$2";
+
$account=$this->db->get_array($sql,array(ATTR_DEF_ACCOUNT,$this->id));
+ return $account;
+ }
static function test_me()
{
$cn=new Database(dossier::id());
Modified: phpcompta/trunk/include/class_acc_ledger.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger.php 2012-03-23 20:05:04 UTC
(rev 4795)
+++ phpcompta/trunk/include/class_acc_ledger.php 2012-03-23 20:12:57 UTC
(rev 4796)
@@ -136,6 +136,22 @@
$this->db->exec_sql('delete from jrn where jr_id=$1',
array($this->jr_id));
}
+ /**
+ *Display warning contained in an array
+ * @return string with error message
+ */
+ function display_warning($pa_msg,$p_warning)
+ {
+ $str='<p class="notice"> '.$p_warning;
+ $str.="<ol class=\"notice\">";
+ for ($i=0;$i<count($pa_msg);$i++)
+ {
+ $str.="<li>".$pa_msg[$i]."</li>";
+ }
+ $str.='</ol>';
+ $str.='</p>';
+ return $str;
+ }
/**
* reverse the operation by creating the opposite one,
* the result is to avoid it
@@ -1330,7 +1346,8 @@
function confirm($p_array,$p_readonly=false)
{
global $g_parameter;
- if (! $p_readonly ) $this->verify($p_array);
+ $msg=array();
+ if (! $p_readonly ) $msg=$this->verify($p_array);
$this->id=$p_array['p_jrn'];
if ( empty($p_array)) return 'Aucun résultat';
$anc=null;
@@ -1348,6 +1365,10 @@
bcscale(2);
$ret="";
+ if ( ! empty ($msg))
+ {
+ $ret.=$this->display_warning($msg,"Attention : il vaut
mieux utiliser les fiches que les postes comptables pour");
+ }
$ret.="<table >";
$ret.="<tr><td>"._('Date')." : </td><td>$e_date</td></tr>";
/* display periode */
@@ -1655,7 +1676,7 @@
$poste->value=(isset(${'poste'.$i}))?${"poste".$i}:''
;
$poste->dbl_click_history();
-
+
$poste->readonly=$p_readonly;
if ( $poste->value != '' )
@@ -1740,6 +1761,7 @@
$user=new User($this->db);
$tot_cred=0;
$tot_deb=0;
+ $msg=array();
/* check if we can write into this ledger */
$user=new User($this->db);
@@ -1831,6 +1853,19 @@
throw new Exception(_('Poste invalide
['.${'poste'.$i}.']'),3);
if ( $p->do_exist() == 0 )
throw new Exception(_('Poste Inexistant
['.${'poste'.$i}.']'),4);
+ $card_id=$p->find_card() ;
+ if (! empty($card_id) )
+ {
+ $str_msg=" Le poste ".$p->id."
appartient à ".count($card_id)." fiche(s) dont :";
+
$max=(count($card_id)>MAX_COMPTE_CARD)?MAX_COMPTE_CARD:count($card_id);
+ for ($x=0;$x < $max;$x++)
+ {
+ $card=new
Fiche($this->db,$card_id[$x]['f_id']);
+
$str_msg.=HtmlInput::card_detail($card->strAttribut(ATTR_DEF_QUICKCODE),$card->strAttribut(ATTR_DEF_NAME),'style="color:red;display:inline;text-decoration:underline"');
+ $str_msg.=" ";
+ }
+ $msg[]=$str_msg;
+ }
}
@@ -1842,6 +1877,7 @@
throw new Exception(_("Balance incorrecte ")." debit = $tot_deb
credit=$tot_cred ",1);
}
+ return $msg;
}
/*!
* \brief compute the internal code of the saved operation and set the
$this->jr_internal to
@@ -1879,8 +1915,11 @@
extract ($p_array);
try
{
- $this->verify($p_array);
-
+ $msg=$this->verify($p_array);
+ if ( ! empty ($msg))
+ {
+ echo $this->display_warning($msg,"Attention :
il vaut mieux utiliser les fiches que les postes comptables pour");
+ }
$this->db->start() ;
$seq=$this->db->get_next_seq('s_grpt');
@@ -2213,7 +2252,7 @@
$doc->f_id=$e_client;
$doc->md_id=$gen_doc;
$doc->ag_id=0;
- $doc->Generate();
+ $doc->Generate($p_array);
// Move the document to the jrn
$doc->MoveDocumentPj($internal);
// Update the comment with invoice number, if the comment is empty
Modified: phpcompta/trunk/include/class_acc_ledger_fin.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger_fin.php 2012-03-23 20:05:04 UTC
(rev 4795)
+++ phpcompta/trunk/include/class_acc_ledger_fin.php 2012-03-23 20:12:57 UTC
(rev 4796)
@@ -327,7 +327,7 @@
$W1->set_attribute('ipopup','ipopcard');
// name of the field to update with the name of the card
- $W1->set_attribute('label','e_other'.$i.'_comment');
+ $W1->set_attribute('label','e_other_name'.$i);
// name of the field to update with the name of the card
$W1->set_attribute('typecard','filter');
// Add the callback function to filter the card on the jrn
@@ -339,6 +339,21 @@
$array[$i]['qcode']=$W1->input();
$array[$i]['search']=$W1->search();
+ // Card name
+ //
+ $card_name="";
+ if ( $tiers !="" )
+ {
+ $fiche=new Fiche($this->db);
+ $fiche->get_by_qcode($tiers);
+ $card_name=$this->db->get_value("Select ad_value from
fiche_detail where ad_id=$1 and f_id=$2",
+
array(ATTR_DEF_NAME,$fiche->id));
+ }
+
+ $wcard_name=new IText("e_other_name".$i,$card_name);
+ $wcard_name->readOnly=true;
+ $array[$i]['cname']=$wcard_name->input();
+
// Comment
$wComment=new IText("e_other$i"."_comment",$tiers_comment);
@@ -463,8 +478,8 @@
//-------------------------------------------------
$r.='<TABLE style="width:100%" id="fin_item">';
$r.="<TR>";
- $r.="<th colspan=\"2\">Nom</TH>";
- $r.="<th>Commentaire</TH>";
+ $r.="<th style=\"width:auto;text-align:left\" colspan=\"2\">Nom</TH>";
+ $r.="<th style=\"text-align:left\" >Commentaire</TH>";
$r.="<th style=\"text-align:right\">Montant</TH>";
$r.='<th colspan="2"> Op. Concernée(s)</th>';
Modified: phpcompta/trunk/include/class_acc_ledger_purchase.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger_purchase.php 2012-03-23
20:05:04 UTC (rev 4795)
+++ phpcompta/trunk/include/class_acc_ledger_purchase.php 2012-03-23
20:12:57 UTC (rev 4796)
@@ -724,7 +724,7 @@
{
$ref_doc= $this->create_document($internal,$p_array);
$this->doc= _('Document généré')." : "."<br>";
- $this->doc.='<A style="line"
HREF="show_pj.php?'.dossier::get().'&jr_grpt_id='.$seq.'&jrn='.$this->id.'">'.$ref_doc.'</A>';
+ $this->doc.='<A class="line"
HREF="show_pj.php?'.dossier::get().'&jr_grpt_id='.$seq.'&jrn='.$this->id.'">'.$ref_doc.'</A>';
}
//----------------------------------------
Modified: phpcompta/trunk/include/class_anc_grandlivre.php
===================================================================
--- phpcompta/trunk/include/class_anc_grandlivre.php 2012-03-23 20:05:04 UTC
(rev 4795)
+++ phpcompta/trunk/include/class_anc_grandlivre.php 2012-03-23 20:12:57 UTC
(rev 4796)
@@ -79,7 +79,7 @@
left join jrnx using (j_id)
left join jrn on (j_grpt=jr_grpt_id)
where $pa_id_cond oa_amount <> 0.0 $cond_poste $filter_date
- order by po_name,to_date(oa_date,'DD.MM.YYYY') ,qcode,j_poste");
+ order by po_name,oa_date::date,qcode,j_poste");
return $array;
}
@@ -108,7 +108,7 @@
left join jrnx using (j_id)
left join jrn on (j_grpt=jr_grpt_id)
where $pa_id_cond oa_amount <> 0.0 $cond_poste $filter_date
- order by po_name,to_date(oa_date,'DD.MM.YYYY') ,qcode,j_poste");
+ order by po_name,oa_date::date,qcode,j_poste");
return $array;
Modified: phpcompta/trunk/include/class_anc_operation.php
===================================================================
--- phpcompta/trunk/include/class_anc_operation.php 2012-03-23 20:05:04 UTC
(rev 4795)
+++ phpcompta/trunk/include/class_anc_operation.php 2012-03-23 20:12:57 UTC
(rev 4796)
@@ -547,7 +547,7 @@
* -oa_description
*
*/
- function save_form_plan($p_array,$p_item,$j_id)
+ function save_form_plan($p_array,$p_item,$p_j_id)
{
extract($p_array);
if (! isset ($hplan) ) return;
@@ -576,7 +576,7 @@
$op=new Anc_Operation($this->db);
$op->po_id=$hplan[$p_item][$e];
$op->oa_group=$this->oa_group;
- $op->j_id=$j_id;
+ $op->j_id=$p_j_id;
$op->oa_amount=abs($val[$p_item][$row]);
$op->oa_debit=$this->oa_debit;
$op->oa_date=$this->oa_date;
Modified: phpcompta/trunk/include/class_calendar.php
===================================================================
--- phpcompta/trunk/include/class_calendar.php 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/include/class_calendar.php 2012-03-23 20:12:57 UTC (rev
4796)
@@ -122,10 +122,10 @@
$cn=new Database(dossier::id());
$array=$cn->get_array("select to_char(p_start,'MM') as month,
to_char(p_start,'YYYY') as year ".
" from parm_periode where
p_id=$1",array($this->default_periode));
- $this->month=$array[0]['month'];
- $this->year=$array[0]['year'];
+ $this->month=(int)$array[0]['month'];
+ $this->year=(int)$array[0]['year'];
$this->day=self::$nb_day[$this->month-1];
- if ( $this->year % 4 == 0 && $this->month=2)
+ if ( $this->year % 4 == 0 && $this->month==2)
$this->day=29;
}
/**
Modified: phpcompta/trunk/include/class_document.php
===================================================================
--- phpcompta/trunk/include/class_document.php 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/include/class_document.php 2012-03-23 20:12:57 UTC (rev
4796)
@@ -66,12 +66,12 @@
/*!
* \brief Generate the document, Call $this-\>Replace to replace
* tag by value
+ *\p_array contains the data normally it is the $_POST
*
- *
* \return an array : the url where the generated doc can be found, the
name
* of the file and his mimetype
*/
- function Generate()
+ function Generate($p_array)
{
// create a temp directory in /tmp to unpack file and to parse it
$dirname=tempnam($_ENV['TMP'],'doc_');
@@ -123,7 +123,7 @@
$this->d_number=$this->db->get_next_seq("seq_doc_type_".$row['md_type']);
// parse the document - return the doc number ?
- $this->ParseDocument($dirname,$file_to_parse,$type);
+ $this->ParseDocument($dirname,$file_to_parse,$type,$p_array);
$this->db->commit();
// if the doc is a OOo, we need to re-zip it
@@ -161,8 +161,9 @@
* \param $p_dir directory name
* \param $p_file filename
* \param $p_type For the OOo document the tag are < and > instead of
< and >
+ * \param $p_array variable from $_POST
*/
- function ParseDocument($p_dir,$p_file,$p_type)
+ function ParseDocument($p_dir,$p_file,$p_type,$p_array)
{
/*!\note Replace in the doc the tags by their values.
@@ -239,7 +240,7 @@
// if the pattern if found we replace it
- $value=$this->Replace($pattern);
+ $value=$this->Replace($pattern,$p_array);
if ( strpos($value,'ERROR') != false )
$value="";
// replace into the $buffer
// take the position in the buffer
@@ -467,7 +468,10 @@
* - [VEN_TVAC]
* - [VEN_TVA]
* - [TOTAL_VEN_HTVA]
+ * - [DATE_CALC]
* - [DATE]
+ * - [DATE_LIMIT]
+ * - [DATE_LIMIT_CALC]
* - [NUMBER]
* - [MY_NAME]
* - [MY_CP]
@@ -494,9 +498,10 @@
* - [BENEF_VAT]
*
* \param $p_tag TAG
+ * \param $p_array data from $_POST
* \return String which must replace the tag
*/
- function Replace($p_tag)
+ function Replace($p_tag,$p_array)
{
$p_tag=strtoupper($p_tag);
$p_tag=str_replace('=','',$p_tag);
@@ -504,15 +509,21 @@
static $counter=0;
switch ($p_tag)
{
- case 'DATE':
+ case 'DATE':
+ $r=(isset
($p_array['ag_timestamp']))?$p_array['ag_timestamp']:$p_array['e_date'];
+ break;
+ case 'DATE_CALC':
$r=' Date inconnue ';
- // Date are in $_REQUEST['ag_date']
- // or $_POST['e_date']
- if ( isset ($_REQUEST['ag_timestamp']))
- $r=$_REQUEST['ag_timestamp'];
- if ( isset ($_REQUEST['e_date']))
- $r=$_REQUEST['e_date'];
-
+ // Date are in $p_array['ag_date']
+ // or $p_array['e_date']
+ if ( isset ($p_array['ag_timestamp'])) {
+
$date=format_date($p_array['ag_timestamp'],'DD.MM.YYYY','YYYY-MM-DD');
+ $r=$date;
+ }
+ if ( isset ($p_array['e_date'])) {
+
$date=format_date($p_array['e_date'],'DD.MM.YYYY','YYYY-MM-DD');
+ $r=$date;
+ }
break;
//
// the company priv
@@ -555,12 +566,12 @@
break;
// customer
- /*\note The CUST_* are retrieved thx the $_REQUEST['tiers']
+ /*\note The CUST_* are retrieved thx the $p_array['tiers']
* which contains the quick_code
*/
case 'SOLDE':
$tiers=new Fiche($this->db);
-
$qcode=isset($_REQUEST['qcode_dest'])?$_REQUEST['qcode_dest']:$_REQUEST['e_client'];
+
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode,false);
$p=$tiers->strAttribut(ATTR_DEF_ACCOUNT);
$poste=new Acc_Account_Ledger($this->db,$p);
@@ -568,13 +579,13 @@
break;
case 'CUST_NAME':
$tiers=new Fiche($this->db);
-
$qcode=isset($_REQUEST['qcode_dest'])?$_REQUEST['qcode_dest']:$_REQUEST['e_client'];
+
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode,false);
$r=$tiers->strAttribut(ATTR_DEF_NAME);
break;
case 'CUST_ADDR_1':
$tiers=new Fiche($this->db);
-
$qcode=isset($_REQUEST['qcode_dest'])?$_REQUEST['qcode_dest']:$_REQUEST['e_client'];
+
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode,false);
$r=$tiers->strAttribut(ATTR_DEF_ADRESS);
@@ -582,7 +593,7 @@
case 'CUST_CP':
$tiers=new Fiche($this->db);
-
$qcode=isset($_REQUEST['qcode_dest'])?$_REQUEST['qcode_dest']:$_REQUEST['e_client'];
+
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode,false);
$r=$tiers->strAttribut(ATTR_DEF_CP);
@@ -590,7 +601,7 @@
case 'CUST_CITY':
$tiers=new Fiche($this->db);
-
$qcode=isset($_REQUEST['qcode_dest'])?$_REQUEST['qcode_dest']:$_REQUEST['e_client'];
+
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode,false);
$r=$tiers->strAttribut(ATTR_DEF_CITY);
@@ -599,35 +610,35 @@
case 'CUST_CO':
$tiers=new Fiche($this->db);
-
$qcode=isset($_REQUEST['qcode_dest'])?$_REQUEST['qcode_dest']:$_REQUEST['e_client'];
+
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode,false);
$r=$tiers->strAttribut(ATTR_DEF_PAYS);
break;
- // Marchandise in $_POST['e_march*']
+ // Marchandise in $p_array['e_march*']
// \see user_form_achat.php or user_form_ven.php
case 'CUST_VAT':
$tiers=new Fiche($this->db);
-
$qcode=isset($_REQUEST['qcode_dest'])?$_REQUEST['qcode_dest']:$_REQUEST['e_client'];
+
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode,false);
$r=$tiers->strAttribut(ATTR_DEF_NUMTVA);
break;
case 'CUST_NUM':
$tiers=new Fiche($this->db);
-
$qcode=isset($_REQUEST['qcode_dest'])?$_REQUEST['qcode_dest']:$_REQUEST['e_client'];
+
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode,false);
$r=$tiers->strAttribut(ATTR_DEF_NUMBER_CUSTOMER);
break;
case 'CUST_BANQUE_NO':
$tiers=new Fiche($this->db);
-
$qcode=isset($_REQUEST['qcode_dest'])?$_REQUEST['qcode_dest']:$_REQUEST['e_client'];
+
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode,false);
$r=$tiers->strAttribut(ATTR_DEF_BQ_NO);
break;
case 'CUST_BANQUE_NAME':
$tiers=new Fiche($this->db);
-
$qcode=isset($_REQUEST['qcode_dest'])?$_REQUEST['qcode_dest']:$_REQUEST['e_client'];
+
$qcode=isset($p_array['qcode_dest'])?$p_array['qcode_dest']:$p_array['e_client'];
$tiers->get_by_qcode($qcode,false);
$r=$tiers->strAttribut(ATTR_DEF_BQ_NAME);
break;
@@ -635,7 +646,7 @@
/* BENEFIT (fee notes */
case 'BENEF_NAME':
$tiers=new Fiche($this->db);
- $qcode=isset($_REQUEST['qcode_benef'])?$_REQUEST['qcode_benef']:'';
+ $qcode=isset($p_array['qcode_benef'])?$p_array['qcode_benef']:'';
if ( $qcode=='')
{
$r='';
@@ -646,7 +657,7 @@
break;
case 'BENEF_ADDR_1':
$tiers=new Fiche($this->db);
- $qcode=isset($_REQUEST['qcode_benef'])?$_REQUEST['qcode_benef']:'';
+ $qcode=isset($p_array['qcode_benef'])?$p_array['qcode_benef']:'';
if ( $qcode=='')
{
$r='';
@@ -659,7 +670,7 @@
case 'BENEF_CP':
$tiers=new Fiche($this->db);
- $qcode=isset($_REQUEST['qcode_benef'])?$_REQUEST['qcode_benef']:'';
+ $qcode=isset($p_array['qcode_benef'])?$p_array['qcode_benef']:'';
if ( $qcode=='')
{
$r='';
@@ -672,7 +683,7 @@
case 'BENEF_CITY':
$tiers=new Fiche($this->db);
- $qcode=isset($_REQUEST['qcode_benef'])?$_REQUEST['qcode_benef']:'';
+ $qcode=isset($p_array['qcode_benef'])?$p_array['qcode_benef']:'';
if ( $qcode=='')
{
$r='';
@@ -686,7 +697,7 @@
case 'BENEF_CO':
$tiers=new Fiche($this->db);
- $qcode=isset($_REQUEST['qcode_benef'])?$_REQUEST['qcode_benef']:'';
+ $qcode=isset($p_array['qcode_benef'])?$p_array['qcode_benef']:'';
if ( $qcode=='')
{
$r='';
@@ -696,12 +707,12 @@
$r=$tiers->strAttribut(ATTR_DEF_PAYS);
break;
- // Marchandise in $_POST['e_march*']
+ // Marchandise in $p_array['e_march*']
// \see user_form_achat.php or user_form_ven.php
case 'BENEF_VAT':
$tiers=new Fiche($this->db);
- $qcode=isset($_REQUEST['qcode_benef'])?$_REQUEST['qcode_benef']:'';
+ $qcode=isset($p_array['qcode_benef'])?$p_array['qcode_benef']:'';
if ( $qcode=='')
{
$r='';
@@ -712,7 +723,7 @@
break;
case 'BENEF_NUM':
$tiers=new Fiche($this->db);
- $qcode=isset($_REQUEST['qcode_benef'])?$_REQUEST['qcode_benef']:'';
+ $qcode=isset($p_array['qcode_benef'])?$p_array['qcode_benef']:'';
if ( $qcode=='')
{
$r='';
@@ -723,7 +734,7 @@
break;
case 'BENEF_BANQUE_NO':
$tiers=new Fiche($this->db);
- $qcode=isset($_REQUEST['qcode_benef'])?$_REQUEST['qcode_benef']:'';
+ $qcode=isset($p_array['qcode_benef'])?$p_array['qcode_benef']:'';
if ( $qcode=='')
{
$r='';
@@ -734,7 +745,7 @@
break;
case 'BENEF_BANQUE_NAME':
$tiers=new Fiche($this->db);
- $qcode=isset($_REQUEST['qcode_benef'])?$_REQUEST['qcode_benef']:'';
+ $qcode=isset($p_array['qcode_benef'])?$p_array['qcode_benef']:'';
if ( $qcode=='')
{
$r='';
@@ -744,7 +755,7 @@
$r=$tiers->strAttribut(ATTR_DEF_BQ_NAME);
break;
- // Marchandise in $_POST['e_march*']
+ // Marchandise in $p_array['e_march*']
// \see user_form_achat.php or user_form_ven.php
case 'NUMBER':
$r=$this->d_number;
@@ -774,20 +785,25 @@
* - [TOTAL_VEN_HTVA]
* - [DATE_LIMIT]
*/
- case 'DATE_LIMIT':
- extract ($_POST);
+ case 'DATE_LIMIT_CALC':
+ extract ($p_array);
$id='e_ech' ;
if ( !isset (${$id}) ) return "";
+ $r=format_date(${$id},'DD.MM.YYYY','YYYY-MM-DD');
+ break;
+ case 'DATE_LIMIT':
+ extract ($p_array);
+ $id='e_ech' ;
+ if ( !isset (${$id}) ) return "";
$r=${$id};
break;
-
case 'MARCH_NEXT':
$counter++;
$r='';
break;
case 'VEN_ART_NAME':
- extract ($_POST);
+ extract ($p_array);
$id='e_march'.$counter;
// check if the march exists
if ( ! isset (${$id})) return "";
@@ -801,7 +817,7 @@
else $r = "";
break;
case 'VEN_ART_LABEL':
- extract ($_POST);
+ extract ($p_array);
$id='e_march'.$counter."_label";
// check if the march exists
@@ -826,15 +842,16 @@
break;
case 'VEN_ART_PRICE':
- extract ($_POST);
+ extract ($p_array);
$id='e_march'.$counter.'_price' ;
if ( !isset (${$id}) ) return "";
+ if (${$id} == 0 ) return "";
$r=${$id};
break;
case 'TVA_RATE':
case 'VEN_ART_TVA_RATE':
- extract ($_POST);
+ extract ($p_array);
$id='e_march'.$counter.'_tva_id';
if ( !isset (${$id}) ) return "";
if ( ${$id} == -1 || ${$id}=='' ) return "";
@@ -848,7 +865,7 @@
case 'TVA_CODE':
case 'VEN_ART_TVA_CODE':
- extract ($_POST);
+ extract ($p_array);
$id='e_march'.$counter.'_tva_id';
if ( !isset (${$id}) ) return "";
if ( ${$id} == -1 ) return "";
@@ -863,7 +880,7 @@
break;
case 'TVA_LABEL':
- extract ($_POST);
+ extract ($p_array);
$id='e_march'.$counter.'_tva_id';
if ( !isset (${$id}) ) return "";
$march_id='e_march'.$counter.'_price' ;
@@ -877,7 +894,7 @@
/* total VAT for one sold */
case 'TVA_AMOUNT':
- extract ($_POST);
+ extract ($p_array);
$qt='e_quant'.$counter;
$price='e_march'.$counter.'_price' ;
$tva='e_march'.$counter.'_tva_id';
@@ -893,7 +910,7 @@
break;
/* TVA automatically computed */
case 'VEN_ART_TVA':
- extract ($_POST);
+ extract ($p_array);
$qt='e_quant'.$counter;
$price='e_march'.$counter.'_price' ;
$tva='e_march'.$counter.'_tva_id';
@@ -910,7 +927,7 @@
break;
case 'VEN_ART_TVAC':
- extract ($_POST);
+ extract ($p_array);
$qt='e_quant'.$counter;
$price='e_march'.$counter.'_price' ;
$tva='e_march'.$counter.'_tva_id';
@@ -934,7 +951,7 @@
break;
case 'VEN_ART_QUANT':
- extract ($_POST);
+ extract ($p_array);
$id='e_quant'.$counter;
if ( !isset (${$id}) ) return "";
// check that something is sold
@@ -947,7 +964,7 @@
break;
case 'VEN_HTVA':
- extract ($_POST);
+ extract ($p_array);
$id='e_march'.$counter.'_price' ;
$quant='e_quant'.$counter;
if ( !isset (${$id}) ) return "";
@@ -962,30 +979,26 @@
break;
case 'VEN_TVAC':
- extract ($_POST);
+ extract ($p_array);
$id='e_march'.$counter.'_tva_amount' ;
$price='e_march'.$counter.'_price' ;
$quant='e_quant'.$counter;
- if ( ! isset(${'e_march'.$counter.'_price'})||
!isset(${'e_quant'.$counter}))
- return "";
+ if ( ! isset(${'e_march'.$counter.'_price'})||
!isset(${'e_quant'.$counter})) return "";
// check that something is sold
- if ( ${'e_march'.$counter.'_price'} == 0 || ${'e_quant'.$counter}
== 0 )
- return "";
-
-
- // if it is exist
+ if ( ${'e_march'.$counter.'_price'} == 0 || ${'e_quant'.$counter}
== 0 ) return "";
+ bcscale(2);
+ // if TVA not exist
if ( ! isset(${$id}))
- $r=round(${$price}*${$quant},2);
- else
- $r=round($
- {
- $price
- }
- *${$quant}+$id,2);
+ $r= bcmul(${$price},${$quant});
+ else{
+ $r= bcmul(${$price},${$quant});
+ $r=bcadd($r,${$id});
+ }
+ return $r;
break;
case 'TOTAL_VEN_HTVA':
- extract($_POST);
+ extract($p_array);
$sum=0.0;
for ($i=0;$i<$nb_item;$i++)
@@ -1007,8 +1020,9 @@
$r=round($sum,2);
break;
case 'TOTAL_VEN_TVAC':
- extract($_POST);
+ extract($p_array);
$sum=0.0;
+ bcscale(2);
for ($i=0;$i<$nb_item;$i++)
{
$tva='e_march'.$i.'_tva_amount';
@@ -1020,16 +1034,15 @@
}
$sell=${'e_march'.$i.'_price'};
$qt=${'e_quant'.$i};
-
-
- $sum+=$sell*$qt+$tva_amount;
- $sum=round($sum,2);
+ $tot=bcmul($sell,$qt);
+ $tot=bcadd($tot,$tva_amount);
+ $sum=bcadd($sum,$tot);
}
$r=round($sum,2);
break;
case 'TOTAL_TVA':
- extract($_POST);
+ extract($p_array);
$sum=0.0;
for ($i=0;$i<$nb_item;$i++)
{
@@ -1046,26 +1059,26 @@
break;
case 'BON_COMMANDE':
- if ( isset($_REQUEST['bon_comm']))
- return $_REQUEST['bon_comm'];
+ if ( isset($p_array['bon_comm']))
+ return $p_array['bon_comm'];
else
return "";
break;
case 'PJ':
- if ( isset($_REQUEST['e_pj']))
- return $_REQUEST['e_pj'];
+ if ( isset($p_array['e_pj']))
+ return $p_array['e_pj'];
else
return "";
case 'OTHER_INFO':
- if ( isset($_REQUEST['other_info']))
- return $_REQUEST['other_info'];
+ if ( isset($p_array['other_info']))
+ return $p_array['other_info'];
else
return "";
break;
case 'COMMENT':
- if ( isset($_REQUEST['e_comm']))
- return $_REQUEST['e_comm'];
+ if ( isset($p_array['e_comm']))
+ return $p_array['e_comm'];
break;
}
return $r;
Modified: phpcompta/trunk/include/class_document_modele.php
===================================================================
--- phpcompta/trunk/include/class_document_modele.php 2012-03-23 20:05:04 UTC
(rev 4795)
+++ phpcompta/trunk/include/class_document_modele.php 2012-03-23 20:12:57 UTC
(rev 4796)
@@ -248,7 +248,7 @@
$w=new ISelect();
$w->name="md_type";
- $w->value=$this->cn->make_array('select dt_id,dt_value from
document_type');
+ $w->value=$this->cn->make_array('select dt_id,dt_value from
document_type order by dt_value');
$r.="<td>".$w->input()."</td></tr>";
$r.='<tr>';
Modified: phpcompta/trunk/include/class_document_type.php
===================================================================
--- phpcompta/trunk/include/class_document_type.php 2012-03-23 20:05:04 UTC
(rev 4795)
+++ phpcompta/trunk/include/class_document_type.php 2012-03-23 20:12:57 UTC
(rev 4796)
@@ -55,7 +55,7 @@
*/
static function get_list($p_cn)
{
- $sql="select * from document_type";
+ $sql="select * from document_type order by dt_value";
$r=$p_cn->get_array($sql);
$array=array();
for ($i=0;$i<count($r);$i++)
Modified: phpcompta/trunk/include/class_fiche.php
===================================================================
--- phpcompta/trunk/include/class_fiche.php 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/include/class_fiche.php 2012-03-23 20:12:57 UTC (rev
4796)
@@ -431,6 +431,7 @@
$w=new IPoste("av_text".$attr->ad_id);
$w->set_attribute('ipopup','ipop_account');
$w->set_attribute('account',"av_text".$attr->ad_id);
+ $w->dbl_click_history();
// account created automatically
$sql="select account_auto($p_fiche_def)";
$ret_sql=$this->cn->exec_sql($sql);
@@ -492,6 +493,7 @@
break;
case 'numeric':
$w = new INum();
+
$w->javascript='onchange="format_number(this,4);"';
$w->size = $attr->ad_size;
break;
case 'date':
@@ -587,6 +589,7 @@
$w = new IPoste("av_text" . $r->ad_id);
$w->set_attribute('ipopup',
'ipop_account');
$w->set_attribute('account', "av_text"
. $r->ad_id);
+ $w->dbl_click_history();
// account created automatically
$w->table = 0;
$w->value = $r->av_text;
@@ -635,6 +638,7 @@
case 'numeric':
$w = new INum('av_text'
. $r->ad_id);
$w->size = $r->ad_size;
+
$w->javascript='onchange="format_number(this,4);"';
$w->value = $r->av_text;
break;
case 'date':
@@ -651,6 +655,7 @@
$w = new
IPoste("av_text" . $r->ad_id);
$w->set_attribute('ipopup', 'ipop_account');
$w->set_attribute('account', "av_text" . $r->ad_id);
+ $w->dbl_click_history();
$w->width = $r->ad_size;
$w->table = 0;
$bulle =
HtmlInput::infobulle(14);
@@ -1302,19 +1307,18 @@
$rep="";
if ( $from_div==1)
{
- echo '<h2 class="info">'." ".$name.'</h2>';
echo "<TABLE class=\"resultfooter\"
style=\"width:100%;border-collapse:separate;border-spacing:5px\">";
}
else
{
- echo "<TABLE class=\"result\"
style=\"width:100%;border-collapse:separate;border-spacing:5px\">";
+ echo "<TABLE class=\"result\"
style=\"width:100%;border-collapse:separate;border-spacing:2px\">";
}
echo '<tbody>';
echo "<TR>".
- "<TH>"._('Date')."</TH>".
- "<TH>"._('n° pièce')." </TH>".
- "<TH>"._('Code interne')." </TH>".
- "<TH>"._('Description')." </TH>".
+ "<TH style=\"text-align:left\">"._('Date')."</TH>".
+ "<TH style=\"text-align:left\">"._('n° pièce')." </TH>".
+ "<TH style=\"text-align:left\">"._('Code interne')." </TH>".
+ "<TH style=\"text-align:left\">"._('Description')." </TH>".
"<TH style=\"text-align:right\">"._('Débit')." </TH>".
"<TH style=\"text-align:right\">"._('Crédit')." </TH>".
th('Prog.','style="text-align:right"').
@@ -1323,6 +1327,7 @@
;
$old_exercice="";$sum_deb=0;$sum_cred=0;
bcscale(2);
+ $idx=0;
foreach ( $this->row as $op )
{
$vw_operation=sprintf('<A class="detail"
style="text-decoration:underline"
HREF="javascript:modifyOperation(\'%s\',\'%s\')" >%s</A>',
@@ -1359,9 +1364,11 @@
$progress=bcadd($progress,$tmp_diff);
$sum_cred=bcadd($sum_cred,$op['cred_montant']);
$sum_deb=bcadd($sum_deb,$op['deb_montant']);
+ if ($idx%2 == 0) $class='class="odd"'; else $class='
class="even"';
+ $idx++;
- echo "<TR>".
- "<TD>".format_date($op['j_date_fmt'])."</TD>".
+ echo "<TR $class>".
+ "<TD>".smaller_date(format_date($op['j_date_fmt']))."</TD>".
td(h($op['jr_pj_number'])).
"<TD>".$vw_operation."</TD>".
"<TD>".h($op['description'])."</TD>".
Modified: phpcompta/trunk/include/class_follow_up.php
===================================================================
--- phpcompta/trunk/include/class_follow_up.php 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/include/class_follow_up.php 2012-03-23 20:12:57 UTC (rev
4796)
@@ -138,7 +138,7 @@
// Doc Type
$doc_type=new ISelect();
$doc_type->name="dt_id";
- $doc_type->value=$this->db->make_array("select dt_id,dt_value from
document_type");
+ $doc_type->value=$this->db->make_array("select dt_id,dt_value from
document_type order by dt_value");
$doc_type->selected=$this->dt_id;
$doc_type->readonly=false;
$str_doc_type=$doc_type->input();
@@ -152,7 +152,7 @@
$str_doc_type=$doc_type->input().$this->db->get_value("select
dt_value from document_type where dt_id=".$this->dt_id);*/
$doc_type=new ISelect();
$doc_type->name="dt_id";
- $doc_type->value=$this->db->make_array("select dt_id,dt_value from
document_type");
+ $doc_type->value=$this->db->make_array("select dt_id,dt_value from
document_type order by dt_value");
$doc_type->selected=$this->dt_id;
$doc_type->readonly=false;
$str_doc_type=$doc_type->input();
@@ -914,8 +914,9 @@
/*!\brief generate the document and add it to the action
* \param md_id is the id of the document_modele
+ * \param $p_array contains normally the $_POST
*/
- function generate_document($md_id)
+ function generate_document($md_id,$p_array)
{
$doc=new Document($this->db);
$mod=new Document_Modele($this->db,$md_id);
@@ -923,7 +924,7 @@
$doc->f_id=$this->f_id_dest;
$doc->md_id=$md_id;
$doc->ag_id=$this->ag_id;
- $doc->Generate();
+ $doc->Generate($p_array);
}
/*!\brief put an array in the variable member, the indice
* is the member name
Modified: phpcompta/trunk/include/class_lettering.php
===================================================================
--- phpcompta/trunk/include/class_lettering.php 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/include/class_lettering.php 2012-03-23 20:12:57 UTC (rev
4796)
@@ -151,20 +151,20 @@
if ( $first == 't')
{
// save into letter_deb
- $ld_id=$this->db->get_value('insert into letter_deb(j_id,jl_id)
values($1,$2) returning ld_id',array($j_id1,$jl_id));
+ if ($let1 == 0) $ld_id=$this->db->get_value('insert into
letter_deb(j_id,jl_id) values($1,$2) returning ld_id',array($j_id1,$jl_id));
}
else
{
- $lc_id=$this->db->get_value('insert into letter_cred(j_id,jl_id)
values($1,$2) returning lc_id',array($j_id1,$jl_id));
+ if ($let1 == 0)$lc_id=$this->db->get_value('insert into
letter_cred(j_id,jl_id) values($1,$2) returning lc_id',array($j_id1,$jl_id));
}
if ( $second == 't')
{
// save into letter_deb
- $ld_id=$this->db->get_value('insert into letter_deb(j_id,jl_id)
values($1,$2) returning ld_id',array($j_id2,$jl_id));
+ if ($let2 == 0)$ld_id=$this->db->get_value('insert into
letter_deb(j_id,jl_id) values($1,$2) returning ld_id',array($j_id2,$jl_id));
}
else
{
- $lc_id=$this->db->get_value('insert into letter_cred(j_id,jl_id)
values($1,$2) returning lc_id',array($j_id2,$jl_id));
+ if ($let2 == 0)$lc_id=$this->db->get_value('insert into
letter_cred(j_id,jl_id) values($1,$2) returning lc_id',array($j_id2,$jl_id));
}
}
@@ -515,17 +515,16 @@
( select jl_id,coalesce(sum(j_montant),0) as
cred_amount from letter_cred join jrnx using (j_id) group by jl_id) as CRED
left join (select jl_id,coalesce(sum(j_montant),0) as
deb_amount from letter_deb join jrnx using (j_id) group by jl_id) as DEB using
(jl_id)) ,
letter_jl as (select jl_id,j_id from letter_cred union
all select jl_id,j_id from letter_deb)
- select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as
j_date_fmt,jr_pj_number,
+ select distinct
j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
let_diff.jl_id as letter,
diff_letter1 as letter_diff
from
- jrnx join jrn on (j_grpt = jr_grpt_id)
+ jrnx join jrn on (j_grpt =
jr_grpt_id)
join letter_jl using (j_id)
join let_diff using (jl_id)
where j_poste = $1 and j_date >= to_date($2,'DD.MM.YYYY') and
j_date <= to_date ($3,'DD.MM.YYYY')
and $this->sql_ledger
- and j_id in (select j_id from letter_deb join jnt_letter using
(jl_id) union select j_id from letter_cred join jnt_letter using (jl_id) )
and diff_letter1 <> 0
order by j_date,j_id";
$this->content=$this->db->get_array($sql,array($this->account,$this->start,$this->end));
@@ -609,9 +608,9 @@
( select jl_id,coalesce(sum(j_montant),0) as
cred_amount from letter_cred join jrnx using (j_id) group by jl_id) as CRED
left join (select jl_id,coalesce(sum(j_montant),0) as
deb_amount from letter_deb join jrnx using (j_id) group by jl_id) as DEB using
(jl_id)) ,
letter_jl as (select jl_id,j_id from letter_cred union
all select jl_id,j_id from letter_deb)
- select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as
j_date_fmt,jr_pj_number,
+ select distinct
j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
- let_diff.jl_id as letter,
+ coalesce(let_diff.jl_id,-1) as
letter,
diff_letter1 as letter_diff
from jrnx join jrn on (j_grpt =
jr_grpt_id)
left join letter_jl using (j_id)
@@ -635,7 +634,7 @@
( select jl_id,coalesce(sum(j_montant),0) as
cred_amount from letter_cred join jrnx using (j_id) group by jl_id) as CRED
left join (select jl_id,coalesce(sum(j_montant),0) as
deb_amount from letter_deb join jrnx using (j_id) group by jl_id) as DEB using
(jl_id)) ,
letter_jl as (select jl_id,j_id from letter_cred union
all select jl_id,j_id from letter_deb)
- select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as
j_date_fmt,jr_pj_number,
+ select DISTINCT
j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
coalesce(let_diff.jl_id,-1) as
letter,
diff_letter1 as letter_diff
@@ -680,7 +679,7 @@
( select jl_id,coalesce(sum(j_montant),0) as
cred_amount from letter_cred join jrnx using (j_id) group by jl_id) as CRED
left join (select jl_id,coalesce(sum(j_montant),0) as
deb_amount from letter_deb join jrnx using (j_id) group by jl_id) as DEB using
(jl_id)) ,
letter_jl as (select jl_id,j_id from letter_cred union
all select jl_id,j_id from letter_deb)
- select j_id,j_date,to_char(j_date,'DD.MM.YYYY') as
j_date_fmt,jr_pj_number,
+ select distinct
j_id,j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,jr_pj_number,
j_montant,j_debit,jr_comment,jr_internal,jr_id,jr_def_id,
let_diff.jl_id as letter,
diff_letter1 as letter_diff
Modified: phpcompta/trunk/include/class_todo_list.php
===================================================================
--- phpcompta/trunk/include/class_todo_list.php 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/include/class_todo_list.php 2012-03-23 20:12:57 UTC (rev
4796)
@@ -112,8 +112,7 @@
{
if ( isDate($this->tl_date) == false )
{
- alert('Date est invalide');
- return 1;
+ $this->tl_date=date('d.m.Y');
}
return 0;
}
@@ -129,7 +128,7 @@
{
if ( $this->verify() != 0 ) return;
if (trim($this->tl_title)=='')
- $this->tl_title=substr(trim($this->tl_desc),0,40);
+ $this->tl_title=substr(trim($this->tl_desc),0,30);
if (trim($this->tl_title)=='')
{
@@ -138,7 +137,7 @@
}
/* limit the title to 35 char */
- $this->tl_title=substr(trim($this->tl_desc),0,40);
+ $this->tl_title=substr(trim($this->tl_title),0,30);
$sql="insert into todo_list (tl_date,tl_title,tl_desc,use_login) ".
" values (to_date($1,'DD.MM.YYYY'),$2,$3,$4) returning tl_id";
Modified: phpcompta/trunk/include/compta_ach.inc.php
===================================================================
--- phpcompta/trunk/include/compta_ach.inc.php 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/include/compta_ach.inc.php 2012-03-23 20:12:57 UTC (rev
4796)
@@ -132,18 +132,19 @@
{
echo '<h3 class="notice"> ' . _('Attention numéro pièce
existante, elle a du être adaptée') . '</h3>';
}
+ /* Save the additional information into jrn_info */
+ $obj = new Acc_Ledger_Info($cn);
+ $obj->save_extra($Ledger->jr_id, $_POST);
+ printf('<a class="line" style="display:inline"
href="javascript:modifyOperation(%d,%d)">%s</a><hr>', $jr_id, dossier::id(),
$internal);
+ // Feedback
+ echo $Ledger->confirm($_POST, true);
if (isset($Ledger->doc))
{
echo '<span class="invoice">';
echo $Ledger->doc;
echo '</span>';
}
- /* Save the additional information into jrn_info */
- $obj = new Acc_Ledger_Info($cn);
- $obj->save_extra($Ledger->jr_id, $_POST);
- printf('<a class="line" style="display:inline"
href="javascript:modifyOperation(%d,%d)">%s</a><hr>', $jr_id, dossier::id(),
$internal);
- // Feedback
- echo $Ledger->confirm($_POST, true);
+
echo '</div>';
exit();
}
Modified: phpcompta/trunk/include/compta_fin_rec.inc.php
===================================================================
--- phpcompta/trunk/include/compta_fin_rec.inc.php 2012-03-23 20:05:04 UTC
(rev 4795)
+++ phpcompta/trunk/include/compta_fin_rec.inc.php 2012-03-23 20:12:57 UTC
(rev 4796)
@@ -117,7 +117,7 @@
echo 'solde Fin' . $nend_extrait->input();
echo IButton::tooggle_checkbox('rec1');
echo '</p>';
-echo HtmlInput::submit('save', 'Mettre à jour le n° de relevé banquaire');
+echo HtmlInput::submit('save', 'Mettre à jour le n° de relevé bancaire');
echo '<table class="result" style="width:80%;margin-left:10%">';
$r = th('Date');
$r.=th('Libellé');
@@ -198,7 +198,7 @@
echo '</table>';
-echo HtmlInput::submit('save', 'Mettre à jour le n° de relevé banquaire');
+echo HtmlInput::submit('save', 'Mettre à jour le n° de relevé bancaire');
echo '</form>';
echo '</div>';
exit();
Modified: phpcompta/trunk/include/compta_ven.inc.php
===================================================================
--- phpcompta/trunk/include/compta_ven.inc.php 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/include/compta_ven.inc.php 2012-03-23 20:12:57 UTC (rev
4796)
@@ -151,7 +151,7 @@
printf ('<a class="line" style="display:inline"
href="javascript:modifyOperation(%d,%d)">%s</a><hr>',
$jr_id,dossier::id(),$internal);
- echo $Ledger->confirm($_POST,true);
+ echo $Ledger->confirm($_POST,true);
/* Show link for Invoice */
if (isset ($Ledger->doc) )
{
Modified: phpcompta/trunk/include/constant.php
===================================================================
--- phpcompta/trunk/include/constant.php 2012-03-23 20:05:04 UTC (rev
4795)
+++ phpcompta/trunk/include/constant.php 2012-03-23 20:12:57 UTC (rev
4796)
@@ -35,17 +35,13 @@
$g_succeed="<span style=\"font-size:18px;color:green\">✓</span>";
/*set to none for production */
/* uncomment for production */
-// $version_phpcompta=4620;
-// define ("DEBUG",true);
-
-
$version_phpcompta=SVNINFO;
define ("DEBUG",false);
-/* $version_phpcompta=4601;
-define ("DEBUG",true); */
+//$version_phpcompta=4601;
+//define ("DEBUG",true);
-define ("DBVERSION",101);
+define ("DBVERSION",102);
define ("DBVERSIONREPO",14);
define ('NOTFOUND','--not found--');
@@ -55,6 +51,7 @@
define ('MAX_CAT',15);
define ('MAX_FORECAST_ITEM',10);
define ('MAX_PREDEFINED_OPERATION',30);
+define ('MAX_COMPTE_CARD',4);
if ( DEBUG ) error_reporting(2147483647); else error_reporting(0);
// Erreur
Modified: phpcompta/trunk/include/template/form_ledger_fin.php
===================================================================
--- phpcompta/trunk/include/template/form_ledger_fin.php 2012-03-23
20:05:04 UTC (rev 4795)
+++ phpcompta/trunk/include/template/form_ledger_fin.php 2012-03-23
20:12:57 UTC (rev 4796)
@@ -21,7 +21,8 @@
<fieldset><legend><?=_('Opérations')?></legend>
<table id="fin_item" width="100%" border="0">
<tr>
-<th style="text-align: left;width:
auto"colspan="2">code<?HtmlInput::infobulle(0)?></TH>
+<th style="text-align: left;width: auto">code<?HtmlInput::infobulle(0)?></TH>
+ <th style="text-align: left"><?=_('Fiche')?></TH>
<th style="text-align: left"><?=_('Commentaire')?></TH>
<th style="text-align: left"><?=_('Montant')?></TH>
<th style="text-align: left;width:auto"colspan="2"> <?=_('Op.
Concernée(s)')?></th>
@@ -30,6 +31,7 @@
<? foreach ($array as $item) {
echo '<tr>';
echo td($item['qcode'].$item['search']);
+echo td($item['cname']);
echo td($item['comment']);
echo td($item['amount']);
echo td($item['concerned']);
Modified: phpcompta/trunk/include/template/ledger_detail_file.php
===================================================================
--- phpcompta/trunk/include/template/ledger_detail_file.php 2012-03-23
20:05:04 UTC (rev 4795)
+++ phpcompta/trunk/include/template/ledger_detail_file.php 2012-03-23
20:12:57 UTC (rev 4796)
@@ -1,11 +1,12 @@
<?
-/**
+/**
address@hidden show an iframe, the iframe contains either
* - a input type to save a file
* - a file name (which can be opened or removed
*/
$str='?'.dossier::get()."&div=$div&act=file&jr_id=$jr_id";
+if ( isset ($_REQUEST['ajax'])) $str.="&ajax=1";
?>
<div class="noprint">
-<iframe frameborder=0 scrolling="no"
style="border:0;width:248;height:22;overflow:hidden" src="<? echo
'ajax_ledger.php'.$str; ?>"> </iframe>
+<iframe frameborder=0 scrolling="no" style="margin:0;padding:
0;border:0;width:100%;height:90;overflow:hidden" src="<? echo
'ajax_ledger.php'.$str; ?>"></iframe>
</div>
\ No newline at end of file
Modified: phpcompta/trunk/include/template/ledger_detail_misc.php
===================================================================
--- phpcompta/trunk/include/template/ledger_detail_misc.php 2012-03-23
20:05:04 UTC (rev 4795)
+++ phpcompta/trunk/include/template/ledger_detail_misc.php 2012-03-23
20:12:57 UTC (rev 4796)
@@ -99,6 +99,7 @@
echo Anc_Plan::hidden($a_anc);
}
echo '</tr>';
+$amount_idx=0;
for ($e=0;$e<count($obj->det->array);$e++) {
$row=''; $q=$obj->det->array;
$view_history= sprintf('<A class="detail"
style="text-decoration:underline"
HREF="javascript:view_history_account(\'%s\',\'%s\')" >%s</A>',
@@ -151,13 +152,13 @@
/* Analytic accountancy */
if ( $owner->MY_ANALYTIC != "nu" && $div=='popup'){
if ( preg_match('/^(6|7)/',$q[$e]['j_poste'])) {
-
-echo HtmlInput::hidden("amount_t".$e,$montant);
+
+ echo HtmlInput::hidden("amount_t".$amount_idx,$q[$e]['j_montant']);
$anc_op=new Anc_Operation($cn);
$anc_op->j_id=$q[$e]['j_id'];
echo HtmlInput::hidden('op[]',$anc_op->j_id);
$row.=$anc_op->display_table(1,$q[$e]['j_montant'],$div);
-
+ $amount_idx++;
} else {
$row.=td('');
}
Modified: phpcompta/trunk/include/template/ledger_detail_ven.php
===================================================================
--- phpcompta/trunk/include/template/ledger_detail_ven.php 2012-03-23
20:05:04 UTC (rev 4795)
+++ phpcompta/trunk/include/template/ledger_detail_ven.php 2012-03-23
20:12:57 UTC (rev 4796)
@@ -37,7 +37,7 @@
$bk=new
Fiche($cn,$obj->det->array[0]['qs_client']);
echo td(_('Client'));
- $view_history= sprintf('<A
class="detail" HREF="javascript:view_history_card(\'%s\',\'%s\')" >%s</A>',
+ $view_history= sprintf('<A
class="line" HREF="javascript:view_history_card(\'%s\',\'%s\')" >%s</A>',
$bk->id, $gDossier, $bk->get_quick_code());
echo
td(h($bk->getName())).td($view_history);;
?>
Modified: phpcompta/trunk/include/template/letter_prop.php
===================================================================
--- phpcompta/trunk/include/template/letter_prop.php 2012-03-23 20:05:04 UTC
(rev 4795)
+++ phpcompta/trunk/include/template/letter_prop.php 2012-03-23 20:12:57 UTC
(rev 4796)
@@ -91,14 +91,14 @@
$check=new ICheckbox('ck[]',$this->content[$i]['j_id']);
if ( $jnt_id == $this->content[$i]['letter'] && $i < $linked_limit)
$check->selected=true; else $check->selected=false;
-if ( $this->content[$i]['letter'] == -1 || $check->selected == true )
+if ( $this->content[$i]['letter'] < 0 || $check->selected == true )
echo $check->input();
echo HtmlInput::hidden('letter_j_id[]',$this->content[$i]['j_id']);
?>
</td>
<td>
<?php
-$letter=($this->content[$i]['letter']==-1)?" ":$this->content[$i]['letter'];
+$letter=($this->content[$i]['letter']< 0)?" ":$this->content[$i]['letter'];
?>
<?=$letter?>
</td>
Modified: phpcompta/trunk/include/template/modele_document.php
===================================================================
--- phpcompta/trunk/include/template/modele_document.php 2012-03-23
20:05:04 UTC (rev 4795)
+++ phpcompta/trunk/include/template/modele_document.php 2012-03-23
20:12:57 UTC (rev 4796)
@@ -25,7 +25,7 @@
$w=new ISelect();
$w->name="md_type";
- $w->value=$cn->make_array('select dt_id,dt_value from document_type');
+ $w->value=$cn->make_array('select dt_id,dt_value from document_type order
by dt_value');
$w->selected=$doc->md_type;
echo $w->input();
?>
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r4796 - in phpcompta/trunk: . doc html html/admin/sql/patch html/js include include/template,
phpcompta-dev <=