From e470d138582244e924675021091baa7de73a6f5b Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 21 Dec 2011 21:30:09 +0000 Subject: [PATCH] fix cosmetic bug : --- html/ajax_card.php | 2 +- html/fid.php | 2 +- html/js/card.js | 2 +- include/class_acc_ledger_purchase.php | 2 +- include/class_acc_ledger_sold.php | 2 +- include/class_document.php | 25 +++++++++++++------------ include/class_fiche.php | 2 +- include/class_print_ledger_detail.php | 11 ++++++----- include/template/detail-action.php | 2 +- include/template/ledger_detail_fin.php | 10 +++++----- 10 files changed, 31 insertions(+), 29 deletions(-) diff --git a/html/ajax_card.php b/html/ajax_card.php index 88e830b8f..a3de53a72 100644 --- a/html/ajax_card.php +++ b/html/ajax_card.php @@ -234,7 +234,7 @@ case 'st': /* we filter thanks a given model of card */ if ( isset($cat)) { - $sql=$sql.sprintf(' where frd_id = '.sql_string ($cat)); + $sql=$sql.sprintf(' where frd_id in ('.sql_string ($cat).')'); } else /* we filter thanks a given list of category of card diff --git a/html/fid.php b/html/fid.php index 87d2bba35..9712b5357 100644 --- a/html/fid.php +++ b/html/fid.php @@ -135,7 +135,7 @@ if ( isset($_SESSION['isValid']) && $_SESSION['isValid'] == 1) /* store the answer in an array and transform it later into a JSON object */ $tmp=array(); $tmp[]=array('flabel',$fLabel); - $tmp[]=array('name',h($name)); + $tmp[]=array('name',$name); $tmp[]=array('ftva_id',$fTva_id); $tmp[]=array('tva_id',$tva_id); $tmp[]=array('fPrice_sale',$fPrice_sale); diff --git a/html/js/card.js b/html/js/card.js index fe98a155d..a04e1b66b 100644 --- a/html/js/card.js +++ b/html/js/card.js @@ -409,7 +409,7 @@ function select_card_type(obj) sx=document.body.scrollTop+60; } - var str_style="top:"+sx+";left:25%;width:50%;height:auto"; + var str_style="top:"+sx+";left:25%;width:50%;height:30%"; var popup={'id': content,'cssclass':'inner_box','style':str_style,'html':loading(),'drag':true}; diff --git a/include/class_acc_ledger_purchase.php b/include/class_acc_ledger_purchase.php index 581b73d05..37a54f4f2 100644 --- a/include/class_acc_ledger_purchase.php +++ b/include/class_acc_ledger_purchase.php @@ -1089,7 +1089,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger $march_label=(isset(${"e_march".$i."_label"}))?${"e_march".$i."_label"}:""; // retrieve the tva label and name //-- - if ( strlen(trim($march))!=0 ) + if ( strlen(trim($march))!=0 && strlen(trim($march_label))==0 ) { $fMarch=new Fiche($this->db); $fMarch->get_by_qcode($march); diff --git a/include/class_acc_ledger_sold.php b/include/class_acc_ledger_sold.php index 9d8e3a68b..d92ad3578 100644 --- a/include/class_acc_ledger_sold.php +++ b/include/class_acc_ledger_sold.php @@ -1198,7 +1198,7 @@ class Acc_Ledger_Sold extends Acc_Ledger // retrieve the tva label and name //-- - if ( strlen(trim($march))!=0 ) + if ( strlen(trim($march))!=0 && strlen(trim($march_label))==0) { $fMarch=new Fiche($this->db); $fMarch->get_by_qcode($march); diff --git a/include/class_document.php b/include/class_document.php index adac1c82f..463a6ed48 100644 --- a/include/class_document.php +++ b/include/class_document.php @@ -66,7 +66,7 @@ class Document /*! * \brief Generate the document, Call $this-\>Replace to replace * tag by value - * + * * * \return an array : the url where the generated doc can be found, the name * of the file and his mimetype @@ -108,7 +108,7 @@ class Document $zip->extractTo($dirname.DIRECTORY_SEPARATOR); $zip->close(); } else { - echo __FILE__.":".__LINE__."cannot unzip model ".$filename; + echo __FILE__.":".__LINE__."cannot unzip model ".$filename; } // Remove the file we do not need anymore @@ -154,7 +154,7 @@ class Document /*! ParseDocument * \brief This function parse a document and replace all - * the predefined tags by a value. This functions + * the predefined tags by a value. This functions * generate diffent documents (invoice, order, letter) * with the info from the database * @@ -169,7 +169,7 @@ class Document * - MY_* table parameter * - ART_VEN* table quant_sold for invoice * - CUST_* table quant_sold and fiche for invoice - * - e_* for the invoice in the $_POST + * - e_* for the invoice in the $_POST */ // open the document $infile_name=$p_dir.DIRECTORY_SEPARATOR.$p_file; @@ -223,7 +223,7 @@ class Document while ( preg_match_all ($regex,$buffer,$f) >0 ) { - + foreach ( $f as $apattern ) { @@ -276,7 +276,7 @@ class Document /*! SaveGenerated * \brief Save the generated Document * \param $p_file is the generated file - * + * * * \return 0 if no error otherwise 1 */ @@ -307,7 +307,7 @@ class Document return 0; } /*! Upload - * \brief Upload a file into document + * \brief Upload a file into document * all the needed data are in $_FILES we don't increment the seq * \param $p_file : array containing by default $_FILES * @@ -447,7 +447,7 @@ class Document } /*! * \brief replace the TAG by the real value, this value can be into - * the database or in $_POST + * the database or in $_POST * The possible tags are * - [CUST_NAME] customer's name * - [CUST_ADDR_1] customer's address line 1 @@ -456,7 +456,7 @@ class Document * - [CUST_CITY] customer's city * - [CUST_VAT] customer's VAT * - [MARCH_NEXT] end this item and increment the counter $i - * - [DATE_LIMIT] + * - [DATE_LIMIT] * - [VEN_ART_NAME] * - [VEN_ART_PRICE] * - [VEN_ART_QUANT] @@ -804,13 +804,13 @@ class Document extract ($_POST); $id='e_march'.$counter."_label"; // check if the march exists - + if (! isset (${$id}) || (isset (${$id}) && strlen(trim(${$id})) == 0)) { $id = 'e_march' . $counter; // check if the march exists if (!isset(${$id})) - return ""; + $r= ""; // check that something is sold if (${'e_march' . $counter . '_price'} != 0 && ${'e_quant' . $counter} != 0) { @@ -818,10 +818,11 @@ class Document $f->get_by_qcode(${$id}, false); $r = $f->strAttribut(ATTR_DEF_NAME); } + else + $r=""; } else $r=${'e_march'.$counter.'_label'}; - return $r; break; case 'VEN_ART_PRICE': diff --git a/include/class_fiche.php b/include/class_fiche.php index 22b176cdd..be3715657 100644 --- a/include/class_fiche.php +++ b/include/class_fiche.php @@ -758,7 +758,7 @@ class Fiche try { - if (isNumber($v) == 1 || strpos($v,',') != 0) + if ( strlen(trim($v)) != 0) { $parameter=array($this->id,$v); } diff --git a/include/class_print_ledger_detail.php b/include/class_print_ledger_detail.php index 48fcf3f3c..501b5f8fa 100644 --- a/include/class_print_ledger_detail.php +++ b/include/class_print_ledger_detail.php @@ -81,10 +81,10 @@ class Print_Ledger_Detail extends PDF $this->SetFont('DejaVu','BI',7); $this->Cell(215,7,'report Débit',0,0,'R'); - $this->Cell(30,7,sprintf('%10.2f',$rap_deb),0,0,'R'); + $this->Cell(30,7,nbm($rap_deb),0,0,'R'); $this->Ln(4); $this->Cell(215,7,'report Crédit',0,0,'R'); - $this->Cell(30,7,sprintf('%10.2f',$rap_cred),0,0,'R'); + $this->Cell(30,7,nbm($rap_cred),0,0,'R'); $this->Ln(4); // print all operation @@ -101,7 +101,8 @@ class Print_Ledger_Detail extends PDF $this->Ln(4); // get the entries - $aEntry=$this->cn->get_array("select j_id,j_poste,j_qcode,j_montant,j_debit, ". + $aEntry=$this->cn->get_array("select j_id,j_poste,j_qcode,j_montant,j_debit, j_text,". + " case when j_text='' or j_text is null then pcm_lib else j_text end as desc,". " pcm_lib ". " from jrnx join tmp_pcmn on (j_poste=pcm_val) where j_grpt = $1". " order by j_debit desc,j_id", @@ -115,7 +116,7 @@ class Print_Ledger_Detail extends PDF $this->Cell(23,6,$entry['j_poste'],0,0,'R'); // if j_qcode is not empty retrieve name - if ( $entry['j_qcode'] != '') + if ( $entry['j_text'] =='' && $entry['j_qcode'] != '') { $f_id=$this->cn->get_value('select f_id from vw_poste_qcode where j_qcode=$1',array($entry['j_qcode'])); if ($f_id != '') @@ -125,7 +126,7 @@ class Print_Ledger_Detail extends PDF $name=$entry['pcm_lib']; } else - $name=$entry['pcm_lib']; + $name=$entry['desc']; $this->Cell(150,6,$name,0,0,'L'); // print amount diff --git a/include/template/detail-action.php b/include/template/detail-action.php index 5ab4f0817..531a57130 100644 --- a/include/template/detail-action.php +++ b/include/template/detail-action.php @@ -210,7 +210,7 @@ function toggleShowDetail() {
- +

