From 6b031616fae895799cfac055fe0385409e1fe7ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 14 Apr 2013 12:34:10 +0200 Subject: [PATCH 01/18] Improved margins es_ES translation --- htdocs/langs/es_ES/margins.lang | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/es_ES/margins.lang b/htdocs/langs/es_ES/margins.lang index 9dd68991ae7..b4614596ae6 100644 --- a/htdocs/langs/es_ES/margins.lang +++ b/htdocs/langs/es_ES/margins.lang @@ -8,10 +8,10 @@ Margins=Márgenes TotalMargin=Margen total MarginOnProducts=Margen / Productos MarginOnServices=Margen / Servicios -MarginRate=Tasa de margen -MarkRate=Tasa de marca -DisplayMarginRates=Mostrar las tasas de margen -DisplayMarkRates=Mostrar las tasas de marca +MarginRate=Margen sobre coste +MarkRate=Margen sobre venta +DisplayMarginRates=Mostrar el margen sobre costes +DisplayMarkRates=Mostrar el margen sobre ventas InputPrice=Introducir un precio margin=Gestión de márgenes From 90b9e7c136c357fd85c57e9a3eee4a4fa310377f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 14 Apr 2013 13:06:13 +0200 Subject: [PATCH 02/18] Fixed bug #807: Margins modules with orders2invoice does not respect cost price Also, removed duplicated requires in orderstoinvoice.php --- htdocs/commande/orderstoinvoice.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index a6b2fe44a1f..5fdfaa59201 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -28,9 +28,9 @@ */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; @@ -84,17 +84,12 @@ if ($action == 'create') if (($action == 'create' || $action == 'add') && empty($mesgs)) { - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; - require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; } $langs->load('bills'); $langs->load('products'); @@ -287,7 +282,9 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) $lines[$i]->special_code, $object->origin, $lines[$i]->rowid, - $fk_parent_line + $fk_parent_line, + $lines[$i]->fk_fournprice, + $lines[$i]->pa_ht ); if ($result > 0) { From b6ce386513b8d6bfca758183a20a08fa3749500c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 14 Apr 2013 13:07:05 +0200 Subject: [PATCH 03/18] Converted indentation to tabs --- htdocs/commande/orderstoinvoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 5fdfaa59201..42a39dd9fa8 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -284,7 +284,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) $lines[$i]->rowid, $fk_parent_line, $lines[$i]->fk_fournprice, - $lines[$i]->pa_ht + $lines[$i]->pa_ht ); if ($result > 0) { From 0e34df43b1f0c944d44efb168d0e92b4857330c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sun, 14 Apr 2013 13:09:00 +0200 Subject: [PATCH 04/18] Updated changelog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 74522e7b7c8..b410a03df2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,7 @@ English Dolibarr ChangeLog - Fix: [ bug #774 ] Bug on creating event with box "all day" crossed - Fix: [ bug #817 ] Purchases journal does not reflect localtaxes - Fix: [ bug #816 ] Sales journal does not reflect localtaxes +- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price - Fix: Orderstoinvoice didn't act as expected when no order was checked From e27e5e9c44bd25bc32c3c59d15080b862a4f3902 Mon Sep 17 00:00:00 2001 From: simnandez Date: Sun, 14 Apr 2013 13:53:48 +0200 Subject: [PATCH 05/18] Improved margins ca_ES translation --- htdocs/langs/ca_ES/margins.lang | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/ca_ES/margins.lang b/htdocs/langs/ca_ES/margins.lang index 62bb253a587..8a0763f5214 100644 --- a/htdocs/langs/ca_ES/margins.lang +++ b/htdocs/langs/ca_ES/margins.lang @@ -8,10 +8,10 @@ Margins=Marges TotalMargin=Marge total MarginOnProducts=Marge / Productes MarginOnServices=Marge / Serveis -MarginRate=Taxa de marge -MarkRate=Taxa de marca -DisplayMarginRates=Mostrar les taxes de marge -DisplayMarkRates=Mostrar les taxes de marca +MarginRate=Marge sobre cost +MarkRate=Marge sobre venda +DisplayMarginRates=Mostrar els marges sobre cost +DisplayMarkRates=Mostrar els marges sobre venda InputPrice=Introduir un preu margin=Gestió de marges From deaa63960ed7bd376c3295cca168c455fe6bcea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Mon, 15 Apr 2013 00:18:08 +0200 Subject: [PATCH 06/18] Improved es_ES holidays translations --- htdocs/holiday/define_holiday.php | 2 +- htdocs/holiday/index.php | 2 +- htdocs/holiday/month_report.php | 2 +- htdocs/holiday/view_log.php | 4 ++-- htdocs/langs/es_ES/agenda.lang | 1 + htdocs/langs/es_ES/holiday.lang | 20 +++++++++++--------- htdocs/langs/es_ES/main.lang | 4 ++-- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 586ae4db258..a4fcfe98201 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -137,7 +137,7 @@ print '
'."\n"; print ''; print ''; print ""; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/holiday/index.php b/htdocs/holiday/index.php index a3ebf0f1c1c..91d3622eb9d 100644 --- a/htdocs/holiday/index.php +++ b/htdocs/holiday/index.php @@ -248,7 +248,7 @@ print_liste_field_titre($langs->trans("ValidatorCP"),$_SERVER["PHP_SELF"],"cp.fk print_liste_field_titre($langs->trans("DateDebCP"),$_SERVER["PHP_SELF"],"cp.date_debut","",'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateFinCP"),$_SERVER["PHP_SELF"],"cp.date_fin","",'','align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Duration")); -print_liste_field_titre($langs->trans("Statut"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="center"',$sortfield,$sortorder); +print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"cp.statut","",'','align="center"',$sortfield,$sortorder); print "\n"; // FILTRES diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index 238b9f70a10..38604e8fa2b 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -77,7 +77,7 @@ print '
'; print ''."\n"; -print 'Choix mois :  '; +print $langs->trans('Month').':  '; $htmlother->select_year($year,'year_start',1,10,3); print ''; diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index ef750abb71a..29c58c4dec7 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -78,8 +78,8 @@ foreach($cp->logs as $logs_CP) print '
'; print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''."\n"; } diff --git a/htdocs/langs/es_ES/agenda.lang b/htdocs/langs/es_ES/agenda.lang index 1b881cf96be..e0131db59fe 100644 --- a/htdocs/langs/es_ES/agenda.lang +++ b/htdocs/langs/es_ES/agenda.lang @@ -15,6 +15,7 @@ MyEvents=Mis eventos OtherEvents=Otros eventos ListOfActions=Listado de eventos EventOnFullDay=Evento para todo el día +Busy=Ocupado Location=Localización SearchAnAction=Buscar un evento/tarea MenuToDoActions=Eventos incompletos diff --git a/htdocs/langs/es_ES/holiday.lang b/htdocs/langs/es_ES/holiday.lang index 3183101f294..55e56fb9d0a 100644 --- a/htdocs/langs/es_ES/holiday.lang +++ b/htdocs/langs/es_ES/holiday.lang @@ -20,12 +20,12 @@ CancelCP=Anulada RefuseCP=Rechazada ValidatorCP=Validador ListeCP=Lista de vacaciones -ValidateByCP=Sera validada por +ValidateByCP=Será validada por DescCP=Descripción SendRequestCP=Enviar la petición de vacaciones DelayToRequestCP=Las peticiones de vacaciones deben realizarse al menos %s días antes. -MenuConfCP=Definir los vacaciones -UpdateAllCP=Actualizar los vacaciones +MenuConfCP=Definir las vacaciones +UpdateAllCP=Actualizar las vacaciones SoldeCPUser=Su saldo de vacaciones es de %s días. ErrorEndDateCP=Debe indicar una fecha de fin superior a la fecha de inicio. ErrorSQLCreateCP=Se ha producido un error de SQL durante la creación : @@ -68,12 +68,12 @@ ConfirmCancelCP=¿Está seguro de querer anular la petición de vacaciones? DetailRefusCP=Motivo del rechazo DateRefusCP=Fecha del rechazo DateCancelCP=Fecha de la anulación -DefineEventUserCP=Asignar vacación excepcional a un usuario -addEventToUserCP=Asignar esta vacación +DefineEventUserCP=Asignar permiso excepcional a un usuario +addEventToUserCP=Asignar este permiso MotifCP=Motivo UserCP=Usuario -ErrorAddEventToUserCP=Se ha producido un error en la asignación de la vacación excepcional. -AddEventToUserOkCP=Se ha añadido la vaciación excepcional. +ErrorAddEventToUserCP=Se ha producido un error en la asignación del permiso excepcional. +AddEventToUserOkCP=Se ha añadido el permiso excepcional. MenuLogCP=Ver los logs de vacaciones LogCP=Logs de actualizaciones de vacaciones ActionByCP=Realizado por @@ -86,6 +86,8 @@ UserName=Nombre Apellidos Employee=Empleado FirstDayOfHoliday=Primer día libre LastDayOfHoliday=Último día libre +Morning=Mañana +Afternoon=Tarde ## Configuration du Module ## ConfCP=Configuración del módulo Vacaciones @@ -98,8 +100,8 @@ UpdateConfCPOK=Actualización efectuada correctamente. ErrorUpdateConfCP=Se ha producido un error durante la actualización, vuélvalo a intentar. AddCPforUsers=Añada los saldos de vacaciones de los usuarios haciendo clic aquí. DelayForSubmitCP=La fecha límite para solicitar vacaciones -AlertValidatorDelayCP=Prevenir al validador si la petición no respeta el límite previsto -AlertValidorSoldeCP=Prevenir al validador si el usuario pide vacaciones superiores a su saldo +AlertValidatorDelayCP=Advertir al usuario validador si la petición no respeta el límite previsto +AlertValidorSoldeCP=Advertir al usuario validador si el usuario pide vacaciones superiores a su saldo nbUserCP=Número de usuarios tomados en cuenta en el módulo vacaciones nbHolidayDeductedCP=Número de días retribuidos a deducir por día de vacaciones nbHolidayEveryMonthCP=Número de vacaciones añadidas por mes diff --git a/htdocs/langs/es_ES/main.lang b/htdocs/langs/es_ES/main.lang index dbafcb393b2..1d61bb709f5 100644 --- a/htdocs/langs/es_ES/main.lang +++ b/htdocs/langs/es_ES/main.lang @@ -498,8 +498,8 @@ Warning=Alerta Warnings=Alertas BuildPDF=Generar el PDF RebuildPDF=Regenerar el PDF -BuildDoc=Generar el doc -RebuildDoc=Regenerar el doc +BuildDoc=Generar el documento +RebuildDoc=Regenerar el documento Entity=Entidad Entities=Entidades EventLogs=Log From 6d896a8558a16a34b5ca3ed86e49d53a4107a5e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Mon, 15 Apr 2013 00:53:06 +0200 Subject: [PATCH 07/18] Improved holidays module translations --- htdocs/holiday/class/holiday.class.php | 4 +-- htdocs/holiday/define_holiday.php | 6 ++-- htdocs/holiday/fiche.php | 42 +++++++++++++------------- htdocs/langs/en_US/holiday.lang | 3 ++ htdocs/langs/es_ES/holiday.lang | 5 ++- htdocs/langs/fr_FR/holiday.lang | 3 ++ 6 files changed, 36 insertions(+), 27 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 34b26421a08..924d6eb1c4e 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -859,7 +859,7 @@ class Holiday extends CommonObject */ function updateSoldeCP($userID='',$nbHoliday='') { - global $user; + global $user, $langs; if (empty($userID) && empty($nbHoliday)) { @@ -897,7 +897,7 @@ class Holiday extends CommonObject $new_solde = $now_holiday + $this->getConfCP('nbHolidayEveryMonth'); // On ajoute la modification dans le LOG - $this->addLogCP($user->id,$users[$i]['rowid'],'Event : Mise à jour mensuelle',$new_solde); + $this->addLogCP($user->id,$users[$i]['rowid'], $langs->trans('Event').': '.$langs->trans('HolidaysMonthlyAssignment'),$new_solde); $i++; } diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index a4fcfe98201..3d43d8e375e 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -67,7 +67,7 @@ if ($action == 'update' && isset($_POST['update_cp'])) } // On ajoute la modification dans le LOG - $holiday->addLogCP($user->id,$userID,'Event : Manual update',$userValue); + $holiday->addLogCP($user->id,$userID, $langs->trans('Event').': '.$langs->trans('ManualUpdate'),$userValue); // Mise à jour des congés de l'utilisateur $holiday->updateSoldeCP($userID,$userValue); @@ -100,7 +100,7 @@ elseif($action == 'add_event') $new_holiday = $nb_holiday + $add_holiday; // On ajoute la modification dans le LOG - $holiday->addLogCP($user->id,$userCP,'Event : '.$holiday->getNameEventCp($event),$new_holiday); + $holiday->addLogCP($user->id,$userCP, $langs->trans('Event').': '.$holiday->getNameEventCp($event),$new_holiday); $holiday->updateSoldeCP($userCP,$new_holiday); @@ -158,7 +158,7 @@ foreach($listUsers as $users) print ''; print ''."\n"; + print ' '.$langs->trans('days').''."\n"; print ''."\n"; print ''; diff --git a/htdocs/holiday/fiche.php b/htdocs/holiday/fiche.php index e4ffc4007fb..e7626506dde 100644 --- a/htdocs/holiday/fiche.php +++ b/htdocs/holiday/fiche.php @@ -52,7 +52,7 @@ $now=dol_now(); // Si création de la demande if ($action == 'create') { - $cp = new Holiday($db); + $cp = new Holiday($db); // Si pas le droit de créer une demande if(!$user->rights->holiday->write) @@ -63,12 +63,12 @@ if ($action == 'create') $date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year')); $date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year')); - $starthalfday=GETPOST('starthalfday'); + $starthalfday=GETPOST('starthalfday'); $endhalfday=GETPOST('endhalfday'); $halfday=0; if ($starthalfday == 'afternoon' && $endhalfday == 'morning') $halfday=2; else if ($starthalfday == 'afternoon') $halfday=-1; - else if ($endhalfday == 'morning') $halfday=1; + else if ($endhalfday == 'morning') $halfday=1; $valideur = GETPOST('valideur'); $description = trim(GETPOST('description')); @@ -144,14 +144,14 @@ if ($action == 'create') if ($action == 'update') { - $date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year')); - $date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year')); - $starthalfday=GETPOST('starthalfday'); - $endhalfday=GETPOST('endhalfday'); - $halfday=0; - if ($starthalfday == 'afternoon' && $endhalfday == 'morning') $halfday=2; - else if ($starthalfday == 'afternoon') $halfday=-1; - else if ($endhalfday == 'morning') $halfday=1; + $date_debut = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year')); + $date_fin = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year')); + $starthalfday=GETPOST('starthalfday'); + $endhalfday=GETPOST('endhalfday'); + $halfday=0; + if ($starthalfday == 'afternoon' && $endhalfday == 'morning') $halfday=2; + else if ($starthalfday == 'afternoon') $halfday=-1; + else if ($endhalfday == 'morning') $halfday=1; // Si pas le droit de modifier une demande if(!$user->rights->holiday->write) @@ -375,7 +375,7 @@ if($action == 'confirm_valid') $newSolde = $soldeActuel - ($nbJour*$cp->getConfCP('nbHolidayDeducted')); // On ajoute la modification dans le LOG - $cp->addLogCP($userID,$cp->fk_user,'Event : '.$langs->transnoentitiesnoconv("Holiday"),$newSolde); + $cp->addLogCP($userID,$cp->fk_user, $langs->trans('Event').': '.$langs->transnoentitiesnoconv("Holidays"),$newSolde); // Mise à jour du solde $cp->updateSoldeCP($cp->fk_user,$newSolde); @@ -575,9 +575,9 @@ if ($action == 'confirm_cancel' && $_GET['confirm'] == 'yes') */ $form = new Form($db); -$cp = new Holiday($db); +$cp = new Holiday($db); -$listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon")); +$listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->trans("Afternoon")); llxHeader(array(),$langs->trans('CPTitreMenu')); @@ -859,12 +859,12 @@ else print ''; print ''; print ''; print ''; $starthalfday=($cp->halfday == -1 || $cp->halfday == 2)?'afternoon':'morning'; - $endhalfday=($cp->halfday == 1 || $cp->halfday == 2)?'morning':'afternoon'; + $endhalfday=($cp->halfday == 1 || $cp->halfday == 2)?'morning':'afternoon'; if(!$edit) { print ''; @@ -890,7 +890,7 @@ else print ''; print ''; print ''; print ''; @@ -1026,10 +1026,10 @@ else { print ''.$langs->trans("Validate").''; } - if($user->rights->holiday->delete && $cp->statut == 1) - { - print ''.$langs->trans("DeleteCP").''; - } + if($user->rights->holiday->delete && $cp->statut == 1) + { + print ''.$langs->trans("DeleteCP").''; + } // Si le statut est en attente de validation et que le valideur est connecté if ($userID == $cp->fk_validator && $cp->statut == 2) diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index abf2b1dc514..67adb36dfeb 100755 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -1,6 +1,7 @@ # Dolibarr language file - en_US - holiday CHARSET= UTF-8 +Holidays=Holidays CPTitreMenu=Holidays MenuReportMonth=Monthly statement MenuAddCP=Apply for holidays @@ -86,6 +87,8 @@ UserName=Name Employee=Employee FirstDayOfHoliday=First day of holiday LastDayOfHoliday=Last day of holiday +HolidaysMonthlyUpdate=Monthly update +ManualUpdate=Manual update ## Configuration du Module ## ConfCP=Configuration of holidays module diff --git a/htdocs/langs/es_ES/holiday.lang b/htdocs/langs/es_ES/holiday.lang index 55e56fb9d0a..ebf1a0457d9 100644 --- a/htdocs/langs/es_ES/holiday.lang +++ b/htdocs/langs/es_ES/holiday.lang @@ -1,6 +1,7 @@ # Dolibarr language file - es_ES - holiday CHARSET= UTF-8 +Holidays=Vacaciones CPTitreMenu=Vacaciones MenuReportMonth=Estado mensual MenuAddCP=Nueva petición @@ -88,6 +89,8 @@ FirstDayOfHoliday=Primer día libre LastDayOfHoliday=Último día libre Morning=Mañana Afternoon=Tarde +HolidaysMonthlyUpdate=Actualización mensual +ManualUpdate=Actualización manual ## Configuration du Module ## ConfCP=Configuración del módulo Vacaciones @@ -99,7 +102,7 @@ LastUpdateCP=Última actualización automática de vacaciones UpdateConfCPOK=Actualización efectuada correctamente. ErrorUpdateConfCP=Se ha producido un error durante la actualización, vuélvalo a intentar. AddCPforUsers=Añada los saldos de vacaciones de los usuarios haciendo clic aquí. -DelayForSubmitCP=La fecha límite para solicitar vacaciones +DelayForSubmitCP=Antelación mínima para solicitar vacaciones AlertValidatorDelayCP=Advertir al usuario validador si la petición no respeta el límite previsto AlertValidorSoldeCP=Advertir al usuario validador si el usuario pide vacaciones superiores a su saldo nbUserCP=Número de usuarios tomados en cuenta en el módulo vacaciones diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index ad8ebd7fcf1..c01d84218bf 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -1,6 +1,7 @@ # Dolibarr language file - fr_FR - holiday CHARSET= UTF-8 +Holidays=Congés CPTitreMenu=Congés MenuReportMonth=Etat mensuel MenuAddCP=Nouvelle demande @@ -86,6 +87,8 @@ UserName=Nom Prénom Employee=Salarié FirstDayOfHoliday=Premier jour de congès LastDayOfHoliday=Dernier jour de congès +HolidaysMonthlyUpdate=Mise à jour mensuelle +ManualUpdate=Mise à jour manuelle ## Configuration du Module ## ConfCP=Configuration du module Congés From 76132206bf549bd0558fc3746eb361725303813a Mon Sep 17 00:00:00 2001 From: simnandez Date: Mon, 15 Apr 2013 17:12:31 +0200 Subject: [PATCH 08/18] Fix: Bad link to all proposals into Third party card if customer is prospect --- ChangeLog | 1 + htdocs/comm/prospect/fiche.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b410a03df2e..87ba9da878e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ English Dolibarr ChangeLog - Fix: [ bug #816 ] Sales journal does not reflect localtaxes - Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price - Fix: Orderstoinvoice didn't act as expected when no order was checked +- Fix: Bad link to all proposals into Third party card if customer is prospect diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index 0e2467a3a75..e81862ec6f5 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -249,7 +250,7 @@ if ($socid > 0) { print '
User ID'.$langs->trans('ID').''.$langs->trans('UserName').''.$langs->trans('Available').''.$langs->trans('UpdateButtonCP').'
'.$user_action->getFullName($langs).''.$user_update->getFullName($langs).''.$logs_CP['type_action'].''.$logs_CP['prev_solde'].' jours'.$logs_CP['new_solde'].' jours'.$logs_CP['prev_solde'].' '.$langs->trans('days').''.$logs_CP['new_solde'].' '.$langs->trans('days').'
'; print ''; - print ' jours
'.$langs->trans("Ref").''; - print $form->showrefnav($cp, 'id', $linkback, 1, 'rowid', 'ref'); + print $form->showrefnav($cp, 'id', $linkback, 1, 'rowid', 'ref'); print '
'.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").')'.dol_print_date($cp->date_fin,'day'); - print '     '; + print '     '; print $langs->trans($listhalfday[$endhalfday]); print '
'; print ''; - print '
'; + print ''; print ''; From 21056d2b78bec5b04f719678a663629baa645051 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 15 Apr 2013 21:27:01 +0200 Subject: [PATCH 09/18] Fix: missing current entity record --- htdocs/compta/sociales/charges.php | 2 +- htdocs/compta/sociales/class/chargesociales.class.php | 7 +++++-- htdocs/compta/tva/class/tva.class.php | 4 ++-- htdocs/compta/tva/fiche.php | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 70065d7b7d2..2ec6539db9e 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -1,6 +1,6 @@ - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2013 Regis Houssin * * 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 diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 1f85a99916d..44779b8b0de 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -115,6 +115,8 @@ class ChargeSociales extends CommonObject */ function create($user) { + global $conf; + // Nettoyage parametres $newamount=price2num($this->amount,'MT'); @@ -127,10 +129,11 @@ class ChargeSociales extends CommonObject $this->db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount)"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount, entity)"; $sql.= " VALUES (".$this->type.",'".$this->db->escape($this->lib)."',"; $sql.= " '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."',"; - $sql.= " ".price2num($newamount); + $sql.= " ".price2num($newamount)."',"; + $sql.= " ".$conf->entity; $sql.= ")"; dol_syslog(get_class($this)."::create sql=".$sql); diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index ab393c12ba2..34dc0262c2e 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -500,13 +500,13 @@ class Tva extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep, datev, amount"; if ($this->note) $sql.=", note"; if ($this->label) $sql.=", label"; - $sql.= ", fk_user_creat, fk_bank"; + $sql.= ", fk_user_creat, fk_bank, entity"; $sql.= ") "; $sql.= " VALUES ('".$this->db->idate($this->datep)."',"; $sql.= "'".$this->db->idate($this->datev)."'," . $this->amount; if ($this->note) $sql.=", '".$this->db->escape($this->note)."'"; if ($this->label) $sql.=", '".$this->db->escape($this->label)."'"; - $sql.=", '".$user->id."', NULL"; + $sql.=", '".$user->id."', NULL, ".$conf->entity; $sql.= ")"; dol_syslog("Tva::addPayment sql=".$sql); diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index 45dc91263ad..f7bb83e221b 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2013 Regis Houssin * * 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 From 7177e59ea4a0f3b1491956782bac930278ad8b5f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 15 Apr 2013 21:40:49 +0200 Subject: [PATCH 10/18] Fix: missing quote --- htdocs/compta/sociales/class/chargesociales.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 44779b8b0de..6fbd0a23143 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -132,7 +132,7 @@ class ChargeSociales extends CommonObject $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, periode, amount, entity)"; $sql.= " VALUES (".$this->type.",'".$this->db->escape($this->lib)."',"; $sql.= " '".$this->db->idate($this->date_ech)."','".$this->db->idate($this->periode)."',"; - $sql.= " ".price2num($newamount)."',"; + $sql.= " '".price2num($newamount)."',"; $sql.= " ".$conf->entity; $sql.= ")"; From 7d6c89169cd189ba1df0c09b924a632761695e2c Mon Sep 17 00:00:00 2001 From: fhenry Date: Mon, 15 Apr 2013 23:06:03 +0200 Subject: [PATCH 11/18] Fix [ bug #789 ] VAT not being calculated in POS --- 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 3538a3908d1..292252c2716 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,0); + $resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',0,$product->type,0); // Calcul du total ht sans remise $total_ht = $resultarray[0]; From 90a2a86dbb0597e8be39089ccd5eb2f7f0bdc57d Mon Sep 17 00:00:00 2001 From: simnandez Date: Tue, 16 Apr 2013 08:59:01 +0200 Subject: [PATCH 12/18] Update ChangeLog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 87ba9da878e..02a03be8896 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ English Dolibarr ChangeLog - Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price - Fix: Orderstoinvoice didn't act as expected when no order was checked - Fix: Bad link to all proposals into Third party card if customer is prospect +- Fix: [ bug #789 ] VAT not being calculated in POS From a5deb8e9d70b249cc445e47dff7bce7abd523508 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Apr 2013 15:54:36 +0200 Subject: [PATCH 13/18] Fix: bug into is_erasable function. Conflicts: test/phpunit/NumberingModulesTest.php --- htdocs/compta/facture/class/facture.class.php | 11 ++- htdocs/core/lib/functions2.lib.php | 46 +++++------ test/phpunit/NumberingModulesTest.php | 81 +++++++++++-------- 3 files changed, 74 insertions(+), 64 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index cf7b89be7aa..2333802cc40 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1576,7 +1576,7 @@ class Facture extends CommonInvoice $now=dol_now(); $error=0; - dol_syslog(get_class($this).'::validate user='.$user->id.', force_number='.$force_number.', idwarehouse='.$idwarehouse, LOG_WARNING); + dol_syslog(get_class($this).'::validate user='.$user->id.', force_number='.$force_number.', idwarehouse='.$idwarehouse); // Check parameters if (! $this->brouillon) @@ -2554,11 +2554,10 @@ class Facture extends CommonInvoice { $maxfacnumber = $this->getNextNumRef($this->client,'last'); $ventilExportCompta = $this->getVentilExportCompta(); - // Si derniere facture et si non ventilee, on peut supprimer - if ($maxfacnumber == $this->ref && $ventilExportCompta == 0) - { - return 1; - } + // If there is no invoice into the reset range and not already dispatched, we can delete + if ($maxfacnumber == '' && $ventilExportCompta == 0) return 1; + // If invoice to delete is last one and not already dispatched, we can delete + if ($maxfacnumber == $this->ref && $ventilExportCompta == 0) return 1; } else if ($this->statut == 0 && $facref == 'PROV') // Si facture brouillon et provisoire { diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 40c52cbc200..63ad0667ca3 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -506,7 +506,7 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti } /** - * Return next value for a mask + * Return last or next value for a mask (according to area we should not reset) * * @param DoliDB $db Database handler * @param string $mask Mask to use @@ -688,7 +688,6 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $posnumstart=strpos($maskwithnocode,$maskcounter); // Pos of counter in final string (from 0 to ...) if ($posnumstart < 0) return 'ErrorBadMaskFailedToLocatePosOfSequence'; $sqlstring='SUBSTRING('.$field.', '.($posnumstart+1).', '.dol_strlen($maskcounter).')'; - //print "x".$sqlstring; // Define $maskLike $maskLike = dol_string_nospecial($mask); @@ -701,7 +700,6 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m $maskLike = preg_replace('/\{dd\}/i','__',$maskLike); $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),str_pad("",dol_strlen($maskcounter),"_"),$maskLike); if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike); - //if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),str_pad("",dol_strlen($masktype),"_"),$maskLike); if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike); // Get counter in database @@ -715,7 +713,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m if ($sqlwhere) $sql.=' AND '.$sqlwhere; //print $sql.'
'; - dol_syslog("functions2::get_next_value sql=".$sql, LOG_DEBUG); + dol_syslog("functions2::get_next_value mode=".$mode." sql=".$sql, LOG_DEBUG); $resql=$db->query($sql); if ($resql) { @@ -725,30 +723,32 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m else dol_print_error($db); if (empty($counter) || preg_match('/[^0-9]/i',$counter)) $counter=$maskoffset; - if ($mode == 'last') + if ($mode == 'last') // We found value for counter = last counter value. Now need to get corresponding ref of invoice. { $counterpadded=str_pad($counter,dol_strlen($maskcounter),"0",STR_PAD_LEFT); - // Define $maskLike - $maskLike = dol_string_nospecial($mask); - $maskLike = str_replace("%","_",$maskLike); - // Replace protected special codes with matching number of _ as wild card caracter - $maskLike = preg_replace('/\{yyyy\}/i','____',$maskLike); - $maskLike = preg_replace('/\{yy\}/i','__',$maskLike); - $maskLike = preg_replace('/\{y\}/i','_',$maskLike); - $maskLike = preg_replace('/\{mm\}/i','__',$maskLike); - $maskLike = preg_replace('/\{dd\}/i','__',$maskLike); - $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),$counterpadded,$maskLike); - if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike); - //if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),str_pad("",dol_strlen($masktype),"_"),$maskLike); - if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike); - + // Define $maskLike + $maskLike = dol_string_nospecial($mask); + $maskLike = str_replace("%","_",$maskLike); + // Replace protected special codes with matching number of _ as wild card caracter + $maskLike = preg_replace('/\{yyyy\}/i','____',$maskLike); + $maskLike = preg_replace('/\{yy\}/i','__',$maskLike); + $maskLike = preg_replace('/\{y\}/i','_',$maskLike); + $maskLike = preg_replace('/\{mm\}/i','__',$maskLike); + $maskLike = preg_replace('/\{dd\}/i','__',$maskLike); + $maskLike = str_replace(dol_string_nospecial('{'.$masktri.'}'),$counterpadded,$maskLike); + if ($maskrefclient) $maskLike = str_replace(dol_string_nospecial('{'.$maskrefclient.'}'),str_pad("",dol_strlen($maskrefclient),"_"),$maskLike); + if ($masktype) $maskLike = str_replace(dol_string_nospecial('{'.$masktype.'}'),$masktype_value,$maskLike); + $ref=''; - $sql = "SELECT facnumber as ref"; - $sql.= " FROM ".MAIN_DB_PREFIX."facture"; - $sql.= " WHERE facnumber LIKE '".$maskLike."'"; + $sql = "SELECT ".$field." as ref"; + $sql.= " FROM ".MAIN_DB_PREFIX.$table; + $sql.= " WHERE ".$field." LIKE '".$maskLike."'"; + $sql.= " AND ".$field." NOT LIKE '%PROV%'"; $sql.= " AND entity IN (".getEntity($table, 1).")"; - + if ($where) $sql.=$where; + if ($sqlwhere) $sql.=' AND '.$sqlwhere; + dol_syslog("functions2::get_next_value sql=".$sql); $resql=$db->query($sql); if ($resql) diff --git a/test/phpunit/NumberingModulesTest.php b/test/phpunit/NumberingModulesTest.php index 59d13c7606f..1f121d6c9e3 100644 --- a/test/phpunit/NumberingModulesTest.php +++ b/test/phpunit/NumberingModulesTest.php @@ -134,23 +134,25 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}-{0000}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}-{0000}'; - $localobject=new Facture($this->savdb); - $localobject->initAsSpecimen(); - $localobject->date=dol_mktime(12, 0, 0, 1, 1, 1915); // we use year 1915 to be sure to not have existing invoice for this year - $numbering=new mod_facture_mercure(); - $result=$numbering->getNextValue($mysoc, $localobject); - $result2=$localobject->create($user,1); - $result3=$localobject->validate($user, $result); - print __METHOD__." result=".$result."\n"; - $this->assertEquals('1915-0001', $result); // counter must start to 1 - - $localobject=new Facture($this->savdb); - $localobject->initAsSpecimen(); - $localobject->date=dol_mktime(12, 0, 0, 1, 1, 1916); // we use following year for second invoice - $numbering=new mod_facture_mercure(); - $result=$numbering->getNextValue($mysoc, $localobject); - print __METHOD__." result=".$result."\n"; - $this->assertEquals('1916-0002', $result); // counter must not be reset + $localobject=new Facture($this->savdb); + $localobject->initAsSpecimen(); + $localobject->date=dol_mktime(12, 0, 0, 1, 1, 1915); // we use year 1915 to be sure to not have existing invoice for this year + $numbering=new mod_facture_mercure(); + $result=$numbering->getNextValue($mysoc, $localobject); + $result2=$localobject->create($user,1); + $result3=$localobject->validate($user, $result); // create invoice by forcing ref + print __METHOD__." result=".$result."\n"; + $this->assertEquals('1915-0001', $result); // counter must start to 1 + + $localobject=new Facture($this->savdb); + $localobject->initAsSpecimen(); + $localobject->date=dol_mktime(12, 0, 0, 1, 1, 1916); // we use following year for second invoice (there is no reset into mask) + $numbering=new mod_facture_mercure(); + $result=$numbering->getNextValue($mysoc, $localobject, 'last'); + $this->assertEquals('1915-0001', $result); + $result=$numbering->getNextValue($mysoc, $localobject); + print __METHOD__." result=".$result."\n"; + $this->assertEquals('1916-0002', $result); // counter must not be reseted so be 2 // Now we try with a reset $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}-{0000@1}'; @@ -162,7 +164,7 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase $numbering=new mod_facture_mercure(); $result=$numbering->getNextValue($mysoc, $localobject); print __METHOD__." result=".$result."\n"; - $this->assertEquals('1910-0001', $result); // counter must start to 1 + $this->assertEquals('1910-0001', $result); // counter must start to 1 // Same mask but we add month $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}{mm}-{0000@1}'; @@ -175,35 +177,44 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase $result2=$localobject->create($user,1); $result3=$localobject->validate($user, $result); print __METHOD__." result=".$result."\n"; - $this->assertEquals('192001-0001', $result); // counter must start to 1 + $this->assertEquals('192001-0001', $result); // counter must start to 1 $localobject=new Facture($this->savdb); $localobject->initAsSpecimen(); - $localobject->date=dol_mktime(12, 0, 0, 1, 1, 1921); // we use following year for second invoice + $localobject->date=dol_mktime(12, 0, 0, 1, 1, 1921); // we use following year for second invoice (and there is a reset required) $numbering=new mod_facture_mercure(); $result=$numbering->getNextValue($mysoc, $localobject); print __METHOD__." result=".$result."\n"; - $this->assertEquals('192101-0001', $result); // counter must be resete to 1 + $this->assertEquals('192101-0001', $result); // counter must be reseted to 1 // Now we try with a different fiscal month (forced by mask) - $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}{mm}-{0000@6}'; - $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}{mm}-{0000@6}'; - - $localobject=new Facture($this->savdb); - $localobject->initAsSpecimen(); - $localobject->date=dol_mktime(12, 0, 0, 1, 1, 1930); // we use year 1930 to be sure to not have existing invoice for this year - $numbering=new mod_facture_mercure(); - $result=$numbering->getNextValue($mysoc, $localobject); - $result2=$localobject->create($user,1); - $result3=$localobject->validate($user, $result); - print __METHOD__." result=".$result."\n"; - $this->assertEquals('193001-0001', $result); // counter must start to 1 - + $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}{mm}-{0000@6}'; + $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}{mm}-{0000@6}'; + + $localobject=new Facture($this->savdb); + $localobject->initAsSpecimen(); + $localobject->date=dol_mktime(12, 0, 0, 1, 1, 1930); // we use year 1930 to be sure to not have existing invoice for this year + $numbering=new mod_facture_mercure(); + $result=$numbering->getNextValue($mysoc, $localobject, 'last'); + print __METHOD__." result for last=".$result."\n"; + $this->assertEquals('', $result); // no existing ref into reset range + $result=$numbering->getNextValue($mysoc, $localobject); + $result2=$localobject->create($user,1); + $result3=$localobject->validate($user, $result); + print __METHOD__." result=".$result."\n"; + $this->assertEquals('193001-0001', $result); // counter must start to 1 + $result=$numbering->getNextValue($mysoc, $localobject, 'last'); + print __METHOD__." result for last=".$result."\n"; + $this->assertEquals('193001-0001', $result); // last ref into reset range should be same than last created + $localobject=new Facture($this->savdb); $localobject->initAsSpecimen(); $localobject->date=dol_mktime(12, 0, 0, 12, 1, 1930); // we use same year but fiscal month after $numbering=new mod_facture_mercure(); + $result=$numbering->getNextValue($mysoc, $localobject, 'last'); + print __METHOD__." result for last=".$result."\n"; + $this->assertEquals('', $result); // last ref into reset range should be '' $result=$numbering->getNextValue($mysoc, $localobject); $result2=$localobject->create($user,1); $result3=$localobject->validate($user, $result); @@ -408,4 +419,4 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase } } -?> \ No newline at end of file +?> From 3a474a22ca75472b5064832ff7ec8c15175b8252 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 16 Apr 2013 15:56:08 +0200 Subject: [PATCH 14/18] Qual: Include is_erasable() into test Conflicts: test/phpunit/NumberingModulesTest.php --- test/phpunit/NumberingModulesTest.php | 64 ++++++++++++++++++--------- 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/test/phpunit/NumberingModulesTest.php b/test/phpunit/NumberingModulesTest.php index 1f121d6c9e3..e9e6454a81a 100644 --- a/test/phpunit/NumberingModulesTest.php +++ b/test/phpunit/NumberingModulesTest.php @@ -131,6 +131,7 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase // First we try with a simple mask, with no reset // and we test counter is still increase second year. + $conf->global->FACTURE_ADDON='mercure'; $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}-{0000}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}-{0000}'; @@ -143,17 +144,29 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase $result3=$localobject->validate($user, $result); // create invoice by forcing ref print __METHOD__." result=".$result."\n"; $this->assertEquals('1915-0001', $result); // counter must start to 1 - - $localobject=new Facture($this->savdb); - $localobject->initAsSpecimen(); - $localobject->date=dol_mktime(12, 0, 0, 1, 1, 1916); // we use following year for second invoice (there is no reset into mask) + $result=$localobject->is_erasable(); + print __METHOD__." is_erasable=".$result."\n"; + $this->assertEquals(1, $result); // Can be deleted + + $localobject2=new Facture($this->savdb); + $localobject2->initAsSpecimen(); + $localobject2->date=dol_mktime(12, 0, 0, 1, 1, 1916); // we use following year for second invoice (there is no reset into mask) $numbering=new mod_facture_mercure(); - $result=$numbering->getNextValue($mysoc, $localobject, 'last'); + $result=$numbering->getNextValue($mysoc, $localobject2, 'last'); + print __METHOD__." result=".$result."\n"; $this->assertEquals('1915-0001', $result); - $result=$numbering->getNextValue($mysoc, $localobject); + $result=$numbering->getNextValue($mysoc, $localobject2); + $result2=$localobject2->create($user,1); + $result3=$localobject2->validate($user, $result); // create invoice by forcing ref print __METHOD__." result=".$result."\n"; $this->assertEquals('1916-0002', $result); // counter must not be reseted so be 2 - + $result=$localobject2->is_erasable(); + print __METHOD__." is_erasable=".$result."\n"; + $this->assertEquals(1, $result); // Can be deleted + $result=$localobject->is_erasable(); + print __METHOD__." is_erasable=".$result."\n"; + $this->assertEquals(0, $result); // Case 1 can not be deleted (case 2 is more recent) + // Now we try with a reset $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}-{0000@1}'; $conf->global->FACTURE_MERCURE_MASK_INVOICE='{yyyy}-{0000@1}'; @@ -178,15 +191,26 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase $result3=$localobject->validate($user, $result); print __METHOD__." result=".$result."\n"; $this->assertEquals('192001-0001', $result); // counter must start to 1 - - $localobject=new Facture($this->savdb); - $localobject->initAsSpecimen(); - $localobject->date=dol_mktime(12, 0, 0, 1, 1, 1921); // we use following year for second invoice (and there is a reset required) + $result=$localobject->is_erasable(); + print __METHOD__." is_erasable=".$result."\n"; + $this->assertEquals(1, $result); // Can be deleted + + $localobject2=new Facture($this->savdb); + $localobject2->initAsSpecimen(); + $localobject2->date=dol_mktime(12, 0, 0, 1, 1, 1921); // we use following year for second invoice (and there is a reset required) $numbering=new mod_facture_mercure(); - $result=$numbering->getNextValue($mysoc, $localobject); - print __METHOD__." result=".$result."\n"; + $result=$numbering->getNextValue($mysoc, $localobject2); + $result2=$localobject2->create($user,1); + $result3=$localobject2->validate($user, $result); + print __METHOD__." result=".$result."\n"; $this->assertEquals('192101-0001', $result); // counter must be reseted to 1 - + $result=$localobject2->is_erasable(); + print __METHOD__." is_erasable=".$result."\n"; + $this->assertEquals(1, $result); // Can be deleted + $result=$localobject->is_erasable(); + print __METHOD__." is_erasable=".$result."\n"; + $this->assertEquals(1, $result); // Case 1 can be deleted (because there was a reset for case 2) + // Now we try with a different fiscal month (forced by mask) $conf->global->FACTURE_MERCURE_MASK_CREDIT='{yyyy}{mm}-{0000@6}'; @@ -231,12 +255,12 @@ class NumberingModulesTest extends PHPUnit_Framework_TestCase print __METHOD__." result=".$result."\n"; $this->assertEquals('193101-0002', $result); // counter must be 2 - $localobject=new Facture($this->savdb); - $localobject->initAsSpecimen(); - $localobject->date=dol_mktime(12, 0, 0, 12, 1, 1931); // we use different discal year but same year - $numbering=new mod_facture_mercure(); - $result=$numbering->getNextValue($mysoc, $localobject); - print __METHOD__." result=".$result."\n"; + $localobject=new Facture($this->savdb); + $localobject->initAsSpecimen(); + $localobject->date=dol_mktime(12, 0, 0, 12, 1, 1931); // we use different fiscal year but same year + $numbering=new mod_facture_mercure(); + $result=$numbering->getNextValue($mysoc, $localobject); + print __METHOD__." result=".$result."\n"; $this->assertEquals('193112-0001', $result); // counter must be reset to 1 From e2156b5df7e58f76c87d3b5628ca9f2c83176359 Mon Sep 17 00:00:00 2001 From: fhenry Date: Tue, 16 Apr 2013 16:00:23 +0200 Subject: [PATCH 15/18] Fix bug http://www.dolibarr.org/forum/527-bugs-on-a-stable-version/22542-table-prefix-bug --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 87e40d8645a..2e49d0f2859 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -139,7 +139,7 @@ $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.t $tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as pays_code, p.libelle as pays, a.fk_pays as pays_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1"; $tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent"; $tabsql[9] = "SELECT code_iso as code, label as libelle, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies"; -$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid"; +$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p WHERE t.fk_pays=p.rowid"; $tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; $tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX.'c_payment_term AS c'; $tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c"; From e7cec6d4100ce694f732bba655faa7e8d1b5667b Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 17 Apr 2013 09:32:35 +0200 Subject: [PATCH 16/18] update change log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 02a03be8896..3503347114a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,7 @@ English Dolibarr ChangeLog - Fix: [ bug #736 ] Missing column in llx_c_chargesociales - Fix: Localtax2 for Spain must be based into buyer - Fix: [ bug #762 ] Bad profit calculation in Reporting +- Fix: bug dictionnary with wrong prefix table From 03e57c229a20b20f0a70f5600e714704dac2d7da Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 17 Apr 2013 10:00:12 +0200 Subject: [PATCH 17/18] Update changelog --- ChangeLog | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3503347114a..945bf875bfd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,7 +20,10 @@ English Dolibarr ChangeLog - Fix: Orderstoinvoice didn't act as expected when no order was checked - Fix: Bad link to all proposals into Third party card if customer is prospect - Fix: [ bug #789 ] VAT not being calculated in POS - +- Fix: [ bug #794 ] Lost filter on zipcode in prospect list +- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed +- Fix: [ bug #810 ] Cannot update ODT template path +- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary ***** ChangeLog for 3.3.1 compared to 3.3 ***** From 5c50b1db57a64c05d0888b63181698b59176dcc9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 17 Apr 2013 10:41:54 +0200 Subject: [PATCH 18/18] Fix: use empty instead isset --- htdocs/compta/bank/releve.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index f3603da2d6d..eb114400f52 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2009 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2013 Regis Houssin * * 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 @@ -84,7 +84,7 @@ if ($id > 0 || ! empty($ref)) $acct->fetch($id, $ref); } -if (! isset($num)) +if (empty($num)) { /* * Vue liste tous releves confondus
'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllPropals").' ('.$num.')'; print ''; print '
'.$langs->trans("LastPropals",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllPropals").' ('.$num.')'.img_picto($langs->trans("Statistics"),'stats').'