From 25fa2254c135f1212247386005effa65764af64c Mon Sep 17 00:00:00 2001 From: fhenry Date: Thu, 7 Mar 2013 10:50:02 +0100 Subject: [PATCH 01/11] Fix [ bug #753 ] cashdesk : Error message when adding product to basket https://doliforge.org/tracker/?func=detail&aid=753&group_id=144 http://www.dolibarr.fr/forum/526-autres-modules/39315-probleme-avec-point-de-vente http://www.dolibarr.es/index.php/foro/6-icomo/2080-errores-con-tpv-y-tipos-de-iva --- htdocs/cashdesk/class/Facturation.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index 32fa03ad48e..3538a3908d1 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -118,7 +118,7 @@ class Facturation } // Define part of HT, VAT, TTC - $resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',$product->type); + $resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',$product->type,0); // Calcul du total ht sans remise $total_ht = $resultarray[0]; From a0803e758ecebf79f4e336b6269d846214c51199 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2013 11:25:14 +0100 Subject: [PATCH 02/11] Fix: Missing generic translation --- htdocs/langs/en_US/main.lang | 2 ++ htdocs/langs/fr_FR/main.lang | 2 ++ 2 files changed, 4 insertions(+) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index ce12e10119d..c958ed0d56b 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -300,6 +300,8 @@ TotalHT=Total (net of tax) TotalTTC=Total (inc. tax) TotalTTCToYourCredit=Total (inc. tax) to your credit TotalVAT=Total tax +TotalLT1=Total tax 2 +TotalLT2=Total tax 3 TotalLT1ES=Total RE TotalLT2ES=Total IRPF IncludedVAT=Included tax diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index c6a9933aa65..7c54726118c 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -302,6 +302,8 @@ TotalHT=Total HT TotalTTC=Total TTC TotalTTCToYourCredit=Total TTC à votre crédit TotalVAT=Total TVA +TotalLT1=Total Taxe 2 +TotalLT2=Total Taxe 3 TotalLT1ES=Total RE TotalLT2ES=Total IRPF IncludedVAT=Dont TVA From 0c8d3336c22df468c9faff977386f57cb24313de Mon Sep 17 00:00:00 2001 From: simnandez Date: Thu, 7 Mar 2013 18:41:56 +0100 Subject: [PATCH 03/11] [ task #707 ] Create option ProfIdx are mandatory to validate a invoice --- htdocs/compta/facture.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 7766cfeb862..7585b71cf68 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -372,7 +372,8 @@ else if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->factu { $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_INVOICE_MANDATORY'; - if (! $object->thirdparty->idprof.$i && ! empty($conf->global->$idprof_mandatory)) + $idprof='idprof'.$i; + if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory)) { if (! $error) $langs->load("errors"); $error++; From 668249a1956571a64516aff2f5e01d78c7f6ecb2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2013 18:44:25 +0100 Subject: [PATCH 04/11] Fix: We must refresh object also if option MAIN_DISABLE_PDF_AUTOUPDATE is 1 (Cyril ZEKSER) --- htdocs/commande/fiche.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 77b8f5956c5..5b80bfadf9e 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -725,6 +725,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) if ($result > 0) { + $ret=$object->fetch($object->id); // Reload to get new records + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language @@ -737,7 +739,6 @@ else if ($action == 'addline' && $user->rights->commande->creer) $outputlangs->setDefaultLang($newlang); } - $ret=$object->fetch($object->id); // Reload to get new records commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } From e97ca67c4a75e9371afc793e3f04ca18301f6fa7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2013 19:13:50 +0100 Subject: [PATCH 05/11] Fix: Several problem with localtax into PDF generation Conflicts: htdocs/core/modules/commande/doc/pdf_einstein.modules.php htdocs/core/modules/facture/doc/pdf_crabe.modules.php htdocs/core/modules/propale/doc/pdf_azur.modules.php htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php --- .../commande/doc/pdf_einstein.modules.php | 50 +++++++++---------- .../modules/facture/doc/pdf_crabe.modules.php | 50 +++++++++---------- .../modules/propale/doc/pdf_azur.modules.php | 50 +++++++++---------- .../pdf/pdf_canelle.modules.php | 28 +++++------ .../pdf/pdf_muscadet.modules.php | 28 +++++------ 5 files changed, 100 insertions(+), 106 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index d0d8840730d..ffb2b7fc1be 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -720,12 +720,11 @@ class pdf_einstein extends ModelePDFCommandes else { //Local tax 1 before VAT - if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //{ foreach( $this->localtax1 as $localtax_type => $localtax_rate ) { - // TODO: Place into a function to control showing by country or study better option - if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue; + if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; foreach( $localtax_rate as $tvakey => $tvaval ) { if ($tvakey!=0) // On affiche pas taux 0 @@ -741,8 +740,8 @@ class pdf_einstein extends ModelePDFCommandes $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -750,14 +749,13 @@ class pdf_einstein extends ModelePDFCommandes } } } - } + //} //Local tax 2 before VAT - if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //{ foreach( $this->localtax2 as $localtax_type => $localtax_rate ) { - // TODO: Place into a function to control showing by country or study better option - if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue; + if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; foreach( $localtax_rate as $tvakey => $tvaval ) { if ($tvakey!=0) // On affiche pas taux 0 @@ -775,8 +773,8 @@ class pdf_einstein extends ModelePDFCommandes $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -785,7 +783,7 @@ class pdf_einstein extends ModelePDFCommandes } } } - } + //} // VAT foreach($this->tva as $tvakey => $tvaval) { @@ -812,15 +810,15 @@ class pdf_einstein extends ModelePDFCommandes } //Local tax 1 after VAT - if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //{ foreach( $this->localtax1 as $localtax_type => $localtax_rate ) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; foreach( $localtax_rate as $tvakey => $tvaval ) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey != 0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -833,7 +831,7 @@ class pdf_einstein extends ModelePDFCommandes $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; if ($localtax_type == '7') { // amount on order $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -842,7 +840,7 @@ class pdf_einstein extends ModelePDFCommandes } else { - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); @@ -850,17 +848,17 @@ class pdf_einstein extends ModelePDFCommandes } } } - } + //} //Local tax 2 after VAT - if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //{ foreach( $this->localtax2 as $localtax_type => $localtax_rate ) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; foreach( $localtax_rate as $tvakey => $tvaval ) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey != 0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -873,7 +871,7 @@ class pdf_einstein extends ModelePDFCommandes $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; if ($localtax_type == '7') { // amount on order $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -882,7 +880,7 @@ class pdf_einstein extends ModelePDFCommandes } else { - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -891,7 +889,7 @@ class pdf_einstein extends ModelePDFCommandes } } } - } + //} // Total TTC $index++; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index e12a4984104..7b46fe6e5a5 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -850,12 +850,11 @@ class pdf_crabe extends ModelePDFFactures else { //Local tax 1 before VAT - if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //{ foreach( $this->localtax1 as $localtax_type => $localtax_rate ) { - // TODO: Place into a function to control showing by country or study better option - if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue; + if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; foreach( $localtax_rate as $tvakey => $tvaval ) { @@ -872,8 +871,8 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -881,14 +880,13 @@ class pdf_crabe extends ModelePDFFactures } } } - } + //} //Local tax 2 before VAT - if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //{ foreach( $this->localtax2 as $localtax_type => $localtax_rate ) { - // TODO: Place into a function to control showing by country or study better option - if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue; + if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; foreach( $localtax_rate as $tvakey => $tvaval ) { @@ -907,8 +905,8 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -917,7 +915,7 @@ class pdf_crabe extends ModelePDFFactures } } } - } + //} // VAT foreach($this->tva as $tvakey => $tvaval) { @@ -944,15 +942,15 @@ class pdf_crabe extends ModelePDFFactures } //Local tax 1 after VAT - if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //{ foreach( $this->localtax1 as $localtax_type => $localtax_rate ) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; foreach( $localtax_rate as $tvakey => $tvaval ) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey != 0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -965,7 +963,7 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; if ($localtax_type == '7') { // amount on order $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -974,7 +972,7 @@ class pdf_crabe extends ModelePDFFactures } else { - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); @@ -982,10 +980,10 @@ class pdf_crabe extends ModelePDFFactures } } } - } + //} //Local tax 2 after VAT - if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //{ foreach( $this->localtax2 as $localtax_type => $localtax_rate ) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; @@ -993,7 +991,7 @@ class pdf_crabe extends ModelePDFFactures foreach( $localtax_rate as $tvakey => $tvaval ) { // retrieve global local tax - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey != 0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -1006,7 +1004,7 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; if ($localtax_type == '7') { // amount on order $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1015,7 +1013,7 @@ class pdf_crabe extends ModelePDFFactures } else { - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -1023,7 +1021,7 @@ class pdf_crabe extends ModelePDFFactures } } } - } + //} } // Total TTC diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 3a76d61f7f3..6c481063086 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -753,12 +753,11 @@ class pdf_azur extends ModelePDFPropales else { //Local tax 1 before VAT - if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //{ foreach( $this->localtax1 as $localtax_type => $localtax_rate ) { - // TODO: Place into a function to control showing by country or study better option - if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue; + if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; foreach( $localtax_rate as $tvakey => $tvaval ) { @@ -775,8 +774,8 @@ class pdf_azur extends ModelePDFPropales $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -784,14 +783,13 @@ class pdf_azur extends ModelePDFPropales } } } - } + //} //Local tax 2 before VAT - if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //{ foreach( $this->localtax2 as $localtax_type => $localtax_rate ) { - // TODO: Place into a function to control showing by country or study better option - if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue; + if (in_array((string) $localtax_type, array('1','3','5','7'))) continue; foreach( $localtax_rate as $tvakey => $tvaval ) { @@ -810,8 +808,8 @@ class pdf_azur extends ModelePDFPropales $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat = $outputlangs->transcountrynoentities("TotalLT2".$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -820,7 +818,7 @@ class pdf_azur extends ModelePDFPropales } } } - } + //} // VAT foreach($this->tva as $tvakey => $tvaval) { @@ -847,15 +845,15 @@ class pdf_azur extends ModelePDFPropales } //Local tax 1 after VAT - if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //{ foreach( $this->localtax1 as $localtax_type => $localtax_rate ) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; foreach( $localtax_rate as $tvakey => $tvaval ) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey != 0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -868,7 +866,7 @@ class pdf_azur extends ModelePDFPropales $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; if ($localtax_type == '7') { // amount on order $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -877,7 +875,7 @@ class pdf_azur extends ModelePDFPropales } else { - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); @@ -885,17 +883,17 @@ class pdf_azur extends ModelePDFPropales } } } - } + //} //Local tax 2 after VAT - if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //{ foreach( $this->localtax2 as $localtax_type => $localtax_rate ) { if (in_array((string) $localtax_type, array('2','4','6'))) continue; foreach( $localtax_rate as $tvakey => $tvaval ) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey != 0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -908,7 +906,7 @@ class pdf_azur extends ModelePDFPropales $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; if ($localtax_type == '7') { // amount on order $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -917,7 +915,7 @@ class pdf_azur extends ModelePDFPropales } else { - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); @@ -926,7 +924,7 @@ class pdf_azur extends ModelePDFPropales } } } - } + //} // Total TTC $index++; diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 0813162020d..5e857abf6b0 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -529,7 +529,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), 0, 'R', 1); } @@ -539,19 +539,19 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), 0, 'R', 1); } } else { - if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //{ //Local tax 1 foreach( $this->localtax1 as $tvakey => $tvaval ) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey != 0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -564,22 +564,22 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat =$outputlangs->transnoentities("TotalLT1",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); } } - } + //} - if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //{ //Local tax 2 foreach( $this->localtax2 as $tvakey => $tvaval ) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey != 0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -592,15 +592,15 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat =$outputlangs->transnoentities("TotalLT2",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); } } - } + //} } $useborder=0; diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 3074e73d19a..4141190f451 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -697,7 +697,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1); } @@ -707,19 +707,19 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); } } else { - if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') + //{ //Local tax 1 foreach( $this->localtax1 as $tvakey => $tvaval ) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey != 0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -732,22 +732,22 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat =$outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); } } - } + //} - if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - { + //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') + //{ //Local tax 2 foreach( $this->localtax2 as $tvakey => $tvaval ) { - if ($tvakey>0) // On affiche pas taux 0 + if ($tvakey != 0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; @@ -760,15 +760,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; - $totalvat.=vatrate($tvakey,1).$tvacompl; + $totalvat =$outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' '; + $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); } } - } + //} } // Total TTC From 6cac84b222c9d0bef4a38319d287bf952d9f026d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2013 22:39:57 +0100 Subject: [PATCH 06/11] Fix: Some fixes into reconciliate page --- htdocs/compta/bank/rappro.php | 51 +++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/htdocs/compta/bank/rappro.php b/htdocs/compta/bank/rappro.php index ce4ff8102e9..2463c768098 100644 --- a/htdocs/compta/bank/rappro.php +++ b/htdocs/compta/bank/rappro.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2010 Juanjo Menent * * This program is free software; you can redistribute it and/or modify @@ -47,6 +47,8 @@ $id=GETPOST('account', 'int'); // Conciliation if ($action == 'rappro' && $user->rights->banque->consolidate) { + $error=0; + // Definition, nettoyage parametres $num_releve=trim($_POST["num_releve"]); @@ -54,25 +56,37 @@ if ($action == 'rappro' && $user->rights->banque->consolidate) { $bankline=new AccountLine($db); - if (isset($_POST["rowid"]) && is_array($_POST["rowid"])) + if (isset($_POST['rowid']) && is_array($_POST['rowid'])) { - foreach($_POST["rowid"] as $row) + foreach($_POST['rowid'] as $row) { if($row > 0) { $result=$bankline->fetch($row); $bankline->num_releve=$num_releve; //$_POST["num_releve"]; $result=$bankline->update_conciliation($user,$_POST["cat"]); - if ($result < 0) $mesg.=$bankline->error; + if ($result < 0) + { + $mesg.=$bankline->error; + $error++; + break; + } } } } } else { + $error++; $langs->load("errors"); $mesg='
'.$langs->trans("ErrorPleaseTypeBankTransactionReportName").'
'; } + + if (! $error) + { + header('Location: '.DOL_URL_ROOT.'/compta/bank/rappro?account='.$id); // To avoid to submit twice and allow back + exit; + } } /* @@ -80,12 +94,12 @@ if ($action == 'rappro' && $user->rights->banque->consolidate) */ if ($action == 'del') { - $accline=new AccountLine($db); - $accline->fetch($_GET["rowid"]); - $result=$accline->delete(); + $bankline=new AccountLine($db); + $bankline->fetch($_GET["rowid"]); + $result=$bankline->delete($user); if ($result < 0) { - dol_print_error($db,$accline->error); + dol_print_error($db,$bankline->error); } } @@ -200,7 +214,7 @@ if ($resql) } - print '
'; + print ''; print ''; print ""; print "id."\">"; @@ -212,8 +226,7 @@ if ($resql) { print $langs->trans("EventualyAddCategory").':
'; } - print $langs->trans("ThenCheckLinesAndConciliate").' '; - print "trans("Conciliate")."\">
"; + print '
'.$langs->trans("ThenCheckLinesAndConciliate").' "'.$langs->trans("Conciliate").'"
'; print '
'; @@ -230,7 +243,6 @@ if ($resql) print "\n"; - $i = 0; while ($i < $num) { @@ -265,7 +277,7 @@ if ($resql) print ''; } - // Number + // Type + Number $label=($langs->trans("PaymentType".$objp->type)!="PaymentType".$objp->type)?$langs->trans("PaymentType".$objp->type):$objp->type; // $objp->type is a code if ($label=='SOLD') $label=''; print ''.$label.($objp->num_chq?' '.$objp->num_chq:'').''; @@ -400,12 +412,12 @@ if ($resql) } - // Affiche zone saisie releve + bouton "Rapprocher" + // Show checkbox for conciliation if ($db->jdate($objp->do) <= $now) { print ''; - print ''; + print 'rowid])?' checked="checked"':'').'>'; // print ''; // print '   '; // print "trans("Conciliate")."\">"; @@ -429,13 +441,12 @@ if ($resql) } $db->free($resql); + print "
\n"; - print "
\n"; + print '

