From 27ace14fb7598ed1f8a8cf096bb401730b91411a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 7 Nov 2017 16:28:51 +0100 Subject: [PATCH 1/5] Fetch right account --- htdocs/compta/bank/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 1f55698d13f..54e22fbbbcb 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -656,7 +656,7 @@ else print ''; if (! empty($conf->accounting->enabled)) { $accountingaccount = new AccountingAccount($db); - $accountingaccount->fetch('',$object->account_number); + $accountingaccount->fetch('',$object->account_number, 1); print $accountingaccount->getNomUrl(0,1,1,'',1); } else { From fe3ce78ae4b546099b34ef54d51d9f93acd578f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 8 Nov 2017 11:24:33 +0100 Subject: [PATCH 2/5] Update card.php --- htdocs/accountancy/bookkeeping/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index d3252b01a18..2c574f91f8b 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -631,7 +631,7 @@ if ($action == 'create') { print "\n"; } - if ($total_debit != $total_credit) + if (price2num($total_debit) != price2num($total_credit)) { setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_credit, $total_debit)), 'warnings'); } From 1ea6df14d04def3271354575b1cd13f5cdb3ccd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 8 Nov 2017 11:35:15 +0100 Subject: [PATCH 3/5] Update card.php --- htdocs/compta/bank/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 1f55698d13f..c23c1b2f96b 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -99,7 +99,7 @@ if ($action == 'add') $object->owner_address = trim($_POST["owner_address"]); $account_number = GETPOST('account_number','alpha'); - if ($account_number <= 0) { $object->account_number = ''; } else { $object->account_number = $account_number; } + if (empty($account_number) || $account_number == '-1') { $object->account_number = ''; } else { $object->account_number = $account_number; } $fk_accountancy_journal = GETPOST('fk_accountancy_journal','int'); if ($fk_accountancy_journal <= 0) { $object->fk_accountancy_journal = ''; } else { $object->fk_accountancy_journal = $fk_accountancy_journal; } From 2636c2470b2dc0bf743ec14e577647406a23a180 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 10 Nov 2017 10:52:58 +0100 Subject: [PATCH 4/5] Fix width of payment term is to large --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 4 ++-- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 4 ++-- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 80c6e6680b2..abc4688ef5c 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -667,13 +667,13 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("PaymentConditions").':'; - $pdf->MultiCell(80, 4, $titre, 0, 'L'); + $pdf->MultiCell(43, 4, $titre, 0, 'L'); $pdf->SetFont('','', $default_font_size - 2); $pdf->SetXY($posxval, $posy); $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement); - $pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L'); + $pdf->MultiCell(67, 4, $lib_condition_paiement,0,'L'); $posy=$pdf->GetY()+3; } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 98b2367db32..bfecd773b27 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -892,13 +892,13 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("PaymentConditions").':'; - $pdf->MultiCell(80, 4, $titre, 0, 'L'); + $pdf->MultiCell(43, 4, $titre, 0, 'L'); $pdf->SetFont('','', $default_font_size - 2); $pdf->SetXY($posxval, $posy); $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement); - $pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L'); + $pdf->MultiCell(67, 4, $lib_condition_paiement,0,'L'); $posy=$pdf->GetY()+3; } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 9105a82b0d4..41e76ddbf3d 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -854,13 +854,13 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); $titre = $outputlangs->transnoentities("PaymentConditions").':'; - $pdf->MultiCell(80, 4, $titre, 0, 'L'); + $pdf->MultiCell(43, 4, $titre, 0, 'L'); $pdf->SetFont('','', $default_font_size - 2); $pdf->SetXY($posxval, $posy); $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc); $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement); - $pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L'); + $pdf->MultiCell(67, 4, $lib_condition_paiement,0,'L'); $posy=$pdf->GetY()+3; } From 22a3721ddafdb849a560f8cbbf825078aa6fc205 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 11 Nov 2017 16:10:06 +0100 Subject: [PATCH 5/5] Fix multi VAT deposit when special lines are in origin document --- htdocs/compta/facture/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a613581f5aa..f438a5ab6b9 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1075,6 +1075,7 @@ if (empty($reshook)) $TTotalByTva = array(); foreach ($srcobject->lines as &$line) { + if(! empty($line->special_code)) continue; $TTotalByTva[$line->tva_tx] += $line->total_ttc ; }