From 6bbcb376b175b6ac1a592680cb8205de3085475f Mon Sep 17 00:00:00 2001 From: simnandez Date: Fri, 28 Sep 2012 15:55:50 +0200 Subject: [PATCH 01/50] Trad: Add missing translations --- htdocs/langs/ca_ES/admin.lang | 4 +++- htdocs/langs/ca_ES/orders.lang | 2 ++ htdocs/langs/es_ES/admin.lang | 5 ++++- htdocs/langs/es_ES/holiday.lang | 3 ++- htdocs/langs/es_ES/orders.lang | 2 ++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index fbf6cf10de2..0a18dbf18ed 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -82,7 +82,7 @@ UserSetup=Configuració gestió dels usuaris MenuSetup=Administració dels menús per base de dades MenuLimits=Límits i precisió MenuIdParent=Id del menú pare -DetailMenuIdParent=IDr del menú pare (0 per a un menú superior) +DetailMenuIdParent=IDr del menú pare (buit per a un menú superior) DetailPosition=Número d'ordre per a la posició del menú PersonalizedMenusNotSupported=Menús personalitzats no generats AllMenus=Tots @@ -1304,6 +1304,8 @@ Sell=Venda InvoiceDateUsed=Data utilitzada de factura YourCompanyDoesNotUseVAT=La seva empresa està configurada com no subjecta a l'IVA (Inici - Configuració - Empresa/Institució), per la qual cosa no hi ha opció per a la parametrització de l'IVA. AccountancyCode=Codi comptable +AccountancyCodeSell=Codi comptable vendes +AccountancyCodeBuy=Codi comptable compres ##### Agenda ##### AgendaSetup=Mòdul configuració d'accions i agenda PasswordTogetVCalExport=Clau d'autorització vCal export link diff --git a/htdocs/langs/ca_ES/orders.lang b/htdocs/langs/ca_ES/orders.lang index a5185f4e48f..ef2f9e43efa 100644 --- a/htdocs/langs/ca_ES/orders.lang +++ b/htdocs/langs/ca_ES/orders.lang @@ -141,6 +141,8 @@ OrderSource6=Revistes QtyOrdered=Qt. demanda AddDeliveryCostLine=Afegir una línia de despeses de ports indicant el pes de la comanda SetDemandReason=Indicar origen de la comanda +CreateInvoiceForThisCustomer=Crear una factura a partir de diverses comandes d'aquest client +CloseProcessedOrdersAutomatically=Classificar automàticament com "Processades" les comandes seleccionades. # Document models PDFEinsteinDescription=Model de comanda complet (logo...) diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 58005491211..c05c4c50ea8 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -83,7 +83,7 @@ UserSetup=Configuración gestión de los usuarios MenuSetup=Administración de los menús por base de datos MenuLimits=Límites y precisión MenuIdParent=Id del menú padre -DetailMenuIdParent=ID del menú padre (0 para un menú superior) +DetailMenuIdParent=ID del menú padre (vacío para un menú superior) DetailPosition=Número de orden para la posición del menú PersonalizedMenusNotSupported=Menús personalizados no generados AllMenus=Todos @@ -1308,7 +1308,10 @@ InvoiceDateUsed=Fecha usada de factura YourCompanyDoesNotUseVAT=Su empresa está configurada como no sujeta al IVA (Inicio - Configuración - Empresa/Institución), por lo que no hay opción para la paremetrización del IVA. AccountancyCode=Código contable Deductible=Deducible +AccountancyCodeSell=Código contable ventas +AccountancyCodeBuy=Código contable compras ##### Agenda ##### + AgendaSetup=Módulo configuración de acciones y agenda PasswordTogetVCalExport=Clave de autorización vcal export link PastDelayVCalExport=No exportar los eventos de más de diff --git a/htdocs/langs/es_ES/holiday.lang b/htdocs/langs/es_ES/holiday.lang index 5e8e1f71d07..4d7344cc10c 100644 --- a/htdocs/langs/es_ES/holiday.lang +++ b/htdocs/langs/es_ES/holiday.lang @@ -84,7 +84,8 @@ NewSoldeCP=Nuevo saldo alreadyCPexist=Ya se ha efectuado una petición de vacaciones para este periodo. UserName=Nombre Apellidos Employee=Empleado - +FirstDayOfHoliday=Primer día libre +LastDayOfHoliday=Último día libre ## Configuration du Module ## ConfCP=Configuración del módulo Vacaciones diff --git a/htdocs/langs/es_ES/orders.lang b/htdocs/langs/es_ES/orders.lang index 70a226023e8..06a662847c6 100644 --- a/htdocs/langs/es_ES/orders.lang +++ b/htdocs/langs/es_ES/orders.lang @@ -141,6 +141,8 @@ OrderSource6=Revistas QtyOrdered=Cant. pedida AddDeliveryCostLine=Añadir una línea de gastos de portes indicando el peso del pedido SetDemandReason=Indicar origen del pedido +CreateInvoiceForThisCustomer=Crear una factura a partir de varios pedidos de este cliente +CloseProcessedOrdersAutomatically=Clasificar automáticamente como "Procesados" los pedidos seleccionados. # Document models PDFEinsteinDescription=Modelo de pedido completo (logo...) From 4f115268a9618079fa03bfd6f59148f7eab5ba64 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 28 Sep 2012 16:55:09 +0200 Subject: [PATCH 02/50] Fix: try this for subdir --- dev/codesniffer/jenkins_ruleset.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/codesniffer/jenkins_ruleset.xml b/dev/codesniffer/jenkins_ruleset.xml index c9d75c45128..0bde049b583 100755 --- a/dev/codesniffer/jenkins_ruleset.xml +++ b/dev/codesniffer/jenkins_ruleset.xml @@ -5,7 +5,7 @@ */conf/* */filemanagerdol/* - */includes/ckeditor/* + */includes/** */PEAR/* */NET/* */HTTP/* From d8a0fed001a461fe00f3e2eb84308248e747760f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 28 Sep 2012 17:11:53 +0200 Subject: [PATCH 03/50] Fix: try to add all subdir --- dev/codesniffer/jenkins_ruleset.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dev/codesniffer/jenkins_ruleset.xml b/dev/codesniffer/jenkins_ruleset.xml index 0bde049b583..7b3285e71dc 100755 --- a/dev/codesniffer/jenkins_ruleset.xml +++ b/dev/codesniffer/jenkins_ruleset.xml @@ -5,7 +5,10 @@ */conf/* */filemanagerdol/* - */includes/** + */includes/* + */includes/nusoap/* + */includes/nusoap/lib/* + */includes/nusoap/lib/Mail/* */PEAR/* */NET/* */HTTP/* From 44dde562fa3af810dcd49afe38dfe03bb60f8d5d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 28 Sep 2012 17:51:35 +0200 Subject: [PATCH 04/50] regression and add slash at end --- dev/codesniffer/jenkins_ruleset.xml | 12 ------------ quickbuild.xml | 1 + 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/dev/codesniffer/jenkins_ruleset.xml b/dev/codesniffer/jenkins_ruleset.xml index 7b3285e71dc..f414b6270af 100755 --- a/dev/codesniffer/jenkins_ruleset.xml +++ b/dev/codesniffer/jenkins_ruleset.xml @@ -2,18 +2,6 @@ Dolibarr coding standard. - - */conf/* - */filemanagerdol/* - */includes/* - */includes/nusoap/* - */includes/nusoap/lib/* - */includes/nusoap/lib/Mail/* - */PEAR/* - */NET/* - */HTTP/* - */zendgdata/* - */reportico/* diff --git a/quickbuild.xml b/quickbuild.xml index 94b2b0d18f2..dfee1b24a7a 100644 --- a/quickbuild.xml +++ b/quickbuild.xml @@ -69,6 +69,7 @@ - + @@ -69,7 +69,7 @@ --> - + @@ -72,8 +72,8 @@ @@ -98,5 +98,5 @@ - + \ No newline at end of file diff --git a/quickbuild.xml b/quickbuild.xml index 01fb110ee7f..2ce72f32b5d 100644 --- a/quickbuild.xml +++ b/quickbuild.xml @@ -2,7 +2,7 @@ - + @@ -69,10 +69,9 @@ From 422f028ac9d4b4c747ccb07b75bdecb33893c846 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 29 Sep 2012 12:07:07 +0200 Subject: [PATCH 07/50] Fix: use ADHERENT_BANK_USE for check or not bank via invoice Fix: code optimizing --- htdocs/adherents/card_subscriptions.php | 69 +++++++++++-------------- 1 file changed, 31 insertions(+), 38 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 400e386ef8e..6972f32113d 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -1,7 +1,8 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2012 Laurent Destailleur +/* Copyright (C) 2001-2004 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2012 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 @@ -40,6 +41,7 @@ $langs->load("mails"); $action=GETPOST('action','alpha'); +$confirm=GETPOST('confirm','alpha'); $rowid=GETPOST('rowid','int'); $typeid=GETPOST('typeid','int'); @@ -87,7 +89,7 @@ if ($rowid) */ // Create third party from a member -if ($action == 'confirm_create_thirdparty' && $_POST["confirm"] == 'yes' && $user->rights->societe->creer) +if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights->societe->creer) { if ($result > 0) { @@ -589,10 +591,10 @@ if ($rowid) print ''; - if ($_GET['action'] != 'editlogin' && $user->rights->adherent->creer) print ''; + if ($action != 'editlogin' && $user->rights->adherent->creer) print ''; print '
'; print $langs->trans("LinkedToDolibarrUser"); print 'id.'">'.img_edit($langs->trans('SetLinkToUser'),1).'id.'">'.img_edit($langs->trans('SetLinkToUser'),1).'
'; print ''; - if ($_GET['action'] == 'editlogin') + if ($action == 'editlogin') { /*$include=array(); if (empty($user->rights->user->user->creer)) // If can edit only itself user, we can link to itself only @@ -748,49 +750,40 @@ if ($rowid) if ($conf->use_javascript_ajax) { print "\n".''."\n"; } // Confirm create third party - if ($_GET["action"] == 'create_thirdparty') + if ($action == 'create_thirdparty') { $name = $object->getFullName($langs); if (! empty($name)) @@ -803,14 +796,14 @@ if ($rowid) } // Create a form array - $formquestion=array( array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); + $formquestion=array(array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name)); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1); if ($ret == 'html') print '
'; } - print '
'; + print ''; print ''; print ''; print ''; @@ -888,15 +881,15 @@ if ($rowid) print ''.$langs->trans('MoreActions'); print ''; print ''; - print ' '.$langs->trans("None").'
'; + print ' '.$langs->trans("None").'
'; if (! empty($conf->banque->enabled)) { - print ' '.$langs->trans("MoreActionBankDirect").'
'; } if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { - print 'global->ADHERENT_BANK_USE) || $invoiceonly?' checked="checked"':''); if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"'; print '> '.$langs->trans("MoreActionInvoiceOnly"); if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; @@ -911,7 +904,7 @@ if ($rowid) } if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { - print 'global->ADHERENT_BANK_USE)?' checked="checked"':''); if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"'; print '> '.$langs->trans("MoreActionBankViaInvoice"); if ($object->fk_soc) print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')'; From d23188c64abc2953e31704e19c2c4ed741d6bad4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 30 Sep 2012 20:49:13 +0200 Subject: [PATCH 08/50] Fix: doxygen --- htdocs/compta/facture/class/facture-rec.class.php | 1 + htdocs/compta/facture/class/facture.class.php | 2 ++ htdocs/core/class/commondocgenerator.class.php | 11 ++++++----- htdocs/core/lib/member.lib.php | 3 +-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 95fd10c7068..02c765ba131 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -410,6 +410,7 @@ class FactureRec extends Facture * @param int $type Type of line (0=product, 1=service) * @param int $rang Position of line * @param int $special_code Special code + * @param string $label Label of the line * @return int <0 if KO, Id of line if OK */ function addline($facid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='') diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 6db8f202fd4..c37e464514b 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1880,6 +1880,7 @@ class Facture extends CommonInvoice * @param int $fk_parent_line Id of parent line * @param int $fk_fournprice To calculate margin * @param int $pa_ht Buying price of line + * @param string $label Label of the line * @return int <0 if KO, Id of line if OK */ function addline($facid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='') @@ -2035,6 +2036,7 @@ class Facture extends CommonInvoice * @param int $skip_update_total ??? * @param int $fk_fournprice To calculate margin * @param int $pa_ht Buying price of line + * @param string $label Label of the line * @return int < 0 if KO, > 0 if OK */ function updateline($rowid, $desc, $pu, $qty, $remise_percent, $date_start, $date_end, $txtva, $txlocaltax1=0, $txlocaltax2=0, $price_base_type='HT', $info_bits=0, $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='') diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 5007dca817f..bf3e8e98ddf 100755 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -168,13 +168,14 @@ abstract class CommonDocGenerator /** * Rect pdf * - * @param unknown_type $pdf - * @param unknown_type $x - * @param unknown_type $y - * @param unknown_type $l - * @param unknown_type $h + * @param PDF $pdf Object PDF + * @param float $x Abscissa of first point + * @param float $y Ordinate of first point + * @param float $l ?? + * @param float $h ?? * @param int $hidetop Hide top * @param int $hidebottom Hide bottom + * @return void */ function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0) { diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 15ada8ed4c0..c3314bb3087 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -103,8 +103,7 @@ function member_prepare_head($object) /** * Return array head with list of tabs to view object informations * - * @param Object $object Member - * @return array head + * @return array head */ function member_admin_prepare_head() { From bcf46d00f0abcd7a2fbec2a8dcddda11105f8f79 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 30 Sep 2012 21:26:58 +0200 Subject: [PATCH 09/50] Fix: convert line delimiters !! --- htdocs/adherents/index.php | 10 +- htdocs/adherents/liste.php | 12 +-- htdocs/admin/menus/edit.php | 24 ++--- htdocs/admin/system/phpinfo.php | 32 +++--- htdocs/commande/orderstoinvoice.php | 8 +- htdocs/compta/facture.php | 4 +- htdocs/compta/recap-compta.php | 2 +- htdocs/core/boxes/box_members.php | 12 +-- htdocs/core/class/extrafields.class.php | 14 +-- htdocs/core/lib/usergroups.lib.php | 30 +++--- htdocs/fourn/facture/fiche.php | 4 +- htdocs/holiday/admin/holiday.php | 2 +- htdocs/holiday/fiche.php | 6 +- htdocs/holiday/index.php | 2 +- htdocs/holiday/month_report.php | 2 +- htdocs/user/perms.php | 132 ++++++++++++------------ 16 files changed, 148 insertions(+), 148 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 11acc1914a1..7827abad53a 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -294,12 +294,12 @@ if ($resql) $staticmember->id=$obj->rowid; $staticmember->lastname=$obj->lastname; $staticmember->firstname=$obj->firstname; - if (! empty($obj->fk_soc)) { - $staticmember->socid = $obj->fk_soc; + if (! empty($obj->fk_soc)) { + $staticmember->socid = $obj->fk_soc; $staticmember->fetch_thirdparty(); - $staticmember->name=$staticmember->thirdparty->name; - } else { - $staticmember->name=$obj->company; + $staticmember->name=$staticmember->thirdparty->name; + } else { + $staticmember->name=$obj->company; } $staticmember->ref=$staticmember->getFullName($langs); print ''.$subscriptionstatic->getNomUrl(1).''; diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index 4752a36a65a..075510fa915 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -268,12 +268,12 @@ if ($resql) $memberstatic->lastname=$objp->lastname; $memberstatic->firstname=$objp->firstname; - if (! empty($objp->fk_soc)) { - $memberstatic->socid = $objp->fk_soc; - $memberstatic->fetch_thirdparty(); - $companyname=$memberstatic->thirdparty->name; - } else { - $companyname=$objp->company; + if (! empty($objp->fk_soc)) { + $memberstatic->socid = $objp->fk_soc; + $memberstatic->fetch_thirdparty(); + $companyname=$memberstatic->thirdparty->name; + } else { + $companyname=$objp->company; } $var=!$var; diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index fff20023c05..3e747760544 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -116,18 +116,18 @@ if ($action == 'add') $leftmenu=''; $mainmenu=''; if (! empty($_POST['menuId']) && ! is_numeric($_POST['menuId'])) { - $tmp=explode('&',$_POST['menuId']); - foreach($tmp as $s) - { - if (preg_match('/fk_mainmenu=/',$s)) - { - $mainmenu=preg_replace('/fk_mainmenu=/','',$s); - } - if (preg_match('/fk_leftmenu=/',$s)) - { - $leftmenu=preg_replace('/fk_leftmenu=/','',$s); - } - } + $tmp=explode('&',$_POST['menuId']); + foreach($tmp as $s) + { + if (preg_match('/fk_mainmenu=/',$s)) + { + $mainmenu=preg_replace('/fk_mainmenu=/','',$s); + } + if (preg_match('/fk_leftmenu=/',$s)) + { + $leftmenu=preg_replace('/fk_leftmenu=/','',$s); + } + } } $langs->load("errors"); diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index 13b7cef0c09..4167f943d32 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -23,7 +23,7 @@ */ require '../../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; $langs->load("admin"); @@ -40,22 +40,22 @@ llxHeader(); $title='InfoPHP'; -if (isset($title)) -{ - print_fiche_titre($langs->trans($title), '', 'setup'); -} +if (isset($title)) +{ + print_fiche_titre($langs->trans($title), '', 'setup'); +} -// Get php_info array +// Get php_info array $phparray=phpinfo_array(); foreach($phparray as $key => $value) { //print_titre($key); - print ''; - print ''; + print '
'; + print ''; //print ''; - print ''; - print ''; - print "\n"; + print ''; + print ''; + print "\n"; $var=true; //var_dump($value); @@ -65,10 +65,10 @@ foreach($phparray as $key => $value) { $var=!$var; print ''; - print ''; + print ''; $valtoshow=$keyvalue; if ($keyparam == 'X-ChromePhp-Data') $valtoshow=dol_trunc($keyvalue,80); - print ''; + print ''; print ''; } else @@ -77,13 +77,13 @@ foreach($phparray as $key => $value) print ''; print ''; $i=0; - foreach($keyvalue as $keyparam2 => $keyvalue2) + foreach($keyvalue as $keyparam2 => $keyvalue2) { print ''; } @@ -92,7 +92,7 @@ foreach($phparray as $key => $value) } print '
'.$langs->trans("Parameter").''.$key.''.$langs->trans("Value").'
'.$key.''.$langs->trans("Value").'
'.$keyparam.''.$keyparam.''.$valtoshow.''.$valtoshow.'
'.$keyparam.''; $valtoshow=$keyvalue2; if ($keyparam == 'disable_functions') $valtoshow=join(', ',explode(',',trim($valtoshow))); //print $keyparam2.' = '; - print $valtoshow; + print $valtoshow; $i++; print '

