From 8df911d72855774b00b22cbed6cc3080363f0e4b Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 3 Sep 2021 15:40:33 +0200 Subject: [PATCH 01/26] work on event --- .../class/conferenceorbooth.class.php | 2 +- .../class/conferenceorboothattendee.class.php | 5 +- .../conferenceorbooth_list.php | 13 +- .../conferenceorboothattendee_card.php | 1 + .../conferenceorboothattendee_list.php | 113 +++++++++++++----- ...ventorganization_conferenceorbooth.lib.php | 74 ++++++++++++ ...nization_conferenceorboothattendee.key.sql | 4 +- ...organization_conferenceorboothattendee.sql | 3 +- htdocs/langs/en_US/eventorganization.lang | 3 +- .../attendee_subscription.php | 63 +++++++--- 10 files changed, 228 insertions(+), 53 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 869a96e464e..100c5559ca1 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -246,7 +246,7 @@ class ConferenceOrBooth extends ActionComm $result = parent::fetch($id, $ref, $ref_ext, $email_msgid); - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.urlencode($id); + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.urlencode($id).'&type=conf'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index b6c80feadd4..985c61376b6 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -103,7 +103,8 @@ class ConferenceOrBoothAttendee extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'Attendee', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty",), - 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>53, 'notnull'=>1, 'visible'=>0, 'index'=>1,), + 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>53, 'notnull'=>0, 'visible'=>0, 'index'=>1,), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>0, 'index'=>1,), 'email' => array('type'=>'mail', 'label'=>'Email', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1,), 'date_subscription' => array('type'=>'datetime', 'label'=>'DateSubscription', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',), 'amount' => array('type'=>'price', 'label'=>'AmountOfSubscriptionPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",), @@ -403,7 +404,7 @@ class ConferenceOrBoothAttendee extends CommonObject $sql = 'SELECT '; $sql .= $this->getFieldList('t'); $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; - $sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id=t.fk_actioncomm"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id=t.fk_actioncomm"; if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { $sql .= ' WHERE t.entity IN ('.getEntity($this->table_element).')'; } else { diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 2306066f9a7..5376acb3289 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; if ($conf->categorie->enabled) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -266,7 +267,7 @@ if ($projectid > 0) { //print "userAccess=".$userAccess." userWrite=".$userWrite." userDelete=".$userDelete; $head = project_prepare_head($project); - print dol_get_fiche_head($head, 'eventorganisation', $langs->trans("Project"), -1, ($project->public ? 'projectpub' : 'project')); + print dol_get_fiche_head($head, 'eventorganisation', $langs->trans("ConferenceOrBoothTab"), -1, ($project->public ? 'projectpub' : 'project')); // Project card $linkback = ''.$langs->trans("BackToList").''; @@ -440,10 +441,10 @@ if ($projectid > 0) { // Link to the subscribe print ''; //print ''; - print $langs->trans("PublicAttendeeSubscriptionPage"); + print $langs->trans("PublicAttendeeSubscriptionGlobalPage"); //print ''; print ''; - $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$project->id; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$project->id.'&type=global'; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 2); $link_subscription .= '&securekey='.urlencode($encodedsecurekey); //print ''; + print ''; - print '
'; + print '
'; - print dol_get_fiche_end(); + print dol_get_fiche_end(); + } } $arrayofselected = is_array($toselect) ? $toselect : array(); @@ -612,7 +669,7 @@ print ''; print ''; print ''; -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].(!empty($confOrBooth->id)?'?conforboothid='.$confOrBooth->id:'').$withProjectUrl), '', $permissiontoadd); +$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].(!empty($confOrBooth->id)?'?conforboothid='.$confOrBooth->id:'').$withProjectUrl), '', $permissiontoadd); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index 7d6339a2ed0..fcdd3c296e1 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -106,6 +106,80 @@ function conferenceorboothPrepareHead($object, $with_project = 0) return $head; } +/** + * Prepare array of tabs for ConferenceOrBooth Project tab + * + * @param $object Project Project + * @return array + */ +function conferenceorboothProjectPrepareHead($object) +{ + + global $db, $langs, $conf; + + $langs->load("eventorganization"); + + $h = 0; + $head = array(); + + $head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_list.php", 1).'?projectid='.$object->id; + $head[$h][1] = $langs->trans("ConferenceOrBooth"); + $head[$h][2] = 'conferenceorbooth'; + // Enable caching of conf or booth count attendees + $nbAttendees = 0; + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; + $cachekey = 'count_conferenceorbooth_project_'.$object->id; + $dataretrieved = dol_getcache($cachekey); + if (!is_null($dataretrieved)) { + $nbAttendees = $dataretrieved; + } else { + require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; + $conforbooth=new ConferenceOrBooth($db); + $result = $conforbooth->fetchAll('', '', 0, 0, array('t.fk_project'=>$object->id)); + if (!is_array($result) && $result<0) { + setEventMessages($conforbooth->error, $conforbooth->errors, 'errors'); + } else { + $nbConferenceOrBooth = count($result); + } + dol_setcache($cachekey, $nbConferenceOrBooth, 120); // If setting cache fails, this is not a problem, so we do not test result. + } + if ($nbConferenceOrBooth > 0) { + $head[$h][1] .= ''.$nbConferenceOrBooth.''; + } + $h++; + + $head[$h][0] = dol_buildpath("/eventorganization/conferenceorboothattendee_list.php", 1).'?fk_project='.$object->id.'&withproject=1'; + $head[$h][1] = $langs->trans("Attendees"); + $head[$h][2] = 'attendees'; + // Enable caching of conf or booth count attendees + $nbAttendees = 0; + require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; + $cachekey = 'count_attendees_conferenceorbooth_project_'.$object->id; + $dataretrieved = dol_getcache($cachekey); + if (!is_null($dataretrieved)) { + $nbAttendees = $dataretrieved; + } else { + require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; + $attendees=new ConferenceOrBoothAttendee($db); + $result = $attendees->fetchAll('', '', 0, 0, array('t.fk_project'=>$object->id)); + if (!is_array($result) && $result<0) { + setEventMessages($attendees->error, $attendees->errors, 'errors'); + } else { + $nbAttendees = count($result); + } + dol_setcache($cachekey, $nbAttendees, 120); // If setting cache fails, this is not a problem, so we do not test result. + } + if ($nbAttendees > 0) { + $head[$h][1] .= ''.$nbAttendees.''; + } + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'conferenceorboothproject@eventorganization'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'conferenceorboothproject@eventorganization', 'remove'); + + return $head; +} + /** * Prepare array of tabs for ConferenceOrBoothAttendees diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql index 3b9cc52e68f..0633e3cc2a2 100644 --- a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql +++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql @@ -21,10 +21,12 @@ ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_evento ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT fx_eventorganization_conferenceorboothattendee_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_actioncomm (fk_actioncomm); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT fx_eventorganization_conferenceorboothattendee_fk_actioncomm FOREIGN KEY (fk_actioncomm) REFERENCES llx_actioncomm(id); +ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_project (fk_project); +ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT fx_eventorganization_conferenceorboothattendee_fk_project FOREIGN KEY (fk_project) REFERENCES llx_projet(rowid); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_email (email); ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_status (status); -- END MODULEBUILDER INDEXES -ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_conferenceorboothattendee(fk_soc, fk_actioncomm, email); +ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_conferenceorboothattendee(fk_soc, fk_project, fk_actioncomm, email); diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql index 026295627d0..6d01cf4bba1 100644 --- a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql +++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql @@ -19,7 +19,8 @@ CREATE TABLE llx_eventorganization_conferenceorboothattendee( rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, ref varchar(128) NOT NULL, fk_soc integer, - fk_actioncomm integer NOT NULL, + fk_actioncomm integer, + fk_project integer NOT NULL, email varchar(100), date_subscription datetime, amount double DEFAULT NULL, diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index d2840be73f2..7c07b853a6b 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -110,7 +110,8 @@ ListOfConferencesOrBooths=List of conferences or booths SuggestConference = Suggest a new conference SuggestBooth = Suggest a booth ViewAndVote = View and vote for suggested events -PublicAttendeeSubscriptionPage = Public link for registration to the event +PublicAttendeeSubscriptionGlobalPage = Public link for registration to the event +PublicAttendeeSubscriptionPage = Public link for registration to this event only MissingOrBadSecureKey = The security key is invalid or missing EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference : '%s' EvntOrgDuration = This conference starts on %s and ends on %s. diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 0387843cf94..506b7215211 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -80,20 +80,35 @@ $societe = GETPOST("societe"); // Getting id from Post and decoding it $id = GETPOST('id', 'int'); +$type = GETPOST('type', 'alpha'); $conference = new ConferenceOrBooth($db); -$resultconf = $conference->fetch($id); -if ($resultconf < 0) { - print 'Bad value for parameter id'; - exit; +$project = new Project($db); + +if ($type=='conf') { + $resultconf = $conference->fetch($id); + if ($resultconf < 0) { + print 'Bad value for parameter id'; + exit; + } + $resultproject = $project->fetch($conference->fk_project); + if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; + } +} +if ($type=='global') { + $project = new Project($db); + if (empty($id)) { + $id = GETPOST('fk_project', 'int'); + } + $resultproject = $project->fetch($id); + if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; + } } -$project = new Project($db); -$resultproject = $project->fetch($conference->fk_project); -if ($resultproject < 0) { - $error++; - $errmsg .= $project->error; -} // Security check @@ -206,7 +221,7 @@ if ($reshook < 0) { } // Action called when page is submitted -if (empty($reshook) && $action == 'add' && $conference->status == 2) { +if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status!=2 || !empty($project->id) && $project->status==Project::STATUS_VALIDATED)) { $error = 0; $urlback = ''; @@ -235,7 +250,15 @@ if (empty($reshook) && $action == 'add' && $conference->status == 2) { if (!$error) { // Check if attendee already exists (by email and for this event) $confattendee = new ConferenceOrBoothAttendee($db); - $resultfetchconfattendee = $confattendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm'=>$id, 'customsql'=>'t.email="'.$email.'"')); + + if ($type=='global') { + $filter = array('t.fk_project'=>$id, 'customsql'=>'t.email="'.$email.'"'); + } + if ($action='conf') { + $filter = array('t.fk_actioncomm'=>$id, 'customsql'=>'t.email="'.$email.'"'); + } + + $resultfetchconfattendee = $confattendee->fetchAll('', '', 0, 0, $filter); if ($resultfetchconfattendee > 0 && count($resultfetchconfattendee)>0) { // Found confattendee $confattendee = array_shift($resultfetchconfattendee); @@ -243,6 +266,7 @@ if (empty($reshook) && $action == 'add' && $conference->status == 2) { // Need to create a confattendee $confattendee->date_subscription = dol_now(); $confattendee->email = $email; + $confattendee->fk_project = $project->id; $confattendee->fk_actioncomm = $id; $resultconfattendee = $confattendee->create($user); if ($resultconfattendee < 0) { @@ -470,16 +494,21 @@ print '
'; print '
'; // Welcome message -print $langs->trans("EvntOrgWelcomeMessage", $conference->label); + +print $langs->trans("EvntOrgWelcomeMessage", $project->title . ' '. $conference->label); print '
'; -print $langs->trans("EvntOrgDuration", dol_print_date($conference->datep), dol_print_date($conference->datef)); +if ($conference->id) { + print $langs->trans("EvntOrgDuration", dol_print_date($conference->datep), dol_print_date($conference->datef)); +} else { + print $langs->trans("EvntOrgDuration", dol_print_date($project->date_start), dol_print_date($project->date_end)); +} print '
'; print '
'; dol_htmloutput_errors($errmsg); -if ($conference->status!=2) { +if (!empty($conference->id) && $conference->status!=2 || !empty($project->id) && $project->status==Project::STATUS_VALIDATED) { print $langs->trans("ConferenceIsNotConfirmed"); } else { // Print form @@ -487,7 +516,9 @@ if ($conference->status!=2) { print ''; print ''; print ''; - print ''; + print ''; + print ''; + print ''; print ''; print '
'; From a57c4c7cc557cbc0793a4df47689e6697b4fee89 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 3 Sep 2021 16:39:10 +0200 Subject: [PATCH 02/26] ok for prod --- htdocs/admin/eventorganization.php | 4 +- .../class/conferenceorboothattendee.class.php | 4 + .../conferenceorboothattendee_card.php | 121 +++++++----------- .../conferenceorboothattendee_list.php | 11 +- .../attendee_subscription.php | 24 ++-- 5 files changed, 74 insertions(+), 90 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index d01aece1ca0..439a3d9cafa 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -48,8 +48,8 @@ $arrayofparameters = array( 'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea','enabled'=>1), 'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), 'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), - //'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), - //'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1), + 'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), + 'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1), diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 985c61376b6..61d8e7c32b2 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -747,6 +747,10 @@ class ConferenceOrBoothAttendee extends CommonObject $url .= '&conforboothid='.$this->fk_actioncomm; } + if ($option == 'projectid') { + $url .= '&fk_project='.$this->fk_project.'&withproject=1'; + } + if ($option == 'conforboothidproject') { $url .= '&conforboothid='.$this->fk_actioncomm.'&withproject=1' ; } diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 80b4b00dc9f..ff46f7b4a7b 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -47,6 +47,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); //$lineid = GETPOST('lineid', 'int'); $conf_or_booth_id = GETPOST('conforboothid', 'int'); +$fk_project = GETPOST('fk_project', 'int'); $withproject = GETPOST('withproject', 'int'); // Initialize technical objects @@ -174,7 +175,7 @@ $title = $langs->trans("ConferenceOrBoothAttendee"); $help_url = ''; llxHeader('', $title, $help_url); -$result = $projectstatic->fetch($confOrBooth->fk_project); +$result = $projectstatic->fetch(empty($confOrBooth->fk_project)?$fk_project:$confOrBooth->fk_project); if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) { $projectstatic->fetchComments(); } @@ -343,10 +344,44 @@ if (!empty($withproject)) { // Show message $message = 'global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); - $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').''; + $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').''; print $message; print ""; + // Link to the submit vote/register page + print ''; + //print ''; + print $form->textwithpicto($langs->trans("SuggestOrVoteForConfOrBooth"), $langs->trans("EvntOrgRegistrationHelpMessage")); + //print ''; + print ''; + $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id; + $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2); + $linksuggest .= '&securekey='.urlencode($encodedsecurekey); + //print ''; + //print ajax_autoselect("linkregister"); + print ''; + + // Link to the subscribe + print ''; + //print ''; + print $langs->trans("PublicAttendeeSubscriptionGlobalPage"); + //print ''; + print ''; + $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$projectstatic->id.'&type=global'; + $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2); + $link_subscription .= '&securekey='.urlencode($encodedsecurekey); + //print ''; + //print ajax_autoselect("linkregister"); + print ''; + print ''; print '
'; @@ -370,7 +405,10 @@ if ($action == 'create') { if ($confOrBooth->id > 0) { print ''; } - print ''; + if ($projectstatic->id > 0) { + print ''; + } + print ''; if ($backtopage) { @@ -382,9 +420,6 @@ if ($action == 'create') { print dol_get_fiche_head(array(), ''); - // Set some default values - //if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue'; - print ''."\n"; // Common attributes @@ -428,6 +463,9 @@ if (($id || $ref) && $action == 'edit') { if ($backtopageforcancel) { print ''; } + if ($projectstatic->id > 0) { + print ''; + } print dol_get_fiche_head(); @@ -477,16 +515,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Confirmation of action xxxx if ($action == 'xxx') { $formquestion = array(); - /* - $forcecombo=0; - if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy - $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) - ); - */ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); } @@ -502,61 +530,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Print form confirm print $formconfirm; - // Object card // ------------------------------------------------------------ $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; - /* - // Ref customer - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); - // Project - if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - $morehtmlref .= '
'.$langs->trans('Project') . ' '; - if ($permissiontoadd) { - //if ($action != 'classify') $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' '; - $morehtmlref .= ' : '; - if ($action == 'classify') { - //$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref .= '
'; - $morehtmlref .= ''; - $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref .= ''; - $morehtmlref .= ''; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref .= ': '.$proj->getNomUrl(); - } else { - $morehtmlref .= ''; - } - } - }*/ + $morehtmlref .= '
'; - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - print '
'; print '
'; print '
'; print '
'."\n"; // Common attributes - //$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field - //unset($object->fields['fk_project']); // Hide field already shown in banner - //unset($object->fields['fk_soc']); // Hide field already shown in banner include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; // Other attributes. Fields from hook formObjectOptions and Extrafields. @@ -635,29 +624,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send if (empty($user->socid)) { - print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle'); + print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&mode=init#formmailbeforetitle'); } - print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&conforboothid='.$confOrBooth->id.'&action=edit', '', $permissiontoadd); + print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit', '', $permissiontoadd); // Clone print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=scrumsprint', '', $permissiontoadd); - /* - if ($permissiontoadd) { - if ($object->status == $object::STATUS_ENABLED) { - print ''.$langs->trans("Disable").''."\n"; - } else { - print ''.$langs->trans("Enable").''."\n"; - } - } - if ($permissiontoadd) { - if ($object->status == $object::STATUS_VALIDATED) { - print ''.$langs->trans("Cancel").''."\n"; - } else { - print ''.$langs->trans("Re-Open").''."\n"; - } - } - */ // Delete (need delete permission, or if draft, just need create/modify permission) print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index d1dfccf2652..401f3367044 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -571,7 +571,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { print dol_get_fiche_end(); - if (!empty($fk_project)) { + if (empty($confOrBooth->id)) { $head = conferenceorboothProjectPrepareHead($projectstatic); $tab = 'attendees'; print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($project->public ? 'projectpub' : 'project'), 0, '', ''); @@ -632,6 +632,9 @@ foreach ($search as $key => $val) { if ($confOrBooth->id > 0) { $param .= '&conforboothid='.urlencode($confOrBooth->id).$withProjectUrl; } +if ($projectstatic->id > 0) { + $param .= '&fk_project='.urlencode($projectstatic->id).$withProjectUrl; +} if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); @@ -841,7 +844,11 @@ while ($i < ($limit ? min($num, $limit) : $num)) { if ($key == 'status') { print $object->getLibStatut(5); } elseif ($key == 'ref') { - print $object->getNomUrl(1, (!empty($withproject)?'conforboothidproject':'conforboothid')); + $optionLink = (!empty($withproject)?'conforboothidproject':'conforboothid'); + if (empty($confOrBooth->id)) { + $optionLink='projectid'; + } + print $object->getNomUrl(1, $optionLink); } else { print $object->showOutputField($val, $key, $object->$key, ''); } diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 506b7215211..79688bffcf6 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -508,9 +508,7 @@ print '
'; dol_htmloutput_errors($errmsg); -if (!empty($conference->id) && $conference->status!=2 || !empty($project->id) && $project->status==Project::STATUS_VALIDATED) { - print $langs->trans("ConferenceIsNotConfirmed"); -} else { +if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CONFIRMED || (!empty($project->id) && $project->status==Project::STATUS_VALIDATED)) { // Print form print '' . "\n"; print ''; @@ -529,15 +527,15 @@ if (!empty($conference->id) && $conference->status!=2 || !empty($project->id) & print dol_get_fiche_head(''); print ''; + jQuery(document).ready(function () { + jQuery(document).ready(function () { + jQuery("#selectcountry_id").change(function() { + document.newmember.action.value="create"; + document.newmember.submit(); + }); + }); + }); + '; print '
' . "\n"; @@ -605,6 +603,8 @@ jQuery(document).ready(function () { print "\n"; print "
"; print ''; +} else { + print $langs->trans("ConferenceIsNotConfirmed"); } llxFooterVierge(); From fdce538380bdecd18a636029bc28899252bdd672 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 5 Sep 2021 14:31:33 +0200 Subject: [PATCH 03/26] Fix trans --- htdocs/langs/en_US/contracts.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/contracts.lang b/htdocs/langs/en_US/contracts.lang index 49a65fdb39d..937c5a7397b 100644 --- a/htdocs/langs/en_US/contracts.lang +++ b/htdocs/langs/en_US/contracts.lang @@ -36,7 +36,7 @@ CloseAContract=Close a contract ConfirmDeleteAContract=Are you sure you want to delete this contract and all its services? ConfirmValidateContract=Are you sure you want to validate this contract under name %s? ConfirmActivateAllOnContract=This will open all services (not yet active). Are you sure you want to open all services? -ConfirmCloseContract=This will close all services (active or not). Are you sure you want to close this contract? +ConfirmCloseContract=This will close all services (expired or not). Are you sure you want to close this contract? ConfirmCloseService=Are you sure you want to close this service with date %s? ValidateAContract=Validate a contract ActivateService=Activate service From 93fdf41521e3ee19bcf1de515e3ce7bdfa009c85 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 03:22:06 +0200 Subject: [PATCH 04/26] Fix css --- htdocs/salaries/paiement_salary.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index a266a2ed88b..749ce8f9575 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -315,8 +315,11 @@ if ($action == 'create') { print "
"; // Bouton Save payment - print '
'.$langs->trans("ClosePaidSalaryAutomatically"); - print '
'; + print '
'; + print '
'; + print '
'; + print '
'; + print ''; print '     '; print ''; print '
'; From 4bf2259fb681448d7e51238c99e73e4bcb844b24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 03:26:43 +0200 Subject: [PATCH 05/26] Fix css --- htdocs/salaries/paiement_salary.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 749ce8f9575..86a0e787e84 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -317,8 +317,7 @@ if ($action == 'create') { // Bouton Save payment print '
'; print '
'; - print '
'; - print '
'; + print '
'; print ''; print '     '; print ''; From ae7a309e8db94723efb22306fccafcc3aad13026 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Sep 2021 03:29:46 +0200 Subject: [PATCH 06/26] Fix css --- htdocs/compta/tva/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index daf5afb025e..2f3f4edf83c 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -437,7 +437,7 @@ if ($action == 'create') { print '
'; // Auto create payment - print ''.$langs->trans('AutomaticCreationPayment').''; + print ''; print ''."\n"; print ''; From 09d1680ea072b4fef82bda3b9299b255f2ab2870 Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Mon, 6 Sep 2021 12:07:48 +0400 Subject: [PATCH 07/26] FIX #18627 Allow users with self read / modify rights to get own info. --- htdocs/user/class/api_users.class.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index e0cbd849092..4059402a8fc 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -151,7 +151,8 @@ class Users extends DolibarrApi */ public function get($id, $includepermissions = 0) { - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && + !(!empty(DolibarrApiAccess::$user->rights->user->self->creer) && (DolibarrApiAccess::$user->id == $id))) { throw new RestException(401, 'Not allowed'); } @@ -189,7 +190,8 @@ class Users extends DolibarrApi */ public function getByLogin($login, $includepermissions = 0) { - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && + !(!empty(DolibarrApiAccess::$user->rights->user->self->creer) && (DolibarrApiAccess::$user->login == $login))) { throw new RestException(401, 'Not allowed'); } @@ -223,7 +225,8 @@ class Users extends DolibarrApi */ public function getByEmail($email, $includepermissions = 0) { - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && + !(!empty(DolibarrApiAccess::$user->rights->user->self->creer) && (DolibarrApiAccess::$user->email == $email))) { throw new RestException(401, 'Not allowed'); } @@ -256,7 +259,7 @@ class Users extends DolibarrApi */ public function getInfo($includepermissions = 0) { - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { + if(empty(DolibarrApiAccess::$user->rights->user->self->creer) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401, 'Not allowed'); } From f535a44921fa703e888506b08620f2ff4e1fdc01 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 6 Sep 2021 13:58:23 +0000 Subject: [PATCH 08/26] Fixing style errors. --- htdocs/user/class/api_users.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 4059402a8fc..f5e1159b6b6 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -259,7 +259,7 @@ class Users extends DolibarrApi */ public function getInfo($includepermissions = 0) { - if(empty(DolibarrApiAccess::$user->rights->user->self->creer) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { + if (empty(DolibarrApiAccess::$user->rights->user->self->creer) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) { throw new RestException(401, 'Not allowed'); } From 63abe2f1ff57cae58bf97bfb4a587ca521dbba2b Mon Sep 17 00:00:00 2001 From: lainwir3d Date: Thu, 9 Sep 2021 19:56:28 +0400 Subject: [PATCH 09/26] FIX #18666 Order / Shipment list: Don't SQL JOIN category table when not necessary. --- htdocs/commande/list.php | 6 +++--- htdocs/expedition/list.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 0404c6a595c..e0208d3cdcc 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -429,7 +429,7 @@ $sql .= ' p.rowid as project_id, p.ref as project_ref, p.title as project_label, $sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender,'; $sql .= ' c.fk_cond_reglement,c.fk_mode_reglement,c.fk_shipping_method,'; $sql .= ' c.fk_input_reason'; -if ($search_categ_cus) { +if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $sql .= ", cc.fk_categorie, cc.fk_soc"; } // Add fields from extrafields @@ -446,7 +446,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; -if (!empty($search_categ_cus)) { +if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ } $sql .= ', '.MAIN_DB_PREFIX.'commande as c'; @@ -793,7 +793,7 @@ if ($resql) { if ($search_product_category != '') { $param .= '&search_product_category='.urlencode($search_product_category); } - if ($search_categ_cus > 0) { + if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $param .= '&search_categ_cus='.urlencode($search_categ_cus); } if ($show_files) { diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index fd056a75056..50a59e0d2e4 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -235,7 +235,7 @@ $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= " e.date_creation as date_creation, e.tms as date_update,"; $sql .= " u.login"; -if ($search_categ_cus) { +if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $sql .= ", cc.fk_categorie, cc.fk_soc"; } // Add fields from extrafields @@ -260,7 +260,7 @@ if ($search_product_category > 0) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc"; -if (!empty($search_categ_cus)) { +if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)"; @@ -449,7 +449,7 @@ if ($search_datereceipt_end) { if ($search_product_category != '') { $param .= '&search_product_category='.urlencode($search_product_category); } -if ($search_categ_cus > 0) { +if (($search_categ_cus > 0) || ($search_categ_cus == -2)) { $param .= '&search_categ_cus='.urlencode($search_categ_cus); } if ($search_status != '') { From ffd7f608300617bebe7b0832fa6a63cccac8cc22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 19:21:32 +0200 Subject: [PATCH 10/26] FIX #18589 #18617 --- htdocs/core/lib/files.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 9db9379523e..43ad95157dc 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2291,9 +2291,13 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $sqlprotectagainstexternals = ''; $ret = array(); - // Find the subdirectory name as the reference. For exemple original_file='10/myfile.pdf' -> refname='10' + // Find the subdirectory name as the reference. For example original_file='10/myfile.pdf' -> refname='10' if (empty($refname)) { $refname = basename(dirname($original_file)."/"); + if ($refname == 'thumbs') { + // If we get the thumbns directory, we must go one step higher. For example original_file='10/thumbs/myfile_small.jpg' -> refname='10' + $refname = basename(dirname(dirname($original_file))."/"); + } } // Define possible keys to use for permission check From b8b5b97d78e10d159ccb1538d300c91221fa8dbd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 19:47:15 +0200 Subject: [PATCH 11/26] Code comment --- htdocs/holiday/class/holiday.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 95462ddd77e..5ecc4d7325a 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -714,12 +714,12 @@ class Holiday extends CommonObject // Update status $sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET"; if (!empty($this->statut) && is_numeric($this->statut)) { - $sql .= " statut = ".$this->statut.","; + $sql .= " statut = ".((int) $this->statut).","; } else { $error++; } $sql .= " ref = '".$this->db->escape($num)."'"; - $sql .= " WHERE rowid= ".$this->id; + $sql .= " WHERE rowid= ".((int) $this->id); $this->db->begin(); @@ -1937,7 +1937,7 @@ class Holiday extends CommonObject * * @param int $fk_user_action Id user creation * @param int $fk_user_update Id user update - * @param string $label Label + * @param string $label Label (Example: 'Leave', 'Manual update', 'Leave request cancelation'...) * @param int $new_solde New value * @param int $fk_type Type of vacation * @return int Id of record added, 0 if nothing done, < 0 if KO From 6465e8aa36f95ac36ad418a8e6ecfbd58684f14f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Sep 2021 19:46:40 +0200 Subject: [PATCH 12/26] Include ref into label of log history --- htdocs/holiday/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index a58806e2e4f..150a9c0754b 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -550,9 +550,10 @@ if (empty($reshook)) { $nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday); $soldeActuel = $object->getCpforUser($object->fk_user, $object->fk_type); $newSolde = ($soldeActuel - $nbopenedday); + $label = $langs->transnoentitiesnoconv("Holidays").' - '.$object->ref; // The modification is added to the LOG - $result = $object->addLogCP($user->id, $object->fk_user, $langs->transnoentitiesnoconv("Holidays"), $newSolde, $object->fk_type); + $result = $object->addLogCP($user->id, $object->fk_user, $label, $newSolde, $object->fk_type); if ($result < 0) { $error++; setEventMessages(null, $object->errors, 'errors'); From f31b7fa3c477624a88644f88f1fa4f17941a6c31 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 9 Sep 2021 22:14:26 +0200 Subject: [PATCH 13/26] NEW Social Contributions - Add from/to on list --- htdocs/compta/sociales/list.php | 117 +++++++++++++++++++++++++------- 1 file changed, 93 insertions(+), 24 deletions(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 71d788d6de6..9570b3eec53 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -4,8 +4,9 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2016 Frédéric France * Copyright (C) 2020 Pierre Ardoin - * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Alexandre Spangaro * * 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 @@ -50,9 +51,22 @@ $search_ref = GETPOST('search_ref', 'int'); $search_label = GETPOST('search_label', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_status = GETPOST('search_status', 'int'); -$search_day_lim = GETPOST('search_day_lim', 'int'); -$search_month_lim = GETPOST('search_month_lim', 'int'); -$search_year_lim = GETPOST('search_year_lim', 'int'); +$search_date_startday = GETPOST('search_date_startday', 'int'); +$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); +$search_date_startyear = GETPOST('search_date_startyear', 'int'); +$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); +$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver +$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); +$search_date_limit_startday = GETPOST('search_date_limit_startday', 'int'); +$search_date_limit_startmonth = GETPOST('search_date_limit_startmonth', 'int'); +$search_date_limit_startyear = GETPOST('search_date_limit_startyear', 'int'); +$search_date_limit_endday = GETPOST('search_date_limit_endday', 'int'); +$search_date_limit_endmonth = GETPOST('search_date_limit_endmonth', 'int'); +$search_date_limit_endyear = GETPOST('search_date_limit_endyear', 'int'); +$search_date_limit_start = dol_mktime(0, 0, 0, $search_date_limit_startmonth, $search_date_limit_startday, $search_date_limit_startyear); +$search_date_limit_end = dol_mktime(23, 59, 59, $search_date_limit_endmonth, $search_date_limit_endday, $search_date_limit_endyear); $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_project = GETPOST('search_project', 'alpha'); $search_users = GETPOST('search_users'); @@ -147,9 +161,22 @@ if (empty($reshook)) { $search_status = ''; $search_typeid = ''; $year = ''; - $search_day_lim = ''; - $search_year_lim = ''; - $search_month_lim = ''; + $search_date_startday = ''; + $search_date_startmonth = ''; + $search_date_startyear = ''; + $search_date_endday = ''; + $search_date_endmonth = ''; + $search_date_endyear = ''; + $search_date_start = ''; + $search_date_end = ''; + $search_date_limit_startday = ''; + $search_date_limit_startmonth = ''; + $search_date_limit_startyear = ''; + $search_date_limit_endday = ''; + $search_date_limit_endmonth = ''; + $search_date_limit_endyear = ''; + $search_date_limit_start = ''; + $search_date_limit_end = ''; $search_project_ref = ''; $search_project = ''; $search_users = ''; @@ -220,15 +247,17 @@ if ($search_amount) { if ($search_status != '' && $search_status >= 0) { $sql .= " AND cs.paye = ".((int) $search_status); } -$sql .= dolSqlDateFilter("cs.periode", $search_day_lim, $search_month_lim, $search_year_lim); -//$sql.= dolSqlDateFilter("cs.periode", 0, 0, $year); -if ($year > 0) { - $sql .= " AND ("; - // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, - // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire - $sql .= " (cs.periode IS NOT NULL AND date_format(cs.periode, '%Y') = '".$db->escape($year)."') "; - $sql .= "OR (cs.periode IS NULL AND date_format(cs.date_ech, '%Y') = '".$db->escape($year)."')"; - $sql .= ")"; +if ($search_date_start) { + $sql .= " AND cs.date_ech >= '".$db->idate($search_date_start)."'"; +} +if ($search_date_end) { + $sql .= " AND cs.date_ech <= '".$db->idate($search_date_end)."'"; +} +if ($search_date_limit_start) { + $sql .= " AND cs.periode >= '".$db->idate($search_date_limit_start)."'"; +} +if ($search_date_limit_end) { + $sql .= " AND cs.periode <= '".$db->idate($search_date_limit_end)."'"; } if ($search_typeid > 0) { $sql .= " AND cs.fk_type = ".((int) $search_typeid); @@ -293,8 +322,41 @@ if ($search_account) { if ($search_status != '' && $search_status != '-1') { $param .= '&search_status='.urlencode($search_status); } -if ($year) { - $param .= '&year='.urlencode($year); +if ($search_date_startday) { + $param .= '&search_date_startday='.urlencode($search_date_startday); +} +if ($search_date_startmonth) { + $param .= '&search_date_startmonth='.urlencode($search_date_startmonth); +} +if ($search_date_startyear) { + $param .= '&search_date_startyear='.urlencode($search_date_startyear); +} +if ($search_date_endday) { + $param .= '&search_date_endday='.urlencode($search_date_endday); +} +if ($search_date_endmonth) { + $param .= '&search_date_endmonth='.urlencode($search_date_endmonth); +} +if ($search_date_endyear) { + $param .= '&search_date_endyear='.urlencode($search_date_endyear); +} +if ($search_date_limit_startday) { + $param .= '&search_date_limit_startday='.urlencode($search_date_limit_startday); +} +if ($search_date_limit_startmonth) { + $param .= '&search_date_limit_startmonth='.urlencode($search_date_limit_startmonth); +} +if ($search_date_limit_startyear) { + $param .= '&search_date_limit_startyear='.urlencode($search_date_limit_startyear); +} +if ($search_date_limit_endday) { + $param .= '&search_date_limit_endday='.urlencode($search_date_limit_endday); +} +if ($search_date_limit_endmonth) { + $param .= '&search_date_limit_endmonth='.urlencode($search_date_limit_endmonth); +} +if ($search_date_limit_endyear) { + $param .= '&search_date_limit_endyear='.urlencode($search_date_limit_endyear); } $newcardbutton = ''; @@ -375,18 +437,25 @@ if (!empty($arrayfields['cs.fk_type']['checked'])) { // Filter: Date (placeholder) if (!empty($arrayfields['cs.date_ech']['checked'])) { - print ''; + print ''; + print '
'; + print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
'; + print '
'; + print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
'; print ''; } // Filter: Period end date if (!empty($arrayfields['cs.periode']['checked'])) { print ''; - if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) { - print ''; - } - print ''; - $formother->select_year($search_year_lim ? $search_year_lim : -1, 'search_year_lim', 1, 20, 5, 0, 0, '', 'widthauto valignmiddle'); + print '
'; + print $form->selectDate($search_date_limit_start ? $search_date_limit_start : -1, 'search_date_limit_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
'; + print '
'; + print $form->selectDate($search_date_limit_end ? $search_date_limit_end : -1, 'search_date_limit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); + print '
'; print ''; } From dfe1576b8d60614382e9033c9232b8bee6a4ebc2 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 9 Sep 2021 20:18:47 +0000 Subject: [PATCH 14/26] Fixing style errors. --- htdocs/compta/sociales/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 9570b3eec53..273904631f7 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -340,7 +340,7 @@ if ($search_date_endmonth) { if ($search_date_endyear) { $param .= '&search_date_endyear='.urlencode($search_date_endyear); } -if ($search_date_limit_startday) { +if ($search_date_limit_startday) { $param .= '&search_date_limit_startday='.urlencode($search_date_limit_startday); } if ($search_date_limit_startmonth) { From 3ea6314494edf79bb754bb806532b85d882a1e07 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 9 Sep 2021 22:24:24 +0200 Subject: [PATCH 15/26] Remove $year --- htdocs/compta/sociales/list.php | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 9570b3eec53..699287df20a 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -92,7 +92,6 @@ if (!$sortorder) { $sortorder = "DESC"; } -$year = GETPOST("year", 'int'); $filtre = GETPOST("filtre", 'int'); if (!GETPOSTISSET('search_typeid')) { @@ -160,7 +159,6 @@ if (empty($reshook)) { $search_amount = ''; $search_status = ''; $search_typeid = ''; - $year = ''; $search_date_startday = ''; $search_date_startmonth = ''; $search_date_startyear = ''; @@ -377,11 +375,6 @@ print ''; print ''; $center = ''; -if ($year) { - $center = ''.img_previous().''; - $center .= ' '.$langs->trans("Year").' '.$year; - $center .= ' '.img_next().''; -} print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'bill', 0, $newcardbutton, '', $limit, 0, 0, 1); @@ -618,13 +611,7 @@ while ($i < min($num, $limit)) { // Date end period if (!empty($arrayfields['cs.periode']['checked'])) { - print ''; - if ($obj->periode) { - print ''; - print dol_print_date($db->jdate($obj->periode), 'day'); - print ''; - } - print ''; + print ''.dol_print_date($db->jdate($obj->periode), 'day').''; if (!$i) { $totalarray['nbfield']++; } From 7526cb3b8be93a4d268e7b210f441469476c8b92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 09:44:06 +0200 Subject: [PATCH 16/26] Fix VAT rate label and add Mali default vat rate --- htdocs/install/mysql/data/llx_c_tva.sql | 282 ++++++++++++------------ htdocs/langs/en_US/admin.lang | 10 +- htdocs/langs/en_US/companies.lang | 2 +- htdocs/langs/en_US/compta.lang | 26 +-- 4 files changed, 162 insertions(+), 158 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 72746ac99ea..cae269783e4 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -47,9 +47,9 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 1 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 133, 13, '19','0','TVA 19%', 1); -- ANGOLA (id country=35) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 351, 35, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 352, 35, '7','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 353, 35, '14','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 351, 35, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 352, 35, '7','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 353, 35, '14','0','VAT rate - standard',1); -- ARGENTINA (id country=23) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (231, 23, '0','0','IVA Rate 0', 1); @@ -57,31 +57,31 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (23 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (233, 23, '21','0','IVA standard rate',1); -- AUSTRALIA (id country=28) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (281, 28, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (282, 28, '10','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (281, 28, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (282, 28, '10','0','VAT rate - standard',1); -- AUSTRIA (id country=41) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (411, 41, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (412, 41, '10','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (413, 41, '20','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (411, 41, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (412, 41, '10','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (413, 41, '20','0','VAT rate - standard',1); -- BRASIL (id country=56) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (561, 56, '0','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (561, 56, '0','0','VAT rate - reduced',1); -- BULGARIA (id country=59) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (591, 59, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (592, 59, '7','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (593, 59, '20','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (591, 59, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (592, 59, '7','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (593, 59, '20','0','VAT rate - standard',1); -- BELGIUM (id country=2) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 21, 2, '0','0','VAT Rate 0 ou non applicable',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 22, 2, '6','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 23, 2, '21','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 24, 2, '12','0','VAT reduced rate', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 21, 2, '0','0','VAT rate 0 ou non applicable',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 22, 2, '6','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 23, 2, '21','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 24, 2, '12','0','VAT rate - reduced', 1); -- CANADA (id country=14) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (141, 14, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (142, 14, '7','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (141, 14, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (142, 14, '7','0','VAT rate - standard',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (143, 14,'5','0','9.975','1','GST/TPS and PST/TVQ rate for Province',1); --insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (143, 14,'5','0','9.975','1','GST/TPS and PST/TVQ rate for Quebec',1); --insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (144, 14,'5','0','7','1','GST/TPS and PST/TVQ rate for British Columbia',1); @@ -89,43 +89,43 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_typ -- CAMEROUN (id country=24) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (241, 24, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (242, 24, '19.25','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (241, 24, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (242, 24, '19.25','0','VAT rate - standard',1); -- CHILE (id country=67) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (671, 67, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (672, 67, '19','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (671, 67, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (672, 67, '19','0','VAT rate - standard',1); -- CHINA (id country=9) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 91, 9, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 92, 9, '13','0','VAT reduced rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 93, 9, '3','0','VAT super reduced rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 94, 9, '17','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 91, 9, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 92, 9, '13','0','VAT rate - reduced 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 93, 9, '3','0','VAT rate - super-reduced 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 94, 9, '17','0','VAT rate - standard',1); -- CONGO = REPUBLIQUE DU CONGO (id country=72) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (721, 72, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (722, 72, '18','0', '0.9', '1', 'VAT Rate 18+0.9', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (721, 72, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (722, 72, '18','0', '0.9', '1', 'VAT rate 18+0.9', 1); -- CYPRUS (id country=78) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (781, 78, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (782, 78, '9','0','VAT Rate 9',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (783, 78, '5','0','VAT Rate 5',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (784, 78, '19','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (781, 78, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (782, 78, '9','0','VAT rate 9',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (783, 78, '5','0','VAT rate 5',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (784, 78, '19','0','VAT rate - standard',1); -- DANMERK (id country=80) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (801, 80, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (802, 80, '25','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (801, 80, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (802, 80, '25','0','VAT rate - standard',1); -- FRANCE (id country=1) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 11, 1, '0','0','VAT Rate 0 ou non applicable',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 12, 1, '20','0','VAT standard rate (France hors DOM-TOM)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 13, 1, '10','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 14, 1, '5.5','0','VAT reduced rate (France hors DOM-TOM)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 15, 1, '2.1','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values (16, 1, '8.5', '85', '0', 'VAT standard rate (DOM sauf Guyane et Saint-Martin)',0); -insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values (17, 1, '8.5', '85NPR', '1', 'VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0); -insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) values (18, 1, '8.5', '85NPROM', '1', 2, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0); -insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (19, 1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 11, 1, '0','0','VAT rate 0 ou non applicable',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 12, 1, '20','0','VAT rate - standard (France hors DOM-TOM)',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 13, 1, '10','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 14, 1, '5.5','0','VAT rate - reduced (France hors DOM-TOM)',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 15, 1, '2.1','0','VAT rate - super-reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values (16, 1, '8.5', '85', '0', 'VAT rate - standard (DOM sauf Guyane et Saint-Martin)',0); +insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,note,active) values (17, 1, '8.5', '85NPR', '1', 'VAT rate - standard (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0); +insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) values (18, 1, '8.5', '85NPROM', '1', 2, 3, 'VAT rate - standard (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0); +insert into llx_c_tva(rowid,fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (19, 1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT rate - standard (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0); -- GERMANY (id country=5) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 51, 5, '0','0','No VAT', 1); @@ -147,11 +147,11 @@ insert into llx_c_tva(rowid,fk_pays,taux,localtax1,localtax1_type,localtax2,loca -- ICELAND (id country=116) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1161, 116, '0','0','VAT rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1163, 116,'25.5','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1162, 116, '7','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1163, 116,'25.5','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1162, 116, '7','0','VAT rate - reduced',1); -- INDIA (id country=117) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '0','0','VAT Rate 0', 0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 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 (1172, 117, 'C+S-5' , 0, 2.5, '1', 2.5, '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 (1173, 117, 'I-5' , 5, 0, '0', 0, '0', 0, 'IGST', 1); @@ -163,54 +163,58 @@ insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2 insert into llx_c_tva(rowid,fk_pays,code,taux,localtax1,localtax1_type,localtax2,localtax2_type,recuperableonly,note,active) values (1179, 117, 'I-28' , 28, 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); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 82, 8, '23','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 83, 8, '13.5','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 84, 8, '9','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 85, 8, '4.8','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 81, 8, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 82, 8, '23','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 83, 8, '13.5','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 84, 8, '9','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 85, 8, '4.8','0','VAT rate - reduced',1); -- ITALY (id country=3) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 31, 3, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 32, 3, '10','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 33, 3, '4','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 34, 3, '22','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 31, 3, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 32, 3, '10','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 33, 3, '4','0','VAT rate - super-reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 34, 3, '22','0','VAT rate - standard',1); -- IVORY COST (id country=21) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (211, 21, '0','0',0,0,0,0,'IVA Rate 0',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (212, 21, '18','0',7.5,2,0,0,'IVA standard rate',1); -- JAPAN (id country=123) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1231, 123, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1232, 123, '5','0','VAT Rate 5',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1231, 123, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1232, 123, '5','0','VAT rate 5',1); -- LUXEMBOURG (id country=140) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1401, 140, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1402, 140, '14','0','VAT intermediary rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1403, 140, '8','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1404, 140, '3','0','VAT super-reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1405, 140, '17','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1401, 140, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1402, 140, '14','0','VAT rate - intermediary',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1403, 140, '8','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1404, 140, '3','0','VAT rate - super-reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1405, 140, '17','0','VAT rate - standard',1); + +-- MALI (id country=147) +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1471, 147, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1471, 147, '18','0','VAT rate - standard', 1); -- MONACO (id country=27) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 271, 27, '0','0','VAT Rate 0 ou non applicable',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 272, 27, '8.5','0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 273, 27, '8.5','1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 274, 27, '5.5','0','VAT reduced rate (France hors DOM-TOM)',0); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 275, 27,'19.6','0','VAT standard rate (France hors DOM-TOM)',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 276, 27, '2.1','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 277, 27, '7','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 271, 27, '0','0','VAT rate 0 ou non applicable',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 272, 27, '8.5','0','VAT rate - standard (DOM sauf Guyane et Saint-Martin)',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 273, 27, '8.5','1','VAT rate - standard (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 274, 27, '5.5','0','VAT rate - reduced (France hors DOM-TOM)',0); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 275, 27,'19.6','0','VAT rate - standard (France hors DOM-TOM)',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 276, 27, '2.1','0','VAT rate - super-reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 277, 27, '7','0','VAT rate - reduced',1); -- MAROCO (id country=12) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 121, 12, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 122, 12, '14','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 123, 12, '10','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 124, 12, '7','0','VAT super-reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 125, 12, '20','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 121, 12, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 122, 12, '14','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 123, 12, '10','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 124, 12, '7','0','VAT rate - super-reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 125, 12, '20','0','VAT rate - standard',1); -- MALTA (id country=148) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1481, 148, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1482, 148, '7','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1483, 148, '5','0','VAT super-reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1484, 148, '18','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1481, 148, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1482, 148, '7','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1483, 148, '5','0','VAT rate - super-reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1484, 148, '18','0','VAT rate - standard',1); -- NEDERLAND (id country=17) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 171, 17, '0','0','0 BTW tarief', 1); @@ -219,96 +223,96 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 1 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 174, 17, '21','0','Algemeen BTW tarief (vanaf 1 oktober 2012)',0); -- NEW CALEDONIA (id country=165) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1651, 165, '0','0','VAT Rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1651, 165, '0','0','VAT rate 0', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1652, 165, '3','0','VAT standard 3', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1653, 165, '6','0','VAT standard 6', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1654, 165, '11','0','VAT standard rate', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1654, 165, '11','0','VAT rate - standard', 1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1655, 165, '22','0','VAT standard high', 1); -- NEW ZEALAND (id country=166) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1661, 166, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1662, 166, '15','0','VAT standard rate', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1661, 166, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1662, 166, '15','0','VAT rate - standard', 1); -- NIGERIA (id country=169) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1691, 169, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1692, 169, '5','0','VAT standard rate', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1691, 169, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1692, 169, '5','0','VAT rate - standard', 1); -- NORWAY (id country=173) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1731, 173, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1732, 173, '14','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1733, 173, '8','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1734, 173, '25','0','VAT standard rate', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1731, 173, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1732, 173, '14','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1733, 173, '8','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1734, 173, '25','0','VAT rate - standard', 1); -- PANAMA (id country=178) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1781, 178, '0','0','ITBMS Rate 0',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1782, 178, '7','0','ITBMS standard rate',1); -- PERU (id country=181) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1811, 181, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1818, 181, '18','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1811, 181, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1818, 181, '18','0','VAT rate - standard',1); -- POLAND (id country=184) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1841, 184, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1842, 184, '8','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1843, 184, '3','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1844, 184, '23','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1841, 184, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1842, 184, '8','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1843, 184, '3','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1844, 184, '23','0','VAT rate - standard',1); -- PORTUGAL (id country=25) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 251, 25, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 252, 25, '13','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 253, 25, '23','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 254, 25, '6','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 251, 25, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 252, 25, '13','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 253, 25, '23','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 254, 25, '6','0','VAT rate - reduced',1); -- ROMANIA (id country=188) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1881, 188, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1882, 188, '9','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1883, 188, '19','0','VAT standard rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1884, 188, '5','0','VAT reduced rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1881, 188, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1882, 188, '9','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1883, 188, '19','0','VAT rate - standard',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1884, 188, '5','0','VAT rate - reduced',1); -- SAUDI ARABIA (id country=26) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 261, 26, '0', '0', 'VAT Rate 0', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 262, 26, '5', '0', 'VAT Rate 5', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 261, 26, '0', '0', 'VAT rate 0', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 262, 26, '5', '0', 'VAT rate 5', 1); -- SAN SALVADOR (id country=86) INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 861, 86, '0', '0', 'SIN IVA', 1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES ( 862, 86, '13', '0', 'IVA 13', 1); -- SENEGAL (id country=22) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 221, 22, '0', '0', 'VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 222, 22, '10', '0', 'VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 223, 22, '18', '0', 'VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 221, 22, '0', '0', 'VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 222, 22, '10', '0', 'VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 223, 22, '18', '0', 'VAT rate - standard',1); -- SLOVAKIA (id country=201) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2011, 201, '0', '0', 'VAT Rate 0', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2012, 201, '10', '0', 'VAT reduced rate', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2013, 201, '19', '0', 'VAT standard rate', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2011, 201, '0', '0', 'VAT rate 0', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2012, 201, '10', '0', 'VAT rate - reduced', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2013, 201, '19', '0', 'VAT rate - standard', 1); -- SLOVENIA (id country=202) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2021, 202, '0', '0', 'VAT Rate 0', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2022, 202,'9.5', '0', 'VAT reduced rate', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2023, 202, '22', '0', 'VAT standard rate', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2021, 202, '0', '0', 'VAT rate 0', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2022, 202,'9.5', '0', 'VAT rate - reduced', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2023, 202, '22', '0', 'VAT rate - standard', 1); -- SOUTH AFRICA (id country=205) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051, 205, '0', '0', 'VAT Rate 0', 1); -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052, 205, '15', '0', 'VAT standard rate', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2051, 205, '0', '0', 'VAT rate 0', 1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) VALUES (2052, 205, '15', '0', 'VAT rate - standard', 1); -- SPAIN (id country=4) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 41, 4, '0','0', '0','3','-19:-15:-9','5','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 42, 4,'10','0','1.4','3','-19:-15:-9','5','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 43, 4, '4','0','0.5','3','-19:-15:-9','5','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4,'21','0','5.2','3','-19:-15:-9','5','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 41, 4, '0','0', '0','3','-19:-15:-9','5','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 42, 4,'10','0','1.4','3','-19:-15:-9','5','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 43, 4, '4','0','0.5','3','-19:-15:-9','5','VAT rate - super-reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values ( 44, 4,'21','0','5.2','3','-19:-15:-9','5','VAT rate - standard',1); -- SWEDEN (id country=20) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 201, 20, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 202, 20, '12','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 203, 20, '6','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 204, 20, '25','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 201, 20, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 202, 20, '12','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 203, 20, '6','0','VAT rate - super-reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 204, 20, '25','0','VAT rate - standard',1); -- SWITZERLAND (id country=6) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 61, 6, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 62, 6, '3.7','0','VAT reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 63, 6, '2.5','0','VAT super-reduced rate',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 64, 6, '7.7','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 61, 6, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 62, 6, '3.7','0','VAT rate - reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 63, 6, '2.5','0','VAT rate - super-reduced',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 64, 6, '7.7','0','VAT rate - standard',1); -- SRI LANKA (id country=207) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2071, 207, '0','0','VAT 0', 1); @@ -319,7 +323,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (21 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2132, 213, '5','0','VAT 5%',1); -- TUNISIA (id country=10) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (101,10, '0','0','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (101,10, '0','0','VAT rate 0',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (102,10, '12','0','VAT 12%',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (103,10, '18','0','VAT 18%',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (104,10, '7.5','0','VAT 6% Majoré à 25% (7.5%)',1); @@ -329,14 +333,14 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (10 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active,localtax1,localtax1_type,localtax2,localtax2_type) values (107,10,'18.18','0','VAT 18%+FODEC', 1, 1, '4', 0, 0); -- UKRAINE (id country=226) -INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2261,226, '0','0','VAT Rate 0',1); +INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2261,226, '0','0','VAT rate 0',1); INSERT INTO llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2262,226, '20','0','VAT standart rate',1); -- UNITED OF KINGDOM (id country=7) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 71, 7, '0','0','VAT Rate 0', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 72, 7, '17.5','0','VAT standard rate before 2011',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 73, 7, '5','0','VAT reduced rate', 1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 74, 7, '20','0','VAT standard rate',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 71, 7, '0','0','VAT rate 0', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 72, 7, '17.5','0','VAT rate - standard before 2011',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 73, 7, '5','0','VAT rate - reduced', 1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 74, 7, '20','0','VAT rate - standard',1); -- UNITED STATES (id country=11) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (111,11, '0','0','No Sales Tax',1); @@ -350,16 +354,16 @@ 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 (1931,193, '0','0','No VAT in SPM',1); -- SAINT MARTIN (id country=24) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2461,246, '0','0','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2461,246, '0','0','VAT rate 0',1); -- MAURITANIA (id country=151) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1511,151, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1512,151, '14','0','VAT Rate 14',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1511,151, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1512,151, '14','0','VAT rate 14',1); -- MAURITIUS (id country=152) -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1521,152, '0','0','VAT Rate 0',1); -insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1522,152, '15','0','VAT Rate 15',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1521,152, '0','0','VAT rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1522,152, '15','0','VAT rate 15',1); -- HONDURAS (id country=114) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1141,114, '0','0','No ISV',1); @@ -384,7 +388,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (23 insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2322,232, '12','0','VAT 12%',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2323,232, '8','0','VAT 8%',1); --- Example of code to insert a vat rate 0 for each country +-- Example of code to insert a VAT rate 0 for each country --delete from llx_c_tva where rowid = 1181; -- to delete a record that does not follow rules for rowid (fk_pays+'1') --insert into llx_c_tva(rowid, fk_pays, taux, recuperableonly, note, active) SELECT CONCAT(c.rowid, '1'), c.rowid, 0, 0, 'No VAT', 1 from llx_c_country as c where c.rowid not in (select fk_pays from llx_c_tva); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 5bda447f368..a0b62ca38cc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -75,7 +75,7 @@ Dictionary=Dictionaries ErrorReservedTypeSystemSystemAuto=Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record ErrorCodeCantContainZero=Code can't contain value 0 DisableJavascript=Disable JavaScript and Ajax functions -DisableJavascriptNote=Note: For test or debug purpose. For optimization for blind person or text browsers, you may prefer to use the setup on the profile of user +DisableJavascriptNote=Note: For test or debug purpose only. For optimization for blind person or text browsers, you may prefer to use the setup on the profile of user UseSearchToSelectCompanyTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant COMPANY_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. UseSearchToSelectContactTooltip=Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. DelaiedFullListToSelectCompany=Wait until a key is pressed before loading content of Third Parties combo list.
This may increase performance if you have a large number of third parties, but it is less convenient. @@ -604,7 +604,7 @@ Module400Desc=Management of projects, leads/opportunities and/or tasks. You can Module410Name=Webcalendar Module410Desc=Webcalendar integration Module500Name=Taxes & Special Expenses -Module500Desc=Management of other expenses (sale taxes, social or fiscal taxes, dividends, ...) +Module500Desc=Management of other expenses (sales taxes, social or fiscal taxes, dividends, ...) Module510Name=Salaries Module510Desc=Record and track employee payments Module520Name=Loans @@ -1910,7 +1910,7 @@ UnicodeCurrency=Enter here between braces, list of byte number that represent th ColorFormat=The RGB color is in HEX format, eg: FF0000 PictoHelp=Icon name in dolibarr format ('image.png' if into the current theme directory, 'image.png@nom_du_module' if into the directory /img/ of a module) PositionIntoComboList=Position of line into combo lists -SellTaxRate=Sale tax rate +SellTaxRate=Sales tax rate 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 offers a page or web site to check the status of your shipments, you may enter it here. You can use the key {TRACKID} in the URL parameters so the system will replace it with the tracking number the user entered into the shipment card. OpportunityPercent=When you create a lead, you will define an estimated amount of project/lead. According to status of the lead, this amount may be multiplied by this rate to evaluate a total amount all your leads may generate. Value is a percentage (between 0 and 100). @@ -2151,5 +2151,5 @@ DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file APIsAreNotEnabled=APIs modules are not enabled YouShouldSetThisToOff=You should set this to 0 or off InstallAndUpgradeLockedBy=Install and upgrades are locked by the file %s -IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sale tax -IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sale tax +IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sales tax +IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sales tax diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index b52ab6131be..7deee6a9d55 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -80,7 +80,7 @@ Web=Web Poste= Position DefaultLang=Default language VATIsUsed=Sales tax used -VATIsUsedWhenSelling=This defines if this third party includes a sale tax or not when it makes an invoice to its own customers +VATIsUsedWhenSelling=This defines if this third party includes a sales tax or not when it makes an invoice to its own customers VATIsNotUsed=Sales tax is not used CopyAddressFromSoc=Copy address from third-party details ThirdpartyNotCustomerNotSupplierSoNoRef=Third party neither customer nor vendor, no available referring objects diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 8329346c163..c5e1a58d243 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -188,25 +188,25 @@ LT1ReportByCustomers=Report tax 2 by third party LT2ReportByCustomers=Report tax 3 by third party LT1ReportByCustomersES=Report by third party RE LT2ReportByCustomersES=Report by third party IRPF -VATReport=Sale tax report -VATReportByPeriods=Sale tax report by period -VATReportByMonth=Sale tax report by month -VATReportByRates=Sale tax report by rates -VATReportByThirdParties=Sale tax report by third parties -VATReportByCustomers=Sale tax report by customer +VATReport=Sales tax report +VATReportByPeriods=Sales tax report by period +VATReportByMonth=Sales tax report by month +VATReportByRates=Sales tax report by rate +VATReportByThirdParties=Sales tax report by third partie +VATReportByCustomers=Sales tax report by customer VATReportByCustomersInInputOutputMode=Report by the customer VAT collected and paid -VATReportByQuartersInInputOutputMode=Report by Sale tax rate of the tax collected and paid +VATReportByQuartersInInputOutputMode=Report by Sales tax rate of the tax collected and paid VATReportShowByRateDetails=Show details of this rate LT1ReportByQuarters=Report tax 2 by rate LT2ReportByQuarters=Report tax 3 by rate LT1ReportByQuartersES=Report by RE rate LT2ReportByQuartersES=Report by IRPF rate -SeeVATReportInInputOutputMode=See report %sVAT encasement%s for a standard calculation -SeeVATReportInDueDebtMode=See report %sVAT on flow%s for a calculation with an option on the flow -RulesVATInServices=- For services, the report includes the VAT regulations actually received or issued on the basis of the date of payment. -RulesVATInProducts=- For material assets, the report includes the VAT received or issued on the basis of the date of payment. -RulesVATDueServices=- For services, the report includes VAT invoices due, paid or not, based on the invoice date. -RulesVATDueProducts=- For material assets, the report includes the VAT invoices, based on the invoice date. +SeeVATReportInInputOutputMode=See report %sVAT collection%s for a standard calculation +SeeVATReportInDueDebtMode=See report %sVAT on debit%s for a calculation with an option on the invoicing +RulesVATInServices=- For services, the report includes the VAT of payments actually received or paid on the basis of the date of payment. +RulesVATInProducts=- For material assets, the report includes the VAT on the basis of the date of payment. +RulesVATDueServices=- For services, the report includes VAT of due invoices, paid or not, based on the invoice date. +RulesVATDueProducts=- For material assets, the report includes the VAT of due invoices, based on the invoice date. OptionVatInfoModuleComptabilite=Note: For material assets, it should use the date of delivery to be more fair. ThisIsAnEstimatedValue=This is a preview, based on business events and not from the final ledger table, so final results may differ from this preview values PercentOfInvoice=%%/invoice From 6a296bf6c2ff3c2b3f87ed8a16a99472e01f7fb5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 10:18:46 +0200 Subject: [PATCH 17/26] Debug setup --- htdocs/admin/ihm.php | 133 +++++++++++++++++++--------------- htdocs/core/lib/admin.lib.php | 13 +--- htdocs/core/lib/ajax.lib.php | 7 +- htdocs/langs/en_US/admin.lang | 11 ++- 4 files changed, 91 insertions(+), 73 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 05fe8c42081..3dcfb66031d 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -44,7 +44,7 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminihm'; // To manage different context of search -$mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'language'; // 'language', 'template', 'dashboard', 'login', 'other' +$mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'other'; // 'template', 'dashboard', 'login', 'other' if (!defined("MAIN_MOTD")) { define("MAIN_MOTD", ""); @@ -97,12 +97,6 @@ if ($action == 'removebackgroundlogin' && !empty($conf->global->MAIN_LOGIN_BACKG if ($action == 'update') { $error = 0; - if ($mode == 'language') { - dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); - //dolibarr_set_const($db, "MAIN_MULTILANGS", GETPOST("MAIN_MULTILANGS"), 'chaine', 0, '', $conf->entity); - } - if ($mode == 'template') { dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity); @@ -212,6 +206,9 @@ if ($action == 'update') { } if ($mode == 'other') { + dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("main_size_liste_limit", 'int'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity); @@ -304,28 +301,6 @@ print dol_get_fiche_head($head, $mode, '', -1, ''); clearstatcache(); -if ($mode == 'language') { - print '
'; - print ''; - - // Default language - print ''; - print ''; - - // Multilingual GUI - print ''; - print ''; - - print '
'.$langs->trans("DefaultLanguage").''; - print img_picto('', 'language', 'class="pictofixedwidth"'); - print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2); - //print ''; - print '
' . $langs->trans("EnableMultilangInterface") . ''; - print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0); - print '
' . "\n"; - print '
'; -} - if ($mode == 'template') { // Themes and themes options showSkins(null, 1); @@ -374,74 +349,74 @@ if ($mode == 'dashboard') { print ''; print '' . $langs->trans('DashboardDisableGlobal') . ''; - print ajax_constantonoff("MAIN_DISABLE_GLOBAL_WORKBOARD", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red'); + print ajax_constantonoff("MAIN_DISABLE_GLOBAL_WORKBOARD", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard'); print ''; print ''; if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { // Block meteo print '' . $langs->trans('MAIN_DISABLE_METEO') . ''; - print ajax_constantonoff("MAIN_DISABLE_METEO", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red'); + print ajax_constantonoff("MAIN_DISABLE_METEO", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard'); print ''; print ''; // Block agenda print '' . $langs->trans('DashboardDisableBlockAgenda') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_AGENDA", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red'); + print ajax_constantonoff("MAIN_DISABLE_BLOCK_AGENDA", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard'); print ''; print ''; // Block agenda print '' . $langs->trans('DashboardDisableBlockProject') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_PROJECT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red'); + print ajax_constantonoff("MAIN_DISABLE_BLOCK_PROJECT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard'); print ''; print ''; // Block customer print '' . $langs->trans('DashboardDisableBlockCustomer') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red'); + print ajax_constantonoff("MAIN_DISABLE_BLOCK_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard'); print ''; print ''; // Block supplier print '' . $langs->trans('DashboardDisableBlockSupplier') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_SUPPLIER", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red'); + print ajax_constantonoff("MAIN_DISABLE_BLOCK_SUPPLIER", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard'); print ''; print ''; // Block contract print '' . $langs->trans('DashboardDisableBlockContract') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_CONTRACT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red'); + print ajax_constantonoff("MAIN_DISABLE_BLOCK_CONTRACT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard'); print ''; print ''; // Block ticket print '' . $langs->trans('DashboardDisableBlockTicket') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_TICKET", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red'); + print ajax_constantonoff("MAIN_DISABLE_BLOCK_TICKET", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard'); print ''; print ''; // Block bank print '' . $langs->trans('DashboardDisableBlockBank') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_BANK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red'); + print ajax_constantonoff("MAIN_DISABLE_BLOCK_BANK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard'); print ''; print ''; // Block adherent print '' . $langs->trans('DashboardDisableBlockAdherent') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_ADHERENT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red'); + print ajax_constantonoff("MAIN_DISABLE_BLOCK_ADHERENT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard'); print ''; print ''; // Block expense report print '' . $langs->trans('DashboardDisableBlockExpenseReport') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_EXPENSEREPORT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red'); + print ajax_constantonoff("MAIN_DISABLE_BLOCK_EXPENSEREPORT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard'); print ''; print ''; // Block holiday print '' . $langs->trans('DashboardDisableBlockHoliday') . ''; - print ajax_constantonoff("MAIN_DISABLE_BLOCK_HOLIDAY", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red'); + print ajax_constantonoff("MAIN_DISABLE_BLOCK_HOLIDAY", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard'); print ''; print ''; } @@ -451,18 +426,46 @@ if ($mode == 'dashboard') { } if ($mode == 'other') { + print '
'; + print ''; + + print ''; + + // Default language + print ''; + print ''; + + // Multilingual GUI + print ''; + print ''; + + print '
'; + print $langs->trans("Language"); + print ''; + print '
'.$langs->trans("DefaultLanguage").''; + print img_picto('', 'language', 'class="pictofixedwidth"'); + print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2); + //print ''; + print '
' . $langs->trans("EnableMultilangInterface") . ''; + print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'language'); + print '
' . "\n"; + print '
'; + + print '
'; + print '
'; + print ''; + print '
'; + + print '
'; + // Other print '
'; print ''; - // Disable javascript and ajax - print ''; - print ''; - print ''; + print ''; // Max size of lists print ''; @@ -515,7 +518,7 @@ if ($mode == 'other') { // Hide unauthorized menus print ''; print ''; print ''; @@ -523,7 +526,7 @@ if ($mode == 'other') { // Hide unauthorized button print ''; print ''; print ''; @@ -539,7 +542,9 @@ if ($mode == 'other') { */ // Show bugtrack link - print ''; print ''; @@ -548,12 +553,21 @@ if ($mode == 'other') { // Hide wiki link on login page $pictohelp = ''; print ''; print ''; print ''; + // Disable javascript and ajax + print ''; + print ''; + print ''; + print '
' . $langs->trans("DisableJavascript") . ''; - print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0); - print '     ' . $langs->trans("DisableJavascriptNote") . ''; - print ''; - print '
'; + print $langs->trans("Miscelaneous"); + print ''; + print '
' . $langs->trans("DefaultMaxSizeList") . '
' . $langs->trans("HideUnauthorizedMenu") . ''; //print $form->selectyesno('MAIN_MENU_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_MENU_HIDE_UNAUTHORIZED : 0, 1); - print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0); + print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other'); print ' 
' . $langs->trans("ButtonHideUnauthorized") . ''; //print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1); - print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0); + print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other'); print ' 
' . $langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")) . ''; + print '
'; + print $form->textwithpicto($langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")), $langs->trans("ShowBugTrackLinkDesc")); + print ''; print ''; print ' 
' . str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')) . ''; - print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0); + print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other'); //print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1); print ' 
' . $langs->trans("DisableJavascript") . ''; + print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other'); + print ' ' . $langs->trans("DisableJavascriptNote") . ''; + print ''; + print '
' . "\n"; print '
'; } @@ -563,11 +577,16 @@ if ($mode == 'login') { print '
'; print ''; + print ''; + // Hide helpcenter link on login page print ''; - print ''; print ''; // Message on login page @@ -579,13 +598,13 @@ if ($mode == 'login') { $texthelp .= $key . '
'; } print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin'); - print '' . "\n"; // Background - print ''; From e5192de9f2b7f9c32e1f3cef23934772a84a4dcf Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Fri, 10 Sep 2021 11:36:08 +0200 Subject: [PATCH 20/26] fix import of product desc without wrong linebreaks --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3261142e02e..f9f596ad8c0 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3385,7 +3385,7 @@ class Form if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) { $opt .= ' data-qty="'.$objp->quantity.'" data-up="'.$objp->unitprice.'" data-discount="'.$outdiscount.'"'; } - $opt .= ' data-description="'.dol_escape_htmltag($objp->description).'"'; + $opt .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"'; $opt .= ' data-html="'.dol_escape_htmltag($optlabel).'"'; $opt .= '>'; From b98f239739d4e263c17d02903c5b81fa8b1996ef Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 10 Sep 2021 12:10:08 +0200 Subject: [PATCH 21/26] Fix : Sql error on movement_list --- htdocs/product/stock/movement_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 2b93d881cb9..464b011048d 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -548,7 +548,7 @@ if (!empty($search_user)) { if (!empty($search_batch)) { $sql .= natural_search('m.batch', $search_batch); } -if (!empty($product_id)) { +if (!empty($product_id)&& $product_id != '-1') { $sql .= natural_search('p.rowid', $product_id); } if (!empty($search_fk_projet) && $search_fk_projet != '-1') { From 17b9957197260d4477df1815525d97f934ac08ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 13:20:49 +0200 Subject: [PATCH 22/26] Update api_users.class.php --- htdocs/user/class/api_users.class.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index f5e1159b6b6..791e9a61cb7 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -151,8 +151,8 @@ class Users extends DolibarrApi */ public function get($id, $includepermissions = 0) { - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && - !(!empty(DolibarrApiAccess::$user->rights->user->self->creer) && (DolibarrApiAccess::$user->id == $id))) { + $canread + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && DolibarrApiAccess::$user->id != $id) { throw new RestException(401, 'Not allowed'); } @@ -190,8 +190,7 @@ class Users extends DolibarrApi */ public function getByLogin($login, $includepermissions = 0) { - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && - !(!empty(DolibarrApiAccess::$user->rights->user->self->creer) && (DolibarrApiAccess::$user->login == $login))) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && DolibarrApiAccess::$user->login != $login) { throw new RestException(401, 'Not allowed'); } @@ -225,8 +224,7 @@ class Users extends DolibarrApi */ public function getByEmail($email, $includepermissions = 0) { - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && - !(!empty(DolibarrApiAccess::$user->rights->user->self->creer) && (DolibarrApiAccess::$user->email == $email))) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && DolibarrApiAccess::$user->email != $email) { throw new RestException(401, 'Not allowed'); } From 999ad7629fa6b20c04d822ec508bb42386229712 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 13:29:19 +0200 Subject: [PATCH 23/26] Update api_users.class.php --- htdocs/user/class/api_users.class.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 791e9a61cb7..24c03bb9037 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -185,11 +185,16 @@ class Users extends DolibarrApi * * @url GET login/{login} * - * @throws RestException 401 Insufficient rights - * @throws RestException 404 User or group not found + * @throws RestException 400 Bad request + * @throws RestException 401 Insufficient rights + * @throws RestException 404 User or group not found */ public function getByLogin($login, $includepermissions = 0) { + if (empty($login)) { + throw new RestException(400, 'Bad parameters'); + } + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && DolibarrApiAccess::$user->login != $login) { throw new RestException(401, 'Not allowed'); } @@ -219,11 +224,16 @@ class Users extends DolibarrApi * * @url GET email/{email} * + * @throws RestException 400 Bad request * @throws RestException 401 Insufficient rights * @throws RestException 404 User or group not found */ public function getByEmail($email, $includepermissions = 0) { + if (empty($email)) { + throw new RestException(400, 'Bad parameters'); + } + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && DolibarrApiAccess::$user->email != $email) { throw new RestException(401, 'Not allowed'); } From d4bfbc69a4d7709fb50cd6be0dc46d546e7abf13 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 13:30:28 +0200 Subject: [PATCH 24/26] Update api_users.class.php --- htdocs/user/class/api_users.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 24c03bb9037..4900141c01b 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -152,7 +152,7 @@ class Users extends DolibarrApi public function get($id, $includepermissions = 0) { $canread - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && DolibarrApiAccess::$user->id != $id) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && ($id == 0 || DolibarrApiAccess::$user->id != $id)) { throw new RestException(401, 'Not allowed'); } From b1c23b9a93ecb8d7ec20ef345f71b6846f04b6bd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 13:31:17 +0200 Subject: [PATCH 25/26] Update api_users.class.php --- htdocs/user/class/api_users.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 4900141c01b..9362f815b3b 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -151,8 +151,7 @@ class Users extends DolibarrApi */ public function get($id, $includepermissions = 0) { - $canread - if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && ($id == 0 || DolibarrApiAccess::$user->id != $id)) { + if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && $id != 0 && DolibarrApiAccess::$user->id != $id) { throw new RestException(401, 'Not allowed'); } From 51d23250dec7a4f14a26fcb31b95e7c82afe92b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 13:35:47 +0200 Subject: [PATCH 26/26] Update movement_list.php --- htdocs/product/stock/movement_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 464b011048d..161eec99047 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -548,7 +548,7 @@ if (!empty($search_user)) { if (!empty($search_batch)) { $sql .= natural_search('m.batch', $search_batch); } -if (!empty($product_id)&& $product_id != '-1') { +if (!empty($product_id) && $product_id != '-1') { $sql .= natural_search('p.rowid', $product_id); } if (!empty($search_fk_projet) && $search_fk_projet != '-1') {
'; + print $langs->trans("Parameter"); + print ''; + print $langs->trans("Value"); + print '
' . $langs->trans("DisableLinkToHelpCenter") . ''; - print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0); + print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0, 0, 0, '', 'login'); print ' 
'; + print ''; $doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME) ? $conf->global->MAIN_HOME : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%'); $doleditor->Create(); print '
'; + print '
'; print '
'; $disabled = ''; if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) { diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 6285aabfb05..c97d80dda4d 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -675,13 +675,13 @@ function ihm_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=language"; - $head[$h][1] = $langs->trans("DefaultLanguage"); - $head[$h][2] = 'language'; + $head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=other"; + $head[$h][1] = $langs->trans("LanguageAndPresentation"); + $head[$h][2] = 'other'; $h++; $head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=template"; - $head[$h][1] = $langs->trans("DefaultSkin"); + $head[$h][1] = $langs->trans("SkinAndColors"); $head[$h][2] = 'template'; $h++; @@ -695,11 +695,6 @@ function ihm_prepare_head() $head[$h][2] = 'login'; $h++; - $head[$h][0] = DOL_URL_ROOT."/admin/ihm.php?mode=other"; - $head[$h][1] = $langs->trans("Miscellaneous"); - $head[$h][2] = 'other'; - $h++; - complete_head_from_modules($conf, $langs, null, $head, $h, 'ihm_admin'); complete_head_from_modules($conf, $langs, null, $head, $h, 'ihm_admin', 'remove'); diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index ac0c24bd05b..cf0752738a5 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -547,9 +547,10 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete = * @param int $forcenoajax 1 = Force to use a ahref link instead of ajax code. * @param int $setzeroinsteadofdel 1 = Set constantto '0' instead of deleting it * @param string $suffix Suffix to use on the name of the switch_on picto. Example: '', '_red' + * @param string $mode Add parameter &mode= to the href link (Used for href link) * @return string */ -function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0, $suffix = '') +function ajax_constantonoff($code, $input = array(), $entity = null, $revertonoff = 0, $strict = 0, $forcereload = 0, $marginleftonlyshort = 2, $forcenoajax = 0, $setzeroinsteadofdel = 0, $suffix = '', $mode = '') { global $conf, $langs, $user; @@ -560,9 +561,9 @@ function ajax_constantonoff($code, $input = array(), $entity = null, $revertonof if (empty($conf->use_javascript_ajax) || $forcenoajax) { if (empty($conf->global->$code)) { - print ''.img_picto($langs->trans("Disabled"), 'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else { - print ''.img_picto($langs->trans("Enabled"), 'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } else { $out = "\n".' diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 998c6c7aff0..7df422d9b9b 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -375,8 +375,8 @@ UMask=UMask parameter for new files on Unix/Linux/BSD/Mac file system. UMaskExplanation=This parameter allow you to define permissions set by default on files created by Dolibarr on server (during upload for example).
It must be the octal value (for example, 0666 means read and write for everyone).
This parameter is useless on a Windows server. SeeWikiForAllTeam=Take a look at the Wiki page for a list of contributors and their organization UseACacheDelay= Delay for caching export response in seconds (0 or empty for no cache) -DisableLinkToHelpCenter=Hide link "Need help or support" on login page -DisableLinkToHelp=Hide link to online help "%s" +DisableLinkToHelpCenter=Hide the link "Need help or support" on the login page +DisableLinkToHelp=Hide the link to the online help "%s" AddCRIfTooLong=There is no automatic text wrapping, text that is too long will not display on documents. Please add carriage returns in the text area if needed. ConfirmPurge=Are you sure you want to execute this purge?
This will permanently delete all your data files with no way to restore them (ECM files, attached files...). MinLength=Minimum length @@ -1168,7 +1168,8 @@ DoNotSuggestPaymentMode=Do not suggest NoActiveBankAccountDefined=No active bank account defined OwnerOfBankAccount=Owner of bank account %s BankModuleNotActive=Bank accounts module not enabled -ShowBugTrackLink=Define the link "%s" (empty to not display this link, 'github' for the link to the Dolibarr project or define directly an url 'https://...') +ShowBugTrackLink=Show the link "%s" +ShowBugTrackLinkDesc=Keep empty to not display this link, use value 'github' for the link to the Dolibarr project or define directly an url 'https://...' Alerts=Alerts DelaysOfToleranceBeforeWarning=Delay before displaying a warning alert for: DelaysOfToleranceDesc=Set the delay before an alert icon %s is shown onscreen for the late element. @@ -1218,7 +1219,7 @@ SystemAreaForAdminOnly=This area is available to administrator users only. Dolib CompanyFundationDesc=Edit the information of your company/organization. Click on "%s" button at the bottom of the page when done. AccountantDesc=If you have an external accountant/bookkeeper, you can edit here its information. AccountantFileNumber=Accountant code -DisplayDesc=Parameters affecting the look and behaviour of the application can be modified here. +DisplayDesc=Parameters affecting the look and presentation of the application can be modified here. AvailableModules=Available app/modules ToActivateModule=To activate modules, go on setup Area (Home->Setup->Modules). SessionTimeOut=Time out for session @@ -2180,3 +2181,5 @@ DashboardDisableBlockHoliday=Disable the thumb for leaves EnabledCondition=Condition to have field enabled (if not enabled, visibility will always be off) IfYouUseASecondTaxYouMustSetYouUseTheMainTax=If you want to use a second tax, you must enable also the first sale tax IfYouUseAThirdTaxYouMustSetYouUseTheMainTax=If you want to use a third tax, you must enable also the first sale tax +LanguageAndPresentation=Language and presentation +SkinAndColors=Skin and colors \ No newline at end of file From 071a2959ab206bb982d0149f8d871c3e2fb30220 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 11:03:48 +0200 Subject: [PATCH 18/26] Fix trans --- htdocs/langs/en_US/errors.lang | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 303df972340..79bc0e1c088 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -307,10 +307,10 @@ WarningPaypalPaymentNotCompatibleWithStrict=The value 'Strict' makes the online # Validate RequireValidValue = Value not valid -RequireAtLeastXString = Requires at least % character(s) -RequireXStringMax = Requires % character(s) max -RequireAtLeastXDigits = Requires at least % digit(s) -RequireXDigitsMax = Requires % digit(s) max +RequireAtLeastXString = Requires at least %s character(s) +RequireXStringMax = Requires %s character(s) max +RequireAtLeastXDigits = Requires at least %s digit(s) +RequireXDigitsMax = Requires %s digit(s) max RequireValidEmail = Email address is not valid RequireMaxLength = Length must be less than %s chars RequireMinLength = Length must be more than %s char(s) From 4939cc99114de681da28bbd28f8dfc3608c45813 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 10 Sep 2021 11:04:59 +0200 Subject: [PATCH 19/26] Fix trans --- htdocs/langs/en_US/eventorganization.lang | 6 +++--- htdocs/langs/en_US/members.lang | 2 +- htdocs/langs/en_US/stocks.lang | 6 +++--- htdocs/langs/fr_FR/members.lang | 4 ++-- htdocs/public/members/new.php | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index d4110dd184f..20f201447f3 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -125,7 +125,7 @@ BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s EventType = Event type LabelOfBooth=Booth label LabelOfconference=Conference label -ConferenceIsNotConfirmed=Subcription not available, conference is not confirmed yet +ConferenceIsNotConfirmed=Registration not available, conference is not confirmed yet DateMustBeBeforeThan=%s must be before %s DateMustBeAfterThan=%s must be after %s @@ -145,11 +145,11 @@ VoteError = An error has occurred during the vote, please try again. # # SubscriptionOk page # -SubscriptionOk = Your subscription to this conference has been validated +SubscriptionOk = Your subscription has been validated # # Subscription validation mail # -ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to a conference +ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to an event # # Payment page # diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 695a11044b1..5285e4ecb60 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -206,7 +206,7 @@ VATToUseForSubscriptions=VAT rate to use for contributionss NoVatOnSubscription=No VAT for contributions ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS=Product used for contribution line into invoice: %s NameOrCompany=Name or company -SubscriptionRecorded=Subscription recorded +SubscriptionRecorded=Contribution recorded NoEmailSentToMember=No email sent to member EmailSentToMember=Email sent to member at %s SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired contributions diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 88e14abaaf6..3c4c33628c4 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -12,9 +12,9 @@ AddWarehouse=Create warehouse AddOne=Add one DefaultWarehouse=Default warehouse WarehouseTarget=Target warehouse -ValidateSending=Confirm sending -CancelSending=Cancel sending -DeleteSending=Delete sending +ValidateSending=Confirm shipment +CancelSending=Cancel shipment +DeleteSending=Delete shipment Stock=Stock Stocks=Stocks MissingStocks=Missing stocks diff --git a/htdocs/langs/fr_FR/members.lang b/htdocs/langs/fr_FR/members.lang index 88a0aa11246..2e1498e4507 100644 --- a/htdocs/langs/fr_FR/members.lang +++ b/htdocs/langs/fr_FR/members.lang @@ -70,8 +70,8 @@ MemberTypeDeleted=Type d'adhérent supprimé MemberTypeCanNotBeDeleted=Ce type d'adhérent ne peut pas être supprimé NewSubscription=Nouvelle adhésion NewSubscriptionDesc=Ce formulaire permet de vous inscrire comme nouvel adhérent de l'association. Pour un renouvellement (si vous êtes déjà adhérent), contactez plutôt l'association par email %s. -Subscription=Adhésion/cotisation -Subscriptions=Adhésions/cotisations +Subscription=Adhésion / cotisation +Subscriptions=Adhésions / cotisations SubscriptionLate=En retard SubscriptionNotReceived=Cotisation non reçue ListOfSubscriptions=Liste des cotisations diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index f9cd88a8c38..f84fce1a2b6 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -724,7 +724,7 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER } if (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { - $amount = $amount ? $amount : (GETPOST('amount') ? GETPOST('amount') : $conf->global->MEMBER_NEWFORM_AMOUNT); + $amount = $amount ? $amount : (GETPOST('amount') ? price2num(GETPOST('amount'), 'MT', 2) : $conf->global->MEMBER_NEWFORM_AMOUNT); } $amount = price2num($amount); @@ -732,10 +732,10 @@ if (!empty($conf->global->MEMBER_NEWFORM_AMOUNT) || !empty($conf->global->MEMBER // $conf->global->MEMBER_NEWFORM_PAYONLINE is 'paypal', 'paybox' or 'stripe' print '
'.$langs->trans("Subscription").''; if (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)) { - print ''; + print ''; } else { - print ''; - print ''; + print ''; + print ''; } print ' '.$langs->trans("Currency".$conf->currency); print '