0.0 diff --git a/include/template/ledger_detail_fin.php b/include/template/ledger_detail_fin.php index 86828e7d0..31827b940 100644 --- a/include/template/ledger_detail_fin.php +++ b/include/template/ledger_detail_fin.php @@ -27,9 +27,9 @@ $date->value=format_date($obj->det->jr_date); det->array[0]['qf_bank']); -$view_history= sprintf('%s', +$view_history= sprintf('%s', $bk->id, $gDossier, $bk->get_quick_code()); -echo td(h($bk->getName())).td($view_history);; +echo td('Compte en banque').td(h($bk->getName())).td($view_history);; ?> @@ -37,9 +37,9 @@ echo td(h($bk->getName())).td($view_history);; det->array[0]['qf_other']); -$view_history= sprintf('%s', +$view_history= sprintf('%s', $bk->id, $gDossier, $bk->get_quick_code()); -echo td(h($bk->getName())); +echo td('Tiers').td(h($bk->getName())); echo td($view_history); ?> @@ -49,7 +49,7 @@ echo td($view_history); $itext=new IText('lib'); $itext->value=strip_tags($obj->det->jr_comment); $itext->size=40; - echo td(_('Libellé')).td($itext->input()); + echo td(_('Libellé')).td($itext->input(),' colspan="2" style="width:auto"'); ?>