'; } - + llxFooter(); diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 60ce5d3b11b..5d9a6b5855a 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -40,12 +40,12 @@ $langs->load('orders'); $langs->load('deliveries'); $langs->load('companies'); -if (! $user->rights->facture->creer) +if (! $user->rights->facture->creer) accessforbidden(); -$id = (GETPOST('id')?GETPOST("id"):GETPOST("facid")); // For backward compatibility -$ref = GETPOST('ref','alpha'); -$action = GETPOST('action','alpha'); +$id = (GETPOST('id')?GETPOST("id"):GETPOST("facid")); // For backward compatibility +$ref = GETPOST('ref','alpha'); +$action = GETPOST('action','alpha'); $confirm = GETPOST('confirm','alpha'); $sref = GETPOST('sref'); $sref_client = GETPOST('sref_client'); diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 60b9ba8ad4c..18364723a90 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1856,8 +1856,8 @@ if ($action == 'create') { $newinvoice_static->id=$key; $newinvoice_static->ref=$valarray['ref']; - $newinvoice_static->statut=$valarray['status']; - $newinvoice_static->type=$valarray['type']; + $newinvoice_static->statut=$valarray['status']; + $newinvoice_static->type=$valarray['type']; $newinvoice_static->paye=$valarray['paye']; $optionsav.=' + + \ No newline at end of file diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php new file mode 100644 index 00000000000..d825e14d681 --- /dev/null +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_edit.tpl.php @@ -0,0 +1,140 @@ + + * Copyright (C) 2012 Philippe Grand + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +$contact = $GLOBALS['objcanvas']->control->object; + +?> + + + +control->tpl['title']); + +dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']); + +echo $this->control->tpl['ajax_selectcountry']; +?> + +
+ +
"> + + + + + + + +control->tpl['company_id'])) { ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
trans("Ref"); ?>control->tpl['ref']; ?>
trans("Lastname").' / '.$langs->trans("Label"); ?>trans("Firstname"); ?>
trans("Company"); ?>control->tpl['company']; ?>
trans("UserTitle"); ?>control->tpl['select_civility']; ?>
trans("Morphy"); ?>
trans("Address"); ?>
trans("Zip").' / '.$langs->trans("Town"); ?>control->tpl['select_zip'].' '.$this->control->tpl['select_town']; ?>
trans("Country"); ?>control->tpl['select_country'].$this->control->tpl['info_admin']; ?>
trans('State'); ?>control->tpl['select_state']; ?>
trans("PhonePro"); ?>trans("PhonePerso"); ?>
trans("PhoneMobile"); ?>
trans("Email"); ?>
trans("ContactVisibility"); ?>control->tpl['select_visibility']; ?>
trans("Note"); ?>
trans("DolibarrLogin"); ?>control->tpl['dolibarr_user']; ?>
+ ">  + "> +