'; + + print "\n"; - if ($num != 0) - { - print "
\n"; - } } else { From b43fffafa91c05bc54f24b8f0002e7de02ba7c43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2013 01:31:45 +0100 Subject: [PATCH 07/11] Fix: Regression after renaming of fields --- htdocs/public/members/new.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 078994e3f9a..d6de1fecf92 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -1,9 +1,9 @@ * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2006-2011 Laurent Destailleur + * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2012 J. Fernando Lagrange * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -182,7 +182,7 @@ if ($action == 'add') $error+=1; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv('Nature'))."
\n"; } - if (empty($_POST["nom"])) + if (empty($_POST["lastname"])) { $error+=1; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Lastname"))."
\n"; From 44698fcde034cf7579af079f45a86ad3b42ea6a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2013 01:50:16 +0100 Subject: [PATCH 08/11] Fix: dol_is_dir may not be loaded, so call fails --- htdocs/core/class/translate.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index fe6d26f6a13..9c492c9aaff 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -621,7 +621,7 @@ class Translate $newdir=dol_osencode($dir); // Check if directory exists - if (! dol_is_dir($dir)) continue; + if (! is_dir($newdir)) continue; // We must not use dol_is_dir here, function may not be loaded $fonc='numberwords'; if (file_exists($newdir.'/functions_'.$fonc.'.lib.php')) @@ -691,4 +691,4 @@ class Translate } -?> \ No newline at end of file +?> From 1e5c56642cab61fad1ef9d318df2be18ad48cbaa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2013 02:49:42 +0100 Subject: [PATCH 09/11] Fix: Some regression after renaming state and lastname. --- htdocs/contact/fiche.php | 6 +++--- htdocs/core/boxes/box_contacts.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index ac8ab1d2e58..3cd480a1ef0 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -140,7 +140,7 @@ if (empty($reshook)) $object->zip = $_POST["zipcode"]; $object->town = $_POST["town"]; $object->country_id = $_POST["country_id"]; - $object->state_id = $_POST["departement_id"]; + $object->state_id = $_POST["state_id"]; $object->email = $_POST["email"]; $object->phone_pro = $_POST["phone_pro"]; $object->phone_perso = $_POST["phone_perso"]; @@ -239,7 +239,7 @@ if (empty($reshook)) $object->address = $_POST["address"]; $object->zip = $_POST["zipcode"]; $object->town = $_POST["town"]; - $object->state_id = $_POST["departement_id"]; + $object->state_id = $_POST["state_id"]; $object->country_id = $_POST["country_id"]; $object->email = $_POST["email"]; @@ -889,7 +889,7 @@ else print ''.$langs->trans("Country").''; $img=picto_from_langcode($object->country_code); if ($img) print $img.' '; - print $object->country_id; + print $object->country; print ''; // State diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index 08202a597ec..a81695ca900 100755 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -87,7 +87,7 @@ class box_contacts extends ModeleBoxes $datec=$db->jdate($objp->datec); $datem=$db->jdate($objp->tms); - $contactstatic->name=$objp->name; + $contactstatic->lastname=$objp->lastname; $contactstatic->firstname=$objp->firstname; $contactstatic->civilite_id=$objp->civilite; From f041a8a95e592221dbe93aedfc9a4848020245e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2013 10:06:23 +0100 Subject: [PATCH 10/11] Fix: Regression for negative proposal lines. --- htdocs/comm/propal.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 6eefcf27155..75761ce93bf 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -635,7 +635,7 @@ else if ($action == "addline" && $user->rights->propal->creer) setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); $error++; } - if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' + if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht != 0) || $price_ht == '')) // Unit price can be 0 but not ''. Also price can be negative for proposal. { setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); $error++; @@ -646,7 +646,7 @@ else if ($action == "addline" && $user->rights->propal->creer) $error++; } - if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod))) + if (! $error && (GETPOST('qty') != 0) && (! empty($product_desc) || ! empty($idprod))) // Price can be negative for proposal. { $pu_ht=0; $pu_ttc=0; @@ -1191,7 +1191,7 @@ if ($action == 'create') } print ''; - + // Reference print ''; From ffa2c2fb583c7a1e042d2e4ac5a9e21c07bf2e3f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Mar 2013 10:22:30 +0100 Subject: [PATCH 11/11] Oops, bad fix --- htdocs/comm/propal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 75761ce93bf..9b75519236e 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -646,7 +646,7 @@ else if ($action == "addline" && $user->rights->propal->creer) $error++; } - if (! $error && (GETPOST('qty') != 0) && (! empty($product_desc) || ! empty($idprod))) // Price can be negative for proposal. + if (! $error && (GETPOST('qty') >= 0) && (! empty($product_desc) || ! empty($idprod))) { $pu_ht=0; $pu_ttc=0;
'.$langs->trans('Ref').''.$langs->trans("Draft").'