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]; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 6eefcf27155..9b75519236e 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++; @@ -1191,7 +1191,7 @@ if ($action == 'create') } print ''; - + // Reference print ''; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index f68710ec740..0fe21564346 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -730,6 +730,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 @@ -742,7 +744,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); } 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 '
'; @@ -400,12 +412,12 @@ if ($resql) } - // Affiche zone saisie releve + bouton "Rapprocher" + // Show checkbox for conciliation if ($db->jdate($objp->do) <= $now) { print '
'.$langs->trans('Ref').''.$langs->trans("Draft").'
'.$label.($objp->num_chq?' '.$objp->num_chq:'').''; - 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 { 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++; 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; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 2110b68d388..f863d1c925d 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -622,7 +622,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')) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 3d7587b249e..fa8a13353fd 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -871,7 +871,7 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - + $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' '; $totalvat.=vatrate(abs($tvakey),1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index f510a561655..61b96bae667 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -301,6 +301,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 e01cb97537e..8b30afc4f04 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -303,6 +303,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 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";