+ +
+ + \ No newline at end of file diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php new file mode 100644 index 00000000000..7ffd10cb149 --- /dev/null +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php @@ -0,0 +1,141 @@ + + * Copyright (C) 2012 Philippe Grand + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +$contact = $GLOBALS['objcanvas']->control->object; +?> + + +control->tpl['showhead']; ?> + +control->tpl['error'],$this->control->tpl['errors']); +?> + +control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user']; ?> +control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
trans("Ref"); ?>control->tpl['showrefnav']; ?>
trans("Lastname"); ?>control->tpl['name']; ?>trans("Firstname"); ?>control->tpl['firstname']; ?>
trans("Company"); ?>control->tpl['company']; ?>
trans("UserTitle"); ?>control->tpl['civility']; ?>
trans("Morphy"); ?>control->tpl['select_morphy']; ?>
trans("Address"); ?>control->tpl['address']; ?>
trans("Zip").' / '.$langs->trans("Town"); ?>control->tpl['zip'].$this->control->tpl['ville']; ?>
trans("Country"); ?>control->tpl['country']; ?>
trans('State'); ?>control->tpl['departement']; ?>
trans("PhonePro"); ?>control->tpl['phone_pro']; ?>trans("PhonePerso"); ?>control->tpl['phone_perso']; ?>
trans("PhoneMobile"); ?>control->tpl['phone_mobile']; ?>
trans("EMail"); ?>control->tpl['email']; ?>
trans("ContactVisibility"); ?>control->tpl['visibility']; ?>
trans("Note"); ?>control->tpl['note']; ?>
trans("DolibarrLogin"); ?>control->tpl['dolibarr_user']; ?>
+ +control->tpl['showend']; ?> + +societe_id) { ?> +
+ +rights->adherent->creer) { ?> +">trans('Modify'); ?> + + +control->tpl['user_id'] && $user->rights->user->user->creer) { ?> +">trans("CreateDolibarrLogin"); ?> + + +rights->adherent->supprimer) { ?> +">trans('Delete'); ?> + + +

+control->tpl['actionstodo']; + +echo $this->control->tpl['actionsdone']; +?> + + \ No newline at end of file diff --git a/htdocs/adherents/canvas/default/tpl/index.php b/htdocs/adherents/canvas/default/tpl/index.php new file mode 100644 index 00000000000..7db0dd9ebf9 --- /dev/null +++ b/htdocs/adherents/canvas/default/tpl/index.php @@ -0,0 +1 @@ +Url not available \ No newline at end of file diff --git a/htdocs/adherents/canvas/index.php b/htdocs/adherents/canvas/index.php new file mode 100644 index 00000000000..7db0dd9ebf9 --- /dev/null +++ b/htdocs/adherents/canvas/index.php @@ -0,0 +1 @@ +Url not available \ No newline at end of file From 6329c01d5d76517ef1f61579bd4b659a4989c3f1 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 1 Oct 2012 11:23:51 +0200 Subject: [PATCH 13/50] Added link to multi-origin invoicing on thirdparty page --- htdocs/comm/fiche.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 889f13c635e..2abee28066e 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -498,6 +498,7 @@ if ($id > 0) print ''; print ''; print ''; + print ''; print '
'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' ('.$num.')'.img_picto($langs->trans("Statistics"),'stats').''.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').'
'; print ''; } From 1d21f24fa79bcce6b3c66beb34f4db877fe9d5cb Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 1 Oct 2012 11:25:17 +0200 Subject: [PATCH 14/50] Task # 559 : Add possibility to define a discount for min quantity on supplier product prices --- .../fourn/class/fournisseur.product.class.php | 32 ++++++++++++++----- .../install/mysql/migration/3.2.0-3.3.0.sql | 4 +++ htdocs/langs/en_US/products.lang | 1 + htdocs/langs/fr_FR/products.lang | 1 + htdocs/product/fournisseurs.php | 20 +++++++++--- 5 files changed, 46 insertions(+), 12 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 02b6b92ab9e..fc02ba27d4a 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -44,6 +44,8 @@ class ProductFournisseur extends Product var $fourn_ref; // ref supplier var $fourn_qty; // quantity for price var $fourn_price; // price for quantity + var $fourn_remise_percent; // discount for quantity (percent) + var $fourn_remise; // discount for quantity (amount) var $product_fourn_id; // supplier id var $fk_availability; // availability delay var $fourn_unitprice; @@ -133,18 +135,20 @@ class ProductFournisseur extends Product /** * Modify the purchase price for a supplier * - * @param int $qty Min quantity for which price is valid - * @param float $buyprice Purchase price for the quantity min - * @param User $user Object user user made changes + * @param int $qty Min quantity for which price is valid + * @param float $buyprice Purchase price for the quantity min + * @param User $user Object user user made changes * @param string $price_base_type HT or TTC * @param Societe $fourn Supplier * @param int $availability Product availability * @param string $ref_fourn Supplier ref * @param float $tva_tx VAT rate * @param string $charges costs affering to product + * @param float $remise_percent Discount regarding qty (percent) + * @param float $remise Discount regarding qty (amount) * @return int >0 if KO, >0 if OK */ - function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0) + function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges=0, $remise_percent=0, $remise=0) { global $conf,$mysoc; @@ -177,6 +181,8 @@ class ProductFournisseur extends Product $sql.= " SET fk_user = " . $user->id." ,"; $sql.= " price = ".price2num($buyprice).","; $sql.= " quantity = ".$qty.","; + $sql.= " remise_percent = ".$remise_percent.","; + $sql.= " remise = ".$remise.","; $sql.= " unitprice = ".$unitBuyPrice.","; $sql.= " unitcharges = ".$unitCharges.","; $sql.= " tva_tx = ".$tva_tx.","; @@ -211,7 +217,7 @@ class ProductFournisseur extends Product { // Add price for this quantity to supplier $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price("; - $sql.= "datec, fk_product, fk_soc, ref_fourn, fk_user, price, quantity, unitprice, tva_tx, fk_availability, entity)"; + $sql.= "datec, fk_product, fk_soc, ref_fourn, fk_user, price, quantity, remise_percent, remise, unitprice, tva_tx, fk_availability, entity)"; $sql.= " values('".$this->db->idate($now)."',"; $sql.= " ".$this->id.","; $sql.= " ".$fourn->id.","; @@ -219,6 +225,8 @@ class ProductFournisseur extends Product $sql.= " ".$user->id.","; $sql.= " ".price2num($buyprice).","; $sql.= " ".$qty.","; + $sql.= " ".$remise_percent.","; + $sql.= " ".$remise.","; $sql.= " ".$unitBuyPrice.","; $sql.= " ".$tva_tx.","; $sql.= " ".$availability.","; @@ -280,7 +288,7 @@ class ProductFournisseur extends Product */ function fetch_product_fournisseur_price($rowid) { - $sql = "SELECT pfp.rowid, pfp.price, pfp.quantity, pfp.unitprice, pfp.tva_tx, pfp.fk_availability,"; + $sql = "SELECT pfp.rowid, pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability,"; $sql.= " pfp.fk_soc, pfp.ref_fourn, pfp.fk_product, pfp.charges, pfp.unitcharges"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= " WHERE pfp.rowid = ".$rowid; @@ -297,6 +305,8 @@ class ProductFournisseur extends Product $this->fourn_price = $obj->price; $this->fourn_charges = $obj->charges; $this->fourn_qty = $obj->quantity; + $this->fourn_remise_percent = $obj->remise_percent; + $this->fourn_remise = $obj->remise; $this->fourn_unitprice = $obj->unitprice; $this->fourn_unitcharges = $obj->unitcharges; $this->tva_tx = $obj->tva_tx; @@ -331,7 +341,7 @@ class ProductFournisseur extends Product $sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,"; $sql.= " pfp.rowid as product_fourn_pri_id, pfp.ref_fourn, pfp.fk_product as product_fourn_id,"; - $sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.unitcharges"; + $sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.unitcharges"; $sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE pfp.entity IN (".getEntity('product', 1).")"; @@ -356,6 +366,8 @@ class ProductFournisseur extends Product $prodfourn->fourn_ref = $record["ref_fourn"]; $prodfourn->fourn_price = $record["price"]; $prodfourn->fourn_qty = $record["quantity"]; + $prodfourn->fourn_remise_percent = $record["remise_percent"]; + $prodfourn->fourn_remise = $record["remise"]; $prodfourn->fourn_unitprice = $record["unitprice"]; $prodfourn->fourn_charges = $record["charges"]; $prodfourn->fourn_unitcharges = $record["unitcharges"]; @@ -406,6 +418,8 @@ class ProductFournisseur extends Product $this->fourn_ref = ''; $this->fourn_price = ''; $this->fourn_qty = ''; + $this->fourn_remise_percent = ''; + $this->fourn_remise = ''; $this->fourn_unitprice = ''; $this->fourn_id = ''; $this->fourn_name = ''; @@ -431,9 +445,11 @@ class ProductFournisseur extends Product $this->fourn_ref = $record["ref_fourn"]; $this->fourn_price = $record["price"]; $this->fourn_qty = $record["quantity"]; + $this->fourn_remise_percent = $record["remise_percent"]; + $this->fourn_remise = $record["remise"]; $this->fourn_unitprice = $record["unitprice"]; $this->fourn_charges = $record["charges"]; - $this->fourn_unitcharges = $record["unitcharges"]; + $this->fourn_unitcharges = $record["unitcharges"]; $this->fourn_tva_tx = $record["tva_tx"]; $this->fourn_id = $record["fourn_id"]; $this->fourn_name = $record["supplier_name"]; diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index baadd65d206..bf6229c859f 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -742,3 +742,7 @@ insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (436,'PCG99-BASE','PROD', 'XXXXXX', '791','79', 'Transferts de charges d''exploitation ', '1'); insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (437,'PCG99-BASE','PROD', 'XXXXXX', '796','79', 'Transferts de charges financières', '1'); insert into llx_accountingaccount (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (438,'PCG99-BASE','PROD', 'XXXXXX', '797','79', 'Transferts de charges exceptionnelles', '1'); + +-- Add discount in product supplier price +ALTER TABLE llx_product_fournisseur_price ADD COLUMN remise_percent DOUBLE NOT NULL DEFAULT 0 AFTER quantity; +ALTER TABLE llx_product_fournisseur_price ADD COLUMN remise DOUBLE NOT NULL DEFAULT 0 AFTER remise_percent; diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index d5f67a57d11..f59a9e0bba6 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -146,6 +146,7 @@ ProductSpecial=Special QtyMin=Quantity minimum PriceQty=Price for this quantity PriceQtyMin=Price quantity min. +DiscountQtyMin=Discount quantity min. NoPriceDefinedForThisSupplier=No price/qty defined for this supplier/product NoSupplierPriceDefinedForThisProduct=No supplier price/qty defined for this product RecordedProducts=Products recorded diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index 4f5bb65ad4d..3c301e60168 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -146,6 +146,7 @@ ProductSpecial=Special QtyMin=Quantité minimum PriceQty=Prix pour la quantité PriceQtyMin=Prix quantité min. +DiscountQtyMin=Remise quantité min. NoPriceDefinedForThisSupplier=Aucun prix/qté défini pour ce fournisseur/produit NoSupplierPriceDefinedForThisProduct=Aucun prix/qté fournisseur défini pour ce produit RecordedProducts=Produits en vente diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 397828dd5c2..08b7ab05410 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -94,6 +94,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) $ref_fourn=GETPOST("ref_fourn"); if (empty($ref_fourn)) $ref_fourn=GETPOST("search_ref_fourn"); $quantity=GETPOST("qty"); + $remise_percent=price2num(GETPOST('remise_percent','alpha')); $tva_tx=price2num(GETPOST('tva_tx','alpha')); if (empty($quantity)) @@ -153,10 +154,10 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel")) $supplier=new Fournisseur($db); $result=$supplier->fetch($id_fourn); - if (isset($_POST['ref_fourn_price_id'])) - $product->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']); + if (isset($_POST['ref_fourn_price_id'])) + $product->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']); - $ret=$product->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"]); + $ret=$product->update_buyprice($quantity, $_POST["price"], $user, $_POST["price_base_type"], $supplier, $_POST["oselDispo"], $ref_fourn, $tva_tx, $_POST["charges"], $remise_percent); if ($ret < 0) { $error++; @@ -346,7 +347,12 @@ if ($id || $ref) print ''; print ' '; print $form->select_PriceBaseType((GETPOST('price_base_type')?GETPOST('price_base_type'):$product->price_base_type), "price_base_type"); - print ''; + print ''; + + // Discount qty min + print ''.$langs->trans("DiscountQtyMin").''; + print ' %'; + print ''; print ''; // Charges ???? @@ -407,6 +413,7 @@ if ($id || $ref) // Charges ???? if (! empty($conf->margin->enabled)) print ''.$langs->trans("Charges").''; print_liste_field_titre($langs->trans("UnitPriceHT"),$_SERVER["PHP_SELF"],"pfp.unitprice","",$param,'align="right"',$sortfield,$sortorder); + print ''.$langs->trans("DiscountQtyMin").''; // Charges ???? if (! empty($conf->margin->enabled)) print ''.$langs->trans("UnitCharges").''; print ''; @@ -466,6 +473,11 @@ if ($id || $ref) print price($productfourn->fourn_unitprice); //print $objp->unitprice? price($objp->unitprice) : ($objp->quantity?price($objp->price/$objp->quantity):" "); print ''; + + // Discount + print ''; + print vatrate($productfourn->fourn_remise_percent, $langs); + print ''; // Unit Charges ??? if (! empty($conf->margin->enabled)) From ed2a140046c55fd9506a383483b55801b0632d24 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 1 Oct 2012 11:45:28 +0200 Subject: [PATCH 15/50] Task # 559 : add display of discount in product list while adding line on supplier order --- htdocs/core/class/html.form.class.php | 13 ++++++++++--- htdocs/fourn/commande/fiche.php | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 93017f18362..5a3482fac18 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1408,7 +1408,7 @@ class Form $langs->load('stocks'); $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,"; - $sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.unitprice,"; + $sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,"; $sql.= " s.nom"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product"; @@ -1435,7 +1435,7 @@ class Form $sql .= " OR p.barcode LIKE '".$filterkey."'"; } } - $sql.= " ORDER BY pfp.ref_fourn DESC"; + $sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC"; // Build output string $outselect=''; @@ -1461,6 +1461,7 @@ class Form $outref=$objp->ref; $outval=''; $outqty=1; + $outdiscount=0; $opt = '