noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 01/01: Task #986 - Mise à jour automatique d


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 01/01: Task #986 - Mise à jour automatique du field Bénéficiaire lorsqu'un montant est lettré dans Import Banque & Trésorerie Update fields supplier or customer with the person who makes the payment + new function select_depot for #1055
Date: Tue, 25 Nov 2014 19:11:03 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit cacd6f2e218974c7271b595bcdebf77b7bd37469
Author: Dany De Bontridder <address@hidden>
Date:   Tue Nov 25 19:55:56 2014 +0100

    Task #986 - Mise à jour automatique du field Bénéficiaire lorsqu'un montant 
est lettré dans Import Banque & Trésorerie
    Update fields supplier or customer with the person who makes the payment
    + new function select_depot for #1055
---
 html/js/scripts.js                           |   29 ++++++++++++++++---
 include/class_acc_ledger.php                 |   37 +++++++++++++++++++++++--
 include/class_acc_ledger_fin.php             |    1 +
 include/class_iconcerned.php                 |    5 +++-
 include/search.inc.php                       |    3 +-
 include/template/card_result.php             |    2 +-
 include/template/result_cat_card_summary.php |    2 +-
 7 files changed, 67 insertions(+), 12 deletions(-)

diff --git a/html/js/scripts.js b/html/js/scripts.js
index 2c7f8f7..5d46377 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -1190,11 +1190,18 @@ function save_predf_op(obj)
 
     return false;
 }
+
 /**
  *ctl_concern is the widget to update
- *amount_id is either a html obj. or an amount
+ *amount_id is either a html obj. or an amount and the field tiers if given
+ * @param {type} dossier
+ * @param {type} ctl_concern
+ * @param {type} amount_id
+ * @param {type} ledger
+ * @param {type} p_id_target
+ * @returns {undefined}
  */
-function search_reconcile(dossier, ctl_concern, amount_id, ledger)
+function search_reconcile(dossier, ctl_concern, amount_id, ledger,p_id_target)
 {
     var dossier = g('gDossier').value;
     if (amount_id === undefined)
@@ -1227,7 +1234,8 @@ function search_reconcile(dossier, ctl_concern, 
amount_id, ledger)
         ctl: target,
         ac: 'JSSEARCH',
         amount_id: amount_id,
-        ledger: ledger};
+        ledger: ledger,
+        target : p_id_target};
 
     var qs = encodeJSON(target);
 
@@ -1272,14 +1280,20 @@ function search_operation(obj)
         alert(e.message);
     }
 }
