From b4b185abe02b8e15216d60386792e1695cf15b4b Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Fri, 23 Feb 2018 14:42:52 +0100 Subject: [PATCH 1/8] fix bad link invoice URL into acoutantcy customer affectation --- htdocs/accountancy/customer/lines.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 9012257adee2d..7deee19d87303 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -152,7 +152,7 @@ /* * Customer Invoice lines */ -$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,"; +$sql = "SELECT f.rowid as factid, f.facnumber, f.type, f.datef, f.ref_client,"; $sql .= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,"; $sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,"; @@ -302,7 +302,7 @@ $codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte; $facture_static->ref = $objp->facnumber; - $facture_static->id = $objp->rowid; + $facture_static->id = $objp->factid; $product_static->ref = $objp->product_ref; $product_static->id = $objp->product_id; From 8b9e1964781436ff10e8f967138d7ec5fecd8251 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2018 19:37:29 +0100 Subject: [PATCH 2/8] Fix trans --- htdocs/cron/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index ca21a40635a99..ba28d019958bf 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -355,7 +355,7 @@ print ''; if (! empty($obj->label)) { - $object->ref = $obj->label; + $object->ref = $langs->trans($obj->label); print $object->getNomUrl(0, '', 1); $object->ref = $obj->rowid; } From ee488ed83ea7cc0d2b5cbd23bbd04bc0c936adbc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2018 20:23:55 +0100 Subject: [PATCH 3/8] FIX invoice creation fails when next date not defined --- htdocs/compta/facture/class/facture-rec.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 1636be2aace88..aeed921d136cf 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1009,7 +1009,7 @@ function createRecurringInvoices() $facture->type = self::TYPE_STANDARD; $facture->brouillon = 1; - $facture->date = $facturerec->date_when; // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. + $facture->date = (empty($facturerec->date_when)?$now:$facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. $facture->socid = $facturerec->socid; $invoiceidgenerated = $facture->create($user); From ee4fcba4f29970a92148e0c2ce46089267f58d61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2018 22:11:11 +0100 Subject: [PATCH 4/8] Fix class not found --- htdocs/accountancy/bookkeeping/balance.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 50f9e18fd8009..76e2a0b8e20f9 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -28,7 +28,9 @@ // Class require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; +require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; From be3e8a0e2d3359291c5b8c558dc9daa07e127396 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Mar 2018 11:51:13 +0100 Subject: [PATCH 5/8] FIX Look and feel v7 --- .../cheque/class/remisecheque.class.php | 53 +++++++++++++++---- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 3458e6bc82a82..528b01477a6e4 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -979,25 +979,56 @@ function initAsSpecimen($option='') } /** - * Return clicable name (with picto eventually) + * Return clicable name (with picto eventually) * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param string $option Sur quoi pointe le lien - * @return string Chaine avec URL + * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param string $option Sur quoi pointe le lien + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string Chaine avec URL */ - function getNomUrl($withpicto=0,$option='') + function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1) { - global $langs; + global $conf, $langs; $result=''; - $label = $langs->trans("ShowCheckReceipt").': '.$this->ref; - $link = ''; + $label = ''.$langs->trans("ShowCheckReceipt").''; + $label.= '
'; + $label.= '' . $langs->trans('Ref') . ': ' . $this->ref; + + $url = DOL_URL_ROOT.'/compta/paiement/cheque/card.php?id='.$this->id; + + if ($option != 'nolink') + { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + } + + $linkclose=''; + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowCheckReceipt"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + } + else $linkclose = ($morecss?' class="'.$morecss.'"':''); + + $linkstart = '
'; $linkend=''; - if ($withpicto) $result.=($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend); - if ($withpicto && $withpicto != 2) $result.=' '; - if ($withpicto != 2) $result.=$link.$this->ref.$linkend; + $result .= $linkstart; + if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); + if ($withpicto != 2) $result.= $this->ref; + $result .= $linkend; return $result; } From bc04b3ee2710e0079aeedb2d41a9d1012ebd3932 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Mar 2018 02:53:47 +0100 Subject: [PATCH 6/8] Fix min decimal on amount in payment page --- htdocs/compta/paiement/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 3ec17c2521d51..6179fb9ac22cb 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -236,7 +236,7 @@ print ''; // Amount -print ''.$langs->trans('Amount').''.price($object->montant,'',$langs,0,0,-1,$conf->currency).''; +print ''.$langs->trans('Amount').''.price($object->amount,'',$langs,0,-1,-1,$conf->currency).''; // Note print ''.$form->editfieldkey("Note",'note',$object->note,$object,$user->rights->facture->paiement).''; From d25270a6f47a5a89941abd373f5657b3cd9d0dad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 Mar 2018 02:49:44 +0100 Subject: [PATCH 7/8] Fix ref not visible in payment link --- htdocs/compta/paiement/class/paiement.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 95c366dff0de3..42106c1cb13b2 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -1089,7 +1089,7 @@ function getNomUrl($withpicto=0, $option='', $mode='withlistofinvoices', $notool $result .= $linkstart; if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); - if ($withpicto && $withpicto != 2) $result.= $this->ref; + if ($withpicto && $withpicto != 2) $result.= ($this->ref?$this->ref:$this->id); $result .= $linkend; return $result; From 0e7a250060660e707949745d57e06a1454207403 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 28 Feb 2018 15:29:52 +0100 Subject: [PATCH 8/8] Fix colspan --- htdocs/product/composition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index a6cc3427243a4..8a62533a37030 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -473,7 +473,7 @@ } else { - $colspan=6; + $colspan=8; if (! empty($conf->stock->enabled)) $colspan++; print '';