noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 88/219: Task #0001481: Encodage Vente, Achat


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 88/219: Task #0001481: Encodage Vente, Achat, Fin ou OD 1. S'il n'y a qu'une seule catégorie de fiche , il n'est plus nécessaire d'afficher le choix (puisqu'il n'y en a qu'un) 2. Avoir pour chaque ligne un bouton ajout fiche
Date: Mon, 18 Dec 2017 13:22:43 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 2abda90c6cd81a9580650a2603fc1af543ffda2a
Author: Dany De Bontridder <address@hidden>
Date:   Wed Oct 18 22:03:03 2017 +0200

    Task #0001481: Encodage Vente, Achat, Fin ou OD
    1. S'il n'y a qu'une seule catégorie de fiche , il n'est plus nécessaire 
d'afficher le choix (puisqu'il n'y en a qu'un)
    2. Avoir pour chaque ligne un bouton ajout fiche
---
 html/image/popout.png                       | Bin 0 -> 675 bytes
 html/js/acc_ledger.js                       |   1 -
 html/js/card.js                             |   2 +-
 include/class/acc_ledger.class.php          |  14 ++++--------
 include/class/acc_ledger_fin.class.php      |  12 +++++-----
 include/class/acc_ledger_purchase.class.php |  24 ++++++++++----------
 include/class/acc_ledger_sold.class.php     |  33 ++++++++++------------------
 7 files changed, 36 insertions(+), 50 deletions(-)

diff --git a/html/image/popout.png b/html/image/popout.png
new file mode 100644
index 0000000..4d7c6b8
Binary files /dev/null and b/html/image/popout.png differ
diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index 13d8811..ce0e5b5 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -431,7 +431,6 @@ function compute_ledger(p_ctl_nb)
     g('e_quant' + p_ctl_nb).value = trim(g('e_quant' + p_ctl_nb).value);
     var quantity = g('e_quant' + p_ctl_nb).value;
     var querystring = 'gDossier=' + dossier + '&c=' + qcode + '&t=' + tva_id + 
