From 8f5c8c63dfb7fbce04356d7c73c688d5f66e585a Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 19 Nov 2019 16:35:31 +0100 Subject: [PATCH 1/6] Fix dom and showOptionals call --- htdocs/expedition/card.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index be5ed4c757a..a33055d4b10 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2443,10 +2443,10 @@ elseif ($id || $ref) // Display lines extrafields if (is_array($extralabelslines) && count($extralabelslines)>0) { $colspan= empty($conf->productbatch->enabled) ? 5 : 6; - $line = new ExpeditionLigne($db); - $line->fetch_optionals($lines[$i]->id); - print ''; - if ($action == 'editline' && $lines[$i]->id == $line_id) + $line = $lines[$i]; + $line->fetch_optionals($line->id); + + if ($action == 'editline' && $line->id == $line_id) { print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$colspan), $indiceAsked); } @@ -2454,7 +2454,6 @@ elseif ($id || $ref) { print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bc[$var], 'colspan'=>$colspan), $indiceAsked); } - print ''; } } } From f73bd0e0a6fba4087e50e1f1548870b0068805ea Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 20 Nov 2019 13:07:26 +0100 Subject: [PATCH 2/6] FIX display job of contact list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit can see différent contact with same name but different job --- htdocs/comm/action/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 4e5abac75d3..c057dc2dee3 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1290,7 +1290,7 @@ if ($id > 0) // related contact print ''.$langs->trans("ActionOnContact").''; print '
'; - print $form->selectcontacts($object->socid, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 0, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid'); + print $form->selectcontacts($object->socid, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'quatrevingtpercent', false, 0, 0, array(), 'multiple', 'contactid'); print '
'; print ''; print ''; From 3daeb24da1ff2adf2d0c312156c41bb46254441f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Nov 2019 13:05:13 +0100 Subject: [PATCH 3/6] Fix confusion with field name in sql --- htdocs/comm/remx.php | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index eabb217fb99..7a8b03cde4e 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -739,8 +739,8 @@ if ($socid > 0) $sql.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,"; $sql.= " rc.fk_facture_source,"; $sql.= " u.login, u.rowid as user_id,"; - $sql.= " f.rowid, f.ref,"; - $sql.= " fa.ref as ref, fa.type as type"; + $sql.= " f.rowid as invoiceid, f.ref,"; + $sql.= " fa.ref as invoice_source_ref, fa.type as type"; $sql.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql.= " , ".MAIN_DB_PREFIX."user as u"; $sql.= " , ".MAIN_DB_PREFIX."facturedet as fc"; @@ -758,8 +758,8 @@ if ($socid > 0) $sql2.= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,"; $sql2.= " rc.fk_facture_source,"; $sql2.= " u.login, u.rowid as user_id,"; - $sql2.= " f.rowid, f.ref,"; - $sql2.= " fa.ref as ref, fa.type as type"; + $sql2.= " f.rowid as invoiceid, f.ref,"; + $sql2.= " fa.ref as invoice_source_ref, fa.type as type"; $sql2.= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql2.= " , ".MAIN_DB_PREFIX."user as u"; $sql2.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; @@ -833,7 +833,7 @@ if ($socid > 0) { print ''; $facturestatic->id=$obj->fk_facture_source; - $facturestatic->ref=$obj->ref; + $facturestatic->ref=$obj->invoice_source_ref; $facturestatic->type=$obj->type; print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; @@ -842,7 +842,7 @@ if ($socid > 0) { print ''; $facturestatic->id=$obj->fk_facture_source; - $facturestatic->ref=$obj->ref; + $facturestatic->ref=$obj->invoice_source_ref; $facturestatic->type=$obj->type; print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; @@ -851,7 +851,7 @@ if ($socid > 0) { print ''; $facturestatic->id=$obj->fk_facture_source; - $facturestatic->ref=$obj->ref; + $facturestatic->ref=$obj->invoice_source_ref; $facturestatic->type=$obj->type; print preg_replace('/\(EXCESS RECEIVED\)/', $langs->trans("Invoice"), $obj->description).' '.$facturestatic->getNomURl(1); print ''; @@ -862,7 +862,12 @@ if ($socid > 0) print $obj->description; print ''; } - print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + print ''; + if ($obj->invoiceid) + { + print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + } + print ''; print ''.price($obj->amount_ht).''; if (! empty($conf->multicurrency->enabled)) { @@ -909,8 +914,8 @@ if ($socid > 0) $sql.= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,"; $sql.= " rc.fk_invoice_supplier_source,"; $sql.= " u.login, u.rowid as user_id,"; - $sql.= " f.rowid, f.ref as ref,"; - $sql.= " fa.ref, fa.type as type"; + $sql.= " f.rowid as invoiceid, f.ref as ref,"; + $sql.= " fa.ref as invoice_source_ref, fa.type as type"; $sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql.= " , ".MAIN_DB_PREFIX."user as u"; $sql.= " , ".MAIN_DB_PREFIX."facture_fourn_det as fc"; @@ -928,8 +933,8 @@ if ($socid > 0) $sql2.= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,"; $sql2.= " rc.fk_invoice_supplier_source,"; $sql2.= " u.login, u.rowid as user_id,"; - $sql2.= " f.rowid, f.ref as ref,"; - $sql2.= " fa.ref, fa.type as type"; + $sql2.= " f.rowid as invoiceid, f.ref as ref,"; + $sql2.= " fa.ref as invoice_source_ref, fa.type as type"; $sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; $sql2.= " , ".MAIN_DB_PREFIX."user as u"; $sql2.= " , ".MAIN_DB_PREFIX."societe_remise_except as rc"; @@ -1003,7 +1008,7 @@ if ($socid > 0) { print ''; $facturefournstatic->id=$obj->fk_invoice_supplier_source; - $facturefournstatic->ref=$obj->ref; + $facturefournstatic->ref=$obj->invoice_source_ref; $facturefournstatic->type=$obj->type; print preg_replace('/\(CREDIT_NOTE\)/', $langs->trans("CreditNote"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; @@ -1012,7 +1017,7 @@ if ($socid > 0) { print ''; $facturefournstatic->id=$obj->fk_invoice_supplier_source; - $facturefournstatic->ref=$obj->ref; + $facturefournstatic->ref=$obj->invoice_source_ref; $facturefournstatic->type=$obj->type; print preg_replace('/\(DEPOSIT\)/', $langs->trans("InvoiceDeposit"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; @@ -1021,7 +1026,7 @@ if ($socid > 0) { print ''; $facturefournstatic->id=$obj->fk_invoice_supplier_source; - $facturefournstatic->ref=$obj->ref; + $facturefournstatic->ref=$obj->invoice_source_ref; $facturefournstatic->type=$obj->type; print preg_replace('/\(EXCESS PAID\)/', $langs->trans("Invoice"), $obj->description).' '.$facturefournstatic->getNomURl(1); print ''; @@ -1032,7 +1037,11 @@ if ($socid > 0) print $obj->description; print ''; } - print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + print ''; + if ($obj->invoiceid) { + print ''.img_object($langs->trans("ShowBill"), 'bill').' '.$obj->ref.''; + } + print ''; print ''.price($obj->amount_ht).''; if (! empty($conf->multicurrency->enabled)) { From a8d02615a843a5b9debf34d80a64a1245fe937ef Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 21 Nov 2019 14:58:20 +0100 Subject: [PATCH 4/6] FIX : we need to be able to recalculate tva only if invoice not ventil --- htdocs/fourn/facture/card.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a294cf3c6ad..f82a2aeac0b 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2642,11 +2642,14 @@ else else $calculationrule=(empty($conf->global->MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND)?'totalofround':'roundoftotal'); if ($calculationrule == 'totalofround') $calculationrulenum=1; else $calculationrulenum=2; - $s=$langs->trans("ReCalculate").' '; - $s.=''.$langs->trans("Mode1").''; - $s.=' / '; - $s.=''.$langs->trans("Mode2").''; - print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'
'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help')); + + if(empty($object->getVentilExportCompta())) { + $s=$langs->trans("ReCalculate").' '; + $s.=''.$langs->trans("Mode1").''; + $s.=' / '; + $s.=''.$langs->trans("Mode2").''; + print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc",$calculationrulenum).'
'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('','help')); + } print ''; // Amount Local Taxes From 5fdd6f698d3b550c7537d37deab1e54b69a50033 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Nov 2019 20:45:19 +0100 Subject: [PATCH 5/6] More complete error message Conflicts: htdocs/core/class/CMailFile.class.php --- htdocs/core/class/CMailFile.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index bf9b617693f..9b1a5a69525 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -752,9 +752,9 @@ class CMailFile } else { - if (empty($this->error)) $this->error=$result; - dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); - $res=false; + if (empty($this->error)) $this->error = $result; + dol_syslog("CMailFile::sendfile: mail end error with smtps lib to HOST=".$server.", PORT=".$conf->global->$keyforsmtpport."
".$this->error, LOG_ERR); + $res = false; } } } From 4043356f3a7ac51122d08d6bf23776a470cec010 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2019 14:25:32 +0100 Subject: [PATCH 6/6] Update card.php --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f82a2aeac0b..1fd48033047 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2643,7 +2643,7 @@ else if ($calculationrule == 'totalofround') $calculationrulenum=1; else $calculationrulenum=2; - if(empty($object->getVentilExportCompta())) { + if (empty($object->getVentilExportCompta())) { $s=$langs->trans("ReCalculate").' '; $s.=''.$langs->trans("Mode1").''; $s.=' / ';