diff --git a/ChangeLog b/ChangeLog index 494050efbfc..481f86bcb31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,7 +14,7 @@ NEW: Add a payment module for Stripe. NEW: Add module "Product variant" (like red, blue for the product shoes) NEW: Accountancy - Activate multi-journal & Add journal_label to database (FEC) NEW: Add a tracking id into mass emailing. -NEW: Tax system more compatible with the new tax roollout in India (IGST / CGST / SGST). +NEW: Tax system more compatible with the new tax rollout in India (IGST / CGST / SGST). NEW: Add calculation function for Loan schedule NEW: Add "depends on" and "required by" into module informations NEW: Add hidden option THIRDPARTY_INCLUDE_PARENT_IN_LINKTO diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 6698be8b01f..f366d8a5ce3 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin - * Copyright (C) 2012-2105 Juanjo Menent + * Copyright (C) 2012-2107 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 @@ -74,7 +74,11 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"],'chaine',0,'',$conf->entity); - + + + dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["_MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } @@ -249,6 +253,40 @@ if ($action == 'edit') // Edit print '
'; + // Localtaxes + if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) + { + $locales =''; + $text=''; + + if ($mysoc->useLocalTax(1)) + { + $locales = $langs->transcountry("LT1",$mysoc->country_code); + $text ='' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT1",$mysoc->country_code)) . ''; + $text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_SECOND_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX : 0, 1); + $text .= ''; + } + + if ($mysoc->useLocalTax(2)) + { + $locales.=($locales?' & ':'').$langs->transcountry("LT2",$mysoc->country_code); + + $text.= '' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT2",$mysoc->country_code)) . ''; + $text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_THIRD_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX : 0, 1); + $text.= ''; + } + + print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'',''); + $var=true; + print ''; + print ''; + print $text; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; + + } + // Other print load_fiche_titre($langs->trans("Other"),'','').'
'; $var=true; @@ -444,6 +482,40 @@ else // Show print '
'; + // Localtaxes + if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2)) + { + $locales =''; + $text=''; + + if ($mysoc->useLocalTax(1)) + { + $locales = $langs->transcountry("LT1",$mysoc->country_code); + $text ='' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT1",$mysoc->country_code)) . ''; + $text .= yn($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX,1); + $text .= ''; + } + + if ($mysoc->useLocalTax(2)) + { + $locales.=($locales?' & ':'').$langs->transcountry("LT2",$mysoc->country_code); + + $text.= '' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT2",$mysoc->country_code)) . ''; + $text.= yn($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX,1); + $text.= ''; + } + + print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'',''); + $var=true; + print ''; + print ''; + print $text; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print '
'; + + } + // Other print load_fiche_titre($langs->trans("Other"),'',''); $var=true; diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 65b8eef5a66..3a9f3a98e26 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -45,7 +45,6 @@ $ref = GETPOST('ref','alpha'); $socid=''; if (! empty($user->societe_id)) { - $action=''; $socid = $user->societe_id; } $result = restrictedArea($user, 'propal', $id); diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 7eea9c95877..d69ec07360a 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -44,7 +44,6 @@ $ref = GETPOST('ref'); // Security check if ($user->societe_id) { - $action=''; $socid = $user->societe_id; } $result=restrictedArea($user,'commande',$id,''); diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 9e5ddf8008a..fa880e0597f 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -514,7 +514,7 @@ foreach ($accounts as $key=>$type) if (! empty($conf->accounting->enabled)) { $accountingjournal = new AccountingJournal($db); - $accountingjournal->fetch('',$acc->fk_accountancy_journal); + $accountingjournal->fetch($acc->fk_accountancy_journal); print $accountingjournal->getNomUrl(0,1,1,'',1); } else diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 14e18cda847..f864b363cc4 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -785,7 +785,7 @@ class Facture extends CommonInvoice $facture->situation_final = $this->situation_final; // Loop on each line of new invoice - foreach($facture->lines as $i => $line) + foreach($facture->lines as $i => $tmpline) { $facture->lines[$i]->fk_prev_id = $this->lines[$i]->rowid; if ($invertdetail) diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index b6c77207952..1ab0d7ceb93 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -49,7 +49,6 @@ $confirm=GETPOST('confirm', 'alpha'); // Security check if ($user->societe_id) { - $action=''; $socid = $user->societe_id; } $result=restrictedArea($user,'facture',$id,''); @@ -72,9 +71,11 @@ if ($object->fetch($id)) $upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref); } + /* * Actions */ + include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; @@ -100,7 +101,7 @@ if ($id > 0 || ! empty($ref)) dol_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'), -1, 'bill'); $totalpaye = $object->getSommePaiement(); - + // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; @@ -109,11 +110,11 @@ if ($id > 0 || ! empty($ref)) $totalsize+=$file['size']; } - + // Invoice content - + $linkback = '' . $langs->trans("BackToList") . ''; - + $morehtmlref='
'; // Ref customer $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); @@ -154,14 +155,14 @@ if ($id > 0 || ! empty($ref)) } } $morehtmlref.='
'; - + $object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status - + dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0); print '
'; print '
'; - + print ''; print ''; diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index f21c41d828d..981de037c13 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -30,9 +30,9 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ($object->id) { if (! empty($upload_dirold) && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) - dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask')); + $result = dol_add_file_process($upload_dirold, 0, 1, 'userfile', GETPOST('savingdocmask')); else - dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask')); + $result = dol_add_file_process($upload_dir, 0, 1, 'userfile', GETPOST('savingdocmask')); } } elseif (GETPOST('linkit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) @@ -176,7 +176,7 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave')) setEventMessages($langs->trans("FileRenamed"), null); } - else + else { $langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now. setEventMessages($langs->trans("ErrorFailToRenameFile", $filenamefrom, $filenameto), null, 'errors'); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index a8de7be8b76..6750aa5de38 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -430,7 +430,7 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se } $arrayofinclusion=array(); - foreach($listofobjectref as $tmppdf) $arrayofinclusion[]=preg_quote($tmppdf.'.pdf','/'); + foreach($listofobjectref as $tmppdf) $arrayofinclusion[]='^'.preg_quote($tmppdf.'.pdf','/').'$'; $listoffiles = dol_dir_list($uploaddir,'all',1,implode('|',$arrayofinclusion),'\.meta$|\.png','date',SORT_DESC,0,true); // build list of files with full path @@ -505,8 +505,8 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se $pdf=pdf_getInstance(); if (class_exists('TCPDF')) { - $pdf->setPrintHeader(false); - $pdf->setPrintFooter(false); + $pdf->setPrintHeader(false); + $pdf->setPrintFooter(false); } $pdf->SetFont(pdf_getPDFFont($outputlangs)); @@ -515,15 +515,15 @@ if (! $error && $massaction == "builddoc" && $permtoread && ! GETPOST('button_se // Add all others foreach($files as $file) { - // Charge un document PDF depuis un fichier. - $pagecount = $pdf->setSourceFile($file); - for ($i = 1; $i <= $pagecount; $i++) - { - $tplidx = $pdf->importPage($i); - $s = $pdf->getTemplatesize($tplidx); - $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); - $pdf->useTemplate($tplidx); - } + // Charge un document PDF depuis un fichier. + $pagecount = $pdf->setSourceFile($file); + for ($i = 1; $i <= $pagecount; $i++) + { + $tplidx = $pdf->importPage($i); + $s = $pdf->getTemplatesize($tplidx); + $pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L'); + $pdf->useTemplate($tplidx); + } } // Create output dir if not exists diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 8643e951fd4..c686d5e3904 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1654,34 +1654,41 @@ function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile= * @param string $fileinput Input file name * @param string $ext Format of target file (It is also extension added to file if fileoutput is not provided). * @param string $fileoutput Output filename - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, 0=Nothing done, >0 if OK */ function dol_convert_file($fileinput,$ext='png',$fileoutput='') { global $langs; - $image=new Imagick(); - $ret = $image->readImage($fileinput); - if ($ret) + if (class_exists('Imagick')) { - $ret = $image->setImageFormat($ext); + $image=new Imagick(); + $ret = $image->readImage($fileinput); if ($ret) { - if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext; + $ret = $image->setImageFormat($ext); + if ($ret) + { + if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext; - $count = $image->getNumberImages(); - $ret = $image->writeImages($fileoutput, true); - if ($ret) return $count; - else return -3; + $count = $image->getNumberImages(); + $ret = $image->writeImages($fileoutput, true); + if ($ret) return $count; + else return -3; + } + else + { + return -2; + } } else { - return -2; + return -1; } } else { - return -1; + return 0; } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d9be404d13d..4aa3ab65ce5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1236,8 +1236,11 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r && (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file))) ) { - $ret = dol_convert_file($file, 'png', $fileimage); - if ($ret < 0) $error++; + if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here. + { + $ret = dol_convert_file($file, 'png', $fileimage); + if ($ret < 0) $error++; + } } $heightforphotref=70; @@ -3702,7 +3705,13 @@ function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0) $info_bits |= 1; } - $ret=price($rate,0,'',0,0).($addpercent?'%':''); + // If rate is '9/9/9' we don't change it. If rate is '9.000' we apply price() + if (! preg_match('/\//', $rate)) $ret=price($rate,0,'',0,0).($addpercent?'%':''); + else + { + // TODO Split on / and output with a price2num to have clean numbers with ton of 000. + $ret=$rate.($addpercent?'%':''); + } if ($info_bits & 1) $ret.=' *'; $ret.=$morelabel; return $ret; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 5b344056efb..8a445625022 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1,9 +1,9 @@ +/* Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2007 Patrick Raguin * Copyright (C) 2010-2012 Regis Houssin - * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2010-2017 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2015 Raphaël Doursenaud @@ -1470,7 +1470,7 @@ function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0) */ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) { - global $hookmanager; + global $conf, $hookmanager, $mysoc; $result=''; $reshook=0; @@ -1487,7 +1487,32 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) } if (empty($reshook)) { - if (empty($hidedetails) || $hidedetails > 1) $result.=vatrate($object->lines[$i]->tva_tx,1,$object->lines[$i]->info_bits,1); + if (empty($hidedetails) || $hidedetails > 1) + { + $tmpresult=''; + + $tmpresult.=vatrate($object->lines[$i]->tva_tx, 1, $object->lines[$i]->info_bits, 1); + if (empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) + { + if ($object->lines[$i]->total_localtax1 != 0) + { + if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; + else $tmpresult=''; + $tmpresult.=vatrate(abs($object->lines[$i]->localtax1_tx),1); + } + } + if (empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) + { + if ($object->lines[$i]->total_localtax2 != 0) + { + if (preg_replace('/[\s0%]/','',$tmpresult)) $tmpresult.='/'; + else $tmpresult=''; + $tmpresult.=vatrate(abs($object->lines[$i]->localtax2_tx),1); + } + } + + $result.=$tmpresult; + } } return $result; } diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 9f72a88599c..3957667714b 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -292,16 +292,16 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -- Project - Categories -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 3__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3200__+MAX_llx_menu__, '/categories/card.php?action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3805__+MAX_llx_menu__, 'project', '', 3804__+MAX_llx_menu__, '/categories/card.php?action=create&type=6', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__); -- Tools insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3900__+MAX_llx_menu__, 'tools', 'mailing', 8__+MAX_llx_menu__, '/comm/mailing/index.php?leftmenu=mailing', 'EMailings', 0, 'mails', '$user->rights->mailing->lire', '', 0, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->mailing->enabled', __HANDLER__, 'left', 3901__+MAX_llx_menu__, 'tools', '', 3900__+MAX_llx_menu__, '/comm/mailing/card.php?leftmenu=mailing&action=create', 'NewMailing', 1, 'mails', '$user->rights->mailing->creer', '', 0, 0, __ENTITY__); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index d1c25ba978f..a91195be45d 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -950,7 +950,7 @@ class pdf_einstein extends ModelePDFCommandes $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1032,7 +1032,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 81aa216a93a..ab1b6e98a12 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1178,7 +1178,7 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1272,7 +1272,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 602375c62ed..5cd10dea0ec 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1105,7 +1105,7 @@ class pdf_azur extends ModelePDFPropales $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1188,7 +1188,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); } diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 8fd90eb3e31..a65256d1b57 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -622,7 +622,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -634,7 +634,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); @@ -725,7 +725,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 8b8a9e3d832..f8bae3b600d 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -513,7 +513,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -795,7 +795,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -807,7 +807,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); @@ -906,7 +906,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFillColor(224,224,224); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - $total_ttc = ($conf->multicurrency->enabled && $object->multiccurency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; + $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); $pdf->SetFont('','', $default_font_size - 1); @@ -1201,7 +1201,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=1; $pdf->SetTextColor(0,0,60); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 5f3f9550179..d48543442f4 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -177,7 +177,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdir = get_exdir(0,2,0,0,$objphoto,'product') . dol_sanitizeFileName($objphoto->ref).'/'; $dir = $conf->product->dir_output.'/'.$pdir; } - + $realpath=''; foreach ($objphoto->liste_photos($dir,1) as $key => $obj) { @@ -453,7 +453,7 @@ class pdf_aurore extends ModelePDFSupplierProposal if ($up_excl_tax > 0) $pdf->MultiCell($this->posxqty-$this->posxup-0.8, 3, $up_excl_tax, 0, 'R', 0); */ - + // Quantity $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxqty, $curY); @@ -474,11 +474,11 @@ class pdf_aurore extends ModelePDFSupplierProposal if ($total_excl_tax > 0) $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0); */ - + // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) $tvaligne=$object->lines[$i]->multicurrency_total_tva; else $tvaligne=$object->lines[$i]->total_tva; - + $localtax1ligne=$object->lines[$i]->total_localtax1; $localtax2ligne=$object->lines[$i]->total_localtax2; $localtax1_rate=$object->lines[$i]->localtax1_tx; @@ -951,7 +951,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalVAT").' '; + $totalvat =$outputlangs->transcountrynoentities("TotalVAT",$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1045,7 +1045,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $resteapayer = $object->total_ttc - $deja_regle; if (! empty($object->paye)) $resteapayer=0; */ - + if ($deja_regle > 0) { $index++; @@ -1297,7 +1297,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); } } - + $posy+=2; // Show list of linked objects diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 064eda8e5b5..e613c479ee0 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -80,7 +80,7 @@ $formfile->form_attach_new_file( $disablemove=1; if ($modulepart == 'produit') $disablemove=0; - + // List of document $formfile->list_of_documents( $filearray, diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index c347c693691..f968fdcbfc7 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2013 Florian Henry + * Copyright (C) 2017 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 @@ -32,7 +33,7 @@ * $usemargins (0 to disable all margins columns, 1 to show according to margin setup) * $object_rights->creer initialized from = $object->getRights() * $disableedit, $disablemove, $disableremove - * + * * $type, $text, $description, $line */ @@ -55,7 +56,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; element == 'supplier_proposal') { ?> - - + - + multicurrency->enabled)) { ?> - + @@ -194,7 +204,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; { $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?> - + rights->margins->creer)) { ?> @@ -220,7 +230,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; - statut == 0 && ($object_rights->creer)) { ?> - 1 && empty($conf->browser->phone) && ($this->situation_counter == 1 || !$this->situation_cycle_ref) && empty($disablemove)) { ?>
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
- info_bits & 2) == 2) { ?> @@ -83,7 +84,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; $discount->fetch($line->fk_remise_except); echo ($txt?' - ':'').$langs->transnoentities("DiscountFromDeposit",$discount->getNomUrl(0)); // Add date of deposit - if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) + if (! empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; } elseif ($line->description == '(EXCESS RECEIVED)' && $objp->fk_remise_except > 0) @@ -101,11 +102,11 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; else { $format = $conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE?'dayhour':'day'; - + if ($line->fk_product > 0) { echo $form->textwithtooltip($text,$description,3,'','',$i,0,(!empty($line->fk_parent_line)?img_picto('', 'rightarrow'):'')); - + // Show range echo get_date_range($line->date_start, $line->date_end, $format); @@ -138,17 +139,26 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0;
ref_fourn; ?>tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); ?>tva_tx)) $positiverates.=($positiverates?'/':'').price2num($line->tva_tx); + if (price2num($line->total_localtax1)) $positiverates.=($positiverates?'/':'').price2num($line->localtax1_tx); + if (price2num($line->total_localtax2)) $positiverates.=($positiverates?'/':'').price2num($line->localtax2_tx); + if (empty($positiverates)) $positiverates='0'; + echo vatrate($positiverates.($line->vat_src_code?' ('.$line->vat_src_code.')':''), '%', $line->info_bits); + //echo vatrate($line->tva_tx.($line->vat_src_code?(' ('.$line->vat_src_code.')'):''), '%', $line->info_bits); + ?> subprice); ?>multicurrency_subprice); ?> pu_ttc)?price($line->pu_ttc):price($line->subprice)); ?> pa_ht); ?> info_bits & 2) == 2 || ! empty($disableedit)) { ?> @@ -241,7 +251,7 @@ if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; ?> 0) { ?> diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 8541454e549..9c7ff195018 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -260,9 +260,16 @@ if ($id > 0) dol_banner_tab($fuser,'id',$linkback,$user->rights->user->user->lire || $user->admin); - print '
'; + if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) + { + print '
'; - print '
'; + print '
'; + + showMyBalance($holiday, $user_id); + } + + dol_fiche_end(); } else { @@ -270,23 +277,43 @@ else //print count($holiday->holiday); print_barre_liste($langs->trans("ListeCP"), $page, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, "", $num, count($holiday->holiday), 'title_hrm.png', 0, '', '', $limit); - dol_fiche_head(''); + if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) + { + dol_fiche_head(''); + + showMyBalance($holiday, $user_id); + + dol_fiche_end(); + } } -$alltypeleaves=$holiday->getTypes(1,-1); // To have labels -$out=''; -$typeleaves=$holiday->getTypes(1,1); -foreach($typeleaves as $key => $val) + +/** + * Show balance of user + * + * @param Holiday $holiday Object $holiday + * @param int $user_id User id + * @return string Html code with balance + */ +function showMyBalance($holiday, $user_id) { - $nb_type = $holiday->getCPforUser($user_id, $val['rowid']); - $nb_holiday += $nb_type; - $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).'
'; -} -print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'
'; -print $out; + global $conf, $langs; + + $alltypeleaves=$holiday->getTypes(1,-1); // To have labels + + $out=''; + $typeleaves=$holiday->getTypes(1,1); + foreach($typeleaves as $key => $val) + { + $nb_type = $holiday->getCPforUser($user_id, $val['rowid']); + $nb_holiday += $nb_type; + $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).'
'; + } + print $langs->trans('SoldeCPUser', round($nb_holiday,5)).'
'; + print $out; +} -dol_fiche_end(); if ($id > 0) print '
'; diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index df533f39db0..cce279d79da 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -138,8 +138,8 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (11 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',0); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0', 0); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'IGST+CGST', 8, 8, '1', 0, '0', 0, 'IGST+CGST', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'SGST' , 0, 0, '0', 16, '1', 0, 'SGST', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'CGST+SGST', 0, 9, '1', 9, '1', 0, 'CGST+SGST - Same state sales', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'IGST' , 18, 0, '0', 0, '0', 0, 'IGST', 1); -- IRELAND (id country=8) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (81, 8, '0','0','VAT Rate 0',1); diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index fdbb3c01bf7..086dbf9f404 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -24,6 +24,7 @@ -- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128); ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_supplier_proposal integer NOT NULL; @@ -583,9 +584,6 @@ ALTER TABLE llx_mailing_cibles MODIFY COLUMN source_url varchar(255); -- VPGSQL8.2 CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_website_page FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'IGST-CGST', 8, 8, '1', 0, '0', 0, 'IGST-CGST', 1); -insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'SGST', 0, 0, '0', 16, '1', 0, 'SGST', 1); - CREATE TABLE llx_facture_rec_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, @@ -605,3 +603,6 @@ CREATE TABLE llx_facturedet_rec_extrafields )ENGINE=innodb; ALTER TABLE llx_facturedet_rec_extrafields ADD INDEX idx_facturedet_rec_extrafields (fk_object); + +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1176, 117, 'CGST+SGST', 0, 9, '1', 9, '1', 0, 'CGST+SGST - Same state sales', 1); +insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1177, 117, 'IGST' , 18, 0, '0', 0, '0', 0, 'IGST', 1); diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 14d419f3c68..340714f690f 100755 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -29,13 +29,18 @@ -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_account MODIFY account_number VARCHAR(20) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_accounting_bookkeeping MODIFY numero_compte VARCHAR(20) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_stock_mouvement MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_lot MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) CHARACTER SET utf8; -- VMYSQLUTF8UNICODECI ALTER TABLE llx_product_batch MODIFY batch VARCHAR(30) COLLATE utf8_unicode_ci; - +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_sell VARCHAR(32) COLLATE utf8_unicode_ci; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_buy VARCHAR(32) CHARACTER SET utf8; +-- VMYSQLUTF8UNICODECI ALTER TABLE llx_product MODIFY accountancy_code_buy VARCHAR(32) COLLATE utf8_unicode_ci; -- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b8a6f3e0701..89b6f045e4e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -369,6 +369,8 @@ PDF=PDF PDFDesc=You can set each global options related to the PDF generation PDFAddressForging=Rules to forge address boxes HideAnyVATInformationOnPDF=Hide all information related to VAT on generated PDF +PDFLocaltax=Rules for %s +HideLocalTaxOnPDF=Hide %s rate into pdf column tax sale HideDescOnPDF=Hide products description on generated PDF HideRefOnPDF=Hide products ref. on generated PDF HideDetailsOnPDF=Hide product lines details on generated PDF @@ -1666,7 +1668,7 @@ UnicodeCurrency=Enter here between braces, list of byte number that represent th ColorFormat=The RGB color is in HEX format, eg: FF0000 PositionIntoComboList=Position of line into combo lists SellTaxRate=Sale tax rate -RecuperableOnly=Yes for VAT "Non Perçue Récupérable" dedicated for some state in France. Keep value to "No" in all other cases. +RecuperableOnly=Yes for VAT "Not Perceived but Recoverable" dedicated for some state in France. Keep value to "No" in all other cases. UrlTrackingDesc=If the provider or transport service offer a page or web site to check status of your shipping, you can enter it here. You can use the key {TRACKID} into URL parameters so the system will replace it with value of tracking number user entered into shipment card. OpportunityPercent=When you create an opportunity, you will defined an estimated amount of project/lead. According to status of opportunity, this amount may be multiplicated by this rate to evaluate global amount all your opportunities may generate. Value is percent (between 0 and 100). TemplateForElement=This template record is dedicated to which element diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 0282e2c06e8..eb4560fb491 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -198,6 +198,7 @@ ErrorMassValidationNotAllowedWhenStockIncreaseOnAction=Mass validation is not po ErrorObjectMustHaveStatusDraftToBeValidated=Object %s must have status 'Draft' to be validated. ErrorObjectMustHaveLinesToBeValidated=Object %s must have lines to be validated. ErrorOnlyInvoiceValidatedCanBeSentInMassAction=Only validated invoices can be sent using the "Send by email" mass action. +ErrorChooseBetweenFreeEntryOrPredefinedProduct=You must choose if article is a predefined product or not # Warnings WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user. diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 26c84e0f0d0..c74ebd9f0df 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -659,8 +659,8 @@ Page=Page Notes=Notes AddNewLine=Add new line AddFile=Add file -FreeZone=Free entry -FreeLineOfType=Free entry of type +FreeZone=Not a predefined product/service +FreeLineOfType=Not a predefined entry of type CloneMainAttributes=Clone object with its main attributes PDFMerge=PDF Merge Merge=Merge diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index 34a7ce3f4c4..3ec07697ec7 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -32,6 +32,8 @@ $userstatic->firstname=$val['firstname']; $userstatic->statut=$val['statut']; $userstatic->photo=$val['photo']; + $userstatic->email=$val['email']; + $userstatic->entity=$val['entity']; print $userstatic->getNomUrl(-1); $i++; if ($i < $nbofsalesrepresentative) print ', '; diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index cec276a6064..4985fd34629 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -44,7 +44,6 @@ $ref = GETPOST('ref','alpha'); $socid=''; if (! empty($user->societe_id)) { - $action=''; $socid = $user->societe_id; } $result = restrictedArea($user, 'supplier_proposal', $id); @@ -96,8 +95,8 @@ if ($object->id > 0) // Supplier proposal card $linkback = '' . $langs->trans("BackToList") . ''; - - + + $morehtmlref='
'; // Ref supplier //$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->fournisseur->commande->creer, 'string', '', 0, 1); @@ -138,14 +137,14 @@ if ($object->id > 0) } } $morehtmlref.='
'; - - + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - + + print '
'; print '
'; - + print ''; print ''; @@ -154,9 +153,9 @@ if ($object->id > 0) print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'; print '
'; - + dol_fiche_end(); - + $modulepart = 'supplier_proposal'; $permission = $user->rights->supplier_proposal->creer; $permtoedit = $user->rights->supplier_proposal->creer;