'&p=' + price + '&q=' + quantity + '&n=' + p_ctl_nb;
-    $('sum').hide();
     var action = new Ajax.Request(
             "compute.php",
             {
diff --git a/html/js/card.js b/html/js/card.js
index 2297744..7662c8e 100644
--- a/html/js/card.js
+++ b/html/js/card.js
@@ -540,7 +540,7 @@ function  successFill_ipopcard(req,json)
  * a card
  address@hidden input field (obj) it must have the attribute ipopup
  *       possible attribute :
- *        - filter is the filter but with a  fd_id list, -1 means there  is no 
filter
+ *        - filter possible values are deb, cred, fd_id list, -1 means there  
is no filter
  *        - ref if we want to refresh the window after adding a card
  *        - type type of card (supplier, customer...)
  address@hidden ajax_card.php
diff --git a/include/class/acc_ledger.class.php 
b/include/class/acc_ledger.class.php
index 5c40bc4..481364b 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -1609,13 +1609,9 @@ class Acc_Ledger extends jrn_def_sql
                $ret = "";
                if ($g_user->check_action(FICADD) == 1)
                {
-                       /* Add button */
-                       $f_add_button = new IButton('add_card');
-                       $f_add_button->label = _('Créer une nouvelle fiche');
-                       $f_add_button->set_attribute('ipopup', 'ipop_newcard');
-                       $f_add_button->set_attribute('jrn', $this->id);
-                       $f_add_button->javascript = " 
this.jrn=\$('p_jrn').value;select_card_type(this);";
-                       $f_add_button->input();
+                       // Button for adding customer
+                        $js_deb="this.filter='-1';this.jrn=\$('p_jrn').value; 
select_card_type(this);";
+                        $str_add_button= 
HtmlInput::button_image($js_deb,"xx",'class="smallbutton 
image_search"',"image/bouton-plus.png");
                }
                $wLedger = $this->select_ledger('ODS', 2);
                if ($wLedger == null)
@@ -1707,8 +1703,6 @@ class Acc_Ledger extends jrn_def_sql
                $ret.=HtmlInput::hidden('jrn_type', $this->get_type());
                $info = HtmlInput::infobulle(0);
                $info_poste = HtmlInput::infobulle(9);
-               if ($g_user->check_action(FICADD) == 1)
-                       $ret.=$f_add_button->input();
                $ret.='<table id="quick_item" 
style="position:float;width:100%">';
                $ret.='<tr>' .
                                '<th style="text-align:left">Quickcode' . $info 
. '</th>' .
@@ -1794,7 +1788,7 @@ class Acc_Ledger extends jrn_def_sql
                        $deb->javascript = ' onChange="checkTotalDirect()"';
 
                        $ret.='<tr>';
-                       $ret.='<td>' . $quick_code->input() . 
$quick_code->search() . '</td>';
+                       $ret.='<td>' . $quick_code->input() . 
$quick_code->search() .$str_add_button. '</td>';
                        $ret.='<td>' . $poste->input() .
                                        '<script> 
document.getElementById(\'poste' . $i . '\').onblur=function(){ if 
(trim(this.value) !=\'\') {document.getElementById(\'qc_' . $i . 
'\').value="";}}</script>' .
                                        '</td>';
diff --git a/include/class/acc_ledger_fin.class.php 
b/include/class/acc_ledger_fin.class.php
index 451edcf..ed41b7f 100644
--- a/include/class/acc_ledger_fin.class.php
+++ b/include/class/acc_ledger_fin.class.php
@@ -248,12 +248,12 @@ class Acc_Ledger_Fin extends Acc_Ledger
 
                $min_article=$this->get_min_row();
 
-               $f_add_button = new IButton('add_card');
-               $f_add_button->label = _('Créer une nouvelle fiche');
-               $f_add_button->set_attribute('ipopup', 'ipop_newcard');
-               $f_add_button->set_attribute('jrn', $this->id);
-               $f_add_button->javascript = " 
this.jrn=\$('p_jrn').value;select_card_type(this);";
-               $str_add_button = ($g_user->check_action(FICADD) == 1) ? 
$f_add_button->input() : "";
+               $str_add_button = "";
+                if ( $g_user->check_action(FICADD) == 1) {
+                   // Button for adding new tiers
+                    $js_deb="this.filter='deb';this.jrn=\$('p_jrn').value; 
select_card_type(this);";
+                    $str_add_button = 
HtmlInput::button_image($js_deb,"xx",'class="smallbutton 
image_search"',"image/bouton-plus.png");
+                }
 
                // The first day of the periode
                $pPeriode = new Periode($this->db);
diff --git a/include/class/acc_ledger_purchase.class.php 
b/include/class/acc_ledger_purchase.class.php
index 438f817..7211c40 100644
--- a/include/class/acc_ledger_purchase.class.php
+++ b/include/class/acc_ledger_purchase.class.php
@@ -966,16 +966,18 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
 
         $flag_tva=$g_parameter->MY_TVA_USE;
         /* Add button */
-        $f_add_button=new IButton('add_card');
-        $f_add_button->label=_('Créer une nouvelle fiche');
-               $f_add_button->tabindex=-1;
-        $f_add_button->set_attribute('jrn',$this->id);
-        $f_add_button->javascript=" 
this.jrn=\$('p_jrn').value;select_card_type(this);";
-
-        $str_add_button="";
-        if ($g_user->check_action(FICADD)==1)
-        {
-                $str_add_button=$f_add_button->input();
+        
+        $str_add_button_tiers = "";
+        $str_add_button_item = "";
+        if ($g_user->check_action(FICADD) == 1) {
+            $js_deb="this.filter='deb';this.jrn=\$('p_jrn').value; 
select_card_type(this);";
+            $js_cred="this.filter='cred';this.jrn=\$('p_jrn').value; 
select_card_type(this);";
+            
+            // Button for adding customer
+            $str_add_button_tiers = 
HtmlInput::button_image($js_cred,"xx",'class="smallbutton 
image_search"',"image/bouton-plus.png");
+            
+            // Button for adding services or items to sale
+            $str_add_button_item = 
HtmlInput::button_image($js_deb,"xx",'class="smallbutton 
image_search"',"image/bouton-plus.png");
         }
         // The first day of the periode
         $oPeriode=new Periode($this->db);
@@ -1233,7 +1235,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
             if ( $g_parameter->MY_UPDLAB == 'Y')
             {
                 $Span=new IText("e_march".$i."_label");
-                $Span->css_size="100%";
+                $Span->css_size="40";
             } else
             {
                 $Span=new ISpan("e_march".$i."_label");
diff --git a/include/class/acc_ledger_sold.class.php 
b/include/class/acc_ledger_sold.class.php
index d3291f2..aa4de82 100644
--- a/include/class/acc_ledger_sold.class.php
+++ b/include/class/acc_ledger_sold.class.php
@@ -1008,26 +1008,17 @@ EOF;
 
         $flag_tva = $g_parameter->MY_TVA_USE;
         /* Add button */
-        $f_add_button = new IButton('add_card');
-        $f_add_button->tabindex = -1;
-        $f_add_button->label = _('Créer une nouvelle fiche');
-        $f_add_button->set_attribute('ipopup', 'ipop_newcard');
-        $f_add_button->set_attribute('jrn', $this->id);
-        $f_add_button->javascript = "this.jrn=\$('p_jrn').value; 
select_card_type(this);";
-
-        $f_add_button2 = new IButton('add_card2');
-        $f_add_button2->tabindex = -1;
-        $f_add_button2->label = _('Créer une nouvelle fiche');
-        $f_add_button2->set_attribute('ipopup', 'ipop_newcard');
-        $f_add_button2->set_attribute('filter', $this->get_all_fiche_def());
-        //    $f_add_button2->set_attribute('jrn',$this->id);
-        $f_add_button2->javascript = " 
this.jrn=\$('p_jrn').value;select_card_type(this);";
-
-        $str_add_button = "";
-        $str_add_button2 = "";
+        
+        $str_add_button_tiers = "";
+        $str_add_button_item = "";
         if ($g_user->check_action(FICADD) == 1) {
-            $str_add_button = $f_add_button->input();
-            $str_add_button2 = $f_add_button2->input();
+            // Button for adding customer
+            $js_deb="this.filter='deb';this.jrn=\$('p_jrn').value; 
select_card_type(this);";
+            $str_add_button_tiers = 
HtmlInput::button_image($js_deb,"xx",'class="smallbutton 
image_search"',"image/bouton-plus.png");
+            
+            // Button for adding services or items to sale
+            $js_cred="this.filter='cred';this.jrn=\$('p_jrn').value; 
select_card_type(this);";
+            $str_add_button_item = 
HtmlInput::button_image($js_cred,"xx",'class="smallbutton 
image_search"',"image/bouton-plus.png");
         }
         // The first day of the periode
         $oPeriode = new Periode($this->db);
@@ -1207,7 +1198,7 @@ EOF;
             $W1->name = "e_march" . $i;
             $W1->value = $march;
             $W1->table = 1;
-            $W1->set_attribute('typecard', 'cred');
+            $W1->set_attribute('typecard', 'cred');            
             $W1->set_dblclick("fill_ipopcard(this);");
             $W1->set_attribute('ipopup', 'ipopcard');
 
@@ -1248,7 +1239,7 @@ EOF;
             if ($g_parameter->MY_UPDLAB == 'Y') {
                 $Span = new IText("e_march" . $i . "_label");
 
-                $Span->css_size = "100%";
+                $Span->size= "40";
             } else {
                 $Span = new ISpan("e_march" . $i . "_label");
             }



reply via email to

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