-
+/**
+ * Update the field e_concerned, from class_iconcerned
+ * Value is the field where to put the quick-code but only if one checkbox has 
been
+ * selected
+ * @param {type} obj
+ * @returns {undefined}
+ */
 function set_reconcile(obj)
 {
 
     try
     {
         var ctlc = obj.elements['ctlc'];
-
+        var target=obj.elements['target'].value;
         for (var e = 0; e < obj.elements.length; e++)
         {
 
@@ -1292,6 +1306,11 @@ function set_reconcile(obj)
                     var nValue = str_name.replace("jr_concerned", "");
                     if ($(ctlc.value).value != '') {
                         $(ctlc.value).value += ',';
+                       
+                    } else {
+                        if ( target !="" && $(target).value == "") {
+                            $(target).value=elmt.value;
+                        }
                     }
                     $(ctlc.value).value += nValue;
                 }
diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php
index 44a54b0..03c2097 100644
--- a/include/class_acc_ledger.php
+++ b/include/class_acc_ledger.php
@@ -626,7 +626,7 @@ class Acc_Ledger extends jrn_def_sql
         * @return HTML string
         */
 
-       public function list_operation_to_reconcile($sql)
+       public function list_operation_to_reconcile($sql,$p_target)
        {
                global $g_parameter, $g_user;
                $gDossier = dossier::id();
@@ -650,7 +650,7 @@ class Acc_Ledger extends jrn_def_sql
 
                if ($Max == 0)
                        return array(0, _("Aucun enregistrement trouvé"));
-
+                $r.=HtmlInput::hidden("target", $p_target);
                $r.='<table class="result">';
 
 
@@ -689,7 +689,7 @@ class Acc_Ledger extends jrn_def_sql
                        // Radiobox
                        //
 
-                       $r.='<td><INPUT TYPE="CHECKBOX" name="jr_concerned' . 
$row['jr_id'] . '" ID="jr_concerned' . $row['jr_id'] . '"> </td>';
+                       $r.='<td><INPUT TYPE="CHECKBOX" name="jr_concerned' . 
$row['jr_id'] . '" ID="jr_concerned' . $row['jr_id'] . '" 
value="'.$row['quick_code'].'"> </td>';
                        //internal code
                        // button  modify
                        $r.="<TD>";
@@ -3825,6 +3825,37 @@ class Acc_Ledger extends jrn_def_sql
             $lib=$this->db->get_value('select pcm_lib from tmp_pcmn where 
pcm_val=$1',array($p_value));
             return $lib;
         }
+        /**
+         * Let you select the repository before confirming a sale or a 
purchase.
+         * Returns an empty string if the company doesn't use stock
+         * @brief Let you select the repository before confirming a sale or a 
purchase.
+         * @global type $g_parameter check if company is using stock
+         * @param type $p_readonly 
+         * @param type $p_repo
+         * @return string
+         */
+        public function select_depot($p_readonly, $p_repo)
+        {
+            global $g_parameter;
+            $r='<div id="repo_div_id">';
+            // Show the available repository
+            if ($g_parameter->MY_STOCK=='Y')
+            {
+                $sel=HtmlInput::select_stock($this->db, 'repo', 'W');
+                $sel->readOnly=$p_readonly;
+                if ($p_readonly==true)
+                    $sel->selected=$p_repo;
+                $r.="<p class=\"decale\">"._('Dans le dépôt')." : ";
+                $r.=$sel->input();
+                $r.='</p>';
+            } else
+            {
+                $r.='<span class="notice">'.'Stock non utilisé'.'</span>';
+            }
+            $r.='</div>';
+            return $r;
+            
+        }
 
 }
 ?>
\ No newline at end of file
diff --git a/include/class_acc_ledger_fin.php b/include/class_acc_ledger_fin.php
index 284e354..8dc9423 100644
--- a/include/class_acc_ledger_fin.php
+++ b/include/class_acc_ledger_fin.php
@@ -431,6 +431,7 @@ class Acc_Ledger_Fin extends Acc_Ledger
                        ${"e_concerned" . $i} = (isset(${"e_concerned" . $i})) 
? ${"e_concerned" . $i} : ""
                        ;
                        $wConcerned = new IConcerned("e_concerned" . $i, 
${"e_concerned" . $i});
+                        $wConcerned->tiers="e_other" . $i;
                        $wConcerned->setReadOnly($pview_only);
                        $wConcerned->amount_id = "e_other" . $i . "_amount";
 
diff --git a/include/class_iconcerned.php b/include/class_iconcerned.php
index bae88ee..f6da041 100644
--- a/include/class_iconcerned.php
+++ b/include/class_iconcerned.php
@@ -36,6 +36,7 @@ class IConcerned extends HtmlInput
                $this->amount_id=null;
                $this->paid='';
                $this->id=$p_id;
+                $this->tiers=""; // id of the field for the tiers to be updated
        }
     /*!\brief show the html  input of the widget*/
     public function input($p_name=null,$p_value=null)
@@ -48,7 +49,8 @@ class IConcerned extends HtmlInput
 
 
         $r=sprintf("
-                   <INPUT TYPE=\"button\" class=\"smallbutton\" 
onClick=\"search_reconcile(".dossier::id().",'%s','%s','%s')\" value=\"?\">
+                    <image 
onclick=\"search_reconcile(".dossier::id().",'%s','%s','%s','%s')\" 
class=\"image_search\" src=\"image/magnifier13.png\" />
+                   
                    <INPUT TYPE=\"text\"  
style=\"color:black;background:lightyellow;border:solid 1px grey;\"  
NAME=\"%s\" ID=\"%s\" VALUE=\"%s\" SIZE=\"8\" readonly>
                                   <INPUT class=\"smallbutton\"  
TYPE=\"button\" onClick=\"$('%s').value=''\" value=\"X\">
 
@@ -56,6 +58,7 @@ class IConcerned extends HtmlInput
                    $this->name,
                    $this->amount_id,
                    $this->paid,
+                   $this->tiers,
                    $this->name,
                    $this->id,
                    $this->value,
diff --git a/include/search.inc.php b/include/search.inc.php
index 017c20e..66c8123 100644
--- a/include/search.inc.php
+++ b/include/search.inc.php
@@ -107,7 +107,8 @@ if ( isset ($_GET['viewsearch']) )
     list($sql,$where)=$ledger->build_search_sql($array);
     // Count nb of line
     $max_line=$cn->count_sql($sql);
-    list($count,$content)=$ledger->list_operation_to_reconcile($sql);
+    $target=HtmlInput::default_value_get("target", "");
+    list($count,$content)=$ledger->list_operation_to_reconcile($sql,$target);
     $bar=navigation_bar($offset,$max_line,$step,$page);
 
    if (! $inside ) {
diff --git a/include/template/card_result.php b/include/template/card_result.php
index 828b0fa..3bf77d4 100644
--- a/include/template/card_result.php
+++ b/include/template/card_result.php
@@ -10,7 +10,7 @@
     <?php $class=($i%2==0)?'odd':'even';?>
 <tr class="<?php echo $class;?>">
 <td style="padding-right:55px">
-<a href="javascript:void(0)" class="one" onclick="<?php echo 
$array[$i]['javascript']?>">
+<a href="javascript:void(0)" class="detail" onclick="<?php echo 
$array[$i]['javascript']?>">
 <?php echo $array[$i]['quick_code']?>
 </a>
 </td>
diff --git a/include/template/result_cat_card_summary.php 
b/include/template/result_cat_card_summary.php
index 09c3f5e..29a3595 100644
--- a/include/template/result_cat_card_summary.php
+++ b/include/template/result_cat_card_summary.php
@@ -19,7 +19,7 @@ for ($i=0;$i<count($aHeading);$i++) :
        $span='<span id="sorttable_sortfwdind">&nbsp;&nbsp;&#x25BE;</span>';
        $sort= 'class="sorttable_sorted"';
    }
-   echo '<th style="color:blue;padding: 0 5 1 10" 
'.$sort.'>'.$aHeading[$i]->ad_text.$span.'</th>';
+   echo '<th '.$sort.'>'.$aHeading[$i]->ad_text.$span.'</th>';
    endfor;
 ?>
 </tr>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]