From 2abda90c6cd81a9580650a2603fc1af543ffda2a Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 18 Oct 2017 22:03:03 +0200 Subject: [PATCH] =?UTF-8?q?Task=20#0001481:=20Encodage=20Vente,=20Achat,?= =?UTF-8?q?=20Fin=20ou=20OD=201.=20S'il=20n'y=20a=20qu'une=20seule=20cat?= =?UTF-8?q?=C3=A9gorie=20de=20fiche=20,=20il=20n'est=20plus=20n=C3=A9cessa?= =?UTF-8?q?ire=20d'afficher=20le=20choix=20(puisqu'il=20n'y=20en=20a=20qu'?= =?UTF-8?q?un)=202.=20Avoir=20pour=20chaque=20ligne=20un=20bouton=20ajout?= =?UTF-8?q?=20fiche?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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(-) create mode 100644 html/image/popout.png diff --git a/html/image/popout.png b/html/image/popout.png new file mode 100644 index 0000000000000000000000000000000000000000..4d7c6b8b0ab4c5e87abc49d6997665cb2fae8dde GIT binary patch literal 675 zcmV;U0$lxxP)i47)q~oniJn zJM&BuGh(4E%N5{Mx7$4)V_e(Ako3pa>2%iIz3uMX?%qo&Z8e+CBg4EfOUW_DyTB7* z0We92@;pB?%*z1W{cH$f2?)JjF8~IF$_xl*7Jv^$Q9Mm4Ed!^4T+(+l%YbvOR_k@6 z(YO>sXq9ETnE{yD6-gJX`{4q5l?iy(Znxit5H`(h5s;a^N-15-^ZY`d=f@=7k`zJ+ zpOA#RKXUgsk_t(gq=qCLq4z;|fA8+9>`SxRJX+_t`w4efr_(u`)q4x1F;W*PrI*0c z;EN=^n4h2D8YQ))?z9axcYh8n1C7e}HO6>-57DdvkY!mpRq~ykoqJ}s3d~imQqp5! zdjx%;MmHPrau-rcH-PiNftq_O#<;OhNCT#jC8cy((mHUs=62vd@MBa=^;-grPi|&& zKsn_8Rusj}F=5js&-45tunN2bIzU^}9iY8mOj(u#Std6$#`v))ij$Ha0H0%wx5x48 zvP^8~pr9DzRiFTNCUB=~=m?A(vH_;kd=?CbXe!NT!0+*|YrdFL+MvHI^^dSU z95Y)PPX3er1g_KH-&EJS?ebZFH}A`p)U&@hLnq>2X#Rha{{mfbQx13Sc_RP-002ov JPDHLkV1lzuEJXkS literal 0 HcmV?d00001 diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js index 13d8811dd..ce0e5b596 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 229774491..7662c8e97 100644 --- a/html/js/card.js +++ b/html/js/card.js @@ -540,7 +540,7 @@ function successFill_ipopcard(req,json) * a card *@param 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...) *@see ajax_card.php diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index 5c40bc403..481364b88 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.=''; $ret.='' . '' . @@ -1794,7 +1788,7 @@ class Acc_Ledger extends jrn_def_sql $deb->javascript = ' onChange="checkTotalDirect()"'; $ret.=''; - $ret.=''; + $ret.=''; $ret.=''; diff --git a/include/class/acc_ledger_fin.class.php b/include/class/acc_ledger_fin.class.php index 451edcf6e..ed41b7fc3 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 438f8178b..7211c40c2 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 d3291f2a8..aa4de825d 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"); }
Quickcode' . $info . '
' . $quick_code->input() . $quick_code->search() . '' . $quick_code->input() . $quick_code->search() .$str_add_button. '' . $poste->input() . '' . '