[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r5303 - in phpcompta/trunk: html html/js include include
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r5303 - in phpcompta/trunk: html html/js include include/template |
Date: |
Wed, 22 May 2013 17:17:00 +0200 (CEST) |
Author: danydb
Date: 2013-05-22 17:17:00 +0200 (Wed, 22 May 2013)
New Revision: 5303
Modified:
phpcompta/trunk/html/ajax_ledger.php
phpcompta/trunk/html/js/acc_ledger.js
phpcompta/trunk/html/js/infobulle.js
phpcompta/trunk/html/js/scripts.js
phpcompta/trunk/include/class_acc_ledger.php
phpcompta/trunk/include/class_acc_operation.php
phpcompta/trunk/include/template/ledger_detail_bottom.php
Log:
Possibilite de corriger les autres info + recherche mais doublon en cas de mise
a jour: a corriger
Modified: phpcompta/trunk/html/ajax_ledger.php
===================================================================
--- phpcompta/trunk/html/ajax_ledger.php 2013-05-22 15:16:06 UTC (rev
5302)
+++ phpcompta/trunk/html/ajax_ledger.php 2013-05-22 15:17:00 UTC (rev
5303)
@@ -470,6 +470,12 @@
$op=new Anc_Operation($cn);
$op->save_update_form($_POST);
}
+ //////////////////////////////////////////////////////////////////
+ //Save other info
+ //////////////////////////////////////////////////////////////////
+ $op->save_info($_POST['OTHER'],'OTHER');
+ $op->save_info($_POST['BON_COMMANDE'],'BON_COMMANDE');
+
}
echo _('Opération sauvée');
$cn->commit();
Modified: phpcompta/trunk/html/js/acc_ledger.js
===================================================================
--- phpcompta/trunk/html/js/acc_ledger.js 2013-05-22 15:16:06 UTC (rev
5302)
+++ phpcompta/trunk/html/js/acc_ledger.js 2013-05-22 15:17:00 UTC (rev
5303)
@@ -141,7 +141,7 @@
}
/**
- *ask the name, quick_code of the bank for the ledger
+ * Update the number of rows when changing of ledger
*/
function update_row(ctl)
{
Modified: phpcompta/trunk/html/js/infobulle.js
===================================================================
--- phpcompta/trunk/html/js/infobulle.js 2013-05-22 15:16:06 UTC (rev
5302)
+++ phpcompta/trunk/html/js/infobulle.js 2013-05-22 15:17:00 UTC (rev
5303)
@@ -57,6 +57,9 @@
content[27]="Attention, <b>SI</b> la fiche a changé de poste comptable, c'est
seulement le dernier qui est affiché";
content[28]="Attention Différence entre TVA calculée et donnée";
content[29]="Si vous ne donnez pas de nom, ce sera le nom du fichier qui sera
utilisé";
+content[30]="Peut contenir une information telle que le message structuré sur
le virement";
+content[31]="Peut contenir un numéro de bon de commande";
+
function showBulle(p_ctl)
{
d=document.getElementById('bulle');
Modified: phpcompta/trunk/html/js/scripts.js
===================================================================
--- phpcompta/trunk/html/js/scripts.js 2013-05-22 15:16:06 UTC (rev 5302)
+++ phpcompta/trunk/html/js/scripts.js 2013-05-22 15:17:00 UTC (rev 5303)
@@ -1040,7 +1040,7 @@
removeDiv(target);
var sx='20%';
var sy='20%';
- var str_style="top:"+sx+";left:"+sy;
+ var str_style="top:"+sx+";left:"+sy+'width:60%;';
var div={id:target,
cssclass:'inner_box',style:str_style,html:loading(),drag:1};
Modified: phpcompta/trunk/include/class_acc_ledger.php
===================================================================
--- phpcompta/trunk/include/class_acc_ledger.php 2013-05-22 15:16:06 UTC
(rev 5302)
+++ phpcompta/trunk/include/class_acc_ledger.php 2013-05-22 15:17:00 UTC
(rev 5303)
@@ -2713,7 +2713,9 @@
$desc = sql_string($desc);
$fil_desc = $and . " ( upper(jr_comment) like upper('%"
. $desc . "%') or upper(jr_pj_number) like upper('%" . $desc . "%') " .
" or upper(jr_internal) like upper('%"
. $desc . "%')
- or jr_grpt_id in (select j_grpt from jrnx where
j_text ~* '" . $desc . "'))";
+ or jr_grpt_id in (select j_grpt from jrnx where
j_text ~* '" . $desc . "')
+ or jr_id in (select jr_id from jrn_info where
ji_value is not null and ji_value ~* '$desc')
+ )";
$and = " and ";
}
// Poste
Modified: phpcompta/trunk/include/class_acc_operation.php
===================================================================
--- phpcompta/trunk/include/class_acc_operation.php 2013-05-22 15:16:06 UTC
(rev 5302)
+++ phpcompta/trunk/include/class_acc_operation.php 2013-05-22 15:17:00 UTC
(rev 5303)
@@ -492,7 +492,10 @@
$ledger_id=$this->get_ledger();
if ( $ledger_id=='') throw new Exception('Journal non trouvé');
$oledger=new Acc_Ledger($this->db,$ledger_id);
-
+
+ // retrieve info from jrn_info
+
+
switch($oledger->get_type())
{
case 'VEN':
@@ -513,8 +516,51 @@
$ret=new Acc_Misc($this->db,$this->jr_id);
$ret->get();
}
+ $ret->get_info();
return $ret;
}
+ /**
+ * @brief retrieve info from the jrn_info, create 2 new arrays
+ * obj->info->command and obj->info->other
+ * the columns are the idx
+ */
+ function get_info()
+ {
+ $this->info=new stdClass();
+ // other info
+ $array=$this->db->get_value("select ji_value from jrn_info where
+ jr_id=$1 and id_type=$2",array($this->jr_id,'OTHER'));
+ $this->info->other= $array['ji_value'];
+
+ // Bon de commande
+ $array=$this->db->get_value("select * from jrn_info where
+ jr_id=$1 and id_type=$2",array($this->jr_id,'BON_COMMANDE'));
+ $this->info->command= $array['ji_value'];
+
+ }
+ /**
+ * Save into jrn_info
+ * @param $p_info msg to save
+ * @param $p_type is OTHER or BON_COMMAND
+ */
+ function save_info($p_info,$p_type)
+ {
+ if ( ! in_array($p_type,array('OTHER','BON_COMMANDE'))) return;
+ if (trim($p_info)=="") {
+ $this->db->exec_sql('delete from jrn_info where jr_id=$1 and
id_type=$2',array($this->jr_id,$p_TYPE));
+ return;
+ }
+ $exist=$this->db->get_value('select count(ji_id) from jrn_info where
jr_id=$1 and id_type=$2',array($this->jr_id,$p_TYPE));
+ if ( $exist == "0" ) {
+ //insert into jrn_info
+ $this->db->exec_sql('insert into jrn_info(jr_id,id_type,ji_value)
values ($1,$2,$3)',
+ array($this->jr_id,$p_type,$p_info));
+ } elseif ( $exist == 1) {
+ //update
+ $this->db->exec_sql('update jrn_info set id_type=$2,ji_value=$3
where jr_id=$1',
+ array($this->jr_id,$p_type,$p_info));
+ }
+ }
static function test_me()
{
$_SESSION['g_user']='phpcompta';
Modified: phpcompta/trunk/include/template/ledger_detail_bottom.php
===================================================================
--- phpcompta/trunk/include/template/ledger_detail_bottom.php 2013-05-22
15:16:06 UTC (rev 5302)
+++ phpcompta/trunk/include/template/ledger_detail_bottom.php 2013-05-22
15:17:00 UTC (rev 5303)
@@ -1,5 +1,19 @@
+<?php
+ $cmd=new IText('BON_COMMANDE',$obj->info->command);
+ $other=new IText('OTHER',$obj->info->other);
+?>
<div class="myfieldset">
-
+ <h1 class="legend">Informations</h1>
+ <table>
+ <tr>
+ <td> Bon de commande :</td><td> <?php echo
HtmlInput::infobulle(31)." ".$cmd->input(); ?></td>
+ </tr>
+ <tr>
+ <td> Autre information : </td><td><?php echo
HtmlInput::infobulle(30)." ".$other->input();?></td>
+ </tr>
+ </table>
+</div>
+<div class="myfieldset">
<h1 class="legend">
<?php echo _('Rapprochement');?>
</h1>
---
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] r5303 - in phpcompta/trunk: html html/js include include/template,
phpcompta-dev <=