';
+ // Title
+ $morehtmlref .= $projectstatic->title;
+ // Thirdparty
+ if ($projectstatic->thirdparty->id > 0) {
+ $morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
+ }
+ $morehtmlref .= '
';
+
+ // Define a complementary filter for search of next/prev ref.
+ if (!$user->rights->projet->all->lire) {
+ $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
+ $projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
+ }
+
+ dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+ print '
*
* 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
@@ -132,18 +132,41 @@ $permissiontoadd = $user->rights->eventorganization->write;
$permissiontodelete = $user->rights->eventorganization->delete;
// Security check
-//$socid = 0;
+if (empty($conf->eventorganization->enabled)) {
+ accessforbidden('Module not enabled');
+}
+$socid = 0;
if ($user->socid > 0) { // Protection if external user
//$socid = $user->socid;
accessforbidden();
}
$result = restrictedArea($user, 'eventorganization');
-
+if (!$permissiontoread) accessforbidden();
/*
* Actions
*/
+if (preg_match('/^set/', $action) && $projectid > 0) {
+ $project = new Project($db);
+ //If "set" fields keys is in projects fields
+ $project_attr=preg_replace('/^set/', '', $action);
+ if (array_key_exists($project_attr, $project->fields)) {
+ $result = $project->fetch($projectid);
+ if ($result < 0) {
+ setEventMessages(null, $project->errors, 'errors');
+ } else {
+ $project->{$project_attr}=GETPOST($project_attr);
+ $result=$project->update($user);
+ if ($result < 0) {
+ setEventMessages(null, $project->errors, 'errors');
+ }
+ }
+ }
+}
+/*if ($action=='setaccept_conference_suggestions' && !empty(GETPOST('cancel', 'alpha'))) {
+}*/
+//setaccept_booth_suggestions
if (GETPOST('cancel', 'alpha')) {
$action = 'list';
$massaction = '';
@@ -152,6 +175,9 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
+
+
+
$parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
@@ -362,6 +388,39 @@ if ($projectid > 0) {
print "";
}
+ print '';
+ $typeofdata = 'checkbox:'.($project->accept_conference_suggestions ? ' checked="checked"' : '');
+ $htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
+ print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $project, $permissiontoadd, $typeofdata, '', 0, 0, 'projectid', $htmltext);
+ print ' ';
+ print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $project, $permissiontoadd, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
+ print " ";
+
+ print '';
+ $typeofdata = 'checkbox:'.($project->accept_booth_suggestions ? ' checked="checked"' : '');
+ $htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
+ print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $project, $permissiontoadd, $typeofdata, '', 0, 0, 'projectid', $htmltext);
+ print ' ';
+ print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $project, $permissiontoadd, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
+ print " ";
+
+ print '';
+ print $form->editfieldkey('PriceOfRegistration', 'price_registration', '', $project, $permissiontoadd, 'amount', '', 0, 0, 'projectid');
+ print ' ';
+ print $form->editfieldval('PriceOfRegistration', 'price_registration', $project->price_registration, $project, $permissiontoadd, 'amount', '', 0, 0, '', 0, '', 'projectid');
+ print " ";
+
+ print '';
+ print $form->editfieldkey('PriceOfBooth', 'price_booth', '', $project, $permissiontoadd, 'amount', '', 0, 0, 'projectid');
+ print ' ';
+ print $form->editfieldval('PriceOfBooth', 'price_booth', $project->price_booth, $project, $permissiontoadd, 'amount', '', 0, 0, '', 0, '', 'projectid');
+ print " ";
+
+ print ''.$langs->trans("EventOrganizationICSLink").' ';
+ print '';
+ print " ";
+
+
print '';
print '';
@@ -403,10 +462,11 @@ if ($object->ismultientitymanaged == 1) {
} else {
$sql .= " WHERE 1 = 1";
}
-
+if ($projectid > 0) {
+ $sql .= ' AND t.fk_project='.$project->id;
+}
foreach ($search as $key => $val) {
if (array_key_exists($key, $object->fields)) {
- //var_dump($key,$object->fields);
if ($key == 'status' && $search[$key] == -1) {
continue;
}
@@ -421,7 +481,6 @@ foreach ($search as $key => $val) {
$sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
}
} else {
- //var_dump($key,$object->fields);
if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
$columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key);
if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
@@ -447,22 +506,6 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
-/* If a group by is required
-$sql.= " GROUP BY ";
-foreach($object->fields as $key => $val) {
- $sql.='t.'.$key.', ';
-}
-// Add fields from extrafields
-if (! empty($extrafields->attributes[$object->table_element]['label'])) {
- foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
-}
-// Add where from hooks
-$parameters=array();
-$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters, $object); // Note that $action and $object may have been modified by hook
-$sql.=$hookmanager->resPrint;
-$sql=preg_replace('/,\s*$/','', $sql);
-*/
-
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records
@@ -554,7 +597,7 @@ print ' ';
print ' ';
print ' ';
-$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?action=create'.(!empty($project->id)?'&fk_project='.$project->id:'').(!empty($project->socid)?'&fk_soc='.$project->socid:'').'&backtopage='.urlencode($_SERVER['PHP_SELF']).(!empty($project->id)?'?projectid='.$project->id:''), '', $permissiontoadd);
+$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?action=create'.(!empty($project->id)?'&withproject=1&fk_project='.$project->id:'').(!empty($project->socid)?'&fk_soc='.$project->socid:'').'&backtopage='.urlencode($_SERVER['PHP_SELF']).(!empty($project->id)?'?projectid='.$project->id:''), '', $permissiontoadd);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
@@ -725,6 +768,8 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
print '';
if ($key == 'status') {
print $object->getLibStatut(5);
+ } elseif ($key == 'ref') {
+ print $object->getNomUrl(1, 0, '', (($projectid > 0)?'withproject':''));
} else {
print $object->showOutputField($val, $key, $object->$key, '');
}
diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php
new file mode 100644
index 00000000000..57cf6baba78
--- /dev/null
+++ b/htdocs/eventorganization/conferenceorboothattendee_card.php
@@ -0,0 +1,701 @@
+
+ * Copyright (C) ---Put here your own copyright and developer email---
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file conferenceorboothattendee_card.php
+ * \ingroup eventorganization
+ * \brief Page to create/edit/view conferenceorboothattendee
+ */
+
+require '../main.inc.php';
+
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
+require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
+require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
+require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+
+// Load translation files required by the page
+$langs->loadLangs(array("eventorganization", "other"));
+
+// Get parameters
+$id = GETPOST('id', 'int');
+$ref = GETPOST('ref', 'alpha');
+$action = GETPOST('action', 'aZ09');
+$confirm = GETPOST('confirm', 'alpha');
+$cancel = GETPOST('cancel', 'aZ09');
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'conferenceorboothattendeecard'; // To manage different context of search
+$backtopage = GETPOST('backtopage', 'alpha');
+$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
+//$lineid = GETPOST('lineid', 'int');
+
+$conf_or_booth_id = GETPOST('conforboothid', 'int');
+$withproject = GETPOST('withproject', 'int');
+
+// Initialize technical objects
+$object = new ConferenceOrBoothAttendee($db);
+$extrafields = new ExtraFields($db);
+$projectstatic = new Project($db);
+$diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id;
+$hookmanager->initHooks(array('conferenceorboothattendeecard', 'globalcard')); // Note that conf->hooks_modules contains array
+
+if ($conf_or_booth_id > 0) {
+ $confOrBooth = new ConferenceOrBooth($db);
+ $result = $confOrBooth->fetch($conf_or_booth_id);
+ if ($result < 0) {
+ setEventMessages(null, $confOrBooth->errors, 'errors');
+ } else {
+ $object->fk_actioncomm = $confOrBooth->id;
+ $object->fk_project = $confOrBooth->fk_project;
+ }
+}
+
+// Fetch optionals attributes and labels
+$extrafields->fetch_name_optionals_label($object->table_element);
+
+$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
+
+// Initialize array of search criterias
+$search_all = GETPOST("search_all", 'alpha');
+$search = array();
+foreach ($object->fields as $key => $val) {
+ if (GETPOST('search_'.$key, 'alpha')) {
+ $search[$key] = GETPOST('search_'.$key, 'alpha');
+ }
+}
+
+if (empty($action) && empty($id) && empty($ref)) {
+ $action = 'view';
+}
+
+// Load object
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
+
+
+$permissiontoread = $user->rights->eventorganization->read;
+$permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
+$permissionnote = $user->rights->eventorganization->write; // Used by the include of actions_setnotes.inc.php
+$permissiondellink = $user->rights->eventorganization->write; // Used by the include of actions_dellink.inc.php
+$upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1];
+
+/*
+ * Actions
+ */
+
+$parameters = array();
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+if ($reshook < 0) {
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+}
+
+if (empty($reshook)) {
+ $error = 0;
+
+ $backurlforlist = dol_buildpath('/eventorganization/conferenceorboothattendee_list.php', 1);
+
+ if (empty($backtopage) || ($cancel && empty($id))) {
+ if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
+ if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
+ $backtopage = $backurlforlist;
+ } else {
+ $backtopage = dol_buildpath('/eventorganization/conferenceorboothattendee_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
+ }
+ }
+ }
+
+ $triggermodname = 'EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_MODIFY'; // Name of trigger action code to execute when we modify record
+
+ // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
+ include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
+
+ // Actions when linking object each other
+ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
+
+ // Actions when printing a doc from card
+ include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
+
+ // Action to move up and down lines of object
+ //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
+
+ // Action to build doc
+ include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
+
+ if ($action == 'set_thirdparty' && $permissiontoadd) {
+ $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname);
+ }
+ if ($action == 'classin' && $permissiontoadd) {
+ $object->setProject(GETPOST('projectid', 'int'));
+ }
+
+ // Actions to send emails
+ $triggersendname = 'EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_SENTBYMAIL';
+ $autocopy = 'MAIN_MAIL_AUTOCOPY_CONFERENCEORBOOTHATTENDEE_TO';
+ $trackid = 'conferenceorboothattendee'.$object->id;
+ include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
+}
+
+
+
+
+/*
+ * View
+ *
+ * Put here all code to build page
+ */
+
+$form = new Form($db);
+$formfile = new FormFile($db);
+$formproject = new FormProjets($db);
+
+$title = $langs->trans("ConferenceOrBoothAttendee");
+$help_url = '';
+llxHeader('', $title, $help_url);
+
+$result = $projectstatic->fetch($confOrBooth->fk_project);
+if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
+ $projectstatic->fetchComments();
+}
+if (!empty($projectstatic->socid)) {
+ $projectstatic->fetch_thirdparty();
+}
+
+$withProjectUrl='';
+$object->project = clone $projectstatic;
+
+if (!empty($withproject)) {
+ // Tabs for project
+ $tab = 'eventorganisation';
+ $withProjectUrl="&withproject=1";
+ $head = project_prepare_head($projectstatic);
+ print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
+
+ $param = ($mode == 'mine' ? '&mode=mine' : '');
+
+ // Project card
+
+ $linkback = ''.$langs->trans("BackToList").' ';
+
+ $morehtmlref = '';
+ // Title
+ $morehtmlref .= $projectstatic->title;
+ // Thirdparty
+ if ($projectstatic->thirdparty->id > 0) {
+ $morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
+ }
+ $morehtmlref .= '
';
+
+ // Define a complementary filter for search of next/prev ref.
+ if (!$user->rights->projet->all->lire) {
+ $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
+ $projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
+ }
+
+ dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+ print '';
+ print '
';
+ print '
';
+
+ print '
';
+
+ // Usage
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
+ print '';
+ print $langs->trans("Usage");
+ print ' ';
+ print '';
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
+ print ' usage_opportunity ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectFollowOpportunity");
+ print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
+ print ' ';
+ }
+ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
+ print ' usage_task ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectFollowTasks");
+ print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
+ print ' ';
+ }
+ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
+ print ' usage_bill_time ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectBillTimeDescription");
+ print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
+ print ' ';
+ }
+ if (!empty($conf->eventorganization->enabled)) {
+ print ' usage_organize_event ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("EventOrganizationDescriptionLong");
+ print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
+ }
+ print ' ';
+ }
+
+ // Visibility
+ print ''.$langs->trans("Visibility").' ';
+ if ($projectstatic->public) {
+ print $langs->trans('SharedProject');
+ } else {
+ print $langs->trans('PrivateProject');
+ }
+ print ' ';
+
+ // Date start - end
+ print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").' ';
+ $start = dol_print_date($projectstatic->date_start, 'day');
+ print ($start ? $start : '?');
+ $end = dol_print_date($projectstatic->date_end, 'day');
+ print ' - ';
+ print ($end ? $end : '?');
+ if ($projectstatic->hasDelay()) {
+ print img_warning("Late");
+ }
+ print ' ';
+
+ // Budget
+ print ''.$langs->trans("Budget").' ';
+ if (strcmp($projectstatic->budget_amount, '')) {
+ print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
+ }
+ print ' ';
+
+ // Other attributes
+ $cols = 2;
+ //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
+
+ print '
';
+
+ print '
';
+
+ print '
';
+ print '
';
+ print '
';
+
+ print '
';
+
+ // Description
+ print ''.$langs->trans("Description").' ';
+ print nl2br($projectstatic->description);
+ print ' ';
+
+ // Categories
+ if ($conf->categorie->enabled) {
+ print ''.$langs->trans("Categories").' ';
+ print $form->showCategories($projectstatic->id, 'project', 1);
+ print " ";
+ }
+
+ print '';
+ $typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : '');
+ $htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
+ print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
+ print ' ';
+ print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
+ print " ";
+
+ print '';
+ $typeofdata = 'checkbox:'.($projectstatic->accept_booth_suggestions ? ' checked="checked"' : '');
+ $htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
+ print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
+ print ' ';
+ print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
+ print " ";
+
+ print '';
+ print $form->editfieldkey('PriceOfRegistration', 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
+ print ' ';
+ print $form->editfieldval('PriceOfRegistration', 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
+ print " ";
+
+ print '';
+ print $form->editfieldkey('PriceOfBooth', 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
+ print ' ';
+ print $form->editfieldval('PriceOfBooth', 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
+ print " ";
+
+ print ''.$langs->trans("EventOrganizationICSLink").' ';
+ print '';
+ print " ";
+
+ print '
';
+
+ print '
';
+ print '
';
+ print '
';
+
+ print '
';
+
+ print dol_get_fiche_end();
+
+ print ' ';
+}
+
+// Part to create
+if ($action == 'create') {
+ print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ConferenceOrBoothAttendee")), '', 'object_'.$object->picto);
+
+ print '';
+
+ //dol_set_focus('input[name="ref"]');
+}
+
+// Part to edit record
+if (($id || $ref) && $action == 'edit') {
+ print load_fiche_titre($langs->trans("ConferenceOrBoothAttendee"), '', 'object_'.$object->picto);
+
+ print '';
+}
+
+// Part to show record
+if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
+ $res = $object->fetch_optionals();
+
+ $head = conferenceorboothattendeePrepareHead($object);
+ print dol_get_fiche_head($head, 'card', $langs->trans("ConferenceOrBoothAttendee"), -1, $object->picto);
+
+ $formconfirm = '';
+
+ // Confirmation to delete
+ if ($action == 'delete') {
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteConferenceOrBoothAttendee'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
+ }
+ // Confirmation to delete line
+ if ($action == 'deleteline') {
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
+ }
+ // Clone confirmation
+ if ($action == 'clone') {
+ // Create an array for form
+ $formquestion = array();
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
+ }
+
+ // 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);
+ }
+
+ // Call Hook formConfirm
+ $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
+ $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+ if (empty($reshook)) {
+ $formconfirm .= $hookmanager->resPrint;
+ } elseif ($reshook > 0) {
+ $formconfirm = $hookmanager->resPrint;
+ }
+
+ // 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 .= '
';
+ } 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.
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
+
+ print '
';
+ print '
';
+ print '
';
+
+ print '
';
+
+ print dol_get_fiche_end();
+
+
+ /*
+ * Lines
+ */
+
+ if (!empty($object->table_element_line)) {
+ // Show object lines
+ $result = $object->getLinesArray();
+
+ print ' \n";
+ }
+
+
+ // Buttons for actions
+
+ if ($action != 'presend' && $action != 'editline') {
+ print ''."\n";
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
+ if ($reshook < 0) {
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+ }
+
+ 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('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&conforboothid='.$confOrBooth->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 '
id.'&action=disable&token='.newToken().'">'.$langs->trans("Disable").' '."\n";
+ } else {
+ print '
id.'&action=enable&token='.newToken().'">'.$langs->trans("Enable").' '."\n";
+ }
+ }
+ if ($permissiontoadd) {
+ if ($object->status == $object::STATUS_VALIDATED) {
+ print '
id.'&action=close&token='.newToken().'">'.$langs->trans("Cancel").' '."\n";
+ } else {
+ print '
id.'&action=reopen&token='.newToken().'">'.$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));
+ }
+ print '
'."\n";
+ }
+
+
+ // Select mail models is same action as presend
+ if (GETPOST('modelselected')) {
+ $action = 'presend';
+ }
+
+ if ($action != 'presend') {
+ print '';
+ print '
'; // ancre
+
+ $includedocgeneration = 0;
+
+ // Documents
+ if ($includedocgeneration) {
+ $objref = dol_sanitizeFileName($object->ref);
+ $relativepath = $objref.'/'.$objref.'.pdf';
+ $filedir = $conf->eventorganization->dir_output.'/'.$object->element.'/'.$objref;
+ $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
+ $genallowed = $user->rights->eventorganization->conferenceorboothattendee->read; // If you can read, you can build the PDF to read content
+ $delallowed = $user->rights->eventorganization->conferenceorboothattendee->write; // If you can create/edit, you can remove a file on card
+ print $formfile->showdocuments('eventorganization:ConferenceOrBoothAttendee', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
+ }
+
+ // Show links to link elements
+ $linktoelem = $form->showLinkToObjectBlock($object, null, array('conferenceorboothattendee'));
+ $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
+
+
+ print '
';
+
+ print '
';
+ }
+
+ //Select mail models is same action as presend
+ if (GETPOST('modelselected')) {
+ $action = 'presend';
+ }
+
+ // Presend form
+ $modelmail = 'conferenceorboothattendee';
+ $defaulttopic = 'InformationMessage';
+ $diroutput = $conf->eventorganization->dir_output;
+ $trackid = 'conferenceorboothattendee'.$object->id;
+
+ include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
+}
+
+// End of page
+llxFooter();
+$db->close();
diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php
new file mode 100644
index 00000000000..d62830de925
--- /dev/null
+++ b/htdocs/eventorganization/conferenceorboothattendee_list.php
@@ -0,0 +1,868 @@
+
+ * Copyright (C) 2021 Florian Henry
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file conferenceorboothattendee_list.php
+ * \ingroup eventorganization
+ * \brief List page for conferenceorboothattendee
+ */
+
+require '../main.inc.php';
+
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.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';
+}
+
+// load eventorganization libraries
+require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
+
+// for other modules
+//dol_include_once('/othermodule/class/otherobject.class.php');
+
+// Load translation files required by the page
+$langs->loadLangs(array("eventorganization", "other"));
+
+$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
+$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
+$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
+$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
+$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
+$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'conferenceorboothattendeelist'; // To manage different context of search
+$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
+$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
+
+$id = GETPOST('id', 'int');
+$conf_or_booth_id = GETPOST('conforboothid', 'int');
+
+$withproject = GETPOST('withproject', 'int');
+$project_ref = GETPOST('project_ref', 'alpha');
+
+$withProjectUrl='';
+
+// Load variable for pagination
+$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
+$sortfield = GETPOST('sortfield', 'aZ09comma');
+$sortorder = GETPOST('sortorder', 'aZ09comma');
+$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
+if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
+ $page = 0;
+} // If $page is not defined, or '' or -1 or if we click on clear filters
+$offset = $limit * $page;
+$pageprev = $page - 1;
+$pagenext = $page + 1;
+
+// Initialize technical objects
+$object = new ConferenceOrBoothAttendee($db);
+$extrafields = new ExtraFields($db);
+$projectstatic = new Project($db);
+$diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id;
+$hookmanager->initHooks(array('conferenceorboothattendeelist')); // Note that conf->hooks_modules contains array
+
+// Fetch optionals attributes and labels
+$extrafields->fetch_name_optionals_label($object->table_element);
+//$extrafields->fetch_name_optionals_label($object->table_element_line);
+
+$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
+
+// Default sort order (if not yet defined by previous GETPOST)
+if (!$sortfield) {
+ reset($object->fields); // Reset is required to avoid key() to return null.
+ $sortfield = "t.".key($object->fields); // Set here default search field. By default 1st field in definition.
+}
+if (!$sortorder) {
+ $sortorder = "ASC";
+}
+
+// Initialize array of search criterias
+$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
+$search = array();
+foreach ($object->fields as $key => $val) {
+ if (GETPOST('search_'.$key, 'alpha') !== '') {
+ $search[$key] = GETPOST('search_'.$key, 'alpha');
+ }
+ if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
+ $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
+ $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
+ }
+}
+
+// List of fields to search into when doing a "search in all"
+$fieldstosearchall = array();
+foreach ($object->fields as $key => $val) {
+ if ($val['searchall']) {
+ $fieldstosearchall['t.'.$key] = $val['label'];
+ }
+}
+
+// Definition of array of fields for columns
+$arrayfields = array();
+foreach ($object->fields as $key => $val) {
+ // If $val['visible']==0, then we never show the field
+ if (!empty($val['visible'])) {
+ $visible = (int) dol_eval($val['visible'], 1);
+ $arrayfields['t.'.$key] = array(
+ 'label'=>$val['label'],
+ 'checked'=>(($visible < 0) ? 0 : 1),
+ 'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
+ 'position'=>$val['position'],
+ 'help'=>$val['help']
+ );
+ }
+}
+// Extra fields
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
+
+$object->fields = dol_sort_array($object->fields, 'position');
+$arrayfields = dol_sort_array($arrayfields, 'position');
+
+$permissiontoread = $user->rights->eventorganization->read;
+$permissiontoadd = $user->rights->eventorganization->write;
+$permissiontodelete = $user->rights->eventorganization->delete;
+
+// Security check
+if (empty($conf->eventorganization->enabled)) {
+ accessforbidden('Module not enabled');
+}
+$socid = 0;
+if ($user->socid > 0) { // Protection if external user
+ //$socid = $user->socid;
+ accessforbidden();
+}
+$result = restrictedArea($user, 'eventorganization');
+if (!$permissiontoread) accessforbidden();
+
+
+/*
+ * Actions
+ */
+
+if (GETPOST('cancel', 'alpha')) {
+ $action = 'list';
+ $massaction = '';
+}
+if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
+ $massaction = '';
+}
+
+$parameters = array();
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
+if ($reshook < 0) {
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+}
+
+if (empty($reshook)) {
+ // Selection of new fields
+ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
+
+ // Purge search criteria
+ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
+ foreach ($object->fields as $key => $val) {
+ $search[$key] = '';
+ if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
+ $search[$key.'_dtstart'] = '';
+ $search[$key.'_dtend'] = '';
+ }
+ }
+ $toselect = '';
+ $search_array_options = array();
+ }
+ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
+ || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
+ $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
+ }
+
+ // Mass actions
+ $objectclass = 'ConferenceOrBoothAttendee';
+ $objectlabel = 'ConferenceOrBoothAttendee';
+ $uploaddir = $conf->eventorganization->dir_output;
+ include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
+}
+
+
+
+/*
+ * View
+ */
+
+$form = new Form($db);
+
+$now = dol_now();
+$confOrBooth = new ConferenceOrBooth($db);
+if ($conf_or_booth_id > 0) {
+ $result = $confOrBooth->fetch($conf_or_booth_id);
+ if ($result < 0) {
+ setEventMessages(null, $confOrBooth->errors, 'errors');
+ }
+}
+
+// Build and execute select
+// --------------------------------------------------------------------
+$sql = 'SELECT ';
+$sql .= $object->getFieldList('t');
+// Add fields from extrafields
+if (!empty($extrafields->attributes[$object->table_element]['label'])) {
+ foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
+ $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : '');
+ }
+}
+// Add fields from hooks
+$parameters = array();
+$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
+$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
+$sql = preg_replace('/,\s*$/', '', $sql);
+$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
+$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id=t.fk_actioncomm AND a.id=".$confOrBooth->id;
+if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
+}
+// Add table from hooks
+$parameters = array();
+$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
+$sql .= $hookmanager->resPrint;
+if ($object->ismultientitymanaged == 1) {
+ $sql .= " WHERE t.entity IN (".getEntity($object->element).")";
+} else {
+ $sql .= " WHERE 1 = 1";
+}
+foreach ($search as $key => $val) {
+ if (array_key_exists($key, $object->fields)) {
+ if ($key == 'status' && $search[$key] == -1) {
+ continue;
+ }
+ $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
+ if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0)) {
+ if ($search[$key] == '-1' || $search[$key] === '0') {
+ $search[$key] = '';
+ }
+ $mode_search = 2;
+ }
+ if ($search[$key] != '') {
+ $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
+ }
+ } else {
+ if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
+ $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key);
+ if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
+ if (preg_match('/_dtstart$/', $key)) {
+ $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'";
+ }
+ if (preg_match('/_dtend$/', $key)) {
+ $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'";
+ }
+ }
+ }
+ }
+}
+if ($search_all) {
+ $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
+}
+//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
+// Add where from extra fields
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
+// Add where from hooks
+$parameters = array();
+$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
+$sql .= $hookmanager->resPrint;
+
+
+$sql .= $db->order($sortfield, $sortorder);
+
+// Count total nb of records
+$nbtotalofrecords = '';
+if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
+ $resql = $db->query($sql);
+ $nbtotalofrecords = $db->num_rows($resql);
+ if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
+ $page = 0;
+ $offset = 0;
+ }
+}
+// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
+if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
+ $num = $nbtotalofrecords;
+} else {
+ if ($limit) {
+ $sql .= $db->plimit($limit + 1, $offset);
+ }
+
+ $resql = $db->query($sql);
+ if (!$resql) {
+ dol_print_error($db);
+ exit;
+ }
+
+ $num = $db->num_rows($resql);
+}
+
+// Direct jump if only one record found
+if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
+ $obj = $db->fetch_object($resql);
+ $id = $obj->rowid;
+ header("Location: ".dol_buildpath('/eventorganization/conferenceorboothattendee_card.php', 1).'?id='.$id);
+ exit;
+}
+
+
+// Output page
+// --------------------------------------------------------------------
+
+//$help_url="EN:Module_ConferenceOrBoothAttendee|FR:Module_ConferenceOrBoothAttendee_FR|ES:Módulo_ConferenceOrBoothAttendee";
+$help_url = '';
+$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("ConferenceOrBoothAttendee"));
+$morejs = array();
+$morecss = array();
+llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs');
+
+if ($confOrBooth->id > 0) {
+ $result = $projectstatic->fetch($confOrBooth->fk_project);
+ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
+ $projectstatic->fetchComments();
+ }
+ if (!empty($projectstatic->socid)) {
+ $projectstatic->fetch_thirdparty();
+ }
+
+ $withProjectUrl='';
+ $object->project = clone $projectstatic;
+
+ if (!empty($withproject)) {
+ // Tabs for project
+ $tab = 'eventorganisation';
+ $withProjectUrl="&withproject=1";
+ $head = project_prepare_head($projectstatic);
+ print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
+
+ $param = ($mode == 'mine' ? '&mode=mine' : '');
+
+ // Project card
+
+ $linkback = ''.$langs->trans("BackToList").' ';
+
+ $morehtmlref = '';
+ // Title
+ $morehtmlref .= $projectstatic->title;
+ // Thirdparty
+ if ($projectstatic->thirdparty->id > 0) {
+ $morehtmlref .= ' '.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
+ }
+ $morehtmlref .= '
';
+
+ // Define a complementary filter for search of next/prev ref.
+ if (!$user->rights->projet->all->lire) {
+ $objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
+ $projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
+ }
+
+ dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+ print '';
+ print '
';
+ print '
';
+
+ print '
';
+
+ // Usage
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
+ print '';
+ print $langs->trans("Usage");
+ print ' ';
+ print '';
+ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
+ print ' usage_opportunity ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectFollowOpportunity");
+ print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
+ print ' ';
+ }
+ if (empty($conf->global->PROJECT_HIDE_TASKS)) {
+ print ' usage_task ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectFollowTasks");
+ print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
+ print ' ';
+ }
+ if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
+ print ' usage_bill_time ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("ProjectBillTimeDescription");
+ print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
+ print ' ';
+ }
+ if (!empty($conf->eventorganization->enabled)) {
+ print ' usage_organize_event ? ' checked="checked"' : '')).'"> ';
+ $htmltext = $langs->trans("EventOrganizationDescriptionLong");
+ print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
+ }
+ print ' ';
+ }
+
+ // Visibility
+ print ''.$langs->trans("Visibility").' ';
+ if ($projectstatic->public) {
+ print $langs->trans('SharedProject');
+ } else {
+ print $langs->trans('PrivateProject');
+ }
+ print ' ';
+
+ // Date start - end
+ print ''.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").' ';
+ $start = dol_print_date($projectstatic->date_start, 'day');
+ print ($start ? $start : '?');
+ $end = dol_print_date($projectstatic->date_end, 'day');
+ print ' - ';
+ print ($end ? $end : '?');
+ if ($projectstatic->hasDelay()) {
+ print img_warning("Late");
+ }
+ print ' ';
+
+ // Budget
+ print ''.$langs->trans("Budget").' ';
+ if (strcmp($projectstatic->budget_amount, '')) {
+ print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
+ }
+ print ' ';
+
+ // Other attributes
+ $cols = 2;
+ //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
+
+ print '
';
+
+ print '
';
+
+ print '
';
+ print '
';
+ print '
';
+
+ print '
';
+
+ // Description
+ print ''.$langs->trans("Description").' ';
+ print nl2br($projectstatic->description);
+ print ' ';
+
+ // Categories
+ if ($conf->categorie->enabled) {
+ print ''.$langs->trans("Categories").' ';
+ print $form->showCategories($projectstatic->id, 'project', 1);
+ print " ";
+ }
+
+ print '';
+ $typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : '');
+ $htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
+ print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
+ print ' ';
+ print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
+ print " ";
+
+ print '';
+ $typeofdata = 'checkbox:'.($projectstatic->accept_booth_suggestions ? ' checked="checked"' : '');
+ $htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
+ print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
+ print ' ';
+ print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
+ print " ";
+
+ print '';
+ print $form->editfieldkey('PriceOfRegistration', 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
+ print ' ';
+ print $form->editfieldval('PriceOfRegistration', 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
+ print " ";
+
+ print '';
+ print $form->editfieldkey('PriceOfBooth', 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
+ print ' ';
+ print $form->editfieldval('PriceOfBooth', 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
+ print " ";
+
+ print ''.$langs->trans("EventOrganizationICSLink").' ';
+ print '';
+ print " ";
+
+ print '
';
+
+ print '
';
+ print '
';
+ print '
';
+
+ print '
';
+
+ print dol_get_fiche_end();
+
+ print ' ';
+ }
+
+ $head = conferenceorboothPrepareHead($confOrBooth, $withproject);
+ print dol_get_fiche_head($head, 'attendees', $langs->trans("ConferenceOrBooth"), -1, $object->picto);
+
+
+ //$help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
+ $title = $langs->trans("ConferenceOrBooth") . ' - ' . $langs->trans("Attendees") . ' - ' . $confOrBooth->id;
+
+ $object_evt=$object;
+ $object=$confOrBooth;
+
+ dol_banner_tab($object, 'ref', '', 0);
+
+ print '';
+ print '
';
+ print '
';
+ print '
'."\n";
+
+ include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
+
+ // Other attributes. Fields from hook formObjectOptions and Extrafields.
+ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
+ $object=$object_evt;
+ print '
';
+ print '
';
+ print '
';
+
+ print '
';
+
+ print dol_get_fiche_end();
+}
+
+$arrayofselected = is_array($toselect) ? $toselect : array();
+
+$param = '';
+if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
+ $param .= '&contextpage='.urlencode($contextpage);
+}
+if ($limit > 0 && $limit != $conf->liste_limit) {
+ $param .= '&limit='.urlencode($limit);
+}
+foreach ($search as $key => $val) {
+ if (is_array($search[$key]) && count($search[$key])) {
+ foreach ($search[$key] as $skey) {
+ $param .= '&search_'.$key.'[]='.urlencode($skey);
+ }
+ } else {
+ $param .= '&search_'.$key.'='.urlencode($search[$key]);
+ }
+}
+if ($confOrBooth->id > 0) {
+ $param .= '&conforboothid='.urlencode($confOrBooth->id).$withProjectUrl;
+}
+
+if ($optioncss != '') {
+ $param .= '&optioncss='.urlencode($optioncss);
+}
+// Add $param from extra fields
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
+// Add $param from hooks
+$parameters = array();
+$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
+$param .= $hookmanager->resPrint;
+
+// List of mass actions available
+$arrayofmassactions = array(
+ //'validate'=>$langs->trans("Validate"),
+ //'generate_doc'=>$langs->trans("ReGeneratePDF"),
+ //'builddoc'=>$langs->trans("PDFMerge"),
+ //'presend'=>$langs->trans("SendByMail"),
+);
+if ($permissiontodelete) {
+ $arrayofmassactions['predelete'] = ' '.$langs->trans("Delete");
+}
+if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
+ $arrayofmassactions = array();
+}
+$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
+
+print ''."\n";
+
+if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
+ $hidegeneratedfilelistifempty = 1;
+ if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
+ $hidegeneratedfilelistifempty = 0;
+ }
+
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
+ $formfile = new FormFile($db);
+
+ // Show list of available documents
+ $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
+ $urlsource .= str_replace('&', '&', $param);
+
+ $filedir = $diroutputmassaction;
+ $genallowed = $permissiontoread;
+ $delallowed = $permissiontoadd;
+
+ print $formfile->showdocuments('massfilesarea_eventorganization', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
+}
+
+// End of page
+llxFooter();
+$db->close();
diff --git a/htdocs/eventorganization/conferenceorbooth_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php
similarity index 90%
rename from htdocs/eventorganization/conferenceorbooth_note.php
rename to htdocs/eventorganization/conferenceorboothattendee_note.php
index 634877d82fe..46620112311 100644
--- a/htdocs/eventorganization/conferenceorbooth_note.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_note.php
@@ -17,9 +17,9 @@
*/
/**
- * \file conferenceorbooth_note.php
+ * \file conferenceorboothattendee_note.php
* \ingroup eventorganization
- * \brief Tab for notes on ConferenceOrBooth
+ * \brief Tab for notes on ConferenceOrBoothAttendee
*/
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
@@ -74,8 +74,8 @@ if (!$res) {
die("Include of main fails");
}
-dol_include_once('/eventorganization/class/conferenceorbooth.class.php');
-dol_include_once('/eventorganization/lib/eventorganization_conferenceorbooth.lib.php');
+dol_include_once('/eventorganization/class/conferenceorboothattendee.class.php');
+dol_include_once('/eventorganization/lib/eventorganization_conferenceorboothattendee.lib.php');
// Load translation files required by the page
$langs->loadLangs(array("eventorganization@eventorganization", "companies"));
@@ -88,10 +88,10 @@ $cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
// Initialize technical objects
-$object = new ConferenceOrBooth($db);
+$object = new ConferenceOrBoothAttendee($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id;
-$hookmanager->initHooks(array('conferenceorboothnote', 'globalcard')); // Note that conf->hooks_modules contains array
+$hookmanager->initHooks(array('conferenceorboothattendeenote', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@@ -106,15 +106,9 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->eventorganization->multidir_output[$object->entity]."/".$object->id;
}
-$permissionnote = $user->rights->eventorganization->conferenceorbooth->write; // Used by the include of actions_setnotes.inc.php
-$permissiontoadd = $user->rights->eventorganization->conferenceorbooth->write; // Used by the include of actions_addupdatedelete.inc.php
+$permissionnote = $user->rights->eventorganization->conferenceorboothattendee->write; // Used by the include of actions_setnotes.inc.php
+$permissiontoadd = $user->rights->eventorganization->conferenceorboothattendee->write; // Used by the include of actions_addupdatedelete.inc.php
-// Security check
-if ($user->socid > 0) {
- accessforbidden();
-}
-$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0);
-$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
/*
@@ -132,18 +126,18 @@ $form = new Form($db);
//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes';
$help_url = '';
-llxHeader('', $langs->trans('ConferenceOrBooth'), $help_url);
+llxHeader('', $langs->trans('ConferenceOrBoothAttendee'), $help_url);
if ($id > 0 || !empty($ref)) {
$object->fetch_thirdparty();
- $head = conferenceorboothPrepareHead($object);
+ $head = conferenceorboothattendeePrepareHead($object);
- print dol_get_fiche_head($head, 'note', $langs->trans("ConferenceOrBooth"), -1, $object->picto);
+ print dol_get_fiche_head($head, 'note', $langs->trans("ConferenceOrBoothAttendee"), -1, $object->picto);
// Object card
// ------------------------------------------------------------
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
$morehtmlref = '';
/*
diff --git a/htdocs/eventorganization/img/object_conferenceorboothattendee.png b/htdocs/eventorganization/img/object_conferenceorboothattendee.png
new file mode 100644
index 00000000000..b421fe3c9e0
Binary files /dev/null and b/htdocs/eventorganization/img/object_conferenceorboothattendee.png differ
diff --git a/htdocs/eventorganization/img/object_ttruc.png b/htdocs/eventorganization/img/object_ttruc.png
new file mode 100644
index 00000000000..b421fe3c9e0
Binary files /dev/null and b/htdocs/eventorganization/img/object_ttruc.png differ
diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php
index 541915fc953..f822bdea743 100644
--- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php
+++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php
@@ -25,28 +25,65 @@
* Prepare array of tabs for ConferenceOrBooth
*
* @param ConferenceOrBooth $object ConferenceOrBooth
+ * @param int $with_project Add project id to URL
* @return array Array of tabs
*/
-function conferenceorboothPrepareHead($object)
+function conferenceorboothPrepareHead($object, $with_project = 0)
{
global $db, $langs, $conf;
- $langs->load("eventorganization@eventorganization");
+ $langs->load("eventorganization");
$h = 0;
$head = array();
- $head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_card.php", 1).'?id='.$object->id;
+ $withProjectUrl='';
+ if ($with_project>0) {
+ $withProjectUrl="&withproject=1";
+ }
+
+ $head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_card.php", 1).'?id='.$object->id.$withProjectUrl;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
+ //$head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_contact.php", 1).'?conforboothid='.$object->id.$withProjectUrl;
+ //$head[$h][1] = $langs->trans("Contact/Adress");
+ //$head[$h][2] = 'attendees';
+ //$h++;
+
+ $head[$h][0] = dol_buildpath("/eventorganization/conferenceorboothattendee_list.php", 1).'?conforboothid='.$object->id.$withProjectUrl;
+ $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_'.$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_actioncomm'=>$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.' ';
+ }
+ $h++;
+
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->eventorganization->dir_output."/conferenceorbooth/".dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
$nbLinks = Link::count($db, $object->element, $object->id);
- $head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_document.php", 1).'?id='.$object->id;
+ $head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_document.php", 1).'?id='.$object->id.$withProjectUrl;
$head[$h][1] = $langs->trans('Documents');
if (($nbFiles + $nbLinks) > 0) {
$head[$h][1] .= '
'.($nbFiles + $nbLinks).' ';
@@ -68,3 +105,33 @@ function conferenceorboothPrepareHead($object)
return $head;
}
+
+
+/**
+ * Prepare array of tabs for ConferenceOrBoothAttendees
+ *
+ * @param ConferenceOrBoothAttendee $object ConferenceOrBoothAttendee
+ * @return array Array of tabs
+ */
+function conferenceorboothattendeePrepareHead($object)
+{
+ global $db, $langs, $conf;
+
+ $langs->load("eventorganization");
+
+ $h = 0;
+ $head = array();
+
+ $head[$h][0] = dol_buildpath("/eventorganization/conferenceorboothattendee_card.php", 1).'?id='.$object->id.'&conforboothid='.$object->fk_actioncomm;
+ $head[$h][1] = $langs->trans("Card");
+ $head[$h][2] = 'card';
+ $h++;
+
+ //TODO : Note and docuement
+
+ complete_head_from_modules($conf, $langs, $object, $head, $h, 'conferenceorboothattendee@eventorganization');
+
+ complete_head_from_modules($conf, $langs, $object, $head, $h, 'conferenceorboothattendee@eventorganization', 'remove');
+
+ return $head;
+}
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index c251fdaf7cd..ed6f7a25eaf 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -2682,7 +2682,7 @@ class ExpeditionLigne extends CommonObjectLine
{
$sql = 'SELECT ed.rowid, ed.fk_expedition, ed.fk_entrepot, ed.fk_origin_line, ed.qty, ed.rang';
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as ed';
- $sql .= ' WHERE ed.rowid = '.$rowid;
+ $sql .= ' WHERE ed.rowid = '.((int) $rowid);
$result = $this->db->query($sql);
if ($result) {
$objp = $this->db->fetch_object($result);
diff --git a/htdocs/expedition/class/expeditionstats.class.php b/htdocs/expedition/class/expeditionstats.class.php
index 50382cef164..d25c7b52098 100644
--- a/htdocs/expedition/class/expeditionstats.class.php
+++ b/htdocs/expedition/class/expeditionstats.class.php
@@ -77,10 +77,10 @@ class ExpeditionStats extends Stats
$this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
}
if ($this->socid) {
- $this->where .= " AND c.fk_soc = ".$this->socid;
+ $this->where .= " AND c.fk_soc = ".((int) $this->socid);
}
if ($this->userid > 0) {
- $this->where .= ' AND c.fk_user_author = '.$this->userid;
+ $this->where .= ' AND c.fk_user_author = '.((int) $this->userid);
}
}
diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php
index 174b97b4a7e..9d5b7c4a8af 100644
--- a/htdocs/expedition/contact.php
+++ b/htdocs/expedition/contact.php
@@ -96,10 +96,10 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) {
}
} elseif ($action == 'swapstatut' && $user->rights->expedition->creer) {
// bascule du statut d'un contact
- $result = $objectsrc->swapContactStatus(GETPOST('ligne'));
+ $result = $objectsrc->swapContactStatus(GETPOST('ligne', 'int'));
} elseif ($action == 'deletecontact' && $user->rights->expedition->creer) {
// Efface un contact
- $result = $objectsrc->delete_contact(GETPOST("lineid"));
+ $result = $objectsrc->delete_contact(GETPOST("lineid", 'int'));
if ($result >= 0) {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
diff --git a/htdocs/expensereport/ajax/ajaxik.php b/htdocs/expensereport/ajax/ajaxik.php
index 72c38959ef8..c2cc8345671 100644
--- a/htdocs/expensereport/ajax/ajaxik.php
+++ b/htdocs/expensereport/ajax/ajaxik.php
@@ -17,7 +17,7 @@
*/
/**
- * \file htdocs/expensereport/ajax/ajaxprojet.php
+ * \file htdocs/expensereport/ajax/ajaxik.php
* \ingroup expensereport
* \brief File to return Ajax response on third parties request
*/
@@ -49,19 +49,19 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php'
// Load translation files required by the page
$langs->loadlangs(array('errors', 'trips'));
+$fk_expense = GETPOST('fk_expense', 'int');
+$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat', 'int');
+
+// Security check
+$result = restrictedArea($user, 'expensereport', $fk_expense, 'expensereport');
+
+
/*
* View
*/
top_httphead();
-
-dol_syslog(join(',', $_POST));
-
-$fk_expense = GETPOST('fk_expense');
-$fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat');
-
-
if (empty($fk_expense) || $fk_expense < 0) {
echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_expense, 'fk_expense')));
} elseif (empty($fk_c_exp_tax_cat) || $fk_c_exp_tax_cat < 0) {
@@ -82,7 +82,7 @@ if (empty($fk_expense) || $fk_expense < 0) {
echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorRecordNotFound'), 'range' => $range));
} else {
$ikoffset = price($range->ikoffset, 0, $langs, 1, -1, -1, $conf->currency);
- echo json_encode(array('up' => $range->coef, 'ikoffset' => $range->ikoffset, 'title' => $langs->transnoentitiesnoconv('ExpenseRangeOffset', $offset), 'comment' => 'offset should be apply on addline or updateline'));
+ echo json_encode(array('up' => $range->coef, 'ikoffset' => $range->ikoffset, 'title' => $langs->transnoentitiesnoconv('ExpenseRangeOffset', $ikoffset), 'comment' => 'offset should be applied on addline or updateline'));
}
}
}
diff --git a/htdocs/expensereport/ajax/ajaxprojet.php b/htdocs/expensereport/ajax/ajaxprojet.php
deleted file mode 100644
index 8549d62fa62..00000000000
--- a/htdocs/expensereport/ajax/ajaxprojet.php
+++ /dev/null
@@ -1,95 +0,0 @@
-
- * Copyright (C) 2005-2009 Regis Houssin
- * Copyright (C) 2007-2010 Laurent Destailleur
- * Copyright (C) 2010 Cyrille de Lambert
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/**
- * \file htdocs/expensereport/ajax/ajaxprojet.php
- * \ingroup expensereport
- * \brief File to return Ajax response on third parties request
- */
-
-if (!defined('NOTOKENRENEWAL')) {
- define('NOTOKENRENEWAL', 1); // Disables token renewal
-}
-if (!defined('NOREQUIREMENU')) {
- define('NOREQUIREMENU', '1');
-}
-if (!defined('NOREQUIREHTML')) {
- define('NOREQUIREHTML', '1');
-}
-if (!defined('NOREQUIREAJAX')) {
- define('NOREQUIREAJAX', '1');
-}
-if (!defined('NOREQUIRESOC')) {
- define('NOREQUIRESOC', '1');
-}
-if (!defined('NOCSRFCHECK')) {
- define('NOCSRFCHECK', '1');
-}
-
-$res = 0;
-require '../../main.inc.php';
-
-
-/*
- * View
- */
-
-// Ajout directives pour resoudre bug IE
-//header('Cache-Control: Public, must-revalidate');
-//header('Pragma: public');
-
-//top_htmlhead("", "", 1); // Replaced with top_httphead. An ajax page does not need html header.
-top_httphead();
-
-//print ''."\n";
-
-dol_syslog(join(',', $_GET));
-
-
-// Generation liste des projets
-if (GETPOST('fk_projet') != '') {
- $return_arr = array();
-
- $sql = "SELECT p.rowid, p.ref, p.title, s.nom";
- $sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
- $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid";
- if (!empty($_GET["fk_projet"])) {
- $sql .= " WHERE p.ref LIKE '%".$db->escape($_GET["fk_projet"])."%' OR p.title LIKE '%".$db->escape($_GET["fk_projet"])."%' OR s.nom LIKE '%".$db->escape($_GET["fk_projet"])."%'"; // Add other filters
- }
- $sql .= " ORDER BY p.ref ASC";
-
- $resql = $db->query($sql);
- if ($resql) {
- while ($row = $db->fetch_array($resql)) {
- $label = $row['ref'].' - '.$row['title'];
- $row_array['label'] = $label;
- $row_array['value'] = $label;
- $row_array['key'] = $row['rowid'];
-
- array_push($return_arr, $row_array);
- }
-
- echo json_encode($return_arr);
- } else {
- echo json_encode(array('nom'=>'Error', 'label'=>'Error', 'key'=>'Error', 'value'=>'Error'));
- }
-} else {
- echo json_encode(array('nom'=>'ErrorBadParameter', 'label'=>'ErrorBadParameter', 'key'=>'ErrorBadParameter', 'value'=>'ErrorBadParameter'));
-}
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 1c3e8594c41..a4c565bc1be 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -67,14 +67,6 @@ $socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('socid_id',
$childids = $user->getAllChildIds(1);
-// Security check
-$id = GETPOST("id", 'int');
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result = restrictedArea($user, 'expensereport', $id, 'expensereport');
-
-
// Hack to use expensereport dir
$rootfordata = DOL_DATA_ROOT;
$rootforuser = DOL_DATA_ROOT;
@@ -111,10 +103,8 @@ $permissionnote = $user->rights->expensereport->creer; // Used by the include of
$permissiondellink = $user->rights->expensereport->creer; // Used by the include of actions_dellink.inc.php
$permissiontoadd = $user->rights->expensereport->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
-
$upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref);
-
if ($object->id > 0) {
// Check current user can read this expense report
$canread = 0;
@@ -129,6 +119,13 @@ if ($object->id > 0) {
}
}
+// Security check
+$id = GETPOST("id", 'int');
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'expensereport', $object->id, 'expensereport');
+
/*
* Actions
@@ -1194,7 +1191,7 @@ if (empty($reshook)) {
}
$object->update_totaux_del($object_ligne->total_ht, $object_ligne->total_tva);
- header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_GET['id']);
+ header("Location: ".$_SERVER["PHP_SELF"]."?id=".GETPOST('id', 'int'));
exit;
} else {
setEventMessages($object->error, $object->errors, 'errors');
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index 496f57812a6..8ec99aa1007 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -663,7 +663,7 @@ class ExpenseReport extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."expensereport";
$sql .= " SET fk_statut = ".self::STATUS_CLOSED.", paid=1";
- $sql .= " WHERE rowid = ".$id." AND fk_statut = ".self::STATUS_APPROVED;
+ $sql .= " WHERE rowid = ".((int) $id)." AND fk_statut = ".self::STATUS_APPROVED;
dol_syslog(get_class($this)."::set_paid sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -880,7 +880,7 @@ class ExpenseReport extends CommonObject
if ($user->rights->expensereport->lire) {
$sql = "SELECT de.fk_expensereport, de.date, de.comments, de.total_ht, de.total_ttc";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as de";
- $sql .= " WHERE de.fk_projet = ".$projectid;
+ $sql .= " WHERE de.fk_projet = ".((int) $projectid);
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
$result = $this->db->query($sql);
@@ -973,7 +973,7 @@ class ExpenseReport extends CommonObject
{
$sql = 'SELECT tt.total_ht, tt.total_ttc, tt.total_tva';
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as tt';
- $sql .= ' WHERE tt.'.$this->fk_element.' = '.$id;
+ $sql .= ' WHERE tt.'.$this->fk_element.' = '.((int) $id);
$total_ht = 0; $total_tva = 0; $total_ttc = 0;
@@ -1117,8 +1117,8 @@ class ExpenseReport extends CommonObject
// Delete extrafields of lines and lines
if (!$error && !empty($this->table_element_line)) {
$tabletodelete = $this->table_element_line;
- //$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")";
- $sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
+ //$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".((int) $this->id).")";
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".((int) $this->id);
if (!$this->db->query($sql)) {
$error++;
$this->error = $this->db->lasterror();
@@ -1154,7 +1154,7 @@ class ExpenseReport extends CommonObject
// Delete main record
if (!$error) {
- $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".((int) $this->id);
$res = $this->db->query($sql);
if (!$res) {
$error++;
@@ -1384,7 +1384,7 @@ class ExpenseReport extends CommonObject
$this->db->begin();
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
- $sql .= " SET ref = '".$this->db->escape($this->ref)."', fk_statut = ".self::STATUS_APPROVED.", fk_user_approve = ".$fuser->id.",";
+ $sql .= " SET ref = '".$this->db->escape($this->ref)."', fk_statut = ".self::STATUS_APPROVED.", fk_user_approve = ".((int) $fuser->id).",";
$sql .= " date_approve='".$this->db->idate($this->date_approve)."'";
$sql .= ' WHERE rowid = '.$this->id;
if ($this->db->query($sql)) {
@@ -1434,7 +1434,7 @@ class ExpenseReport extends CommonObject
// date de refus
if ($this->status != self::STATUS_REFUSED) {
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
- $sql .= " SET ref = '".$this->db->escape($this->ref)."', fk_statut = ".self::STATUS_REFUSED.", fk_user_refuse = ".$fuser->id.",";
+ $sql .= " SET ref = '".$this->db->escape($this->ref)."', fk_statut = ".self::STATUS_REFUSED.", fk_user_refuse = ".((int) $fuser->id).",";
$sql .= " date_refuse='".$this->db->idate($now)."',";
$sql .= " detail_refuse='".$this->db->escape($details)."',";
$sql .= " fk_user_approve = NULL";
@@ -1558,7 +1558,7 @@ class ExpenseReport extends CommonObject
$this->db->begin();
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
- $sql .= " SET fk_statut = ".self::STATUS_CANCELED.", fk_user_cancel = ".$fuser->id;
+ $sql .= " SET fk_statut = ".self::STATUS_CANCELED.", fk_user_cancel = ".((int) $fuser->id);
$sql .= ", date_cancel='".$this->db->idate($this->date_cancel)."'";
$sql .= " ,detail_cancel='".$this->db->escape($detail)."'";
$sql .= ' WHERE rowid = '.$this->id;
@@ -2124,7 +2124,7 @@ class ExpenseReport extends CommonObject
// Select des infos sur le type fees
$sql = "SELECT c.code as code_type_fees, c.label as libelle_type_fees";
$sql .= " FROM ".MAIN_DB_PREFIX."c_type_fees as c";
- $sql .= " WHERE c.id = ".$type_fees_id;
+ $sql .= " WHERE c.id = ".((int) $type_fees_id);
$resql = $this->db->query($sql);
if ($resql) {
$objp_fees = $this->db->fetch_object($resql);
@@ -2136,7 +2136,7 @@ class ExpenseReport extends CommonObject
// Select des informations du projet
$sql = "SELECT p.ref as ref_projet, p.title as title_projet";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
- $sql .= " WHERE p.rowid = ".$projet_id;
+ $sql .= " WHERE p.rowid = ".((int) $projet_id);
$resql = $this->db->query($sql);
if ($resql) {
$objp_projet = $this->db->fetch_object($resql);
@@ -2173,7 +2173,7 @@ class ExpenseReport extends CommonObject
$this->db->begin();
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element_line;
- $sql .= ' WHERE rowid = '.$rowid;
+ $sql .= ' WHERE rowid = '.((int) $rowid);
dol_syslog(get_class($this)."::deleteline sql=".$sql);
$result = $this->db->query($sql);
@@ -2331,7 +2331,7 @@ class ExpenseReport extends CommonObject
$ret = array();
$sql = "SELECT id, code, label";
$sql .= " FROM ".MAIN_DB_PREFIX."c_type_fees";
- $sql .= " WHERE active = ".$active;
+ $sql .= " WHERE active = ".((int) $active);
dol_syslog(get_class($this)."::listOfTypes", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
@@ -2495,7 +2495,7 @@ class ExpenseReport extends CommonObject
$type = 'expense_report';
- $sql = " SELECT COUNT(ab.rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='".$this->db->escape($type)."' AND ab.fk_doc = ".$this->id;
+ $sql = " SELECT COUNT(ab.rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='".$this->db->escape($type)."' AND ab.fk_doc = ".((int) $this->id);
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
@@ -2628,7 +2628,7 @@ class ExpenseReportLine
$sql .= ' FROM '.MAIN_DB_PREFIX.'expensereport_det as fde';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON fde.fk_c_type_fees=ctf.id'; // Sometimes type of expense report has been removed, so we use a left join here.
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pjt ON fde.fk_projet=pjt.rowid';
- $sql .= ' WHERE fde.rowid = '.$rowid;
+ $sql .= ' WHERE fde.rowid = '.((int) $rowid);
$result = $this->db->query($sql);
@@ -2757,7 +2757,7 @@ class ExpenseReportLine
$sql = 'SELECT SUM(d.total_ttc) as total_amount';
$sql .= ' FROM '.MAIN_DB_PREFIX.'expensereport_det d';
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'expensereport e ON (d.fk_expensereport = e.rowid)';
- $sql .= ' WHERE e.fk_user_author = '.$fk_user;
+ $sql .= ' WHERE e.fk_user_author = '.((int) $fk_user);
if (!empty($this->id)) {
$sql .= ' AND d.rowid <> '.$this->id;
}
diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php
index 18a0503cdd7..6c6623c30c7 100644
--- a/htdocs/expensereport/class/expensereport_ik.class.php
+++ b/htdocs/expensereport/class/expensereport_ik.class.php
@@ -137,7 +137,7 @@ class ExpenseReportIk extends CoreObject
* @param int $fk_c_exp_tax_cat category
* @return boolean|array
*/
- public static function getRangeByUser(User $userauthor, $fk_c_exp_tax_cat)
+ public static function getRangeByUser(User $userauthor, int $fk_c_exp_tax_cat)
{
$default_range = (int) $userauthor->default_range; // if not defined, then 0
$ranges = self::getRangesByCategory($fk_c_exp_tax_cat);
@@ -157,23 +157,24 @@ class ExpenseReportIk extends CoreObject
* @param int $active active
* @return array
*/
- public static function getRangesByCategory($fk_c_exp_tax_cat, $active = 1)
+ public static function getRangesByCategory(int $fk_c_exp_tax_cat, $active = 1)
{
global $db;
$ranges = array();
+ dol_syslog(get_called_class().'::getRangesByCategory for fk_c_exp_tax_cat='.$fk_c_exp_tax_cat, LOG_DEBUG);
+
$sql = 'SELECT r.rowid FROM '.MAIN_DB_PREFIX.'c_exp_tax_range r';
if ($active) {
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'c_exp_tax_cat c ON (r.fk_c_exp_tax_cat = c.rowid)';
}
- $sql .= ' WHERE r.fk_c_exp_tax_cat = '.$fk_c_exp_tax_cat;
+ $sql .= ' WHERE r.fk_c_exp_tax_cat = '.((int) $fk_c_exp_tax_cat);
if ($active) {
$sql .= ' AND r.active = 1 AND c.active = 1';
}
$sql .= ' ORDER BY r.range_ik';
- dol_syslog(get_called_class().'::getRangesByCategory sql='.$sql, LOG_DEBUG);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php
index 4e4d1009750..653f030b6d2 100644
--- a/htdocs/expensereport/class/expensereport_rule.class.php
+++ b/htdocs/expensereport/class/expensereport_rule.class.php
@@ -167,7 +167,7 @@ class ExpenseReportRule extends CoreObject
if ($fk_user > 0) {
$sql .= ' AND (er.is_for_all = 1';
$sql .= ' OR er.fk_user = '.$fk_user;
- $sql .= ' OR er.fk_usergroup IN (SELECT ugu.fk_usergroup FROM '.MAIN_DB_PREFIX.'usergroup_user ugu WHERE ugu.fk_user = '.$fk_user.') )';
+ $sql .= ' OR er.fk_usergroup IN (SELECT ugu.fk_usergroup FROM '.MAIN_DB_PREFIX.'usergroup_user ugu WHERE ugu.fk_user = '.((int) $fk_user).') )';
}
$sql .= ' ORDER BY er.is_for_all, er.fk_usergroup, er.fk_user';
diff --git a/htdocs/expensereport/class/expensereportstats.class.php b/htdocs/expensereport/class/expensereportstats.class.php
index ec71f530f51..8f3574f2952 100644
--- a/htdocs/expensereport/class/expensereportstats.class.php
+++ b/htdocs/expensereport/class/expensereportstats.class.php
@@ -114,7 +114,7 @@ class ExpenseReportStats extends Stats
{
$sql = "SELECT MONTH(".$this->db->ifsql('e.'.$this->datetouse.' IS NULL', 'e.date_create', 'e.'.$this->datetouse).") as dm, count(*)";
$sql .= " FROM ".$this->from;
- $sql .= " WHERE YEAR(e.".$this->datetouse.") = ".$year;
+ $sql .= " WHERE YEAR(e.".$this->datetouse.") = ".((int) $year);
$sql .= " AND ".$this->where;
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');
diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php
index c9cf0cdaf41..c673316d491 100644
--- a/htdocs/expensereport/class/paymentexpensereport.class.php
+++ b/htdocs/expensereport/class/paymentexpensereport.class.php
@@ -607,7 +607,7 @@ class PaymentExpenseReport extends CommonObject
public function update_fk_bank($id_bank)
{
// phpcs:enable
- $sql = "UPDATE ".MAIN_DB_PREFIX."payment_expensereport SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."payment_expensereport SET fk_bank = ".((int) $id_bank)." WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
$result = $this->db->query($sql);
diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php
index d50f6336669..b7057af86fc 100644
--- a/htdocs/expensereport/payment/payment.php
+++ b/htdocs/expensereport/payment/payment.php
@@ -206,7 +206,7 @@ if ($action == 'create' || empty($action)) {
$sql = "SELECT sum(p.amount) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_expensereport as p, ".MAIN_DB_PREFIX."expensereport as e";
- $sql .= " WHERE p.fk_expensereport = e.rowid AND p.fk_expensereport = ".$id;
+ $sql .= " WHERE p.fk_expensereport = e.rowid AND p.fk_expensereport = ".((int) $id);
$sql .= ' AND e.entity IN ('.getEntity('expensereport').')';
$resql = $db->query($sql);
if ($resql) {
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index f5602bc5abb..1fef1ed7c03 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -1438,7 +1438,7 @@ class FichinterLigne extends CommonObjectLine
$sql = 'SELECT ft.rowid, ft.fk_fichinter, ft.description, ft.duree, ft.rang,';
$sql .= ' ft.date as datei';
$sql .= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft';
- $sql .= ' WHERE ft.rowid = '.$rowid;
+ $sql .= ' WHERE ft.rowid = '.((int) $rowid);
dol_syslog("FichinterLigne::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
@@ -1622,7 +1622,7 @@ class FichinterLigne extends CommonObjectLine
$sql = "SELECT SUM(duree) as total_duration, min(date) as dateo, max(date) as datee ";
$sql .= " FROM ".MAIN_DB_PREFIX."fichinterdet";
- $sql .= " WHERE fk_fichinter=".$this->fk_fichinter;
+ $sql .= " WHERE fk_fichinter=".((int) $this->fk_fichinter);
dol_syslog("FichinterLigne::update_total", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -1634,10 +1634,10 @@ class FichinterLigne extends CommonObjectLine
}
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinter";
- $sql .= " SET duree = ".$total_duration;
+ $sql .= " SET duree = ".((int) $total_duration);
$sql .= " , dateo = ".(!empty($obj->dateo) ? "'".$this->db->idate($obj->dateo)."'" : "null");
$sql .= " , datee = ".(!empty($obj->datee) ? "'".$this->db->idate($obj->datee)."'" : "null");
- $sql .= " WHERE rowid = ".$this->fk_fichinter;
+ $sql .= " WHERE rowid = ".((int) $this->fk_fichinter);
dol_syslog("FichinterLigne::update_total", LOG_DEBUG);
$resql = $this->db->query($sql);
diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php
index 8ed842a70c9..4fe35c32a2c 100644
--- a/htdocs/fichinter/class/fichinterrec.class.php
+++ b/htdocs/fichinter/class/fichinterrec.class.php
@@ -434,10 +434,10 @@ class FichinterRec extends Fichinter
$error = 0;
$this->db->begin();
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet_rec WHERE fk_fichinter = ".$rowid;
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet_rec WHERE fk_fichinter = ".((int) $rowid);
dol_syslog($sql);
if ($this->db->query($sql)) {
- $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinter_rec WHERE rowid = ".$rowid;
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinter_rec WHERE rowid = ".((int) $rowid);
dol_syslog($sql);
if (!$this->db->query($sql)) {
$this->error = $this->db->lasterror();
@@ -784,8 +784,8 @@ class FichinterRec extends Fichinter
}
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
- $sql .= ' SET nb_gen_max = '.$nb;
- $sql .= ' WHERE rowid = '.$this->id;
+ $sql .= ' SET nb_gen_max = '.((int) $nb);
+ $sql .= ' WHERE rowid = '.((int) $this->id);
dol_syslog(get_class($this)."::setMaxPeriod", LOG_DEBUG);
if ($this->db->query($sql)) {
@@ -811,8 +811,8 @@ class FichinterRec extends Fichinter
}
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
- $sql .= ' SET auto_validate = '.$validate;
- $sql .= ' WHERE rowid = '.$this->id;
+ $sql .= ' SET auto_validate = '.((int) $validate);
+ $sql .= ' WHERE rowid = '.((int) $this->id);
dol_syslog(get_class($this)."::setAutoValidate", LOG_DEBUG);
if ($this->db->query($sql)) {
diff --git a/htdocs/fichinter/class/fichinterstats.class.php b/htdocs/fichinter/class/fichinterstats.class.php
index a0d22cf1e2a..297aeca7760 100644
--- a/htdocs/fichinter/class/fichinterstats.class.php
+++ b/htdocs/fichinter/class/fichinterstats.class.php
@@ -73,15 +73,15 @@ class FichinterStats extends Stats
//$this->where.= " AND c.fk_statut > 0"; // Not draft and not cancelled
}
if (!$user->rights->societe->client->voir && !$this->socid) {
- $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
+ $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
$this->where .= ($this->where ? ' AND ' : '')."c.entity IN (".getEntity('fichinter').')';
if ($this->socid) {
- $this->where .= " AND c.fk_soc = ".$this->socid;
+ $this->where .= " AND c.fk_soc = ".((int) $this->socid);
}
if ($this->userid > 0) {
- $this->where .= ' AND c.fk_user_author = '.$this->userid;
+ $this->where .= ' AND c.fk_user_author = '.((int) $this->userid);
}
}
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 1c9ed333fae..0dfb4047b4f 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -1157,7 +1157,7 @@ class CommandeFournisseur extends CommonOrder
$this->db->begin();
- $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET fk_statut = ".$statut;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET fk_statut = ".((int) $statut);
$sql .= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::cancel", LOG_DEBUG);
if ($this->db->query($sql)) {
@@ -2306,7 +2306,7 @@ class CommandeFournisseur extends CommonOrder
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur";
- $sql .= " SET fk_statut = ".$statut;
+ $sql .= " SET fk_statut = ".((int) $statut);
$sql .= " WHERE rowid = ".$this->id;
$sql .= " AND fk_statut IN (".self::STATUS_ORDERSENT.",".self::STATUS_RECEIVED_PARTIALLY.")"; // Process running or Partially received
@@ -3495,7 +3495,7 @@ class CommandeFournisseurLigne extends CommonOrderLine
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON cd.fk_product = pfp.fk_product and cd.ref = pfp.ref_fourn";
}
- $sql .= ' WHERE cd.rowid = '.$rowid;
+ $sql .= ' WHERE cd.rowid = '.((int) $rowid);
$result = $this->db->query($sql);
if ($result) {
$objp = $this->db->fetch_object($result);
diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
index 21c36ced633..0f8b8341a3d 100644
--- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php
@@ -674,8 +674,10 @@ class CommandeFournisseurDispatch extends CommonObject
$sqlwhere [] = $key.' LIKE \'%'.$this->db->escape($value).'%\'';
} elseif ($key == 't.datec' || $key == 't.tms' || $key == 't.eatby' || $key == 't.sellby' || $key == 't.batch') {
$sqlwhere [] = $key.' = \''.$this->db->escape($value).'\'';
+ } elseif ($key == 'qty') {
+ $sqlwhere [] = $key.' = '.((float) $value);
} else {
- $sqlwhere [] = $key.' = '.$this->db->escape($value);
+ $sqlwhere [] = $key.' = '.((int) $value);
}
}
}
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index e7a7766e3be..ab7e6ea3fc4 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -1181,7 +1181,7 @@ class FactureFournisseur extends CommonInvoice
if (!$error) {
// If invoice was converted into a discount not yet consumed, we remove discount
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'societe_remise_except';
- $sql .= ' WHERE fk_invoice_supplier_source = '.$rowid;
+ $sql .= ' WHERE fk_invoice_supplier_source = '.((int) $rowid);
$sql .= ' AND fk_invoice_supplier_line IS NULL';
$resql = $this->db->query($sql);
@@ -1208,13 +1208,13 @@ class FactureFournisseur extends CommonInvoice
if (!$error) {
$main = MAIN_DB_PREFIX.'facture_fourn_det';
$ef = $main."_extrafields";
- $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_facture_fourn = $rowid)";
+ $sqlef = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM ".$main." WHERE fk_facture_fourn = ".((int) $rowid).")";
$resqlef = $this->db->query($sqlef);
- $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det WHERE fk_facture_fourn = '.$rowid.';';
+ $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det WHERE fk_facture_fourn = '.((int) $rowid);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resqlef && $resql) {
- $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn WHERE rowid = '.$rowid;
+ $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn WHERE rowid = '.((int) $rowid);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql2 = $this->db->query($sql);
if (!$resql2) {
@@ -1465,7 +1465,7 @@ class FactureFournisseur extends CommonInvoice
$this->newref = dol_sanitizeFileName($num);
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn";
- $sql .= " SET ref='".$num."', fk_statut = 1, fk_user_valid = ".$user->id.", date_valid = '".$this->db->idate($now)."'";
+ $sql .= " SET ref='".$this->db->escape($num)."', fk_statut = 1, fk_user_valid = ".((int) $user->id).", date_valid = '".$this->db->idate($now)."'";
$sql .= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::validate", LOG_DEBUG);
@@ -2092,7 +2092,7 @@ class FactureFournisseur extends CommonInvoice
// Libere remise liee a ligne de facture
$sql = 'UPDATE '.MAIN_DB_PREFIX.'societe_remise_except';
$sql .= ' SET fk_invoice_supplier_line = NULL';
- $sql .= ' WHERE fk_invoice_supplier_line = '.$rowid;
+ $sql .= ' WHERE fk_invoice_supplier_line = '.((int) $rowid);
dol_syslog(get_class($this)."::deleteline", LOG_DEBUG);
$result = $this->db->query($sql);
@@ -3093,7 +3093,7 @@ class SupplierInvoiceLine extends CommonObjectLine
$sql .= ', f.multicurrency_subprice, f.multicurrency_total_ht, f.multicurrency_total_tva, multicurrency_total_ttc';
$sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid';
- $sql .= ' WHERE f.rowid = '.$rowid;
+ $sql .= ' WHERE f.rowid = '.((int) $rowid);
$sql .= ' ORDER BY f.rang, f.rowid';
$query = $this->db->query($sql);
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index b124817bf9f..c910cffe8d4 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -164,7 +164,7 @@ class ProductFournisseur extends Product
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
- $sql .= " WHERE fk_product = ".$this->id." AND fk_soc = ".$id_fourn;
+ $sql .= " WHERE fk_product = ".$this->id." AND fk_soc = ".((int) $id_fourn);
dol_syslog(get_class($this)."::remove_fournisseur", LOG_DEBUG);
$resql2 = $this->db->query($sql);
@@ -208,7 +208,7 @@ class ProductFournisseur extends Product
if (empty($error)) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
- $sql .= " WHERE rowid = ".$rowid;
+ $sql .= " WHERE rowid = ".((int) $rowid);
dol_syslog(get_class($this)."::remove_product_fournisseur_price", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -372,15 +372,15 @@ class ProductFournisseur extends Product
}
}
$sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price";
- $sql .= " SET fk_user = ".$user->id." ,";
+ $sql .= " SET fk_user = ".((int) $user->id)." ,";
$sql .= " ref_fourn = '".$this->db->escape($ref_fourn)."',";
$sql .= " desc_fourn = '".$this->db->escape($desc_fourn)."',";
- $sql .= " price = ".$buyprice.",";
- $sql .= " quantity = ".$qty.",";
- $sql .= " remise_percent = ".$remise_percent.",";
- $sql .= " remise = ".$remise.",";
- $sql .= " unitprice = ".$unitBuyPrice.",";
- $sql .= " fk_availability = ".$availability.",";
+ $sql .= " price = ".((float) $buyprice).",";
+ $sql .= " quantity = ".((float) $qty).",";
+ $sql .= " remise_percent = ".((float) $remise_percent).",";
+ $sql .= " remise = ".((float) $remise).",";
+ $sql .= " unitprice = ".((float) $unitBuyPrice).",";
+ $sql .= " fk_availability = ".((int) $availability).",";
$sql .= " multicurrency_price = ".(isset($multicurrency_buyprice) ? "'".$this->db->escape(price2num($multicurrency_buyprice))."'" : 'null').",";
$sql .= " multicurrency_unitprice = ".(isset($multicurrency_unitBuyPrice) ? "'".$this->db->escape(price2num($multicurrency_unitBuyPrice))."'" : 'null').",";
$sql .= " multicurrency_tx = ".(isset($multicurrency_tx) ? "'".$this->db->escape($multicurrency_tx)."'" : '1').",";
@@ -394,16 +394,16 @@ class ProductFournisseur extends Product
//$sql.= " localtax1_type=".($localtaxtype1!=''?"'".$this->db->escape($localtaxtype1)."'":"'0'").",";
//$sql.= " localtax2_type=".($localtaxtype2!=''?"'".$this->db->escape($localtaxtype2)."'":"'0'").",";
$sql .= " default_vat_code=".($newdefaultvatcode ? "'".$this->db->escape($newdefaultvatcode)."'" : "null").",";
- $sql .= " info_bits = ".$newnpr.",";
- $sql .= " charges = ".$charges.","; // deprecated
- $sql .= " delivery_time_days = ".($delivery_time_days != '' ? $delivery_time_days : 'null').",";
+ $sql .= " info_bits = ".((int) $newnpr).",";
+ $sql .= " charges = ".((float) $charges).","; // deprecated
+ $sql .= " delivery_time_days = ".($delivery_time_days != '' ? ((int) $delivery_time_days) : 'null').",";
$sql .= " supplier_reputation = ".(empty($supplier_reputation) ? 'NULL' : "'".$this->db->escape($supplier_reputation)."'").",";
$sql .= " barcode = ".(empty($barcode) ? 'NULL' : "'".$this->db->escape($barcode)."'").",";
$sql .= " fk_barcode_type = ".(empty($fk_barcode_type) ? 'NULL' : "'".$this->db->escape($fk_barcode_type)."'");
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
$sql .= ", packaging = ".(empty($packaging) ? 1 : $packaging);
}
- $sql .= " WHERE rowid = ".$this->product_fourn_price_id;
+ $sql .= " WHERE rowid = ".((int) $this->product_fourn_price_id);
// TODO Add price_base_type and price_ttc
dol_syslog(get_class($this).'::update_buyprice update knowing id of line = product_fourn_price_id = '.$this->product_fourn_price_id, LOG_DEBUG);
@@ -438,7 +438,7 @@ class ProductFournisseur extends Product
// Delete price for this quantity
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
- $sql .= " WHERE fk_soc = ".$fourn->id." AND ref_fourn = '".$this->db->escape($ref_fourn)."' AND quantity = ".$qty." AND entity = ".$conf->entity;
+ $sql .= " WHERE fk_soc = ".$fourn->id." AND ref_fourn = '".$this->db->escape($ref_fourn)."' AND quantity = ".((float) $qty)." AND entity = ".$conf->entity;
$resql = $this->db->query($sql);
if ($resql) {
// Add price for this quantity to supplier
@@ -653,7 +653,7 @@ class ProductFournisseur extends Product
$sql .= " WHERE pfp.entity IN (".getEntity('productsupplierprice').")";
$sql .= " AND pfp.fk_soc = s.rowid AND pfp.fk_product = p.rowid";
$sql .= " AND s.status=1"; // only enabled company selected
- $sql .= " AND pfp.fk_product = ".$prodid;
+ $sql .= " AND pfp.fk_product = ".((int) $prodid);
if (empty($sortfield)) {
$sql .= " ORDER BY s.nom, pfp.quantity, pfp.price";
} else {
@@ -885,8 +885,8 @@ class ProductFournisseur extends Product
$expression_id = $expression_id != 0 ? $expression_id : 'NULL';
$sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price";
- $sql .= " SET fk_supplier_price_expression = ".$expression_id;
- $sql .= " WHERE rowid = ".$this->product_fourn_price_id;
+ $sql .= " SET fk_supplier_price_expression = ".((int) $expression_id);
+ $sql .= " WHERE rowid = ".((int) $this->product_fourn_price_id);
dol_syslog(get_class($this)."::setSupplierPriceExpression", LOG_DEBUG);
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 6def24cf64b..0a03b367717 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -290,7 +290,7 @@ if (empty($reshook)) {
}
if ($action == 'setremisepercent' && $usercancreate) {
- $result = $object->set_remise($user, $_POST['remise_percent']);
+ $result = $object->set_remise($user, price2num(GETPOST('remise_percent')));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -1436,10 +1436,10 @@ if (empty($reshook)) {
}
} elseif ($action == 'swapstatut' && $object->id > 0) {
// bascule du statut d'un contact
- $result = $object->swapContactStatus(GETPOST('ligne'));
+ $result = $object->swapContactStatus(GETPOST('ligne', 'int'));
} elseif ($action == 'deletecontact' && $object->id > 0) {
// Efface un contact
- $result = $object->delete_contact($_GET["lineid"]);
+ $result = $object->delete_contact(GETPOST("lineid", 'int'));
if ($result >= 0) {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php
index ae2e8bab481..2ff1c97e3e5 100644
--- a/htdocs/fourn/commande/contact.php
+++ b/htdocs/fourn/commande/contact.php
@@ -76,14 +76,14 @@ if ($action == 'addcontact' && $user->rights->fournisseur->commande->creer) {
} elseif ($action == 'swapstatut' && $user->rights->fournisseur->commande->creer) {
// Toggle the status of a contact
if ($object->fetch($id)) {
- $result = $object->swapContactStatus(GETPOST('ligne'));
+ $result = $object->swapContactStatus(GETPOST('ligne', 'int'));
} else {
dol_print_error($db);
}
} elseif ($action == 'deletecontact' && $user->rights->fournisseur->commande->creer) {
// Deleting a contact
$object->fetch($id);
- $result = $object->delete_contact($_GET["lineid"]);
+ $result = $object->delete_contact(GETPOST("lineid", 'int'));
if ($result >= 0) {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 0312c851de3..a033be48f08 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -1588,14 +1588,14 @@ if (empty($reshook)) {
} elseif ($action == 'swapstatut') {
// bascule du statut d'un contact
if ($object->fetch($id)) {
- $result = $object->swapContactStatus(GETPOST('ligne'));
+ $result = $object->swapContactStatus(GETPOST('ligne', 'int'));
} else {
dol_print_error($db);
}
} elseif ($action == 'deletecontact') {
// Efface un contact
$object->fetch($id);
- $result = $object->delete_contact($_GET["lineid"]);
+ $result = $object->delete_contact(GETPOST("lineid", 'int'));
if ($result >= 0) {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php
index 4f450bca3c4..1284ee293be 100644
--- a/htdocs/fourn/facture/contact.php
+++ b/htdocs/fourn/facture/contact.php
@@ -76,14 +76,14 @@ if ($action == 'addcontact' && $user->rights->fournisseur->facture->creer) {
} elseif ($action == 'swapstatut' && $user->rights->fournisseur->facture->creer) {
// bascule du statut d'un contact
if ($object->fetch($id)) {
- $result = $object->swapContactStatus(GETPOST('ligne'));
+ $result = $object->swapContactStatus(GETPOST('ligne', 'int'));
} else {
dol_print_error($db);
}
} elseif ($action == 'deletecontact' && $user->rights->fournisseur->facture->creer) {
// Efface un contact
$object->fetch($id);
- $result = $object->delete_contact($_GET["lineid"]);
+ $result = $object->delete_contact(GETPOST("lineid", 'int'));
if ($result >= 0) {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php
index 305c7bedba5..a876f5753b9 100644
--- a/htdocs/fourn/paiement/list.php
+++ b/htdocs/fourn/paiement/list.php
@@ -11,6 +11,7 @@
* Copyright (C) 2017 Alexandre Spangaro
* Copyright (C) 2018-2021 Frédéric France
* Copyright (C) 2020 Tobias Sekan
+ * Copyright (C) 2021 Ferran Marcet
*
* 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
@@ -200,9 +201,8 @@ if ($search_amount) {
$sql .= natural_search('p.amount', $search_amount, 1);
}
if ($search_bank_account > 0) {
- $sql .= ' AND b.fk_account='.$search_bank_account."'";
+ $sql .= ' AND b.fk_account = '.((int) $search_bank_account);
}
-
if ($search_all) {
$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
}
diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php
index 06ad90ec858..97a6b53f2e2 100644
--- a/htdocs/fourn/recap-fourn.php
+++ b/htdocs/fourn/recap-fourn.php
@@ -73,7 +73,7 @@ if ($socid > 0) {
$sql .= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,";
$sql .= " u.login, u.rowid as userid";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_fourn as f,".MAIN_DB_PREFIX."user as u";
- $sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$societe->id;
+ $sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $societe->id);
$sql .= " AND f.entity IN (".getEntity("facture_fourn").")"; // Recognition of the entity attributed to this invoice for Multicompany
$sql .= " AND f.fk_user_valid = u.rowid";
$sql .= " ORDER BY f.datef DESC";
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index 4b5c742b3f1..ffd394a35b3 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -2069,7 +2069,7 @@ class Holiday extends CommonObject
$sql = "SELECT rowid, code, label, affect, delay, newByMonth";
$sql .= " FROM ".MAIN_DB_PREFIX."c_holiday_types";
- $sql .= " WHERE (fk_country IS NULL OR fk_country = ".$mysoc->country_id.')';
+ $sql .= " WHERE (fk_country IS NULL OR fk_country = ".((int) $mysoc->country_id).')';
if ($active >= 0) {
$sql .= " AND active = ".((int) $active);
}
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index 50ab14dfce5..f484e3b0901 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -307,8 +307,8 @@ if ($step == 4 && $action == 'select_model') {
if ($action == 'saveorder') {
// Enregistrement de la position des champs
- dol_syslog("boxorder=".$_GET['boxorder']." datatoimport=".$_GET["datatoimport"], LOG_DEBUG);
- $part = explode(':', $_GET['boxorder']);
+ dol_syslog("boxorder=".GETPOST('boxorder')." datatoimport=".GETPOST("datatoimport"), LOG_DEBUG);
+ $part = explode(':', GETPOST('boxorder'));
$colonne = $part[0];
$list = $part[1];
dol_syslog('column='.$colonne.' list='.$list);
diff --git a/htdocs/install/lib/repair.lib.php b/htdocs/install/lib/repair.lib.php
index 6133f3eccc8..242fbff25d4 100644
--- a/htdocs/install/lib/repair.lib.php
+++ b/htdocs/install/lib/repair.lib.php
@@ -106,7 +106,7 @@ function checkLinkedElements($sourcetype, $targettype)
foreach ($elements as $key => $element) {
if (!checkElementExist($element[$sourcetype], $sourcetable) || !checkElementExist($element[$targettype], $targettable)) {
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'element_element';
- $sql .= ' WHERE rowid = '.$key;
+ $sql .= ' WHERE rowid = '.((int) $key);
$resql = $db->query($sql);
$deleted++;
}
diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql
index 882bcd09960..b054ca383ef 100644
--- a/htdocs/install/mysql/data/llx_10_c_regions.sql
+++ b/htdocs/install/mysql/data/llx_10_c_regions.sql
@@ -11,10 +11,6 @@
-- Copyright (C) 2015 Ferran Marcet
-- Copyright (C) 2019~ Lao Tian <281388879@qq.com>
-- Copyright (C) 2020-2021 Udo Tamm
-
-
-
--- LICENSE ---------------------------------------------------------------------
--
-- 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
@@ -56,8 +52,28 @@
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 0, 0, '0',0,'-');
+-- Algeria Regions (id country=13)
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 13, 1301, '', 0, 'Algerie');
+
+
+-- Argentina Regions (id country=23)
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 23, 2301, '', 0, 'Norte');
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 23, 2302, '', 0, 'Litoral');
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 23, 2303, '', 0, 'Cuyana');
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 23, 2304, '', 0, 'Central');
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 23, 2305, '', 0, 'Patagonia');
+
+
+-- Australia Regions (id country=28)
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 28, 2801, '', 0, 'Australia');
+
+
-- Austria Regions (id country=41)
-INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 41, 4101, '', 0, 'Österreich', 1);
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 41, 4101, '', 0, 'Österreich');
+
+
+-- Barbados Regions (id country=46)
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 46, 4601, '', 0, 'Barbados');
-- Belgium Regions (id country=2)
@@ -66,6 +82,14 @@ insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 2, 203, '',3,'Bruxelles-Capitale');
+-- Brazil Regions (id country=56)
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 56, 5601, '', 0, 'Brasil');
+
+
+-- Canada Region (id country=14)
+INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) values ( 14, 1401, '', 0, 'Canada');
+
+
-- Regions France (id country=1)
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 1,'97105',3,'Guadeloupe');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 2,'97209',3,'Martinique');
@@ -188,27 +212,10 @@ insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,102
-- Region USA (id country=11)
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 11, 1101, '', 0, 'United-States', 1);
--- Regions Algeria (id country=13)
-INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 13, 1301, '', 0, 'Algerie', 1);
-
--- Region Canada (id country=14)
-INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 14, 1401, '', 0, 'Canada', 1);
-- Regions The Netherlands (id country=17)
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 17, 1701, '', 0,'Provincies van Nederland ', 1);
--- Regions Argentina (id country=23)
-INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2301, '', 0, 'Norte', 1);
-INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2302, '', 0, 'Litoral', 1);
-INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2303, '', 0, 'Cuyana', 1);
-INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2304, '', 0, 'Central', 1);
-INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2305, '', 0, 'Patagonia', 1);
-
--- Regions Australia (id country=28)
-INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 28, 2801, '', 0, 'Australia', 1);
-
--- Regions Barbados (id country=46)
-INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 46, 4601, '', 0, 'Barbados', 1);
-- Regions Bolivia (id country=52)
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 52, 5201, '', 0, 'Chuquisaca', 1);
@@ -221,8 +228,6 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) v
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 52, 5208, '', 0, 'El Beni', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 52, 5209, '', 0, 'Pando', 1);
--- Regions Brazil (id country=56)
-INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 56, 5601, '', 0, 'Brasil', 1);
-- Regions Colombie (id country=70)
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 70, 7001, '', 0, 'Colombie', 1);
diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql
index 82201f8d3a6..1b5da7602e2 100644
--- a/htdocs/install/mysql/data/llx_20_c_departements.sql
+++ b/htdocs/install/mysql/data/llx_20_c_departements.sql
@@ -7,11 +7,10 @@
-- Copyright (C) 2007 Patrick Raguin
-- Copyright (C) 2010-2016 Juanjo Menent
-- Copyright (C) 2012 Sebastian Neuwert
--- Copyright (C) 2012 Ricardo Schluter
--- Copyright (C) 2015 Ferran Marcet
+-- Copyright (C) 2012 Ricardo Schluter
+-- Copyright (C) 2015 Ferran Marcet
+-- Copyright (C) 2020-2021 Udo Tamm
--
-
--- LICENSE -------------------------------------------------------------------
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
@@ -27,15 +26,26 @@
--
--- WARNING -------------------------------------------------------------------
+-- WARNING ---------------------------------------------------------------------
-- Do not put comments at the end of the lines, this file is parsed during
-- the install and all '-' prefixed texts are removed.
-- Do not concatenate the values in a single query, for the same reason.
--- NOTES ----------------------------------
+-- NOTES -----------------------------------------------------------------------
-- Departements/Cantons/Provinces/States
--
+-- Algeria
+-- Andorra
+-- Argentina
+-- Australia
+-- Austria
+-- Barbados
+-- Belgium
+-- Brazil
+-- Canada
+-- France
+-- Germany
-- TEMPLATE -------------------------------------------------------------------------------------------------------------
@@ -43,87 +53,130 @@ insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
-- Algeria Provinces (id country=13)
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL01', '', 0, '', 'Wilaya d''Adrar', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL02', '', 0, '', 'Wilaya de Chlef', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL03', '', 0, '', 'Wilaya de Laghouat', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL04', '', 0, '', 'Wilaya d''Oum El Bouaghi', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL05', '', 0, '', 'Wilaya de Batna', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL06', '', 0, '', 'Wilaya de Béjaïa', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL07', '', 0, '', 'Wilaya de Biskra', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL08', '', 0, '', 'Wilaya de Béchar', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL09', '', 0, '', 'Wilaya de Blida', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL10', '', 0, '', 'Wilaya de Bouira', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL11', '', 0, '', 'Wilaya de Tamanrasset', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL12', '', 0, '', 'Wilaya de Tébessa', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL13', '', 0, '', 'Wilaya de Tlemcen', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL14', '', 0, '', 'Wilaya de Tiaret', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL15', '', 0, '', 'Wilaya de Tizi Ouzou', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL16', '', 0, '', 'Wilaya d''Alger', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL17', '', 0, '', 'Wilaya de Djelfa', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL18', '', 0, '', 'Wilaya de Jijel', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL19', '', 0, '', 'Wilaya de Sétif ', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL20', '', 0, '', 'Wilaya de Saïda', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL21', '', 0, '', 'Wilaya de Skikda', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL22', '', 0, '', 'Wilaya de Sidi Bel Abbès', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL23', '', 0, '', 'Wilaya d''Annaba', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL24', '', 0, '', 'Wilaya de Guelma', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL25', '', 0, '', 'Wilaya de Constantine', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL26', '', 0, '', 'Wilaya de Médéa', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL27', '', 0, '', 'Wilaya de Mostaganem', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL28', '', 0, '', 'Wilaya de M''Sila', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL29', '', 0, '', 'Wilaya de Mascara', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL30', '', 0, '', 'Wilaya d''Ouargla', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL31', '', 0, '', 'Wilaya d''Oran', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL32', '', 0, '', 'Wilaya d''El Bayadh', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL33', '', 0, '', 'Wilaya d''Illizi', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL34', '', 0, '', 'Wilaya de Bordj Bou Arreridj', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL35', '', 0, '', 'Wilaya de Boumerdès', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL36', '', 0, '', 'Wilaya d''El Tarf', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL37', '', 0, '', 'Wilaya de Tindouf', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL38', '', 0, '', 'Wilaya de Tissemsilt', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL39', '', 0, '', 'Wilaya d''El Oued', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL40', '', 0, '', 'Wilaya de Khenchela', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL41', '', 0, '', 'Wilaya de Souk Ahras', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL42', '', 0, '', 'Wilaya de Tipaza', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL43', '', 0, '', 'Wilaya de Mila', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL44', '', 0, '', 'Wilaya d''Aïn Defla', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL45', '', 0, '', 'Wilaya de Naâma', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL46', '', 0, '', 'Wilaya d''Aïn Témouchent', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL47', '', 0, '', 'Wilaya de Ghardaia', 1);
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom, active) VALUES(1301, 'AL48', '', 0, '', 'Wilaya de Relizane', 1);
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL01', '', 0, '', 'Wilaya d''Adrar');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL02', '', 0, '', 'Wilaya de Chlef');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL03', '', 0, '', 'Wilaya de Laghouat');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL04', '', 0, '', 'Wilaya d''Oum El Bouaghi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL05', '', 0, '', 'Wilaya de Batna');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL06', '', 0, '', 'Wilaya de Béjaïa');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL07', '', 0, '', 'Wilaya de Biskra');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL08', '', 0, '', 'Wilaya de Béchar');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL09', '', 0, '', 'Wilaya de Blida');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL10', '', 0, '', 'Wilaya de Bouira');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL11', '', 0, '', 'Wilaya de Tamanrasset');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL12', '', 0, '', 'Wilaya de Tébessa');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL13', '', 0, '', 'Wilaya de Tlemcen');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL14', '', 0, '', 'Wilaya de Tiaret');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL15', '', 0, '', 'Wilaya de Tizi Ouzou');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL16', '', 0, '', 'Wilaya d''Alger');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL17', '', 0, '', 'Wilaya de Djelfa');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL18', '', 0, '', 'Wilaya de Jijel');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL19', '', 0, '', 'Wilaya de Sétif');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL20', '', 0, '', 'Wilaya de Saïda');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL21', '', 0, '', 'Wilaya de Skikda');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL22', '', 0, '', 'Wilaya de Sidi Bel Abbès');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL23', '', 0, '', 'Wilaya d''Annaba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL24', '', 0, '', 'Wilaya de Guelma');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL25', '', 0, '', 'Wilaya de Constantine');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL26', '', 0, '', 'Wilaya de Médéa');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL27', '', 0, '', 'Wilaya de Mostaganem');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL28', '', 0, '', 'Wilaya de M''Sila');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL29', '', 0, '', 'Wilaya de Mascara');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL30', '', 0, '', 'Wilaya d''Ouargla');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL31', '', 0, '', 'Wilaya d''Oran');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL32', '', 0, '', 'Wilaya d''El Bayadh');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL33', '', 0, '', 'Wilaya d''Illizi');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL34', '', 0, '', 'Wilaya de Bordj Bou Arreridj');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL35', '', 0, '', 'Wilaya de Boumerdès');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL36', '', 0, '', 'Wilaya d''El Tarf');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL37', '', 0, '', 'Wilaya de Tindouf');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL38', '', 0, '', 'Wilaya de Tissemsilt');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL39', '', 0, '', 'Wilaya d''El Oued');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL40', '', 0, '', 'Wilaya de Khenchela');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL41', '', 0, '', 'Wilaya de Souk Ahras');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL42', '', 0, '', 'Wilaya de Tipaza');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL43', '', 0, '', 'Wilaya de Mila');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL44', '', 0, '', 'Wilaya d''Aïn Defla');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL45', '', 0, '', 'Wilaya de Naâma');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL46', '', 0, '', 'Wilaya d''Aïn Témouchent');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL47', '', 0, '', 'Wilaya de Ghardaia');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1301, 'AL48', '', 0, '', 'Wilaya de Relizane');
-- Andorra Parròquies (id country=34)
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-002', 'AD100', NULL, NULL, 'Canillo');
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-003', 'AD200', NULL, NULL, 'Encamp');
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-004', 'AD400', NULL, NULL, 'La Massana');
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-005', 'AD300', NULL, NULL, 'Ordino');
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-006', 'AD600', NULL, NULL, 'Sant Julià de Lòria');
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-007', 'AD500', NULL, NULL, 'Andorra la Vella');
-INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-008', 'AD700', NULL, NULL, 'Escaldes-Engordany');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-002', 'AD100', NULL, NULL, 'Canillo');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-003', 'AD200', NULL, NULL, 'Encamp');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-004', 'AD400', NULL, NULL, 'La Massana');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-005', 'AD300', NULL, NULL, 'Ordino');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-006', 'AD600', NULL, NULL, 'Sant Julià de Lòria');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-007', 'AD500', NULL, NULL, 'Andorra la Vella');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-008', 'AD700', NULL, NULL, 'Escaldes-Engordany');
+
+
+-- Argentina Provinces / provincias (id country=23)
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2301, '2301', '', 0, 'CATAMARCA', 'Catamarca');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2301, '2302', '', 0, 'JUJUY', 'Jujuy');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2301, '2303', '', 0, 'TUCAMAN', 'Tucamán');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2301, '2304', '', 0, 'SANTIAGO DEL ESTERO', 'Santiago del Estero');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2301, '2305', '', 0, 'SALTA', 'Salta');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2302, '2306', '', 0, 'CHACO', 'Chaco');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2302, '2307', '', 0, 'CORRIENTES', 'Corrientes');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2302, '2308', '', 0, 'ENTRE RIOS', 'Entre Ríos');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2302, '2309', '', 0, 'FORMOSA', 'Formosa');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2302, '2310', '', 0, 'SANTA FE', 'Santa Fe');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2303, '2311', '', 0, 'LA RIOJA', 'La Rioja');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2303, '2312', '', 0, 'MENDOZA', 'Mendoza');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2303, '2313', '', 0, 'SAN JUAN', 'San Juan');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2303, '2314', '', 0, 'SAN LUIS', 'San Luis');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2304, '2315', '', 0, 'CORDOBA', 'Córdoba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2304, '2316', '', 0, 'BUENOS AIRES', 'Buenos Aires');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2304, '2317', '', 0, 'CABA', 'Caba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2305, '2318', '', 0, 'LA PAMPA', 'La Pampa');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2305, '2319', '', 0, 'NEUQUEN', 'Neuquén');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2305, '2320', '', 0, 'RIO NEGRO', 'Río Negro');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2305, '2321', '', 0, 'CHUBUT', 'Chubut');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2305, '2322', '', 0, 'SANTA CRUZ', 'Santa Cruz');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2305, '2323', '', 0, 'TIERRA DEL FUEGO', 'Tierra del Fuego');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2305, '2324', '', 0, 'ISLAS MALVINAS', 'Islas Malvinas');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2305, '2325', '', 0, 'ANTARTIDA', 'Antártida');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (2305, '2326', '', 0, 'MISIONES', 'Misiones');
-- Australia States & Territories (id country=28)
-insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'NSW','',1,'','New South Wales');
-insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'VIC','',1,'','Victoria');
-insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'QLD','',1,'','Queensland');
-insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'SA' ,'',1,'','South Australia');
-insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'ACT','',1,'','Australia Capital Territory');
-insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'TAS','',1,'','Tasmania');
-insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'WA' ,'',1,'','Western Australia');
-insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'NT' ,'',1,'','Northern Territory');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801, 'NSW','',1,'','New South Wales');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801, 'VIC','',1,'','Victoria');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801, 'QLD','',1,'','Queensland');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801, 'SA' ,'',1,'','South Australia');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801, 'ACT','',1,'','Australia Capital Territory');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801, 'TAS','',1,'','Tasmania');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801, 'WA' ,'',1,'','Western Australia');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801, 'NT' ,'',1,'','Northern Territory');
-- Austria States / Österreich Bundesländer (id country=41)
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'B','BURGENLAND','Burgenland',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'K','KAERNTEN','Kärnten',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'N','NIEDEROESTERREICH','Niederösterreich',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'O','OBEROESTERREICH','Oberösterreich',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'S','SALZBURG','Salzburg',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'ST','STEIERMARK','Steiermark',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'T','TIROL','Tirol',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'V','VORARLBERG','Vorarlberg',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'W','WIEN','Wien',1);
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101, 'B','BURGENLAND','Burgenland',1);
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101, 'K','KAERNTEN','Kärnten',1);
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101, 'N','NIEDEROESTERREICH','Niederösterreich',1);
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101, 'O','OBEROESTERREICH','Oberösterreich',1);
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101, 'S','SALZBURG','Salzburg',1);
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101, 'ST','STEIERMARK','Steiermark',1);
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101, 'T','TIROL','Tirol',1);
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101, 'V','VORARLBERG','Vorarlberg',1);
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101, 'W','WIEN','Wien',1);
+
+
+-- Barbados Parish (id country=46)
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (4601, 'CC', 'Oistins', 0, 'CC', 'Christ Church');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (4601, 'SA', 'Greenland', 0, 'SA', 'Saint Andrew');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (4601, 'SG', 'Bulkeley', 0, 'SG', 'Saint George');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (4601, 'JA', 'Holetown', 0, 'JA', 'Saint James');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (4601, 'SJ', 'Four Roads', 0, 'SJ', 'Saint John');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (4601, 'SB', 'Bathsheba', 0, 'SB', 'Saint Joseph');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (4601, 'SL', 'Crab Hill', 0, 'SL', 'Saint Lucy');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (4601, 'SM', 'Bridgetown', 0, 'SM', 'Saint Michael');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (4601, 'SP', 'Speightstown', 0, 'SP', 'Saint Peter');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (4601, 'SC', 'Crane', 0, 'SC', 'Saint Philip');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (4601, 'ST', 'Hillaby', 0, 'ST', 'Saint Thomas');
-- Belgium Provinces (id country=2)
@@ -140,12 +193,55 @@ insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (201,'11','',2,'NAMUR','Namur');
--- Departements France (id country=1)
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 1,'971','97105',3,'GUADELOUPE','Guadeloupe');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 2,'972','97209',3,'MARTINIQUE','Martinique');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 3,'973','97302',3,'GUYANE','Guyane');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 4,'974','97411',3,'REUNION','Réunion');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 6,'976','97601',3,'MAYOTTE','Mayotte');
+-- Brazil Provinces (id country=56)
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'AC', 'ACRE', 0, 'AC', 'Acre');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'AL', 'ALAGOAS', 0, 'AL', 'Alagoas');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'AP', 'AMAPA', 0, 'AP', 'Amapá');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'AM', 'AMAZONAS', 0, 'AM', 'Amazonas');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'BA', 'BAHIA', 0, 'BA', 'Bahia');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'CE', 'CEARA', 0, 'CE', 'Ceará');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'ES', 'ESPIRITO SANTO', 0, 'ES', 'Espirito Santo');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'GO', 'GOIAS', 0, 'GO', 'Goiás');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'MA', 'MARANHAO', 0, 'MA', 'Maranhão');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'MT', 'MATO GROSSO', 0, 'MT', 'Mato Grosso');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'MS', 'MATO GROSSO DO SUL', 0, 'MS', 'Mato Grosso do Sul');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'MG', 'MINAS GERAIS', 0, 'MG', 'Minas Gerais');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'PA', 'PARA', 0, 'PA', 'Pará');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'PB', 'PARAIBA', 0, 'PB', 'Paraiba');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'PR', 'PARANA', 0, 'PR', 'Paraná');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'PE', 'PERNAMBUCO', 0, 'PE', 'Pernambuco');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'PI', 'PIAUI', 0, 'PI', 'Piauí');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'RJ', 'RIO DE JANEIRO', 0, 'RJ', 'Rio de Janeiro');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'RN', 'RIO GRANDE DO NORTE', 0, 'RN', 'Rio Grande do Norte');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'RS', 'RIO GRANDE DO SUL', 0, 'RS', 'Rio Grande do Sul');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'RO', 'RONDONIA', 0, 'RO', 'Rondônia');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'RR', 'RORAIMA', 0, 'RR', 'Roraima');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'SC', 'SANTA CATARINA', 0, 'SC', 'Santa Catarina');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'SE', 'SERGIPE', 0, 'SE', 'Sergipe');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'SP', 'SAO PAULO', 0, 'SP', 'Sao Paulo');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'TO', 'TOCANTINS', 0, 'TO', 'Tocantins');
+INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (5601, 'DF', 'DISTRITO FEDERAL', 0, 'DF', 'Distrito Federal');
+
+
+-- Canada Provinces & Territories (id country=14)
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1401,'ON','',1,'','Ontario');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1401,'QC','',1,'','Quebec');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1401,'NS','',1,'','Nova Scotia');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1401,'NB','',1,'','New Brunswick');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1401,'MB','',1,'','Manitoba');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1401,'BC','',1,'','British Columbia');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1401,'PE','',1,'','Prince Edward Island');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1401,'SK','',1,'','Saskatchewan');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1401,'AB','',1,'','Alberta');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1401,'NL','',1,'','Newfoundland and Labrador');
+
+
+-- France Departements (id country=1)
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 1,'971','97105',3,'GUADELOUPE','Guadeloupe');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 2,'972','97209',3,'MARTINIQUE','Martinique');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 3,'973','97302',3,'GUYANE','Guyane');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 4,'974','97411',3,'REUNION','Réunion');
+insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values ( 6,'976','97601',3,'MAYOTTE','Mayotte');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (84,'01','01053',5,'AIN','Ain');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (32,'02','02408',5,'AISNE','Aisne');
@@ -245,6 +341,25 @@ insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,no
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (11,'95','95500',2,'VAL-D OISE','Val-d Oise');
+-- Germany States / Bundesländer (id country=5)
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'BW', 'BADEN-WÜRTTEMBERG', 'Baden-Württemberg');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'BY', 'BAYERN', 'Bayern');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'BE', 'BERLIN', 'Berlin');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'BB', 'BRANDENBURG', 'Brandenburg');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'HB', 'BREMEN', 'Bremen');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'HH', 'HAMBURG', 'Hamburg');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'HE', 'HESSEN', 'Hessen');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'MV', 'MECKLENBURG-VORPOMMERN', 'Mecklenburg-Vorpommern');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'NI', 'NIEDERSACHSEN', 'Niedersachsen');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'NW', 'NORDRHEIN-WESTFALEN', 'Nordrhein-Westfalen');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'RP', 'RHEINLAND-PFALZ', 'Rheinland-Pfalz');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'SL', 'SAARLAND', 'Saarland');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'SN', 'SACHSEN', 'Sachsen');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'ST', 'SACHSEN-ANHALT', 'Sachsen-Anhalt');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'SH', 'SCHLESWIG-HOLSTEIN', 'Schleswig-Holstein');
+INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom) VALUES (501, 'TH', 'THÜRINGEN', 'Thüringen');
+
+
-- Provinces Italy (id=3)
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AG',315,NULL,NULL,NULL,'AGRIGENTO');
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AL',312,NULL,NULL,NULL,'ALESSANDRIA');
@@ -583,18 +698,6 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('112', 5209, '', 0, '', 'General Federico Román', 1);
--- Provinces Canada (id country=14)
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'ON','',1,'','Ontario');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'QC','',1,'','Quebec');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'NS','',1,'','Nova Scotia');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'NB','',1,'','New Brunswick');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'MB','',1,'','Manitoba');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'BC','',1,'','British Columbia');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'PE','',1,'','Prince Edward Island');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'SK','',1,'','Saskatchewan');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'AB','',1,'','Alberta');
-insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'NL','',1,'','Newfoundland and Labrador');
-
-- Provinces Spain (id country=4) in order of province (for logical pick list)
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('VI', '419', '01', 19, 'ALAVA', 'Álava');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('AB', '404', '02', 4, 'ALBACETE', 'Albacete');
@@ -649,23 +752,6 @@ INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('ZA', '403', '49', 3, 'ZAMORA', 'Zamora');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('Z', '402', '50', 1, 'ZARAGOZA', 'Zaragoza');
--- Provinces Germany (id country=5)
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'BW','BADEN-WÜRTTEMBERG','Baden-Württemberg',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'BY','BAYERN','Bayern',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'BE','BERLIN','Berlin',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'BB','BRANDENBURG','Brandenburg',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'HB','BREMEN','Bremen',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'HH','HAMBURG','Hamburg',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'HE','HESSEN','Hessen',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'MV','MECKLENBURG-VORPOMMERN','Mecklenburg-Vorpommern',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'NI','NIEDERSACHSEN','Niedersachsen',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'NW','NORDRHEIN-WESTFALEN','Nordrhein-Westfalen',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'RP','RHEINLAND-PFALZ','Rheinland-Pfalz',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'SL','SAARLAND','Saarland',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'SN','SACHSEN','Sachsen',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'ST','SACHSEN-ANHALT','Sachsen-Anhalt',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'SH','SCHLESWIG-HOLSTEIN','Schleswig-Holstein',1);
-INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (501,'TH','THÜRINGEN','Thüringen',1);
-- Provinces Greece (id country=102)
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('66', 10201, '', 0, '', 'Αθήνα', 1);
@@ -968,76 +1054,6 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SV', 8601, '', 0, '', 'San Vicente', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CU', 8601, '', 0, '', 'Cuscatlan', 1);
--- Provinces Argentina (id country=23)
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2301', 2301, '', 0, 'CATAMARCA', 'Catamarca', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2302', 2301, '', 0, 'JUJUY', 'Jujuy', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2303', 2301, '', 0, 'TUCAMAN', 'Tucamán', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2304', 2301, '', 0, 'SANTIAGO DEL ESTERO', 'Santiago del Estero', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2305', 2301, '', 0, 'SALTA', 'Salta', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2306', 2302, '', 0, 'CHACO', 'Chaco', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2307', 2302, '', 0, 'CORRIENTES', 'Corrientes', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2308', 2302, '', 0, 'ENTRE RIOS', 'Entre Ríos', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2309', 2302, '', 0, 'FORMOSA', 'Formosa', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2310', 2302, '', 0, 'SANTA FE', 'Santa Fe', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2311', 2303, '', 0, 'LA RIOJA', 'La Rioja', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2312', 2303, '', 0, 'MENDOZA', 'Mendoza', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2313', 2303, '', 0, 'SAN JUAN', 'San Juan', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2314', 2303, '', 0, 'SAN LUIS', 'San Luis', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2315', 2304, '', 0, 'CORDOBA', 'Córdoba', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2316', 2304, '', 0, 'BUENOS AIRES', 'Buenos Aires', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2317', 2304, '', 0, 'CABA', 'Caba', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2318', 2305, '', 0, 'LA PAMPA', 'La Pampa', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2319', 2305, '', 0, 'NEUQUEN', 'Neuquén', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2320', 2305, '', 0, 'RIO NEGRO', 'Río Negro', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2321', 2305, '', 0, 'CHUBUT', 'Chubut', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2322', 2305, '', 0, 'SANTA CRUZ', 'Santa Cruz', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2323', 2305, '', 0, 'TIERRA DEL FUEGO', 'Tierra del Fuego', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2324', 2305, '', 0, 'ISLAS MALVINAS', 'Islas Malvinas', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2325', 2305, '', 0, 'ANTARTIDA', 'Antártida', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2326', 2305, '', 0, 'MISIONES', 'Misiones', 1);
-
--- Parish Barbados (id country=46)
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CC', 4601, 'Oistins', 0, 'CC', 'Christ Church', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SA', 4601, 'Greenland', 0, 'SA', 'Saint Andrew', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SG', 4601, 'Bulkeley', 0, 'SG', 'Saint George', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('JA', 4601, 'Holetown', 0, 'JA', 'Saint James', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SJ', 4601, 'Four Roads', 0, 'SJ', 'Saint John', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SB', 4601, 'Bathsheba', 0, 'SB', 'Saint Joseph', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SL', 4601, 'Crab Hill', 0, 'SL', 'Saint Lucy', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SM', 4601, 'Bridgetown', 0, 'SM', 'Saint Michael', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SP', 4601, 'Speightstown', 0, 'SP', 'Saint Peter', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SC', 4601, 'Crane', 0, 'SC', 'Saint Philip', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ST', 4601, 'Hillaby', 0, 'ST', 'Saint Thomas', 1);
-
--- Provinces Brazil (id country=56)
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AC', 5601, 'ACRE', 0, 'AC', 'Acre', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AL', 5601, 'ALAGOAS', 0, 'AL', 'Alagoas', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AP', 5601, 'AMAPA', 0, 'AP', 'Amapá', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('AM', 5601, 'AMAZONAS', 0, 'AM', 'Amazonas', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('BA', 5601, 'BAHIA', 0, 'BA', 'Bahia', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('CE', 5601, 'CEARA', 0, 'CE', 'Ceará', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('ES', 5601, 'ESPIRITO SANTO', 0, 'ES', 'Espirito Santo', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('GO', 5601, 'GOIAS', 0, 'GO', 'Goiás', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MA', 5601, 'MARANHAO', 0, 'MA', 'Maranhão', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MT', 5601, 'MATO GROSSO', 0, 'MT', 'Mato Grosso', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MS', 5601, 'MATO GROSSO DO SUL', 0, 'MS', 'Mato Grosso do Sul', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('MG', 5601, 'MINAS GERAIS', 0, 'MG', 'Minas Gerais', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PA', 5601, 'PARA', 0, 'PA', 'Pará', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PB', 5601, 'PARAIBA', 0, 'PB', 'Paraiba', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PR', 5601, 'PARANA', 0, 'PR', 'Paraná', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PE', 5601, 'PERNAMBUCO', 0, 'PE', 'Pernambuco', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('PI', 5601, 'PIAUI', 0, 'PI', 'Piauí', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('RJ', 5601, 'RIO DE JANEIRO', 0, 'RJ', 'Rio de Janeiro', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('RN', 5601, 'RIO GRANDE DO NORTE', 0, 'RN', 'Rio Grande do Norte', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('RS', 5601, 'RIO GRANDE DO SUL', 0, 'RS', 'Rio Grande do Sul', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('RO', 5601, 'RONDONIA', 0, 'RO', 'Rondônia', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('RR', 5601, 'RORAIMA', 0, 'RR', 'Roraima', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SC', 5601, 'SANTA CATARINA', 0, 'SC', 'Santa Catarina', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SE', 5601, 'SERGIPE', 0, 'SE', 'Sergipe', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SP', 5601, 'SAO PAULO', 0, 'SP', 'Sao Paulo', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('TO', 5601, 'TOCANTINS', 0, 'TO', 'Tocantins', 1);
-INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('DF', 5601, 'DISTRITO FEDERAL', 0, 'DF', 'Distrito Federal', 1);
-
-- Provinces Chile (id country=67)
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('151', 6715, '', 0, '151', 'Arica', 1);
diff --git a/htdocs/install/mysql/data/llx_accounting_account_de.sql b/htdocs/install/mysql/data/llx_accounting_account_de.sql
index f6f6ab702fb..41f5b623d7b 100644
--- a/htdocs/install/mysql/data/llx_accounting_account_de.sql
+++ b/htdocs/install/mysql/data/llx_accounting_account_de.sql
@@ -268,83 +268,83 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1306, 'SKR03', '0', '898', '870', 'Gesellschafter-Darlehen');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1307, 'SKR03', '0', '899', '870', 'Gesellschafter-Darlehen');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1309, 'SKR03', '0', '900', '0', 'Kommandit-Kapital');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1310, 'SKR03', '0', '901', '900', 'Kommandit-Kapital');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1311, 'SKR03', '0', '902', '900', 'Kommandit-Kapital');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1312, 'SKR03', '0', '903', '900', 'Kommandit-Kapital');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1313, 'SKR03', '0', '904', '900', 'Kommandit-Kapital');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1314, 'SKR03', '0', '905', '900', 'Kommandit-Kapital');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1315, 'SKR03', '0', '906', '900', 'Kommandit-Kapital');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1316, 'SKR03', '0', '907', '900', 'Kommandit-Kapital');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1317, 'SKR03', '0', '908', '900', 'Kommandit-Kapital');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1318, 'SKR03', '0', '909', '900', 'Kommandit-Kapital');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1319, 'SKR03', '0', '910', '900', 'Verlustausgleichskonto');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1320, 'SKR03', '0', '911', '900', 'Verlustausgleichskonto');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1321, 'SKR03', '0', '912', '900', 'Verlustausgleichskonto');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1322, 'SKR03', '0', '913', '900', 'Verlustausgleichskonto');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1323, 'SKR03', '0', '914', '900', 'Verlustausgleichskonto');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1324, 'SKR03', '0', '915', '900', 'Verlustausgleichskonto');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1325, 'SKR03', '0', '916', '900', 'Verlustausgleichskonto');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1326, 'SKR03', '0', '917', '900', 'Verlustausgleichskonto');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1327, 'SKR03', '0', '918', '900', 'Verlustausgleichskonto');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1328, 'SKR03', '0', '919', '900', 'Verlustausgleichskonto');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1329, 'SKR03', '0', '920', '900', 'Gesellschafter-Darlehen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1330, 'SKR03', '0', '921', '900', 'Gesellschafter-Darlehen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1331, 'SKR03', '0', '922', '900', 'Gesellschafter-Darlehen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1332, 'SKR03', '0', '923', '900', 'Gesellschafter-Darlehen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1333, 'SKR03', '0', '924', '900', 'Gesellschafter-Darlehen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1334, 'SKR03', '0', '925', '900', 'Gesellschafter-Darlehen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1335, 'SKR03', '0', '926', '900', 'Gesellschafter-Darlehen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1336, 'SKR03', '0', '927', '900', 'Gesellschafter-Darlehen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1337, 'SKR03', '0', '928', '900', 'Gesellschafter-Darlehen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1338, 'SKR03', '0', '929', '900', 'Gesellschafter-Darlehen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1341, 'SKR03', '0', '930', '900', 'Sonderposten mit Rücklageanteil steuerfreie Rücklagen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1342, 'SKR03', '0', '931', '930', 'Sonderposten mit Rücklageanteil nach § 6b EStG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1343, 'SKR03', '0', '932', '930', 'Sonderposten mit Rücklageanteil nach Abschnitt 35 EStG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1344, 'SKR03', '0', '933', '930', 'Sonderposten mit Rücklageanteil nach § 6d EStG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1345, 'SKR03', '0', '934', '930', 'Sonderposten mit Rücklageanteil nach § 1 EntwLStG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1347, 'SKR03', '0', '935', '900', 'Sonderposten aus der Währungsumstellung auf den Euro');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1348, 'SKR03', '0', '936', '930', 'Sonderposten mit Rücklageanteil nach § 7 d EStG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1349, 'SKR03', '0', '937', '930', 'Sonderposten mit Rücklageanteil nach § 79 EStDV');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1350, 'SKR03', '0', '938', '930', 'Sonderposten mit Rücklageanteil nach § 80 EStDV');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1351, 'SKR03', '0', '939', '930', 'Sonderposten mit Rücklageanteil nach § 52 Abs.16 EStG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1352, 'SKR03', '0', '940', '930', 'Sonderposten mit Rücklageanteil Sonderabschreibungen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1353, 'SKR03', '0', '941', '930', 'Sonderposten mit Rücklageanteil § 82 a EStDV');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1354, 'SKR03', '0', '942', '930', 'Sonderposten mit Rücklageanteil § 82 d EStDV');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1355, 'SKR03', '0', '943', '930', 'Sonderposten mit Rücklageanteil nach § 82 e EStDV');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1356, 'SKR03', '0', '944', '930', 'Sonderposten mit Rücklageanteil nach § 14 BerlinFG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1357, 'SKR03', '0', '945', '930', 'Sonderposten mit Rücklageanteil für Förderung nach § 3 Zonen-RFG/§ 4-6 FördergebietsG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1358, 'SKR03', '0', '946', '930', 'Sonderposten mit Rücklageanteil nach § 4d EStG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1359, 'SKR03', '0', '947', '930', 'Sonderposten mit Rücklageanteil nach § 7g Abs.1 EStG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1360, 'SKR03', '0', '948', '930', 'Sonderposten mit Rücklageanteil nach § 7g Abs.3 u.7 EStG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1362, 'SKR03', '0', '949', '900', 'Sonderposten für Zuschüsse und Zulagen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1365, 'SKR03', '0', '950', '900', 'Rückstellungen für Pensionen und ähnliche Verpflichtungen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1367, 'SKR03', '0', '955', '900', 'Steuerrückstellungen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1368, 'SKR03', '0', '957', '955', 'Gewerbesteuerrückstellung');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1369, 'SKR03', '0', '963', '955', 'Körperschaftsteuerrückstellung');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1371, 'SKR03', '0', '965', '900', 'Rückstellungen für Personalkosten');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1372, 'SKR03', '0', '966', '900', 'Rückstellungen zur Erfüllung der Aufbewahrungspflichten');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1373, 'SKR03', '0', '969', '900', 'Rückstellung für latente Steuern');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1374, 'SKR03', '0', '970', '900', 'Sonstige Rückstellungen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1375, 'SKR03', '0', '971', '900', 'Rückstellungen für unterlassene Aufwendungen für Instandhaltung Nachholung in den ersten drei Monaten');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1376, 'SKR03', '0', '972', '900', 'Rückstellungen für unterlassene Aufwendungen für Instandhaltung Nachholung innerhalb des 4. bis 12. Monats');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1377, 'SKR03', '0', '973', '900', 'Rückstellungen für Abraum- und Abfallbeseitigung');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1378, 'SKR03', '0', '974', '900', 'Rückstellungen für Gewährleistungen ( Gegenkonto 4790 )');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1379, 'SKR03', '0', '976', '900', 'Rückstellungen für drohende Verluste aus schwebenden Geschäften');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1380, 'SKR03', '0', '977', '900', 'Rückstellungen für Abschluss- und Prüfungskosten');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1381, 'SKR03', '0', '978', '900', 'Aufwandsrückstellungen gemäß § 249 Abs. 2 HGB');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1382, 'SKR03', '0', '979', '900', 'Rückstellungen für Umweltschutz');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1385, 'SKR03', '0', '980', '900', 'Aktive Rechnungsabgrenzung');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1387, 'SKR03', '0', '983', '980', 'Abgrenzung aktive latente Steuern');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1388, 'SKR03', '0', '984', '900', 'Als Aufwand berücksichtigte Zölle und Verbrauchsteuern');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1389, 'SKR03', '0', '985', '900', 'Als Aufwand berücksichtigte Umsatzsteuer auf Anzahlungen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1390, 'SKR03', '0', '986', '900', 'Damnum / Disagio');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1393, 'SKR03', '0', '990', '900', 'Passive Rechnungsabgrenzung');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1395, 'SKR03', '0', '992', '990', 'Abgenzungsposten zur unterjährigen Kostenverrechnung für BWA');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1396, 'SKR03', '0', '993', '990', 'Forderungen aus Lieferungen und Leistungen H-Saldo');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1397, 'SKR03', '0', '996', '990', 'Pauschalwertberichtigung auf Forderungen mit einer Restlaufzeit bis zu 1 Jahr');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1398, 'SKR03', '0', '997', '990', 'Pauschalwertberichtigung auf Forderungen mit einer Restlaufzeit von mehr als 1 Jahr');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1399, 'SKR03', '0', '998', '990', 'Einzelwertberichtigungen auf Forderungen mit einer Restlaufzeit bis zu 1 Jahr');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1400, 'SKR03', '0', '999', '990', 'Einzelwertberichtigungen auf Forderungen mit einer Restlaufzeit von mehr als 1 Jahr');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1310, 'SKR03', '0', '901', '1309', 'Kommandit-Kapital');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1311, 'SKR03', '0', '902', '1309', 'Kommandit-Kapital');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1312, 'SKR03', '0', '903', '1309', 'Kommandit-Kapital');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1313, 'SKR03', '0', '904', '1309', 'Kommandit-Kapital');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1314, 'SKR03', '0', '905', '1309', 'Kommandit-Kapital');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1315, 'SKR03', '0', '906', '1309', 'Kommandit-Kapital');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1316, 'SKR03', '0', '907', '1309', 'Kommandit-Kapital');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1317, 'SKR03', '0', '908', '1309', 'Kommandit-Kapital');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1318, 'SKR03', '0', '909', '1309', 'Kommandit-Kapital');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1319, 'SKR03', '0', '910', '1309', 'Verlustausgleichskonto');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1320, 'SKR03', '0', '911', '1309', 'Verlustausgleichskonto');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1321, 'SKR03', '0', '912', '1309', 'Verlustausgleichskonto');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1322, 'SKR03', '0', '913', '1309', 'Verlustausgleichskonto');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1323, 'SKR03', '0', '914', '1309', 'Verlustausgleichskonto');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1324, 'SKR03', '0', '915', '1309', 'Verlustausgleichskonto');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1325, 'SKR03', '0', '916', '1309', 'Verlustausgleichskonto');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1326, 'SKR03', '0', '917', '1309', 'Verlustausgleichskonto');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1327, 'SKR03', '0', '918', '1309', 'Verlustausgleichskonto');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1328, 'SKR03', '0', '919', '1309', 'Verlustausgleichskonto');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1329, 'SKR03', '0', '920', '1309', 'Gesellschafter-Darlehen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1330, 'SKR03', '0', '921', '1309', 'Gesellschafter-Darlehen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1331, 'SKR03', '0', '922', '1309', 'Gesellschafter-Darlehen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1332, 'SKR03', '0', '923', '1309', 'Gesellschafter-Darlehen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1333, 'SKR03', '0', '924', '1309', 'Gesellschafter-Darlehen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1334, 'SKR03', '0', '925', '1309', 'Gesellschafter-Darlehen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1335, 'SKR03', '0', '926', '1309', 'Gesellschafter-Darlehen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1336, 'SKR03', '0', '927', '1309', 'Gesellschafter-Darlehen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1337, 'SKR03', '0', '928', '1309', 'Gesellschafter-Darlehen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1338, 'SKR03', '0', '929', '1309', 'Gesellschafter-Darlehen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1341, 'SKR03', '0', '930', '1309', 'Sonderposten mit Rücklageanteil steuerfreie Rücklagen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1342, 'SKR03', '0', '931', '1341', 'Sonderposten mit Rücklageanteil nach § 6b EStG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1343, 'SKR03', '0', '932', '1341', 'Sonderposten mit Rücklageanteil nach Abschnitt 35 EStG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1344, 'SKR03', '0', '933', '1341', 'Sonderposten mit Rücklageanteil nach § 6d EStG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1345, 'SKR03', '0', '934', '1341', 'Sonderposten mit Rücklageanteil nach § 1 EntwLStG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1347, 'SKR03', '0', '935', '1309', 'Sonderposten aus der Währungsumstellung auf den Euro');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1348, 'SKR03', '0', '936', '1341', 'Sonderposten mit Rücklageanteil nach § 7 d EStG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1349, 'SKR03', '0', '937', '1341', 'Sonderposten mit Rücklageanteil nach § 79 EStDV');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1350, 'SKR03', '0', '938', '1341', 'Sonderposten mit Rücklageanteil nach § 80 EStDV');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1351, 'SKR03', '0', '939', '1341', 'Sonderposten mit Rücklageanteil nach § 52 Abs.16 EStG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1352, 'SKR03', '0', '940', '1341', 'Sonderposten mit Rücklageanteil Sonderabschreibungen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1353, 'SKR03', '0', '941', '1341', 'Sonderposten mit Rücklageanteil § 82 a EStDV');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1354, 'SKR03', '0', '942', '1341', 'Sonderposten mit Rücklageanteil § 82 d EStDV');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1355, 'SKR03', '0', '943', '1341', 'Sonderposten mit Rücklageanteil nach § 82 e EStDV');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1356, 'SKR03', '0', '944', '1341', 'Sonderposten mit Rücklageanteil nach § 14 BerlinFG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1357, 'SKR03', '0', '945', '1341', 'Sonderposten mit Rücklageanteil für Förderung nach § 3 Zonen-RFG/§ 4-6 FördergebietsG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1358, 'SKR03', '0', '946', '1341', 'Sonderposten mit Rücklageanteil nach § 4d EStG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1359, 'SKR03', '0', '947', '1341', 'Sonderposten mit Rücklageanteil nach § 7g Abs.1 EStG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1360, 'SKR03', '0', '948', '1341', 'Sonderposten mit Rücklageanteil nach § 7g Abs.3 u.7 EStG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1362, 'SKR03', '0', '949', '1309', 'Sonderposten für Zuschüsse und Zulagen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1365, 'SKR03', '0', '950', '1309', 'Rückstellungen für Pensionen und ähnliche Verpflichtungen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1367, 'SKR03', '0', '955', '1309', 'Steuerrückstellungen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1368, 'SKR03', '0', '957', '1367', 'Gewerbesteuerrückstellung');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1369, 'SKR03', '0', '963', '1367', 'Körperschaftsteuerrückstellung');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1371, 'SKR03', '0', '965', '1309', 'Rückstellungen für Personalkosten');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1372, 'SKR03', '0', '966', '1309', 'Rückstellungen zur Erfüllung der Aufbewahrungspflichten');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1373, 'SKR03', '0', '969', '1309', 'Rückstellung für latente Steuern');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1374, 'SKR03', '0', '970', '1309', 'Sonstige Rückstellungen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1375, 'SKR03', '0', '971', '1309', 'Rückstellungen für unterlassene Aufwendungen für Instandhaltung Nachholung in den ersten drei Monaten');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1376, 'SKR03', '0', '972', '1309', 'Rückstellungen für unterlassene Aufwendungen für Instandhaltung Nachholung innerhalb des 4. bis 12. Monats');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1377, 'SKR03', '0', '973', '1309', 'Rückstellungen für Abraum- und Abfallbeseitigung');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1378, 'SKR03', '0', '974', '1309', 'Rückstellungen für Gewährleistungen ( Gegenkonto 4790 )');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1379, 'SKR03', '0', '976', '1309', 'Rückstellungen für drohende Verluste aus schwebenden Geschäften');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1380, 'SKR03', '0', '977', '1309', 'Rückstellungen für Abschluss- und Prüfungskosten');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1381, 'SKR03', '0', '978', '1309', 'Aufwandsrückstellungen gemäß § 249 Abs. 2 HGB');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1382, 'SKR03', '0', '979', '1309', 'Rückstellungen für Umweltschutz');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1385, 'SKR03', '0', '980', '1309', 'Aktive Rechnungsabgrenzung');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1387, 'SKR03', '0', '983', '1385', 'Abgrenzung aktive latente Steuern');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1388, 'SKR03', '0', '984', '1309', 'Als Aufwand berücksichtigte Zölle und Verbrauchsteuern');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1389, 'SKR03', '0', '985', '1309', 'Als Aufwand berücksichtigte Umsatzsteuer auf Anzahlungen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1390, 'SKR03', '0', '986', '1309', 'Damnum / Disagio');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1393, 'SKR03', '0', '990', '1309', 'Passive Rechnungsabgrenzung');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1395, 'SKR03', '0', '992', '1393', 'Abgenzungsposten zur unterjährigen Kostenverrechnung für BWA');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1396, 'SKR03', '0', '993', '1393', 'Forderungen aus Lieferungen und Leistungen H-Saldo');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1397, 'SKR03', '0', '996', '1393', 'Pauschalwertberichtigung auf Forderungen mit einer Restlaufzeit bis zu 1 Jahr');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1398, 'SKR03', '0', '997', '1393', 'Pauschalwertberichtigung auf Forderungen mit einer Restlaufzeit von mehr als 1 Jahr');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1399, 'SKR03', '0', '998', '1393', 'Einzelwertberichtigungen auf Forderungen mit einer Restlaufzeit bis zu 1 Jahr');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1400, 'SKR03', '0', '999', '1393', 'Einzelwertberichtigungen auf Forderungen mit einer Restlaufzeit von mehr als 1 Jahr');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1403, 'SKR03', '1', '1000', '0', 'Kasse');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1404, 'SKR03', '1', '1010', '1403', 'Nebenkasse 1');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1405, 'SKR03', '1', '1020', '1403', 'Nebenkasse 2');
@@ -884,7 +884,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1966, 'SKR03', '2', '2010', '0', 'Betriebsfremde Aufwendungen (soweit nicht außerordentlich)');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1967, 'SKR03', '2', '2020', '0', 'Periodenfremde Aufwendungen (soweit nicht außerordentlich)');
-);
+
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1970, 'SKR03', '2', '2100', '0', 'Zinsen und ähnliche Aufwendungen');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1971, 'SKR03', '2', '2103', '0', 'Steuerlich abzugsfähige andere Nebenleistungen zu steuern');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1972, 'SKR03', '2', '2104', '0', 'Steuerlich nicht abzugsfähige andere Nebenleistungen zu Steuern');
@@ -1051,7 +1051,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2138, 'SKR03', '2', '2680', '0', 'Zinsähnliche Erträge');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2139, 'SKR03', '2', '2689', '0', 'Zinsähnliche Erträge aus verbundenen Unternehmen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2142, 'SKR03', '2', '2700', '0',, 'Sonstige Erträge');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2142, 'SKR03', '2', '2700', '0', 'Sonstige Erträge');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2143, 'SKR03', '2', '2705', '0', 'Sonstige Erträge betrieblich und regelmäßig');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2144, 'SKR03', '2', '2707', '0', 'Sonstige Erträge betriebsfremd und regelmäßig');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2145, 'SKR03', '2', '2709', '0', 'Sonstige Erträge unregelmäßig');
@@ -1145,133 +1145,133 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2240, 'SKR03', '3', '3200', '0', 'Wareneingang');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2241, 'SKR03', '3', '3300', '2240', 'Wareneingang 7% Vorsteuer');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2242, 'SKR03', '3', '3301', '2240', 'Wareneingang 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2243, 'SKR03', '3', '3302', '2240' 'Wareneingang 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2244, 'SKR03', '3', '3303', '2240' 'Wareneingang 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2245, 'SKR03', '3', '3304', '2240' 'Wareneingang 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2246, 'SKR03', '3', '3305', '2240' 'Wareneingang 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2247, 'SKR03', '3', '3306', '2240' 'Wareneingang 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2248, 'SKR03', '3', '3307', '2240' 'Wareneingang 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2249, 'SKR03', '3', '3308', '2240' 'Wareneingang 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2250, 'SKR03', '3', '3309', '2240' 'Wareneingang 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2251, 'SKR03', '3', '3340', '2240' 'Wareneingang 16% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2252, 'SKR03', '3', '3341', '2240' 'Wareneingang 16% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2253, 'SKR03', '3', '3342', '2240' 'Wareneingang 16% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2254, 'SKR03', '3', '3343', '2240' 'Wareneingang 16% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2255, 'SKR03', '3', '3344', '2240' 'Wareneingang 16% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2256, 'SKR03', '3', '3345', '2240' 'Wareneingang 16% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2257, 'SKR03', '3', '3346', '2240' 'Wareneingang 16% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2258, 'SKR03', '3', '3347', '2240' 'Wareneingang 16% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2259, 'SKR03', '3', '3348', '2240' 'Wareneingang 16% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2260, 'SKR03', '3', '3349', '2240' 'Wareneingang 16% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2261, 'SKR03', '3', '3400', '2240' 'Wareneingang 19% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2262, 'SKR03', '3', '3401', '2240' 'Produkt Ausgaben');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2263, 'SKR03', '3', '3402', '2240' 'Produkt Vertriebsausgaben');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2264, 'SKR03', '3', '3403', '2240' 'Konto Kasse Aufwand');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2265, 'SKR03', '3', '3404', '2240' 'Einstandskosten Verrechnungskonto');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2266, 'SKR03', '3', '3405', '2240' 'Wareneingang 19% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2267, 'SKR03', '3', '3406', '2240' 'Wareneingang 19% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2268, 'SKR03', '3', '3407', '2240' 'Wareneingang 19% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2269, 'SKR03', '3', '3408', '2240' 'Wareneingang 19% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2270, 'SKR03', '3', '3409', '2240' 'Wareneingang 19% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2271, 'SKR03', '3', '3420', '2240' 'Innergemeinschaftlicher Erwerb 7% Vorsteuer und 7% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2272, 'SKR03', '3', '3421', '2240' 'Innergemeinschaftlicher Erwerb 7% Vorsteuer und 7% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2273, 'SKR03', '3', '3422', '2240' 'Innergemeinschaftlicher Erwerb 7% Vorsteuer und 7% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2274, 'SKR03', '3', '3423', '2240' 'Innergemeinschaftlicher Erwerb 7% Vorsteuer und 7% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2275, 'SKR03', '3', '3424', '2240' 'Innergemeinschaftlicher Erwerb 7% Vorsteuer und 7% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2276, 'SKR03', '3', '3425', '2240' 'Innergemeinschaftlicher Erwerb 19% Vorsteuer und 19% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2277, 'SKR03', '3', '3426', '2240' 'Innergemeinschaftlicher Erwerb 19% Vorsteuer und 19% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2278, 'SKR03', '3', '3427', '2240' 'Innergemeinschaftlicher Erwerb 19% Vorsteuer und 19% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2279, 'SKR03', '3', '3428', '2240' 'Innergemeinschaftlicher Erwerb 19% Vorsteuer und 19% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2280, 'SKR03', '3', '3429', '2240' 'Innergemeinschaftlicher Erwerb 19% Vorsteuer und 19% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2281, 'SKR03', '3', '3430', '2240' 'Innergemeinschaftlicher Erwerb ohne Vorsteuer und 7% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2282, 'SKR03', '3', '3433', '2240' 'Innergemeinschaftlicher Erwerb 16% Vorsteuer und 16% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2283, 'SKR03', '3', '3434', '2240' 'Innergemeinschaftlicher Erwerb 16% Vorsteuer und 16% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2284, 'SKR03', '3', '3435', '2240' 'Innergemeinschaftlicher Erwerb ohne Vorsteuer und 19% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2285, 'SKR03', '3', '3440', '2240' 'Innergemeinschaftlicher Erwerb von Neufahrzeugen von Lieferanten ohne Umsatzsteuer-Identifikationsnummer 19% Vorsteuer und 19% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2286, 'SKR03', '3', '3441', '2240' 'Innergemeinschaftlicher Erwerb von Neufahrzeugen von Lieferanten ohne Umsatzsteuer-Identifikationsnummer 16% Vorsteuer und 16% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2287, 'SKR03', '3', '3500', '2240' 'Wareneingang 5% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2288, 'SKR03', '3', '3501', '2240' 'Wareneingang 5% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2289, 'SKR03', '3', '3502', '2240' 'Wareneingang 5% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2290, 'SKR03', '3', '3503', '2240' 'Wareneingang 5% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2291, 'SKR03', '3', '3504', '2240' 'Wareneingang 5% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2292, 'SKR03', '3', '3505', '2240' 'Wareneingang 5 5% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2293, 'SKR03', '3', '3506', '2240' 'Wareneingang 5 5% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2294, 'SKR03', '3', '3507', '2240' 'Wareneingang 5 5% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2295, 'SKR03', '3', '3508', '2240' 'Wareneingang 5 5% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2296, 'SKR03', '3', '3509', '2240' 'Wareneingang 5 5% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2297, 'SKR03', '3', '3530', '2240' 'Wareneingang 9% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2298, 'SKR03', '3', '3531', '2240' 'Wareneingang 9% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2299, 'SKR03', '3', '3532', '2240' 'Wareneingang 9% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2300, 'SKR03', '3', '3533', '2240' 'Wareneingang 9% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2301, 'SKR03', '3', '3534', '2240' 'Wareneingang 9% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2302, 'SKR03', '3', '3540', '2240' 'Wareneingang 10 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2303, 'SKR03', '3', '3541', '2240' 'Wareneingang 10 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2304, 'SKR03', '3', '3542', '2240' 'Wareneingang 10 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2305, 'SKR03', '3', '3543', '2240' 'Wareneingang 10 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2306, 'SKR03', '3', '3544', '2240' 'Wareneingang 10 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2307, 'SKR03', '3', '3545', '2240' 'Wareneingang 10 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2308, 'SKR03', '3', '3546', '2240' 'Wareneingang 10 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2309, 'SKR03', '3', '3547', '2240' 'Wareneingang 10 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2310, 'SKR03', '3', '3548', '2240' 'Wareneingang 10 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2311, 'SKR03', '3', '3549', '2240' 'Wareneingang 10 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2312, 'SKR03', '3', '3550', '2240' 'steuerfreier innergemeinschaftlicher Erwerb');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2313, 'SKR03', '3', '3551', '2240' 'Wareneingang im Drittland steuerbar');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2314, 'SKR03', '3', '3559', '2240' 'Steuerfreier Einfuhren');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2315, 'SKR03', '3', '3558', '2240' 'Wareneingang I.a. EG-Land steuerbar');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2316, 'SKR03', '3', '3560', '2240' 'waren aus einem Umsatzsteuerlager § 13a UStG 7% Vorsteuer und 7% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2317, 'SKR03', '3', '3565', '2240' 'waren aus einem Umsatzsteuerlager § 13a UStG 19% Vorsteuer und 19% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2318, 'SKR03', '3', '3566', '2240' 'waren aus einem Umsatzsteuerlager § 13a UStG 16% Vorsteuer und 16% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2319, 'SKR03', '3', '3600', '2240' 'Nicht abziehbare Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2320, 'SKR03', '3', '3601', '2240' 'Nicht abziehbare Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2321, 'SKR03', '3', '3602', '2240' 'Nicht abziehbare Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2322, 'SKR03', '3', '3603', '2240' 'Nicht abziehbare Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2323, 'SKR03', '3', '3604', '2240' 'Nicht abziehbare Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2324, 'SKR03', '3', '3605', '2240' 'Nicht abziehbare Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2325, 'SKR03', '3', '3606', '2240' 'Nicht abziehbare Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2326, 'SKR03', '3', '3607', '2240' 'Nicht abziehbare Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2327, 'SKR03', '3', '3608', '2240' 'Nicht abziehbare Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2328, 'SKR03', '3', '3609', '2240' 'Nicht abziehbare Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2329, 'SKR03', '3', '3610', '2240' 'Nicht abziehbare Vorsteuer 7%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2330, 'SKR03', '3', '3611', '2240' 'Nicht abziehbare Vorsteuer 7%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2331, 'SKR03', '3', '3612', '2240' 'Nicht abziehbare Vorsteuer 7%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2332, 'SKR03', '3', '3613', '2240' 'Nicht abziehbare Vorsteuer 7%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2333, 'SKR03', '3', '3614', '2240' 'Nicht abziehbare Vorsteuer 7%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2334, 'SKR03', '3', '3615', '2240' 'Nicht abziehbare Vorsteuer 7%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2335, 'SKR03', '3', '3616', '2240' 'Nicht abziehbare Vorsteuer 7%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2336, 'SKR03', '3', '3617', '2240' 'Nicht abziehbare Vorsteuer 7%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2337, 'SKR03', '3', '3618', '2240' 'Nicht abziehbare Vorsteuer 7%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2338, 'SKR03', '3', '3619', '2240' 'Nicht abziehbare Vorsteuer 7%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2339, 'SKR03', '3', '3650', '2240' 'Nicht abziehbare Vorsteuer 16%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2340, 'SKR03', '3', '3651', '2240' 'Nicht abziehbare Vorsteuer 16%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2341, 'SKR03', '3', '3652', '2240' 'Nicht abziehbare Vorsteuer 16%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2342, 'SKR03', '3', '3653', '2240' 'Nicht abziehbare Vorsteuer 16%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2343, 'SKR03', '3', '3654', '2240' 'Nicht abziehbare Vorsteuer 16%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2344, 'SKR03', '3', '3655', '2240' 'Nicht abziehbare Vorsteuer 16%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2345, 'SKR03', '3', '3656', '2240' 'Nicht abziehbare Vorsteuer 16%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2346, 'SKR03', '3', '3657', '2240' 'Nicht abziehbare Vorsteuer 16%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2347, 'SKR03', '3', '3658', '2240' 'Nicht abziehbare Vorsteuer 16%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2348, 'SKR03', '3', '3659', '2240' 'Nicht abziehbare Vorsteuer 16%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2349, 'SKR03', '3', '3660', '2240' 'Nicht abziehbare Vorsteuer 19%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2350, 'SKR03', '3', '3661', '2240' 'Nicht abziehbare Vorsteuer 19%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2351, 'SKR03', '3', '3662', '2240' 'Nicht abziehbare Vorsteuer 19%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2352, 'SKR03', '3', '3663', '2240' 'Nicht abziehbare Vorsteuer 19%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2353, 'SKR03', '3', '3664', '2240' 'Nicht abziehbare Vorsteuer 19%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2354, 'SKR03', '3', '3665', '2240' 'Nicht abziehbare Vorsteuer 19%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2355, 'SKR03', '3', '3666', '2240' 'Nicht abziehbare Vorsteuer 19%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2356, 'SKR03', '3', '3667', '2240' 'Nicht abziehbare Vorsteuer 19%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2357, 'SKR03', '3', '3668', '2240' 'Nicht abziehbare Vorsteuer 19%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2358, 'SKR03', '3', '3669', '2240' 'Nicht abziehbare Vorsteuer 19%');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2359, 'SKR03', '3', '3700', '2240' 'Nachlässe');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2360, 'SKR03', '3', '3710', '2240' 'Nachlässe 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2361, 'SKR03', '3', '3711', '2240' 'Nachlässe 7% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2362, 'SKR03', '3', '3720', '2240' 'Nachlässe 19% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2363, 'SKR03', '3', '3721', '2240' 'Nachlässe 19% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2364, 'SKR03', '3', '3722', '2240' 'Nachlässe 16% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2365, 'SKR03', '3', '3723', '2240' 'Nachlässe 15% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2366, 'SKR03', '3', '3724', '2240' 'Nachlässe aus innergemeinschaftlichem Erwerb 7% Vorsteuer und 7% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2367, 'SKR03', '3', '3725', '2240' 'Nachlässe aus innergemeinschaftlichem Erwerb 19% Vorsteuer und 19% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2368, 'SKR03', '3', '3726', '2240' 'Nachlässe aus innergemeinschaftlichem Erwerb 16% Vorsteuer und 16% Umsatzsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2369, 'SKR03', '3', '3727', '2240' 'Nachlässe aus innergemeinschaftlichem Erwerb 15% Vorsteuer und 15% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2243, 'SKR03', '3', '3302', '2240', 'Wareneingang 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2244, 'SKR03', '3', '3303', '2240', 'Wareneingang 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2245, 'SKR03', '3', '3304', '2240', 'Wareneingang 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2246, 'SKR03', '3', '3305', '2240', 'Wareneingang 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2247, 'SKR03', '3', '3306', '2240', 'Wareneingang 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2248, 'SKR03', '3', '3307', '2240', 'Wareneingang 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2249, 'SKR03', '3', '3308', '2240', 'Wareneingang 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2250, 'SKR03', '3', '3309', '2240', 'Wareneingang 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2251, 'SKR03', '3', '3340', '2240', 'Wareneingang 16% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2252, 'SKR03', '3', '3341', '2240', 'Wareneingang 16% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2253, 'SKR03', '3', '3342', '2240', 'Wareneingang 16% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2254, 'SKR03', '3', '3343', '2240', 'Wareneingang 16% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2255, 'SKR03', '3', '3344', '2240', 'Wareneingang 16% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2256, 'SKR03', '3', '3345', '2240', 'Wareneingang 16% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2257, 'SKR03', '3', '3346', '2240', 'Wareneingang 16% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2258, 'SKR03', '3', '3347', '2240', 'Wareneingang 16% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2259, 'SKR03', '3', '3348', '2240', 'Wareneingang 16% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2260, 'SKR03', '3', '3349', '2240', 'Wareneingang 16% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2261, 'SKR03', '3', '3400', '2240', 'Wareneingang 19% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2262, 'SKR03', '3', '3401', '2240', 'Produkt Ausgaben');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2263, 'SKR03', '3', '3402', '2240', 'Produkt Vertriebsausgaben');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2264, 'SKR03', '3', '3403', '2240', 'Konto Kasse Aufwand');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2265, 'SKR03', '3', '3404', '2240', 'Einstandskosten Verrechnungskonto');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2266, 'SKR03', '3', '3405', '2240', 'Wareneingang 19% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2267, 'SKR03', '3', '3406', '2240', 'Wareneingang 19% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2268, 'SKR03', '3', '3407', '2240', 'Wareneingang 19% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2269, 'SKR03', '3', '3408', '2240', 'Wareneingang 19% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2270, 'SKR03', '3', '3409', '2240', 'Wareneingang 19% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2271, 'SKR03', '3', '3420', '2240', 'Innergemeinschaftlicher Erwerb 7% Vorsteuer und 7% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2272, 'SKR03', '3', '3421', '2240', 'Innergemeinschaftlicher Erwerb 7% Vorsteuer und 7% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2273, 'SKR03', '3', '3422', '2240', 'Innergemeinschaftlicher Erwerb 7% Vorsteuer und 7% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2274, 'SKR03', '3', '3423', '2240', 'Innergemeinschaftlicher Erwerb 7% Vorsteuer und 7% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2275, 'SKR03', '3', '3424', '2240', 'Innergemeinschaftlicher Erwerb 7% Vorsteuer und 7% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2276, 'SKR03', '3', '3425', '2240', 'Innergemeinschaftlicher Erwerb 19% Vorsteuer und 19% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2277, 'SKR03', '3', '3426', '2240', 'Innergemeinschaftlicher Erwerb 19% Vorsteuer und 19% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2278, 'SKR03', '3', '3427', '2240', 'Innergemeinschaftlicher Erwerb 19% Vorsteuer und 19% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2279, 'SKR03', '3', '3428', '2240', 'Innergemeinschaftlicher Erwerb 19% Vorsteuer und 19% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2280, 'SKR03', '3', '3429', '2240', 'Innergemeinschaftlicher Erwerb 19% Vorsteuer und 19% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2281, 'SKR03', '3', '3430', '2240', 'Innergemeinschaftlicher Erwerb ohne Vorsteuer und 7% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2282, 'SKR03', '3', '3433', '2240', 'Innergemeinschaftlicher Erwerb 16% Vorsteuer und 16% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2283, 'SKR03', '3', '3434', '2240', 'Innergemeinschaftlicher Erwerb 16% Vorsteuer und 16% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2284, 'SKR03', '3', '3435', '2240', 'Innergemeinschaftlicher Erwerb ohne Vorsteuer und 19% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2285, 'SKR03', '3', '3440', '2240', 'Innergemeinschaftlicher Erwerb von Neufahrzeugen von Lieferanten ohne Umsatzsteuer-Identifikationsnummer 19% Vorsteuer und 19% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2286, 'SKR03', '3', '3441', '2240', 'Innergemeinschaftlicher Erwerb von Neufahrzeugen von Lieferanten ohne Umsatzsteuer-Identifikationsnummer 16% Vorsteuer und 16% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2287, 'SKR03', '3', '3500', '2240', 'Wareneingang 5% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2288, 'SKR03', '3', '3501', '2240', 'Wareneingang 5% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2289, 'SKR03', '3', '3502', '2240', 'Wareneingang 5% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2290, 'SKR03', '3', '3503', '2240', 'Wareneingang 5% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2291, 'SKR03', '3', '3504', '2240', 'Wareneingang 5% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2292, 'SKR03', '3', '3505', '2240', 'Wareneingang 5 5% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2293, 'SKR03', '3', '3506', '2240', 'Wareneingang 5 5% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2294, 'SKR03', '3', '3507', '2240', 'Wareneingang 5 5% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2295, 'SKR03', '3', '3508', '2240', 'Wareneingang 5 5% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2296, 'SKR03', '3', '3509', '2240', 'Wareneingang 5 5% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2297, 'SKR03', '3', '3530', '2240', 'Wareneingang 9% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2298, 'SKR03', '3', '3531', '2240', 'Wareneingang 9% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2299, 'SKR03', '3', '3532', '2240', 'Wareneingang 9% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2300, 'SKR03', '3', '3533', '2240', 'Wareneingang 9% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2301, 'SKR03', '3', '3534', '2240', 'Wareneingang 9% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2302, 'SKR03', '3', '3540', '2240', 'Wareneingang 10 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2303, 'SKR03', '3', '3541', '2240', 'Wareneingang 10 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2304, 'SKR03', '3', '3542', '2240', 'Wareneingang 10 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2305, 'SKR03', '3', '3543', '2240', 'Wareneingang 10 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2306, 'SKR03', '3', '3544', '2240', 'Wareneingang 10 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2307, 'SKR03', '3', '3545', '2240', 'Wareneingang 10 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2308, 'SKR03', '3', '3546', '2240', 'Wareneingang 10 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2309, 'SKR03', '3', '3547', '2240', 'Wareneingang 10 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2310, 'SKR03', '3', '3548', '2240', 'Wareneingang 10 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2311, 'SKR03', '3', '3549', '2240', 'Wareneingang 10 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2312, 'SKR03', '3', '3550', '2240', 'steuerfreier innergemeinschaftlicher Erwerb');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2313, 'SKR03', '3', '3551', '2240', 'Wareneingang im Drittland steuerbar');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2314, 'SKR03', '3', '3559', '2240', 'Steuerfreier Einfuhren');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2315, 'SKR03', '3', '3558', '2240', 'Wareneingang I.a. EG-Land steuerbar');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2316, 'SKR03', '3', '3560', '2240', 'waren aus einem Umsatzsteuerlager § 13a UStG 7% Vorsteuer und 7% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2317, 'SKR03', '3', '3565', '2240', 'waren aus einem Umsatzsteuerlager § 13a UStG 19% Vorsteuer und 19% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2318, 'SKR03', '3', '3566', '2240', 'waren aus einem Umsatzsteuerlager § 13a UStG 16% Vorsteuer und 16% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2319, 'SKR03', '3', '3600', '2240', 'Nicht abziehbare Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2320, 'SKR03', '3', '3601', '2240', 'Nicht abziehbare Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2321, 'SKR03', '3', '3602', '2240', 'Nicht abziehbare Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2322, 'SKR03', '3', '3603', '2240', 'Nicht abziehbare Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2323, 'SKR03', '3', '3604', '2240', 'Nicht abziehbare Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2324, 'SKR03', '3', '3605', '2240', 'Nicht abziehbare Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2325, 'SKR03', '3', '3606', '2240', 'Nicht abziehbare Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2326, 'SKR03', '3', '3607', '2240', 'Nicht abziehbare Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2327, 'SKR03', '3', '3608', '2240', 'Nicht abziehbare Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2328, 'SKR03', '3', '3609', '2240', 'Nicht abziehbare Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2329, 'SKR03', '3', '3610', '2240', 'Nicht abziehbare Vorsteuer 7%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2330, 'SKR03', '3', '3611', '2240', 'Nicht abziehbare Vorsteuer 7%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2331, 'SKR03', '3', '3612', '2240', 'Nicht abziehbare Vorsteuer 7%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2332, 'SKR03', '3', '3613', '2240', 'Nicht abziehbare Vorsteuer 7%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2333, 'SKR03', '3', '3614', '2240', 'Nicht abziehbare Vorsteuer 7%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2334, 'SKR03', '3', '3615', '2240', 'Nicht abziehbare Vorsteuer 7%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2335, 'SKR03', '3', '3616', '2240', 'Nicht abziehbare Vorsteuer 7%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2336, 'SKR03', '3', '3617', '2240', 'Nicht abziehbare Vorsteuer 7%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2337, 'SKR03', '3', '3618', '2240', 'Nicht abziehbare Vorsteuer 7%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2338, 'SKR03', '3', '3619', '2240', 'Nicht abziehbare Vorsteuer 7%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2339, 'SKR03', '3', '3650', '2240', 'Nicht abziehbare Vorsteuer 16%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2340, 'SKR03', '3', '3651', '2240', 'Nicht abziehbare Vorsteuer 16%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2341, 'SKR03', '3', '3652', '2240', 'Nicht abziehbare Vorsteuer 16%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2342, 'SKR03', '3', '3653', '2240', 'Nicht abziehbare Vorsteuer 16%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2343, 'SKR03', '3', '3654', '2240', 'Nicht abziehbare Vorsteuer 16%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2344, 'SKR03', '3', '3655', '2240', 'Nicht abziehbare Vorsteuer 16%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2345, 'SKR03', '3', '3656', '2240', 'Nicht abziehbare Vorsteuer 16%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2346, 'SKR03', '3', '3657', '2240', 'Nicht abziehbare Vorsteuer 16%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2347, 'SKR03', '3', '3658', '2240', 'Nicht abziehbare Vorsteuer 16%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2348, 'SKR03', '3', '3659', '2240', 'Nicht abziehbare Vorsteuer 16%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2349, 'SKR03', '3', '3660', '2240', 'Nicht abziehbare Vorsteuer 19%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2350, 'SKR03', '3', '3661', '2240', 'Nicht abziehbare Vorsteuer 19%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2351, 'SKR03', '3', '3662', '2240', 'Nicht abziehbare Vorsteuer 19%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2352, 'SKR03', '3', '3663', '2240', 'Nicht abziehbare Vorsteuer 19%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2353, 'SKR03', '3', '3664', '2240', 'Nicht abziehbare Vorsteuer 19%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2354, 'SKR03', '3', '3665', '2240', 'Nicht abziehbare Vorsteuer 19%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2355, 'SKR03', '3', '3666', '2240', 'Nicht abziehbare Vorsteuer 19%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2356, 'SKR03', '3', '3667', '2240', 'Nicht abziehbare Vorsteuer 19%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2357, 'SKR03', '3', '3668', '2240', 'Nicht abziehbare Vorsteuer 19%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2358, 'SKR03', '3', '3669', '2240', 'Nicht abziehbare Vorsteuer 19%');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2359, 'SKR03', '3', '3700', '2240', 'Nachlässe');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2360, 'SKR03', '3', '3710', '2240', 'Nachlässe 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2361, 'SKR03', '3', '3711', '2240', 'Nachlässe 7% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2362, 'SKR03', '3', '3720', '2240', 'Nachlässe 19% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2363, 'SKR03', '3', '3721', '2240', 'Nachlässe 19% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2364, 'SKR03', '3', '3722', '2240', 'Nachlässe 16% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2365, 'SKR03', '3', '3723', '2240', 'Nachlässe 15% Vorsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2366, 'SKR03', '3', '3724', '2240', 'Nachlässe aus innergemeinschaftlichem Erwerb 7% Vorsteuer und 7% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2367, 'SKR03', '3', '3725', '2240', 'Nachlässe aus innergemeinschaftlichem Erwerb 19% Vorsteuer und 19% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2368, 'SKR03', '3', '3726', '2240', 'Nachlässe aus innergemeinschaftlichem Erwerb 16% Vorsteuer und 16% Umsatzsteuer');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2369, 'SKR03', '3', '3727', '2240', 'Nachlässe aus innergemeinschaftlichem Erwerb 15% Vorsteuer und 15% Umsatzsteuer');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2372, 'SKR03', '3', '3730', '0', 'Erhaltene Skonti');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2373, 'SKR03', '3', '3731', '0', 'Erhaltene Skonti 7% Vorsteuer');
@@ -1295,9 +1295,9 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2391, 'SKR03', '3', '3791', '0', 'Erhaltene Rabatte 19% Vorsteuer');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2392, 'SKR03', '3', '3794', '0', 'Erhaltene Rabatte 16% Vorsteuer');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2393, 'SKR03', '3', '3795', '0', 'Erhaltene Rabatte 16% Vorsteuer');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2394, 'SKR03', '3', '3800', '0' 'Bezugsnebenkosten');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2395, 'SKR03', '3', '3830', '0' 'Leergut');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2396, 'SKR03', '3', '3850', '0' 'Zölle und Einfuhrabgaben');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2394, 'SKR03', '3', '3800', '0', 'Bezugsnebenkosten');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2395, 'SKR03', '3', '3830', '0', 'Leergut');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2396, 'SKR03', '3', '3850', '0', 'Zölle und Einfuhrabgaben');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2399, 'SKR03', '3', '3960', '0', 'Bestandsveränderungen Roh- Hilfs- und Betriebsstoffe sowie bezogene Waren');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2400, 'SKR03', '3', '3961', '0', 'Bestandsveränderungen Roh- Hilfs- und Betriebsstoffe sowie bezogene Waren');
@@ -1965,42 +1965,42 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3071, 'SKR03', '8', '8700', '0', 'Erlösschmälerungen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3072, 'SKR03', '8', '8701', '8700', 'Nicht abgerechnete Einnahmen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3073, 'SKR03', '8', '8705', '8700', 'Erlösschmälerungen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3074, 'SKR03', '8', '8705', '8700', 'Erlösschmälerungen aus steuerfreien Umsätzen §4 Nr. 1a UStG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3075, 'SKR03', '8', '8710', '8700', 'Erlösschmälerungen 7% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3076, 'SKR03', '8', '8720', '8700', 'Erlösschmälerungen 19% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3077, 'SKR03', '8', '8721', '8700', 'Erlösschmälerungen 19% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3078, 'SKR03', '8', '8723', '8700', 'Erlösschmälerungen 16% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3079, 'SKR03', '8', '8724', '8700', 'Erlösschmälerungen aus steuerfreien innergemeinschaftlichen Lieferung');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3080, 'SKR03', '8', '8725', '8700', 'Erlösschmälerungen aus im Inland steuerpflichtigen EG-Lieferungen 7 % USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3081, 'SKR03', '8', '8726', '8700', 'Erlösschmälerungen aus im Inland steuerpflichtigen EG-Lieferungen 19 % USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3082, 'SKR03', '8', '8727', '8700', 'Erlösschmälerungen aus im anderen EG-Land steuerpflichtigen Lieferungen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3083, 'SKR03', '8', '8729', '8700', 'Erlösschmälerungen aus im Inland steuerpflichtigen 16% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3084, 'SKR03', '8', '8730', '8700', 'Gewährte Skonti');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3085, 'SKR03', '8', '8731', '8700', 'Gewährte Skonti 7% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3086, 'SKR03', '8', '8735', '8700', 'Gewährte Skonti 16% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3087, 'SKR03', '8', '8736', '8700', 'Gewährte Skonti 19% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3088, 'SKR03', '8', '8741', '8700', 'Gewährte Skonti aus Lieferungen für die der Leistungsempfänger die Umsatzsteuer nach § 13b UStG schuldet');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3089, 'SKR03', '8', '8743', '8700', 'Gewährte Skonti aus steuerfreien innergemeinschaftlichen Lieferungen § 4 Nr. 1b UStG');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3090, 'SKR03', '8', '8745', '8700', 'Gewährte Skonti aus im Inland steuerpflichtigen EG-Lieferungen');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3091, 'SKR03', '8', '8746', '8700', 'Gewährte Skonti aus im Inland steuerpflichtigen EG-Lieferungen 7% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3092, 'SKR03', '8', '8748', '8700', 'Gewährte Skonti aus im Inland steuerpflichtigen EG-Lieferungen 19% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3093, 'SKR03', '8', '8749', '8700', 'Gewährte Skonti aus im Inland steuerpflichtigen EG-Lieferungen 16% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3094, 'SKR03', '8', '8750', '8700', 'Gewährte Boni 7% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3095, 'SKR03', '8', '8751', '8700', 'Gewährte Boni 7% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3096, 'SKR03', '8', '8760', '8700', 'Gewährte Boni 19% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3097, 'SKR03', '8', '8761', '8700', 'Gewährte Boni 19% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3098, 'SKR03', '8', '8764', '8700', 'Gewährte Boni 16% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3099, 'SKR03', '8', '8765', '8700', 'Gewährte Boni 16% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3100, 'SKR03', '8', '8769', '8700', 'Gewährte Boni');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3101, 'SKR03', '8', '8770', '8700', 'Gewährte Rabatte');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3102, 'SKR03', '8', '8780', '8700', 'Gewährte Rabatte 7% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3103, 'SKR03', '8', '8781', '8700', 'Gewährte Rabatte 7% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3104, 'SKR03', '8', '8790', '8700', 'Gewährte Rabatte 19% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3105, 'SKR03', '8', '8791', '8700', 'Gewährte Rabatte 19% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3106, 'SKR03', '8', '8794', '8700', 'Gewährte Rabatte 16% USt');
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3107, 'SKR03', '8', '8795', '8700', 'Gewährte Rabatte 16% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3072, 'SKR03', '8', '8701', '3071', 'Nicht abgerechnete Einnahmen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3073, 'SKR03', '8', '8705', '3071', 'Erlösschmälerungen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3074, 'SKR03', '8', '8705', '3071', 'Erlösschmälerungen aus steuerfreien Umsätzen §4 Nr. 1a UStG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3075, 'SKR03', '8', '8710', '3071', 'Erlösschmälerungen 7% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3076, 'SKR03', '8', '8720', '3071', 'Erlösschmälerungen 19% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3077, 'SKR03', '8', '8721', '3071', 'Erlösschmälerungen 19% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3078, 'SKR03', '8', '8723', '3071', 'Erlösschmälerungen 16% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3079, 'SKR03', '8', '8724', '3071', 'Erlösschmälerungen aus steuerfreien innergemeinschaftlichen Lieferung');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3080, 'SKR03', '8', '8725', '3071', 'Erlösschmälerungen aus im Inland steuerpflichtigen EG-Lieferungen 7 % USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3081, 'SKR03', '8', '8726', '3071', 'Erlösschmälerungen aus im Inland steuerpflichtigen EG-Lieferungen 19 % USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3082, 'SKR03', '8', '8727', '3071', 'Erlösschmälerungen aus im anderen EG-Land steuerpflichtigen Lieferungen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3083, 'SKR03', '8', '8729', '3071', 'Erlösschmälerungen aus im Inland steuerpflichtigen 16% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3084, 'SKR03', '8', '8730', '3071', 'Gewährte Skonti');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3085, 'SKR03', '8', '8731', '3071', 'Gewährte Skonti 7% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3086, 'SKR03', '8', '8735', '3071', 'Gewährte Skonti 16% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3087, 'SKR03', '8', '8736', '3071', 'Gewährte Skonti 19% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3088, 'SKR03', '8', '8741', '3071', 'Gewährte Skonti aus Lieferungen für die der Leistungsempfänger die Umsatzsteuer nach § 13b UStG schuldet');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3089, 'SKR03', '8', '8743', '3071', 'Gewährte Skonti aus steuerfreien innergemeinschaftlichen Lieferungen § 4 Nr. 1b UStG');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3090, 'SKR03', '8', '8745', '3071', 'Gewährte Skonti aus im Inland steuerpflichtigen EG-Lieferungen');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3091, 'SKR03', '8', '8746', '3071', 'Gewährte Skonti aus im Inland steuerpflichtigen EG-Lieferungen 7% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3092, 'SKR03', '8', '8748', '3071', 'Gewährte Skonti aus im Inland steuerpflichtigen EG-Lieferungen 19% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3093, 'SKR03', '8', '8749', '3071', 'Gewährte Skonti aus im Inland steuerpflichtigen EG-Lieferungen 16% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3094, 'SKR03', '8', '8750', '3071', 'Gewährte Boni 7% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3095, 'SKR03', '8', '8751', '3071', 'Gewährte Boni 7% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3096, 'SKR03', '8', '8760', '3071', 'Gewährte Boni 19% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3097, 'SKR03', '8', '8761', '3071', 'Gewährte Boni 19% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3098, 'SKR03', '8', '8764', '3071', 'Gewährte Boni 16% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3099, 'SKR03', '8', '8765', '3071', 'Gewährte Boni 16% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3100, 'SKR03', '8', '8769', '3071', 'Gewährte Boni');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3101, 'SKR03', '8', '8770', '3071', 'Gewährte Rabatte');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3102, 'SKR03', '8', '8780', '3071', 'Gewährte Rabatte 7% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3103, 'SKR03', '8', '8781', '3071', 'Gewährte Rabatte 7% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3104, 'SKR03', '8', '8790', '3071', 'Gewährte Rabatte 19% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3105, 'SKR03', '8', '8791', '3071', 'Gewährte Rabatte 19% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3106, 'SKR03', '8', '8794', '3071', 'Gewährte Rabatte 16% USt');
+INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3107, 'SKR03', '8', '8795', '3071', 'Gewährte Rabatte 16% USt');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3109, 'SKR03', '8', '8800', '0', 'Erlöse aus Verkäufen Sachanlagevermögen (Bei Buchverlust)');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3110, 'SKR03', '8', '8801', '3109', 'Erlöse aus Verkäufen Sachanlagevermögen 19% USt (Bei Buchverlust)');
@@ -2707,7 +2707,6 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc
-- SKR04
-- Some lines of SKR04 has been disabled because the fiel account_parent is wrong, it must be the rowid of parent line and not the account_number of parent line
-INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3837, 'SKR04', 'Anlagevermögen', 0, 0, 'Anlagevermögen');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3838, 'SKR04', 'Anlagevermögen', 100, 0, 'Entgeltlich erworbene Konzessionen, gewerbliche Schutzrechte und ähnliche Rechte und Werte sowie Lizenzen an solchen Rechten und Werten');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3839, 'SKR04', 'Anlagevermögen', 110, 3838, 'Konzessionen');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3840, 'SKR04', 'Anlagevermögen', 120, 3838, 'Gewerbliche Schutzrechte');
@@ -2715,66 +2714,66 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3842, 'SKR04', 'Anlagevermögen', 135, 3838, 'EDV-Software');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3843, 'SKR04', 'Anlagevermögen', 140, 3838, 'Lizenzen an gewerblichen Schutzrechten und ähnlichen Rechten und Werte');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3844, 'SKR04', 'Anlagevermögen', 143, 0, 'Selbst geschaffene immaterielle Vermögensgegenstände');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3845, 'SKR04', 'Anlagevermögen', 144, 143, 'EDV-Software');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3846, 'SKR04', 'Anlagevermögen', 145, 143, 'Lizenzen und Franchiseverträge');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3847, 'SKR04', 'Anlagevermögen', 146, 143, 'Konzessionen und gewerbliche Schutzrechte');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3848, 'SKR04', 'Anlagevermögen', 147, 143, 'Rezepte, Verfahren, Prototypen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3849, 'SKR04', 'Anlagevermögen', 148, 143, 'Immaterielle Vermögensgegenstände in Entwicklung');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3845, 'SKR04', 'Anlagevermögen', 144, 3844, 'EDV-Software');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3846, 'SKR04', 'Anlagevermögen', 145, 3844, 'Lizenzen und Franchiseverträge');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3847, 'SKR04', 'Anlagevermögen', 146, 3844, 'Konzessionen und gewerbliche Schutzrechte');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3848, 'SKR04', 'Anlagevermögen', 147, 3844, 'Rezepte, Verfahren, Prototypen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3849, 'SKR04', 'Anlagevermögen', 148, 3844, 'Immaterielle Vermögensgegenstände in Entwicklung');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3850, 'SKR04', 'Anlagevermögen', 150, 0, 'Geschäfts- oder Firmenwert');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3851, 'SKR04', 'Anlagevermögen', 160, 0, 'Verschmelzungsmehrwert');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3852, 'SKR04', 'Anlagevermögen', 170, 0, 'Geleistete Anzahlungen auf immaterielle Vermögensgegenstände');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3853, 'SKR04', 'Anlagevermögen', 179, 0, 'Anzahlungen auf Geschäfts- oder Firmenwert');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3854, 'SKR04', 'Anlagevermögen', 200, 0, 'Grundstücke, grundstücksgleiche Rechte und Bauten einschließlich der Bauten auf fremden Grundstück');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3855, 'SKR04', 'Anlagevermögen', 210, 200, 'Grundstücksgleiche Rechte ohne Bauten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3856, 'SKR04', 'Anlagevermögen', 215, 200, 'Unbebaute Grundstücke');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3857, 'SKR04', 'Anlagevermögen', 220, 200, 'Grundstücksgleiche Rechte (Erbbaurecht, Dauerwohnrecht, unbebaute Grundstücke)');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3858, 'SKR04', 'Anlagevermögen', 225, 200, 'Grundstücke mit Substanzverkehr');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3859, 'SKR04', 'Anlagevermögen', 229, 200, 'Grundstücksanteil des häuslichen Arbeitszimmers');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3860, 'SKR04', 'Anlagevermögen', 230, 200, 'Bauten auf eigenen Grundstücken und grundstücksgleichen Rechten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3861, 'SKR04', 'Anlagevermögen', 235, 200, 'Grundstückswerte eigener bebauter Grundstücke');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3862, 'SKR04', 'Anlagevermögen', 240, 200, 'Geschäftsbauten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3863, 'SKR04', 'Anlagevermögen', 250, 200, 'Fabrikbauten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3864, 'SKR04', 'Anlagevermögen', 260, 200, 'Andere Bauten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3865, 'SKR04', 'Anlagevermögen', 270, 200, 'Garagen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3866, 'SKR04', 'Anlagevermögen', 280, 200, 'Außenanlagen für Geschäfts-, Fabrik- und andere Bauten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3867, 'SKR04', 'Anlagevermögen', 285, 200, 'Hof- und Wegbefestigungen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3868, 'SKR04', 'Anlagevermögen', 290, 200, 'Einrichtungen für Geschäfts-. Fabrik- und andere Bauten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3869, 'SKR04', 'Anlagevermögen', 300, 200, 'Wohnbauten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3870, 'SKR04', 'Anlagevermögen', 305, 200, 'Garagen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3871, 'SKR04', 'Anlagevermögen', 310, 200, 'Außenanlagen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3872, 'SKR04', 'Anlagevermögen', 315, 200, 'Hof- und Wegbefestigungen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3873, 'SKR04', 'Anlagevermögen', 320, 200, 'Einrichtungen für Wohnbauten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3874, 'SKR04', 'Anlagevermögen', 329, 200, 'Gebäudeteil des häuslichen Arbeitszimmers');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3875, 'SKR04', 'Anlagevermögen', 330, 200, 'Bauten auf fremden Grundstücken');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3876, 'SKR04', 'Anlagevermögen', 340, 200, 'Geschäftsbauten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3877, 'SKR04', 'Anlagevermögen', 350, 200, 'Fabrikbauten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3878, 'SKR04', 'Anlagevermögen', 360, 200, 'Wohnbauten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3879, 'SKR04', 'Anlagevermögen', 370, 200, 'Andere Bauten');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3880, 'SKR04', 'Anlagevermögen', 380, 200, 'Garagen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3881, 'SKR04', 'Anlagevermögen', 390, 200, 'Außenanlagen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3882, 'SKR04', 'Anlagevermögen', 395, 200, 'Hof- und Wegbefestigungen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3883, 'SKR04', 'Anlagevermögen', 398, 200, 'Einrichtungen für Geschäfts-. Fabrik-, Wohn- und andere Bauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3855, 'SKR04', 'Anlagevermögen', 210, 3854, Grundstücksgleiche Rechte ohne Bauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3856, 'SKR04', 'Anlagevermögen', 215, 3854, Unbebaute Grundstücke');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3857, 'SKR04', 'Anlagevermögen', 220, 3854, Grundstücksgleiche Rechte (Erbbaurecht, Dauerwohnrecht, unbebaute Grundstücke)');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3858, 'SKR04', 'Anlagevermögen', 225, 3854, Grundstücke mit Substanzverkehr');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3859, 'SKR04', 'Anlagevermögen', 229, 3854, Grundstücksanteil des häuslichen Arbeitszimmers');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3860, 'SKR04', 'Anlagevermögen', 230, 3854, Bauten auf eigenen Grundstücken und grundstücksgleichen Rechten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3861, 'SKR04', 'Anlagevermögen', 235, 3854, Grundstückswerte eigener bebauter Grundstücke');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3862, 'SKR04', 'Anlagevermögen', 240, 3854, Geschäftsbauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3863, 'SKR04', 'Anlagevermögen', 250, 3854, Fabrikbauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3864, 'SKR04', 'Anlagevermögen', 260, 3854, Andere Bauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3865, 'SKR04', 'Anlagevermögen', 270, 3854, Garagen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3866, 'SKR04', 'Anlagevermögen', 280, 3854, Außenanlagen für Geschäfts-, Fabrik- und andere Bauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3867, 'SKR04', 'Anlagevermögen', 285, 3854, Hof- und Wegbefestigungen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3868, 'SKR04', 'Anlagevermögen', 290, 3854, Einrichtungen für Geschäfts-. Fabrik- und andere Bauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3869, 'SKR04', 'Anlagevermögen', 300, 3854, Wohnbauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3870, 'SKR04', 'Anlagevermögen', 305, 3854, Garagen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3871, 'SKR04', 'Anlagevermögen', 310, 3854, Außenanlagen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3872, 'SKR04', 'Anlagevermögen', 315, 3854, Hof- und Wegbefestigungen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3873, 'SKR04', 'Anlagevermögen', 320, 3854, Einrichtungen für Wohnbauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3874, 'SKR04', 'Anlagevermögen', 329, 3854, Gebäudeteil des häuslichen Arbeitszimmers');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3875, 'SKR04', 'Anlagevermögen', 330, 3854, Bauten auf fremden Grundstücken');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3876, 'SKR04', 'Anlagevermögen', 340, 3854, Geschäftsbauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3877, 'SKR04', 'Anlagevermögen', 350, 3854, Fabrikbauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3878, 'SKR04', 'Anlagevermögen', 360, 3854, Wohnbauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3879, 'SKR04', 'Anlagevermögen', 370, 3854, Andere Bauten');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3880, 'SKR04', 'Anlagevermögen', 380, 3854, Garagen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3881, 'SKR04', 'Anlagevermögen', 390, 3854, Außenanlagen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3882, 'SKR04', 'Anlagevermögen', 395, 3854, Hof- und Wegbefestigungen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3883, 'SKR04', 'Anlagevermögen', 398, 3854, Einrichtungen für Geschäfts-. Fabrik-, Wohn- und andere Bauten');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3884, 'SKR04', 'Anlagevermögen', 400, 0, 'Technische Anlagen und Maschinen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3885, 'SKR04', 'Anlagevermögen', 420, 400, 'Technische Anlagen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3886, 'SKR04', 'Anlagevermögen', 440, 400, 'Maschinen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3887, 'SKR04', 'Anlagevermögen', 450, 400, 'Transportanlagen und Ähnlichen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3888, 'SKR04', 'Anlagevermögen', 460, 400, 'Maschinengebundene Werkzeuge');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3889, 'SKR04', 'Anlagevermögen', 470, 400, 'Betriebsvorrichtungen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3885, 'SKR04', 'Anlagevermögen', 420, 3884, 'Technische Anlagen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3886, 'SKR04', 'Anlagevermögen', 440, 3884, 'Maschinen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3887, 'SKR04', 'Anlagevermögen', 450, 3884, 'Transportanlagen und Ähnlichen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3888, 'SKR04', 'Anlagevermögen', 460, 3884, 'Maschinengebundene Werkzeuge');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3889, 'SKR04', 'Anlagevermögen', 470, 3884, 'Betriebsvorrichtungen');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3890, 'SKR04', 'Anlagevermögen', 500, 0, 'Andere Anlagen, Betriebs- und Geschäftsausstattungen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3891, 'SKR04', 'Anlagevermögen', 510, 500, 'Andere Anlagen');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3892, 'SKR04', 'Anlagevermögen', 520, 500, 'PKW');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3893, 'SKR04', 'Anlagevermögen', 540, 500, 'LKW');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3894, 'SKR04', 'Anlagevermögen', 560, 500, 'Sonstige Transportmittel');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3895, 'SKR04', 'Anlagevermögen', 620, 500, 'Werkzeuge');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3896, 'SKR04', 'Anlagevermögen', 630, 500, 'Betriebsausstattung');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3897, 'SKR04', 'Anlagevermögen', 635, 500, 'Geschäftsausstattung');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3898, 'SKR04', 'Anlagevermögen', 640, 500, 'Ladeneinrichtung');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3899, 'SKR04', 'Anlagevermögen', 650, 500, 'Büroeinrichtung');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3900, 'SKR04', 'Anlagevermögen', 660, 500, 'Gerüst- und Schalungsmaterial');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3901, 'SKR04', 'Anlagevermögen', 670, 500, 'Geringwertige Wirtschaftsgüter');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3902, 'SKR04', 'Anlagevermögen', 675, 500, 'Wirtschaftsgüter (Sammelposten)');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3903, 'SKR04', 'Anlagevermögen', 680, 500, 'Einbauten in fremde Grundstücke');
---INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3904, 'SKR04', 'Anlagevermögen', 690, 500, 'Sonstige Betriebs- und Geschäftsausstattung');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3891, 'SKR04', 'Anlagevermögen', 510, 3890, 'Andere Anlagen');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3892, 'SKR04', 'Anlagevermögen', 520, 3890, 'PKW');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3893, 'SKR04', 'Anlagevermögen', 540, 3890, 'LKW');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3894, 'SKR04', 'Anlagevermögen', 560, 3890, 'Sonstige Transportmittel');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3895, 'SKR04', 'Anlagevermögen', 620, 3890, 'Werkzeuge');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3896, 'SKR04', 'Anlagevermögen', 630, 3890, 'Betriebsausstattung');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3897, 'SKR04', 'Anlagevermögen', 635, 3890, 'Geschäftsausstattung');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3898, 'SKR04', 'Anlagevermögen', 640, 3890, 'Ladeneinrichtung');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3899, 'SKR04', 'Anlagevermögen', 650, 3890, 'Büroeinrichtung');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3900, 'SKR04', 'Anlagevermögen', 660, 3890, 'Gerüst- und Schalungsmaterial');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3901, 'SKR04', 'Anlagevermögen', 670, 3890, 'Geringwertige Wirtschaftsgüter');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3902, 'SKR04', 'Anlagevermögen', 675, 3890, 'Wirtschaftsgüter (Sammelposten)');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3903, 'SKR04', 'Anlagevermögen', 680, 3890, 'Einbauten in fremde Grundstücke');
+--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3904, 'SKR04', 'Anlagevermögen', 690, 3890, 'Sonstige Betriebs- und Geschäftsausstattung');
INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3905, 'SKR04', 'Anlagevermögen', 700, 0, 'Geleistete Anzahlungen und Anlagen im Bau');
--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3906, 'SKR04', 'Anlagevermögen', 705, 700, 'Anzahlungen auf Grundstücke und grundstücksgleiche Rechte ohne Bauten');
--INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3907, 'SKR04', 'Anlagevermögen', 710, 700, 'Geschäfts-, Fabrik- und andere Bauten im Bau auf eigenen Grundstücken');
diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql
index 713a7f31a4f..fabbbf2e700 100644
--- a/htdocs/install/mysql/data/llx_c_email_templates.sql
+++ b/htdocs/install/mysql/data/llx_c_email_templates.sql
@@ -36,5 +36,5 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private,
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__ __ONLINE_PAYMENT_TEXT_AND_URL__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__ __ONLINE_PAYMENT_TEXT_AND_URL__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__ __ONLINE_PAYMENT_TEXT_AND_URL__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
-INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendes)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
diff --git a/htdocs/install/mysql/data/llx_c_forme_juridique.sql b/htdocs/install/mysql/data/llx_c_forme_juridique.sql
index b3182846723..07a09724ed2 100644
--- a/htdocs/install/mysql/data/llx_c_forme_juridique.sql
+++ b/htdocs/install/mysql/data/llx_c_forme_juridique.sql
@@ -8,14 +8,10 @@
-- Copyright (C) 2010-2016 Juanjo Menent
-- Copyright (C) 2012 Sebastian Neuwert
-- Copyright (C) 2012 Tommaso Basilici
--- Copyright (C) 2012 Ricardo Schluter
--- Copyright (C) 2013 Cedric GROSS
+-- Copyright (C) 2012 Ricardo Schluter
+-- Copyright (C) 2013 Cedric GROSS
-- Copyright (C) 2020-2021 Udo Tamm
--
-
-
--- LICENSE ---------------------------------------------------------------
---
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
index 772f0e51bdf..af32340170e 100644
--- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
+++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
@@ -197,7 +197,7 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private,
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__ __ONLINE_PAYMENT_TEXT_AND_URL__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__ __ONLINE_PAYMENT_TEXT_AND_URL__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__ __ONLINE_PAYMENT_TEXT_AND_URL__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
-INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailAttendes', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendes)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
+INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, tms, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '2021-02-14 14:42:41', 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__, __(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__ __(Sincerely)__ __USER_SIGNATURE__', null, '1', null);
ALTER TABLE llx_projet ADD COLUMN accept_conference_suggestions integer DEFAULT 0;
@@ -279,8 +279,83 @@ DELETE FROM llx_boxes_def WHERE file IN ('box_graph_ticket_by_severity', 'box_ti
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_nb_tickets_type.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_nb_tickets_type.php' AND entity = 1);
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_new_vs_close_ticket.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_new_vs_close_ticket.php' AND entity = 1);
+create table llx_product_perentity
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ fk_product integer,
+ entity integer DEFAULT 1 NOT NULL, -- multi company id
+ accountancy_code_sell varchar(32), -- Selling accountancy code
+ accountancy_code_sell_intra varchar(32), -- Selling accountancy code for vat intracommunity
+ accountancy_code_sell_export varchar(32), -- Selling accountancy code for vat export
+ accountancy_code_buy varchar(32), -- Buying accountancy code
+ accountancy_code_buy_intra varchar(32), -- Buying accountancy code for vat intracommunity
+ accountancy_code_buy_export varchar(32) -- Buying accountancy code for vat import
+)ENGINE=innodb;
+
+ALTER TABLE llx_product_perentity ADD INDEX idx_product_perentity_fk_product (fk_product);
+ALTER TABLE llx_product_perentity ADD UNIQUE INDEX uk_product_perentity (fk_product, entity);
+
+create table llx_societe_perentity
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ fk_soc integer,
+ entity integer DEFAULT 1 NOT NULL, -- multi company id
+-- code_compta varchar(24), -- code compta client
+-- code_compta_fournisseur varchar(24), -- code compta founisseur
+ accountancy_code_sell varchar(32), -- Selling accountancy code
+ accountancy_code_buy varchar(32) -- Buying accountancy code
+)ENGINE=innodb;
+
+ALTER TABLE llx_societe_perentity ADD INDEX idx_societe_perentity_fk_soc (fk_soc);
+ALTER TABLE llx_societe_perentity ADD UNIQUE INDEX uk_societe_perentity (fk_soc, entity);
+
+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,
+ email varchar(100),
+ date_subscription datetime,
+ amount double DEFAULT NULL,
+ note_public text,
+ note_private text,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ last_main_doc varchar(255),
+ import_key varchar(14),
+ model_pdf varchar(255),
+ status smallint NOT NULL
+) ENGINE=innodb;
+
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_rowid (rowid);
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_ref (ref);
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_soc (fk_soc);
+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_email (email);
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT llx_eventorganization_conferenceorboothattendee_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_status (status);
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD UNIQUE INDEX uk_eventorganization_conferenceorboothattendee(fk_soc, fk_actioncomm, email);
+
+create table llx_eventorganization_conferenceorboothattendee_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
+ALTER TABLE llx_eventorganization_conferenceorboothattendee_extrafields ADD INDEX idx_conferenceorboothattendee_fk_object(fk_object);
ALTER TABLE llx_c_ticket_category ADD COLUMN public integer DEFAULT 0;
+ALTER TABLE llx_c_ticket_category MODIFY COLUMN pos integer DEFAULT 0 NOT NULL;
+ALTER TABLE llx_propal ADD COLUMN date_signature datetime AFTER date_valid;
+ALTER TABLE llx_propal ADD COLUMN fk_user_signature integer AFTER fk_user_valid;
+ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_signature FOREIGN KEY (fk_user_signature) REFERENCES llx_user (rowid);
+UPDATE llx_propal SET fk_user_signature = fk_user_cloture WHERE fk_user_signature IS NULL AND fk_user_cloture IS NOT NULL;
+UPDATE llx_propal SET date_signature = date_cloture WHERE date_signature IS NULL AND date_cloture IS NOT NULL;
diff --git a/htdocs/install/mysql/tables/llx_c_ticket_category.sql b/htdocs/install/mysql/tables/llx_c_ticket_category.sql
index c42c3f029d4..317be25e142 100644
--- a/htdocs/install/mysql/tables/llx_c_ticket_category.sql
+++ b/htdocs/install/mysql/tables/llx_c_ticket_category.sql
@@ -21,7 +21,7 @@ create table llx_c_ticket_category
entity integer DEFAULT 1,
code varchar(32) NOT NULL,
label varchar(128) NOT NULL,
- pos varchar(32) NOT NULL,
+ pos integer DEFAULT 0 NOT NULL,
public integer DEFAULT 0,
use_default integer DEFAULT 1,
active integer DEFAULT 1,
diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql
new file mode 100644
index 00000000000..2314221b41d
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.key.sql
@@ -0,0 +1,31 @@
+-- Copyright (C) ---Put here your own copyright and developer email---
+--
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_rowid (rowid);
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_ref (ref);
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD INDEX idx_eventorganization_conferenceorboothattendee_fk_soc (fk_soc);
+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_email (email);
+ALTER TABLE llx_eventorganization_conferenceorboothattendee ADD CONSTRAINT llx_eventorganization_conferenceorboothattendee_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user(rowid);
+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);
+
+
diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql
new file mode 100644
index 00000000000..c6ff6dedf66
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee.sql
@@ -0,0 +1,37 @@
+-- Copyright (C) ---Put here your own copyright and developer email---
+--
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see https://www.gnu.org/licenses/.
+
+
+CREATE TABLE llx_eventorganization_conferenceorboothattendee(
+ -- BEGIN MODULEBUILDER FIELDS
+ rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
+ ref varchar(128) NOT NULL,
+ fk_soc integer,
+ fk_actioncomm integer NOT NULL,
+ email varchar(100),
+ date_subscription datetime,
+ amount double DEFAULT NULL,
+ note_public text,
+ note_private text,
+ date_creation datetime NOT NULL,
+ tms timestamp,
+ fk_user_creat integer NOT NULL,
+ fk_user_modif integer,
+ last_main_doc varchar(255),
+ import_key varchar(14),
+ model_pdf varchar(255),
+ status smallint NOT NULL
+ -- END MODULEBUILDER FIELDS
+) ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee_extrafields.key.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee_extrafields.key.sql
new file mode 100644
index 00000000000..5fa3554fae3
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee_extrafields.key.sql
@@ -0,0 +1,19 @@
+-- Copyright (C) ---Put here your own copyright and developer email---
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see https://www.gnu.org/licenses/.
+
+
+-- BEGIN MODULEBUILDER INDEXES
+ALTER TABLE llx_eventorganization_conferenceorboothattendee_extrafields ADD INDEX idx_conferenceorboothattendee_fk_object(fk_object);
+-- END MODULEBUILDER INDEXES
diff --git a/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee_extrafields.sql b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee_extrafields.sql
new file mode 100644
index 00000000000..5455314ff06
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_eventorganization_conferenceorboothattendee_extrafields.sql
@@ -0,0 +1,23 @@
+-- Copyright (C) ---Put here your own copyright and developer email---
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see https://www.gnu.org/licenses/.
+
+create table llx_eventorganization_conferenceorboothattendee_extrafields
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ tms timestamp,
+ fk_object integer NOT NULL,
+ import_key varchar(14) -- import key
+) ENGINE=innodb;
+
diff --git a/htdocs/install/mysql/tables/llx_holiday_extrafields.sql b/htdocs/install/mysql/tables/llx_holiday_extrafields.sql
index 8b6e3ef8dc9..6baf1789dc2 100644
--- a/htdocs/install/mysql/tables/llx_holiday_extrafields.sql
+++ b/htdocs/install/mysql/tables/llx_holiday_extrafields.sql
@@ -1,6 +1,9 @@
-- ========================================================================
-- Copyright (C) 2016 Laurent Destailleur
--
+--
+-- LICENSE ================================================================
+--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
@@ -12,7 +15,7 @@
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
--- along with this program. If not, see .
+-- along with this program. If not, see .
--
-- ========================================================================
diff --git a/htdocs/install/mysql/tables/llx_product_perentity.key.sql b/htdocs/install/mysql/tables/llx_product_perentity.key.sql
new file mode 100644
index 00000000000..8e8ad48044c
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_product_perentity.key.sql
@@ -0,0 +1,21 @@
+-- ===================================================================
+-- Copyright (C) 2021 Open-Dsi
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ===================================================================
+
+ALTER TABLE llx_product_perentity ADD INDEX idx_product_perentity_fk_product (fk_product);
+
+ALTER TABLE llx_product_perentity ADD UNIQUE INDEX uk_product_perentity (fk_product, entity);
diff --git a/htdocs/install/mysql/tables/llx_product_perentity.sql b/htdocs/install/mysql/tables/llx_product_perentity.sql
new file mode 100644
index 00000000000..6e32e506ddf
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_product_perentity.sql
@@ -0,0 +1,30 @@
+-- ========================================================================
+-- Copyright (C) 2021 Open-Dsi
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ========================================================================
+
+create table llx_product_perentity
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ fk_product integer,
+ entity integer DEFAULT 1 NOT NULL, -- multi company id
+ accountancy_code_sell varchar(32), -- Selling accountancy code
+ accountancy_code_sell_intra varchar(32), -- Selling accountancy code for vat intracommunity
+ accountancy_code_sell_export varchar(32), -- Selling accountancy code for vat export
+ accountancy_code_buy varchar(32), -- Buying accountancy code
+ accountancy_code_buy_intra varchar(32), -- Buying accountancy code for vat intracommunity
+ accountancy_code_buy_export varchar(32) -- Buying accountancy code for vat import
+)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_propal.key.sql b/htdocs/install/mysql/tables/llx_propal.key.sql
index 89a0c54ad83..d0265e6fcdf 100644
--- a/htdocs/install/mysql/tables/llx_propal.key.sql
+++ b/htdocs/install/mysql/tables/llx_propal.key.sql
@@ -24,6 +24,7 @@ ALTER TABLE llx_propal ADD UNIQUE INDEX uk_propal_ref (ref, entity);
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_soc (fk_soc);
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_author (fk_user_author);
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_valid (fk_user_valid);
+ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_signature (fk_user_signature);
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_user_cloture (fk_user_cloture);
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_projet (fk_projet);
ALTER TABLE llx_propal ADD INDEX idx_propal_fk_account(fk_account);
@@ -33,6 +34,7 @@ ALTER TABLE llx_propal ADD INDEX idx_propal_fk_warehouse(fk_warehouse);
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
+ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_signature FOREIGN KEY (fk_user_signature) REFERENCES llx_user (rowid);
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_user_cloture FOREIGN KEY (fk_user_cloture) REFERENCES llx_user (rowid);
ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
--ALTER TABLE llx_propal ADD CONSTRAINT fk_propal_fk_warehouse FOREIGN KEY (fk_warehouse) REFERENCES llx_entrepot(rowid);
diff --git a/htdocs/install/mysql/tables/llx_propal.sql b/htdocs/install/mysql/tables/llx_propal.sql
index 004bb027d35..7c94086b3b9 100644
--- a/htdocs/install/mysql/tables/llx_propal.sql
+++ b/htdocs/install/mysql/tables/llx_propal.sql
@@ -37,11 +37,13 @@ create table llx_propal
datep date, -- date de la propal
fin_validite datetime, -- date de fin de validite
date_valid datetime, -- date de validation
+ date_signature datetime, -- date signature
date_cloture datetime, -- date de cloture
fk_user_author integer, -- user making creation
fk_user_modif integer, -- user making last change
fk_user_valid integer, -- user validating
- fk_user_cloture integer, -- user closing (signed or not)
+ fk_user_signature integer, -- user signing (signed or not)
+ fk_user_cloture integer, -- user closing
fk_statut smallint DEFAULT 0 NOT NULL, -- 0=draft, 1=validated, 2=accepted, 3=refused, 4=billed/closed
price real DEFAULT 0, -- (obsolete)
remise_percent real DEFAULT 0, -- remise globale relative en pourcent (obsolete)
diff --git a/htdocs/install/mysql/tables/llx_societe_perentity.key.sql b/htdocs/install/mysql/tables/llx_societe_perentity.key.sql
new file mode 100644
index 00000000000..dd2970e16d2
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_societe_perentity.key.sql
@@ -0,0 +1,21 @@
+-- ===================================================================
+-- Copyright (C) 2021 Open-Dsi
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ===================================================================
+
+ALTER TABLE llx_societe_perentity ADD INDEX idx_societe_perentity_fk_soc (fk_soc);
+
+ALTER TABLE llx_societe_perentity ADD UNIQUE INDEX uk_societe_perentity (fk_soc, entity);
diff --git a/htdocs/install/mysql/tables/llx_societe_perentity.sql b/htdocs/install/mysql/tables/llx_societe_perentity.sql
new file mode 100644
index 00000000000..408169476d9
--- /dev/null
+++ b/htdocs/install/mysql/tables/llx_societe_perentity.sql
@@ -0,0 +1,28 @@
+-- ========================================================================
+-- Copyright (C) 2021 Open-Dsi
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see .
+--
+-- ========================================================================
+
+create table llx_societe_perentity
+(
+ rowid integer AUTO_INCREMENT PRIMARY KEY,
+ fk_soc integer,
+ entity integer DEFAULT 1 NOT NULL, -- multi company id
+-- code_compta varchar(24), -- code compta client
+-- code_compta_fournisseur varchar(24), -- code compta founisseur
+ accountancy_code_sell varchar(32), -- Selling accountancy code
+ accountancy_code_buy varchar(32) -- Buying accountancy code
+)ENGINE=innodb;
diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php
index 1d695f40249..ed4fb8dab13 100644
--- a/htdocs/install/repair.php
+++ b/htdocs/install/repair.php
@@ -3,6 +3,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur
* Copyright (C) 2005-2012 Regis Houssin
* Copyright (C) 2015 Raphaël Doursenaud
+ * Copyright (C) 2021 Frédéric France
*
* 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
@@ -94,6 +95,7 @@ print 'Option repair_link_dispatch_lines_supplier_order_lines, (\'test\' or \'co
print 'Option set_empty_time_spent_amount (\'test\' or \'confirmed\') is '.(GETPOST('set_empty_time_spent_amount', 'alpha') ?GETPOST('set_empty_time_spent_amount', 'alpha') : 'undefined').' '."\n";
// Structure
print 'Option force_utf8_on_tables, for mysql/mariadb only (\'test\' or \'confirmed\') is '.(GETPOST('force_utf8_on_tables', 'alpha') ?GETPOST('force_utf8_on_tables', 'alpha') : 'undefined').' '."\n";
+print "Option force_utf8mb4_on_tables (EXPERIMENTAL!), for mysql/mariadb only ('test' or 'confirmed') is ".(GETPOST('force_utf8mb4_on_tables', 'alpha') ? GETPOST('force_utf8mb4_on_tables', 'alpha') : 'undefined')." \n";
// Rebuild sequence
print 'Option rebuild_sequences, for postgresql only (\'test\' or \'confirmed\') is '.(GETPOST('rebuild_sequences', 'alpha') ?GETPOST('rebuild_sequences', 'alpha') : 'undefined').' '."\n";
print ' ';
@@ -933,14 +935,14 @@ if ($ok && GETPOST('clean_product_stock_batch', 'alpha')) {
}
if ($methodtofix == 'updatestock') {
// Method 2
- print ' -> Update qty of product_stock with qty = '.($obj->reelbatch ? $obj->reelbatch : '0').' for ps.rowid = '.$obj->psrowid;
+ print ' -> Update qty of product_stock with qty = '.($obj->reelbatch ? ((float) $obj->reelbatch) : '0').' for ps.rowid = '.((int) $obj->psrowid);
if (GETPOST('clean_product_stock_batch') == 'confirmed') {
$error = 0;
$db->begin();
$sql2 = "UPDATE ".MAIN_DB_PREFIX."product_stock";
- $sql2 .= " SET reel = ".($obj->reelbatch ? $obj->reelbatch : '0')." WHERE rowid = ".$obj->psrowid;
+ $sql2 .= " SET reel = ".($obj->reelbatch ? ((float) $obj->reelbatch) : '0')." WHERE rowid = ".((int) $obj->psrowid);
$resql2 = $db->query($sql2);
if ($resql2) {
// We update product_stock, so we must fill p.stock into product too.
@@ -1027,7 +1029,7 @@ if ($ok && GETPOST('set_empty_time_spent_amount', 'alpha')) {
if (GETPOST('set_empty_time_spent_amount') == 'confirmed') {
$sql2 = "UPDATE ".MAIN_DB_PREFIX."projet_task_time";
- $sql2 .= " SET thm = ".$obj->user_thm." WHERE thm IS NULL AND fk_user = ".$obj->user_id;
+ $sql2 .= " SET thm = ".$obj->user_thm." WHERE thm IS NULL AND fk_user = ".((int) $obj->user_id);
$resql2 = $db->query($sql2);
if (!$resql2) {
$error++;
@@ -1256,6 +1258,60 @@ if ($ok && GETPOST('force_utf8_on_tables', 'alpha')) {
}
}
+// force utf8mb4 on tables EXPERIMENTAL !
+if ($ok && GETPOST('force_utf8mb4_on_tables', 'alpha')) {
+ print ' *** Force page code and collation of tables into utf8mb4/utf8mb4_unicode_ci (for mysql/mariadb only) ';
+
+ if ($db->type == "mysql" || $db->type == "mysqli") {
+ $force_utf8mb4_on_tables = GETPOST('force_utf8mb4_on_tables', 'alpha');
+
+ $listoftables = $db->DDLListTables($db->database_name);
+
+ // Disable foreign key checking for avoid errors
+ if ($force_utf8mb4_on_tables == 'confirmed') {
+ $sql = 'SET FOREIGN_KEY_CHECKS=0';
+ print '';
+ $resql = $db->query($sql);
+ }
+
+ foreach ($listoftables as $table) {
+ // do not convert llx_const if mysql encrypt/decrypt is used
+ if ($conf->db->dolibarr_main_db_encryption != 0 && preg_match('/\_const$/', $table)) {
+ continue;
+ }
+
+ print '';
+ print $table;
+ $sql1 = 'ALTER TABLE '.$table.' ROW_FORMAT=dynamic;';
+ $sql2 = 'ALTER TABLE '.$table.' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci';
+ print '';
+ print '';
+ if ($force_utf8mb4_on_tables == 'confirmed') {
+ $resql1 = $db->query($sql1);
+ if ($resql1) {
+ $resql2 = $db->query($sql2);
+ } else {
+ $resql2 = false;
+ }
+ print ' - Done ('.(($resql1 && $resql2) ? 'OK' : 'KO').')';
+ } else {
+ print ' - Disabled';
+ }
+ print ' ';
+ flush();
+ ob_flush();
+ }
+
+ // Enable foreign key checking
+ if ($force_utf8mb4_on_tables == 'confirmed') {
+ $sql = 'SET FOREIGN_KEY_CHECKS=1';
+ print '';
+ $resql = $db->query($sql);
+ }
+ } else {
+ print 'Not available with database type '.$db->type.' ';
+ }
+}
// rebuild sequences for pgsql
if ($ok && GETPOST('rebuild_sequences', 'alpha')) {
@@ -1274,7 +1330,6 @@ if ($ok && GETPOST('rebuild_sequences', 'alpha')) {
}
}
-
//
if ($ok && GETPOST('repair_link_dispatch_lines_supplier_order_lines')) {
/*
@@ -1318,8 +1373,8 @@ if ($ok && GETPOST('repair_link_dispatch_lines_supplier_order_lines')) {
}
while ($obj_dispatch = $db->fetch_object($resql_dispatch)) {
$sql_line = 'SELECT line.rowid, line.qty FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet AS line';
- $sql_line .= ' WHERE line.fk_commande = '.$obj_dispatch->fk_commande;
- $sql_line .= ' AND line.fk_product = '.$obj_dispatch->fk_product;
+ $sql_line .= ' WHERE line.fk_commande = '.((int) $obj_dispatch->fk_commande);
+ $sql_line .= ' AND line.fk_product = '.((int) $obj_dispatch->fk_product);
$resql_line = $db->query($sql_line);
// s’il y a plusieurs lignes avec le même produit sur cette commande fournisseur,
@@ -1347,8 +1402,8 @@ if ($ok && GETPOST('repair_link_dispatch_lines_supplier_order_lines')) {
$qty_for_line = min($remaining_qty, $obj_line->qty);
if ($first_iteration) {
$sql_attach = 'UPDATE '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch';
- $sql_attach .= ' SET fk_commandefourndet = '.$obj_line->rowid.', qty = '.$qty_for_line;
- $sql_attach .= ' WHERE rowid = '.$obj_dispatch->rowid;
+ $sql_attach .= ' SET fk_commandefourndet = '.((int) $obj_line->rowid).', qty = '.((float) $qty_for_line);
+ $sql_attach .= ' WHERE rowid = '.((int) $obj_dispatch->rowid);
$first_iteration = false;
} else {
$sql_attach_values = array(
diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php
index d613e4a18b0..32959af80cc 100644
--- a/htdocs/install/upgrade2.php
+++ b/htdocs/install/upgrade2.php
@@ -678,7 +678,7 @@ function migrate_paiements($db, $langs, $conf)
$res += $db->query($sql);
- $sql = "UPDATE ".MAIN_DB_PREFIX."paiement SET fk_facture = 0 WHERE rowid = ".$row[$i][0];
+ $sql = "UPDATE ".MAIN_DB_PREFIX."paiement SET fk_facture = 0 WHERE rowid = ".((int) $row[$i][0]);
$res += $db->query($sql);
@@ -1342,7 +1342,7 @@ function migrate_paiementfourn_facturefourn($db, $langs, $conf)
// Verifier si la ligne est deja dans la nouvelle table. On ne veut pas inserer de doublons.
$check_sql = 'SELECT fk_paiementfourn, fk_facturefourn';
$check_sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn_facturefourn';
- $check_sql .= ' WHERE fk_paiementfourn = '.$select_obj->rowid.' AND fk_facturefourn = '.$select_obj->fk_facture_fourn;
+ $check_sql .= ' WHERE fk_paiementfourn = '.((int) $select_obj->rowid).' AND fk_facturefourn = '.((int) $select_obj->fk_facture_fourn);
$check_resql = $db->query($check_sql);
if ($check_resql) {
$check_num = $db->num_rows($check_resql);
@@ -2161,7 +2161,7 @@ function migrate_detail_livraison($db, $langs, $conf)
if ($resql2) {
$sql = "SELECT total_ht";
$sql .= " FROM ".MAIN_DB_PREFIX."livraison";
- $sql .= " WHERE rowid = ".$obj->fk_livraison;
+ $sql .= " WHERE rowid = ".((int) $obj->fk_livraison);
$resql3 = $db->query($sql);
if ($resql3) {
@@ -2864,7 +2864,7 @@ function migrate_project_task_time($db, $langs, $conf)
foreach ($totaltime as $taskid => $total_duration) {
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET";
$sql .= " duration_effective = ".$total_duration;
- $sql .= " WHERE rowid = ".$taskid;
+ $sql .= " WHERE rowid = ".((int) $taskid);
$resql = $db->query($sql);
if (!$resql) {
@@ -3235,7 +3235,7 @@ function migrate_mode_reglement($db, $langs, $conf)
$sqlSelect = "SELECT id";
$sqlSelect .= " FROM ".MAIN_DB_PREFIX."c_paiement";
- $sqlSelect .= " WHERE id = ".$old_id;
+ $sqlSelect .= " WHERE id = ".((int) $old_id);
$sqlSelect .= " AND code = '".$db->escape($elements['code'][$key])."'";
$resql = $db->query($sqlSelect);
@@ -3246,23 +3246,23 @@ function migrate_mode_reglement($db, $langs, $conf)
$db->begin();
- $sqla = "UPDATE ".MAIN_DB_PREFIX."paiement SET ";
- $sqla .= "fk_paiement = ".$elements['new_id'][$key];
- $sqla .= " WHERE fk_paiement = ".$old_id;
- $sqla .= " AND fk_paiement IN (SELECT id FROM ".MAIN_DB_PREFIX."c_paiement WHERE id = ".$old_id." AND code = '".$db->escape($elements['code'][$key])."')";
+ $sqla = "UPDATE ".MAIN_DB_PREFIX."paiement SET";
+ $sqla .= " fk_paiement = ".((int) $elements['new_id'][$key]);
+ $sqla .= " WHERE fk_paiement = ".((int) $old_id);
+ $sqla .= " AND fk_paiement IN (SELECT id FROM ".MAIN_DB_PREFIX."c_paiement WHERE id = ".((int) $old_id)." AND code = '".$db->escape($elements['code'][$key])."')";
$resqla = $db->query($sqla);
- $sql = "UPDATE ".MAIN_DB_PREFIX."c_paiement SET ";
- $sql .= "id = ".$elements['new_id'][$key];
- $sql .= " WHERE id = ".$old_id;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."c_paiement SET";
+ $sql .= " id = ".((int) $elements['new_id'][$key]);
+ $sql .= " WHERE id = ".((int) $old_id);
$sql .= " AND code = '".$db->escape($elements['code'][$key])."'";
$resql = $db->query($sql);
if ($resqla && $resql) {
foreach ($elements['tables'] as $table) {
$sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET ";
- $sql .= "fk_mode_reglement = ".$elements['new_id'][$key];
- $sql .= " WHERE fk_mode_reglement = ".$old_id;
+ $sql .= "fk_mode_reglement = ".((int) $elements['new_id'][$key]);
+ $sql .= " WHERE fk_mode_reglement = ".((int) $old_id);
$resql = $db->query($sql);
if (!$resql) {
@@ -3786,16 +3786,16 @@ function migrate_remise_except_entity($db, $langs, $conf)
$sqlSelect2 = "SELECT f.entity";
$sqlSelect2 .= " FROM ".MAIN_DB_PREFIX."facture as f";
- $sqlSelect2 .= " WHERE f.rowid = ".$fk_facture;
+ $sqlSelect2 .= " WHERE f.rowid = ".((int) $fk_facture);
} elseif (!empty($obj->fk_facture_line)) {
$sqlSelect2 = "SELECT f.entity";
$sqlSelect2 .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd";
- $sqlSelect2 .= " WHERE fd.rowid = ".$obj->fk_facture_line;
+ $sqlSelect2 .= " WHERE fd.rowid = ".((int) $obj->fk_facture_line);
$sqlSelect2 .= " AND fd.fk_facture = f.rowid";
} else {
$sqlSelect2 = "SELECT s.entity";
$sqlSelect2 .= " FROM ".MAIN_DB_PREFIX."societe as s";
- $sqlSelect2 .= " WHERE s.rowid = ".$obj->fk_soc;
+ $sqlSelect2 .= " WHERE s.rowid = ".((int) $obj->fk_soc);
}
$resql2 = $db->query($sqlSelect2);
diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php
index cd4765161e9..a36a489ea70 100644
--- a/htdocs/intracommreport/class/intracommreport.class.php
+++ b/htdocs/intracommreport/class/intracommreport.class.php
@@ -417,7 +417,7 @@ class IntracommReport extends CommonObject
(
SELECT fk_product
FROM '.MAIN_DB_PREFIX.'categorie_product
- WHERE fk_categorie = '.$categ_fraisdeport->id.'
+ WHERE fk_categorie = '.((int) $categ_fraisdeport->id).'
)
)';
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index c635809404e..380a747a53a 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -402,6 +402,26 @@ UseMenuToSetBindindManualy=Lines not yet bound, use menu %s to
## Import
ImportAccountingEntries=Accounting entries
+ImportAccountingEntriesFECFormat=Accounting entries - FEC format
+FECFormatJournalCode=Code journal (JournalCode)
+FECFormatJournalLabel=Label journal (JournalLib)
+FECFormatEntryNum=Piece number (EcritureNum)
+FECFormatEntryDate=Piece date (EcritureDate)
+FECFormatGeneralAccountNumber=General account number (CompteNum)
+FECFormatGeneralAccountLabel=General account label (CompteLib)
+FECFormatSubledgerAccountNumber=Subledger account number (CompAuxNum)
+FECFormatSubledgerAccountLabel=Subledger account number (CompAuxLib)
+FECFormatPieceRef=Piece ref (PieceRef)
+FECFormatPieceDate=Piece date creation (PieceDate)
+FECFormatLabelOperation=Label operation (EcritureLib)
+FECFormatDebit=Debit (Debit)
+FECFormatCredit=Credit (Credit)
+FECFormatReconcilableCode=Reconcilable code (EcritureLet)
+FECFormatReconcilableDate=Reconcilable date (DateLet)
+FECFormatValidateDate=Piece date validated (ValidDate)
+FECFormatMulticurrencyAmount=Multicurrency amount (Montantdevise)
+FECFormatMulticurrencyCode=Multicurrency code (Idevise)
+
DateExport=Date export
WarningReportNotReliable=Warning, this report is not based on the Ledger, so does not contains transaction modified manually in the Ledger. If your journalization is up to date, the bookkeeping view is more accurate.
ExpenseReportJournal=Expense Report Journal
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 6f7515a01ac..857ef41bbc2 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2085,6 +2085,8 @@ MakeAnonymousPing=Make an anonymous Ping '+1' to the Dolibarr foundation server
FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled
EmailTemplate=Template for email
EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax
+PDF_SHOW_PROJECT=Show project on document
+ShowProjectLabel=Project Label
PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some texts in your PDF duplicated in 2 different languages in the same generated PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF.
FafaIconSocialNetworksDesc=Enter here the code of a FontAwesome icon. If you don't know what is FontAwesome, you can use the generic value fa-address-book.
FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index 93e1f560f5e..89463a535b3 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -181,6 +181,12 @@ ProfId3FR=Prof Id 3 (NAF, old APE)
ProfId4FR=Prof Id 4 (RCS/RM)
ProfId5FR=Prof Id 5 (numéro EORI)
ProfId6FR=-
+ProfId1ShortFR=SIREN
+ProfId2ShortFR=SIRET
+ProfId3ShortFR=NAF
+ProfId4ShortFR=RCS
+ProfId5ShortFR=EORI
+ProfId6ShortFR=-
ProfId1GB=Registration Number
ProfId2GB=-
ProfId3GB=SIC
diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang
index d42d8845aeb..7080810bfea 100644
--- a/htdocs/langs/en_US/compta.lang
+++ b/htdocs/langs/en_US/compta.lang
@@ -175,6 +175,7 @@ RulesResultInOut=- It includes the real payments made on invoices, expenses, VAT
RulesCADue=- It includes the customer's due invoices whether they are paid or not. - It is based on the billing date of these invoices.
RulesCAIn=- It includes all the effective payments of invoices received from customers. - It is based on the payment date of these invoices
RulesCATotalSaleJournal=It includes all credit lines from the Sale journal.
+RulesSalesTurnoverOfIncomeAccounts=It includes (credit - debit) of lines for product accounts in group INCOME
RulesAmountOnInOutBookkeepingRecord=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME"
RulesResultBookkeepingPredefined=It includes record in your Ledger with accounting accounts that has the group "EXPENSE" or "INCOME"
RulesResultBookkeepingPersonalized=It show record in your Ledger with accounting accounts grouped by personalized groups
@@ -280,6 +281,7 @@ PurchaseTurnoverCollected=Purchase turnover collected
RulesPurchaseTurnoverDue=- It includes the supplier's due invoices whether they are paid or not. - It is based on the invoice date of these invoices.
RulesPurchaseTurnoverIn=- It includes all the effective payments of invoices done to suppliers. - It is based on the payment date of these invoices
RulesPurchaseTurnoverTotalPurchaseJournal=It includes all debit lines from the purchase journal.
+RulesPurchaseTurnoverOfExpenseAccounts=It includes (debit - credit) of lines for product accounts in group EXPENSE
ReportPurchaseTurnover=Purchase turnover invoiced
ReportPurchaseTurnoverCollected=Purchase turnover collected
IncludeVarpaysInResults = Include various payments in reports
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index bb5e7c5e287..002aa63fa62 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -293,4 +293,6 @@ WarningFailedToAddFileIntoDatabaseIndex=Warning, failed to add file entry into E
WarningTheHiddenOptionIsOn=Warning, the hidden option %s is on.
WarningCreateSubAccounts=Warning, you can't create directly a sub account, you must create a third party or an user and assign them an accounting code to find them in this list
WarningAvailableOnlyForHTTPSServers=Available only if using HTTPS secured connection.
-WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here.
\ No newline at end of file
+WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So you may miss a lot of event here.
+ErrorActionCommPropertyUserowneridNotDefined=User's owner is required
+ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary
diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang
index 82f18107a5c..c0ff5e8e281 100644
--- a/htdocs/langs/en_US/eventorganization.lang
+++ b/htdocs/langs/en_US/eventorganization.lang
@@ -42,6 +42,8 @@ EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Template of email to send aft
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = Template of email to send after a subscription to an event has been paid.
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Template of email of massaction to attendes
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Template of email of massaction to speakers
+EVENTORGANIZATION_FILTERATTENDEES_CAT = Filter thirdpartie's select list in attendees creation card/form with category
+EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filter thirdpartie's select list in attendees creation card/form with customer type
#
# Object
@@ -50,6 +52,9 @@ EventOrganizationConfOrBooth= Conference Or Booth
ManageOrganizeEvent = Manage event organisation
ConferenceOrBooth = Conference Or Booth
ConferenceOrBoothTab = Conference Or Booth
+AmountOfSubscriptionPaid = Amount of subscription paid
+DateSubscription = Date of subscription
+ConferenceOrBoothAttendee = Conference Or Booth Attendee
#
# Template Mail
@@ -60,7 +65,7 @@ EventOrganizationEmailAskConf = Request for conference
EventOrganizationEmailAskBooth = Request for booth
EventOrganizationEmailSubsBooth = Subscription for booth
EventOrganizationEmailSubsEvent = Subscription for an event
-EventOrganizationMassEmailAttendees = Communication to attendes
+EventOrganizationMassEmailAttendees = Communication to attendees
EventOrganizationMassEmailSpeakers = Communication to speakers
#
@@ -72,10 +77,11 @@ AllowUnknownPeopleSuggestBooth=Allow unknown people to suggest booth
AllowUnknownPeopleSuggestBoothHelp=Allow unknown people to suggest booth
PriceOfRegistration=Price of registration
PriceOfRegistrationHelp=Price of registration
-PriceOfBooth=Price of subscription
-PriceOfBoothHelp=Price of subscription
+PriceOfBooth=Subscription price to stand a booth
+PriceOfBoothHelp=Subscription price to stand a booth
EventOrganizationICSLink=Link ICS for events
-
+ConferenceOrBoothInformation=Conference Or Booth informations
+Attendees = Attendees
#
# Status
#
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index e27ec6d9c43..dc2a83f2015 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -278,6 +278,7 @@ DateModificationShort=Modif. date
IPModification=Modification IP
DateLastModification=Latest modification date
DateValidation=Validation date
+DateSigning=Signing date
DateClosing=Closing date
DateDue=Due date
DateValue=Value date
@@ -1060,6 +1061,7 @@ YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode
Inventory=Inventory
AnalyticCode=Analytic code
TMenuMRP=MRP
+ShowCompanyInfos=Show company infos
ShowMoreInfos=Show More Infos
NoFilesUploadedYet=Please upload a document first
SeePrivateNote=See private note
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index 7a895bb1ca5..5ae6c7727b3 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -114,6 +114,7 @@ DemoCompanyAll=Company with multiple activities (all main modules)
CreatedBy=Created by %s
ModifiedBy=Modified by %s
ValidatedBy=Validated by %s
+SignedBy=Signed by %s
ClosedBy=Closed by %s
CreatedById=User id who created
ModifiedById=User id who made latest change
diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang
index 8e949661c49..24dc4cef0c6 100644
--- a/htdocs/langs/en_US/stocks.lang
+++ b/htdocs/langs/en_US/stocks.lang
@@ -62,6 +62,7 @@ EnhancedValueOfWarehouses=Warehouses value
UserWarehouseAutoCreate=Create a user warehouse automatically when creating a user
AllowAddLimitStockByWarehouse=Manage also value for minimum and desired stock per pairing (product-warehouse) in addition to the value for minimum and desired stock per product
RuleForWarehouse=Rule for warehouses
+WarehouseAskWarehouseOnThirparty=Set a warehouse on thirparty
WarehouseAskWarehouseDuringPropal=Set a warehouse on Commercial proposals
WarehouseAskWarehouseDuringOrder=Set a warehouse on Sale orders
UserDefaultWarehouse=Set a warehouse on Users
@@ -184,6 +185,7 @@ inventoryCreatePermission=Create new inventory
inventoryReadPermission=View inventories
inventoryWritePermission=Update inventories
inventoryValidatePermission=Validate inventory
+inventoryDeletePermission=Delete inventory
inventoryTitle=Inventory
inventoryListTitle=Inventories
inventoryListEmpty=No inventory in progress
@@ -242,4 +244,12 @@ InventoryRealQtyHelp=Set value to 0 to reset qty Keep field empty, or remove
UpdateByScaning=Update by scaning
UpdateByScaningProductBarcode=Update by scan (product barcode)
UpdateByScaningLot=Update by scan (lot|serial barcode)
-DisableStockChangeOfSubProduct=Deactivate the stock change for all the subproducts of this Kit during this movement.
\ No newline at end of file
+DisableStockChangeOfSubProduct=Deactivate the stock change for all the subproducts of this Kit during this movement.
+ImportFromCSV=Import CSV list of movement
+ChooseFileToImport=Upload file then click on the %s icon to select file as source import file...
+SelectAStockMovementFileToImport=select a stock movement file to import
+InfoTemplateImport=Uploaded file needs to have this format (* are mandatory fields): Source Warehouse* | Target Warehouse* | Product* | Quantity* | Lot/serial number CSV character separator must be "%s "
+LabelOfInventoryMovemement=Inventory %s
+ReOpen=Reopen
+ConfirmFinish=Confirm closing
+
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index 86ba2247682..a8b13c7e914 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -278,6 +278,7 @@ DateModificationShort=Date modif.
IPModification=Modification IP
DateLastModification=Date de dernière modification
DateValidation=Date validation
+DateSigning=Date signature
DateClosing=Date clôture
DateDue=Date échéance
DateValue=Date valeur
diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang
index 3023cd7216e..a8078129464 100644
--- a/htdocs/langs/fr_FR/other.lang
+++ b/htdocs/langs/fr_FR/other.lang
@@ -114,6 +114,7 @@ DemoCompanyAll=Société avec de multiples activités (tous les modules principa
CreatedBy=Créé par %s
ModifiedBy=Modifié par %s
ValidatedBy=Validé par %s
+SignedBy=Signé par %s
ClosedBy=Clôturé par %s
CreatedById=Id utilisateur créateur
ModifiedById=Id utilisateur du dernier changement
diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang
index c29c3b26d82..2d2be548f3b 100644
--- a/htdocs/langs/fr_FR/stocks.lang
+++ b/htdocs/langs/fr_FR/stocks.lang
@@ -62,6 +62,7 @@ EnhancedValueOfWarehouses=Valorisation des stocks
UserWarehouseAutoCreate=Créer automatiquement un stock/entrepôt propre à l'utilisateur lors de sa création
AllowAddLimitStockByWarehouse=Gérez également les valeurs des stocks minimums et souhaités par paire (produit-entrepôt) en plus des valeurs de minimums et souhaités par produit
RuleForWarehouse=Règle pour les entrepôts
+WarehouseAskWarehouseOnThirparty=Définir un entrepôt sur les tiers
WarehouseAskWarehouseDuringPropal=Définir un entrepôt sur les propositions
WarehouseAskWarehouseDuringOrder=Définir un entrepôt sur les commandes
UserDefaultWarehouse=Définir un entrepôt sur les utilisateurs
diff --git a/htdocs/loan/calcmens.php b/htdocs/loan/calcmens.php
index 5c6260dec84..19763c0a924 100644
--- a/htdocs/loan/calcmens.php
+++ b/htdocs/loan/calcmens.php
@@ -37,11 +37,11 @@ if (!defined('NOREQUIREAJAX')) {
require '../main.inc.php';
require DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php';
-$mens = GETPOST('mens');
-$capital = GETPOST('capital');
-$rate = GETPOST('rate');
-$echance = GETPOST('echeance');
-$nbterm = GETPOST('nbterm');
+$mens = price2num(GETPOST('mens'));
+$capital = price2num(GETPOST('capital'));
+$rate = price2num(GETPOST('rate'));
+$echance = GETPOST('echeance', 'int');
+$nbterm = GETPOST('nbterm', 'int');
top_httphead();
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index 9e9e1a0a992..c3c08b6cf2f 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -636,7 +636,7 @@ if ($id > 0) {
$sql .= " FROM ".MAIN_DB_PREFIX."payment_loan as p";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_typepayment = c.id";
$sql .= ", ".MAIN_DB_PREFIX."loan as l";
- $sql .= " WHERE p.fk_loan = ".$id;
+ $sql .= " WHERE p.fk_loan = ".((int) $id);
$sql .= " AND p.fk_loan = l.rowid";
$sql .= " AND l.entity IN ( ".getEntity('loan').")";
$sql .= " ORDER BY dp DESC";
diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php
index bc819f747ca..54d4607ab70 100644
--- a/htdocs/loan/class/loanschedule.class.php
+++ b/htdocs/loan/class/loanschedule.class.php
@@ -447,7 +447,7 @@ class LoanSchedule extends CommonObject
$sql .= " t.fk_user_creat,";
$sql .= " t.fk_user_modif";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as t";
- $sql .= " WHERE t.fk_loan = ".$loanid;
+ $sql .= " WHERE t.fk_loan = ".((int) $loanid);
dol_syslog(get_class($this)."::fetchAll", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -535,7 +535,7 @@ class LoanSchedule extends CommonObject
{
$sql = "SELECT p.datep";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_loan as p ";
- $sql .= " WHERE p.fk_loan = ".$loanid;
+ $sql .= " WHERE p.fk_loan = ".((int) $loanid);
$sql .= " ORDER BY p.datep DESC ";
$sql .= " LIMIT 1 ";
@@ -563,7 +563,7 @@ class LoanSchedule extends CommonObject
$sql = "SELECT p.rowid";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element." as p ";
- $sql .= " WHERE p.fk_loan = ".$loanid;
+ $sql .= " WHERE p.fk_loan = ".((int) $loanid);
if (!empty($datemax)) {
$sql .= " AND p.datep > '".$this->db->idate($datemax)."'";
}
diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php
index c7f1940943b..cf0a8e87f63 100644
--- a/htdocs/loan/class/paymentloan.class.php
+++ b/htdocs/loan/class/paymentloan.class.php
@@ -594,12 +594,12 @@ class PaymentLoan extends CommonObject
public function update_fk_bank($id_bank)
{
// phpcs:enable
- $sql = "UPDATE ".MAIN_DB_PREFIX."payment_loan SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."payment_loan SET fk_bank = ".((int) $id_bank)." WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
- $this->fk_bank = $id_bank;
+ $this->fk_bank = ((int) $id_bank);
return 1;
} else {
$this->error = $this->db->error();
diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php
index cf4466bb0da..675401e34f9 100644
--- a/htdocs/loan/payment/card.php
+++ b/htdocs/loan/payment/card.php
@@ -58,7 +58,7 @@ if ($id > 0) {
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->delete) {
$db->begin();
- $sql = "UPDATE ".MAIN_DB_PREFIX."loan_schedule SET fk_bank = 0 WHERE fk_bank = ".$payment->fk_bank;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."loan_schedule SET fk_bank = 0 WHERE fk_bank = ".((int) $payment->fk_bank);
$db->query($sql);
$fk_loan = $payment->fk_loan;
@@ -66,7 +66,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->loan->del
$result = $payment->delete($user);
if ($result > 0) {
$db->commit();
- header("Location: ".DOL_URL_ROOT."/loan/card.php?id=".$fk_loan);
+ header("Location: ".DOL_URL_ROOT."/loan/card.php?id=".urlencode($fk_loan));
exit;
} else {
setEventMessages($payment->error, $payment->errors, 'errors');
diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php
index eec24d9b3e2..58783be181e 100644
--- a/htdocs/loan/payment/payment.php
+++ b/htdocs/loan/payment/payment.php
@@ -239,7 +239,7 @@ if ($action == 'create') {
$sql = "SELECT SUM(amount_capital) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."payment_loan";
- $sql .= " WHERE fk_loan = ".$chid;
+ $sql .= " WHERE fk_loan = ".((int) $chid);
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 436870a20c3..a5d485d1b14 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -12,8 +12,9 @@
* Copyright (C) 2014-2015 Marcos García
* Copyright (C) 2015 Raphaël Doursenaud
* Copyright (C) 2020 Demarest Maxime
- * Copyright (C) 2020 Charlene Benke
+ * Copyright (C) 2020 Charlene Benke
* Copyright (C) 2021 Frédéric France
+ * 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
@@ -55,7 +56,7 @@ if (!empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) {
* only be guaranted by escaping data during output.
*
* @param string $val Value brut found int $_GET, $_POST or PHP_SELF
- * @param string $type 1=GET, 0=POST, 2=PHP_SELF, 3=GET without sql reserved keywords (the less tolerant test)
+ * @param string $type 0=POST, 1=GET, 2=PHP_SELF, 3=GET without sql reserved keywords (the less tolerant test)
* @return int >0 if there is an injection, 0 if none
*/
function testSqlAndScriptInject($val, $type)
@@ -149,7 +150,7 @@ function testSqlAndScriptInject($val, $type)
$inj += preg_match('/"/i', $val); // We refused " in GET parameters value.
}
if ($type == 2) {
- $inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces.
+ $inj += preg_match('/[:;"\'<>\?\(\){}\$%]/', $val); // PHP_SELF is a file system (or url path without parameters). It can contains spaces.
}
return $inj;
@@ -437,13 +438,13 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->gl
'confirm_create_user', 'confirm_create_thirdparty', 'confirm_purge', 'confirm_reject_check',
'delete', 'deletefilter', 'deleteoperation', 'deleteprof', 'deletepayment', 'disable',
'doprev', 'donext', 'dvprev', 'dvnext',
- 'enable'
+ 'enable', 'setpricelevel'
);
$sensitiveget = false;
if (in_array(GETPOST('action', 'aZ09'), $arrayofactiontoforcetokencheck)) {
$sensitiveget = true;
}
- if (preg_match('/^(disable_|enable_)/', GETPOST('action', 'aZ09'))) {
+ if (preg_match('/^(disable_|enable_|setremise)/', GETPOST('action', 'aZ09'))) {
$sensitiveget = true;
}
@@ -1981,6 +1982,20 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
}
$dropdownBody = '';
+ $dropdownBody .= '';
+ $dropdownBody .= '';
+
+ $dropdownBody .= ' ';
$dropdownBody .= '';
$dropdownBody .= '';
+ } else {
+ $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
+ }
+ }
+ }
+
+ if ($withpicto != 2) $result .= $this->ref;
+
+ $result .= $linkend;
+ //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
+
+ global $action, $hookmanager;
+ $hookmanager->initHooks(array('productfournisseurpricedao'));
+ $parameters = array('id'=>$this->id, 'getnomurl'=>$result);
+ $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
+ if ($reshook > 0) $result = $hookmanager->resPrint;
+ else $result .= $hookmanager->resPrint;
+
+ return $result;
+ }
+
+ /**
+ * Return the label of the status
+ *
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
+ * @return string Label of status
+ */
+ public function getLibStatut($mode = 0)
+ {
+ return $this->LibStatut($this->status, $mode);
+ }
+
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ /**
+ * Return the status
+ *
+ * @param int $status Id status
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
+ * @return string Label of status
+ */
+ public function LibStatut($status, $mode = 0)
+ {
+ // phpcs:enable
+ if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
+ global $langs;
+ //$langs->load("buypricehistory@buypricehistory");
+ $this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft');
+ $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled');
+ $this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled');
+ $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft');
+ $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled');
+ $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled');
+ }
+
+ $statusType = 'status'.$status;
+ //if ($status == self::STATUS_VALIDATED) $statusType = 'status1';
+ if ($status == self::STATUS_CANCELED) $statusType = 'status6';
+
+ return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
+ }
+
+ /**
+ * Load the info information in the object
+ *
+ * @param int $id Id of object
+ * @return void
+ */
+ public function info($id)
+ {
+ $sql = 'SELECT rowid, date_creation as datec, tms as datem,';
+ $sql .= ' fk_user_creat, fk_user_modif';
+ $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
+ $sql .= ' WHERE t.rowid = '.((int) $id);
+ $result = $this->db->query($sql);
+ if ($result) {
+ if ($this->db->num_rows($result)) {
+ $obj = $this->db->fetch_object($result);
+ $this->id = $obj->rowid;
+ if ($obj->fk_user_author) {
+ $cuser = new User($this->db);
+ $cuser->fetch($obj->fk_user_author);
+ $this->user_creation = $cuser;
+ }
+
+ if ($obj->fk_user_valid) {
+ $vuser = new User($this->db);
+ $vuser->fetch($obj->fk_user_valid);
+ $this->user_validation = $vuser;
+ }
+
+ if ($obj->fk_user_cloture) {
+ $cluser = new User($this->db);
+ $cluser->fetch($obj->fk_user_cloture);
+ $this->user_cloture = $cluser;
+ }
+
+ $this->date_creation = $this->db->jdate($obj->datec);
+ $this->date_modification = $this->db->jdate($obj->datem);
+ $this->date_validation = $this->db->jdate($obj->datev);
+ }
+
+ $this->db->free($result);
+ } else {
+ dol_print_error($this->db);
+ }
+ }
+
+ /**
+ * Initialise object with example values
+ * Id must be 0 if object instance is a specimen
+ *
+ * @return void
+ */
+ public function initAsSpecimen()
+ {
+ $this->initAsSpecimenCommon();
+ }
+
+ /**
+ * Returns the reference to the following non used object depending on the active numbering module.
+ *
+ * @return string Object free reference
+ */
+ public function getNextNumRef()
+ {
+ global $langs, $conf;
+ $langs->load("buypricehistory@buypricehistory");
+
+ if (empty($conf->global->BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON)) {
+ $conf->global->BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON = 'mod_productfournisseurprice_standard';
+ }
+
+ if (!empty($conf->global->BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON)) {
+ $mybool = false;
+
+ $file = $conf->global->BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON.".php";
+ $classname = $conf->global->BUYPRICEHISTORY_PRODUCTFOURNISSEURPRICE_ADDON;
+
+ // Include file with class
+ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
+ foreach ($dirmodels as $reldir) {
+ $dir = dol_buildpath($reldir."core/modules/buypricehistory/");
+
+ // Load file with numbering class (if found)
+ $mybool |= @include_once $dir.$file;
+ }
+
+ if ($mybool === false) {
+ dol_print_error('', "Failed to include file ".$file);
+ return '';
+ }
+
+ if (class_exists($classname)) {
+ $obj = new $classname();
+ $numref = $obj->getNextValue($this);
+
+ if ($numref != '' && $numref != '-1') {
+ return $numref;
+ } else {
+ $this->error = $obj->error;
+ //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error);
+ return "";
+ }
+ } else {
+ print $langs->trans("Error")." ".$langs->trans("ClassNotFound").' '.$classname;
+ return "";
+ }
+ } else {
+ print $langs->trans("ErrorNumberingModuleNotSetup", $this->element);
+ return "";
+ }
+ }
+
+ /**
+ * Create a document onto disk according to template module.
+ *
+ * @param string $modele Force template to use ('' to not force)
+ * @param Translate $outputlangs objet lang a utiliser pour traduction
+ * @param int $hidedetails Hide details of lines
+ * @param int $hidedesc Hide description
+ * @param int $hideref Hide ref
+ * @param null|array $moreparams Array to provide more information
+ * @return int 0 if KO, 1 if OK
+ */
+ public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
+ {
+ global $conf, $langs;
+
+ $result = 0;
+ $includedocgeneration = 0;
+
+ $langs->load("buypricehistory@buypricehistory");
+
+ if (!dol_strlen($modele)) {
+ $modele = 'standard_productfournisseurprice';
+
+ if (!empty($this->model_pdf)) {
+ $modele = $this->model_pdf;
+ } elseif (!empty($conf->global->PRODUCTFOURNISSEURPRICE_ADDON_PDF)) {
+ $modele = $conf->global->PRODUCTFOURNISSEURPRICE_ADDON_PDF;
+ }
+ }
+
+ $modelpath = "core/modules/buypricehistory/doc/";
+
+ if ($includedocgeneration && !empty($modele)) {
+ $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
+ }
+
+ return $result;
+ }
+}
diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php
index f7cf48df5e0..a1d92cc492a 100644
--- a/htdocs/product/class/propalmergepdfproduct.class.php
+++ b/htdocs/product/class/propalmergepdfproduct.class.php
@@ -239,7 +239,7 @@ class Propalmergepdfproduct extends CommonObject
$sql .= " FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product as t";
- $sql .= " WHERE t.fk_product = ".$product_id;
+ $sql .= " WHERE t.fk_product = ".((int) $product_id);
if ($conf->global->MAIN_MULTILANGS && !empty($lang)) {
$sql .= " AND t.lang = '".$this->db->escape($lang)."'";
}
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index 6dd6a0ac89d..442232686d3 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -171,11 +171,11 @@ $help_url = '';
$shortlabel = dol_trunc($object->label, 16);
if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) {
$title = $langs->trans('Product')." ".$shortlabel." - ".$langs->trans('AssociatedProducts');
- $help_url = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
+ $help_url = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos|DE:Modul_Produkte';
}
if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) {
$title = $langs->trans('Service')." ".$shortlabel." - ".$langs->trans('AssociatedProducts');
- $help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
+ $help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Leistungen';
}
llxHeader('', $title, $help_url);
diff --git a/htdocs/product/document.php b/htdocs/product/document.php
index c218d753d88..55cf32b7b56 100644
--- a/htdocs/product/document.php
+++ b/htdocs/product/document.php
@@ -52,7 +52,6 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productdocuments'));
@@ -98,6 +97,8 @@ $modulepart = 'produit';
$permissiontoadd = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer));
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
/*
* Actions
diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php
index 546c2050990..db0c427c334 100644
--- a/htdocs/product/dynamic_price/class/price_expression.class.php
+++ b/htdocs/product/dynamic_price/class/price_expression.class.php
@@ -327,7 +327,7 @@ class PriceExpression
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
- $sql .= " WHERE rowid = ".$rowid;
+ $sql .= " WHERE rowid = ".((int) $rowid);
dol_syslog(__METHOD__);
$resql = $this->db->query($sql);
diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php
index 29505ff8573..5286b932ca7 100644
--- a/htdocs/product/dynamic_price/class/price_global_variable.class.php
+++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php
@@ -250,7 +250,7 @@ class PriceGlobalVariable
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
- $sql .= " WHERE rowid = ".$rowid;
+ $sql .= " WHERE rowid = ".((int) $rowid);
dol_syslog(__METHOD__);
$resql = $this->db->query($sql);
diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php
index f43d6bc731d..96e77d661ab 100644
--- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php
+++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php
@@ -275,7 +275,7 @@ class PriceGlobalVariableUpdater
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element;
- $sql .= " WHERE rowid = ".$rowid;
+ $sql .= " WHERE rowid = ".((int) $rowid);
dol_syslog(__METHOD__);
$resql = $this->db->query($sql);
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 77659142744..0d5ea9647f5 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -62,9 +62,9 @@ $extrafields = new ExtraFields($db);
// If socid provided by ajax company selector
if (!empty($_REQUEST['search_fourn_id'])) {
- $_GET['id_fourn'] = $_GET['search_fourn_id'];
- $_POST['id_fourn'] = $_POST['search_fourn_id'];
- $_REQUEST['id_fourn'] = $_REQUEST['search_fourn_id'];
+ $_GET['id_fourn'] = GETPOST('search_fourn_id', 'int');
+ $_POST['id_fourn'] = GETPOST('search_fourn_id', 'int');
+ $_REQUEST['id_fourn'] = GETPOST('search_fourn_id', 'int');
}
// Security check
@@ -73,7 +73,6 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
if (empty($user->rights->fournisseur->lire)) {
accessforbidden();
@@ -114,6 +113,8 @@ if (!$sortorder) {
$sortorder = "ASC";
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
/*
* Actions
@@ -290,7 +291,7 @@ if (empty($reshook)) {
foreach ($extrafield_values as $key => $value) {
$sql .= str_replace('options_', '', $key).' = "'.$value.'", ';
}
- $sql = substr($sql, 0, strlen($sql) - 2).' WHERE fk_object = '.$object->product_fourn_price_id;
+ $sql = substr($sql, 0, strlen($sql) - 2).' WHERE fk_object = '.((int) $object->product_fourn_price_id);
}
// Execute the sql command from above
@@ -793,7 +794,7 @@ END;
$sql .= ", ".$key;
}
$sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields";
- $sql .= " WHERE fk_object = ".$rowid;
+ $sql .= " WHERE fk_object = ".((int) $rowid);
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
@@ -1145,7 +1146,7 @@ END;
$sql .= ", ".$key;
}
$sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price_extrafields";
- $sql .= " WHERE fk_object = ".$productfourn->product_fourn_price_id;
+ $sql .= " WHERE fk_object = ".((int) $productfourn->product_fourn_price_id);
$resql = $db->query($sql);
if ($resql) {
if ($db->num_rows($resql) != 1) {
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 9cdbe85cf4b..7d5f59c1ed9 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -41,6 +41,14 @@ if ($type == '' && !$user->rights->service->lire) {
$type = '0'; // Force global page on product page only
}
+// Load translation files required by the page
+$langs->loadLangs(array('products', 'stocks'));
+
+// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
+$hookmanager->initHooks(array('productindex'));
+
+$product_static = new Product($db);
+
// Security check
if ($type == '0') {
$result = restrictedArea($user, 'produit');
@@ -50,14 +58,6 @@ if ($type == '0') {
$result = restrictedArea($user, 'produit|service|expedition');
}
-// Load translation files required by the page
-$langs->loadLangs(array('products', 'stocks'));
-
-// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
-$hookmanager->initHooks(array('productindex'));
-
-$product_static = new Product($db);
-
/*
* View
diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php
index 92ad4c2176b..dda16746398 100644
--- a/htdocs/product/inventory/card.php
+++ b/htdocs/product/inventory/card.php
@@ -407,6 +407,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ''.$langs->trans("SetToDraft").' ';
}
}
+ // Back to validate
+ if ($object->status == $object::STATUS_RECORDED) {
+ if ($permissiontoadd) {
+ print ''.$langs->trans("ReOpen").' ';
+ }
+ }
// Modify
if ($object->status == $object::STATUS_DRAFT) {
diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php
index ce585c51a10..e872d7e353a 100644
--- a/htdocs/product/inventory/class/inventory.class.php
+++ b/htdocs/product/inventory/class/inventory.class.php
@@ -52,7 +52,7 @@ class Inventory extends CommonObject
/**
* @var int Does object support extrafields ? 0=No, 1=Yes
*/
- public $isextrafieldmanaged = 1;
+ public $isextrafieldmanaged = 0;
/**
* @var string String with name of icon for inventory
@@ -254,6 +254,7 @@ class Inventory extends CommonObject
*/
public function validate(User $user, $notrigger = false)
{
+ global $conf;
$this->db->begin();
$result = 0;
@@ -328,6 +329,7 @@ class Inventory extends CommonObject
} else {
$this->db->rollback();
}
+ return $result;
}
/**
@@ -357,6 +359,51 @@ class Inventory extends CommonObject
} else {
$this->db->rollback();
}
+ return $result;
+ }
+
+ /**
+ * Set to Recorded
+ *
+ * @param User $user User that creates
+ * @param bool $notrigger false=launch triggers after, true=disable triggers
+ * @return int <0 if KO, Id of created object if OK
+ */
+ public function setRecorded(User $user, $notrigger = false)
+ {
+ $this->db->begin();
+
+ $result = $this->setStatut($this::STATUS_RECORDED, null, '', 'INVENTORY_RECORDED');
+
+ if ($result > 0) {
+ $this->db->commit();
+ } else {
+ $this->db->rollback();
+ return -1;
+ }
+ return $result;
+ }
+
+ /**
+ * Set to Canceled
+ *
+ * @param User $user User that creates
+ * @param bool $notrigger false=launch triggers after, true=disable triggers
+ * @return int <0 if KO, Id of created object if OK
+ */
+ public function setCanceled(User $user, $notrigger = false)
+ {
+ $this->db->begin();
+
+ $result = $this->setStatut($this::STATUS_CANCELED, null, '', 'INVENTORY_CANCELED');
+
+ if ($result > 0) {
+ $this->db->commit();
+ } else {
+ $this->db->rollback();
+ return -1;
+ }
+ return $result;
}
/**
@@ -566,9 +613,11 @@ class Inventory extends CommonObject
$labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft');
$labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated').' ('.$langs->trans('Started').')';
$labelStatus[self::STATUS_CANCELED] = $langs->trans('Canceled');
+ $labelStatus[self::STATUS_RECORDED] = $langs->trans('Closed');
$labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft');
$labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Started');
$labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Canceled');
+ $labelStatusShort[self::STATUS_RECORDED] = $langs->trans('Closed');
return dolGetStatus($labelStatus[$status], $labelStatusShort[$status], '', 'status'.$status, $mode);
}
@@ -628,6 +677,7 @@ class Inventory extends CommonObject
public function initAsSpecimen()
{
$this->initAsSpecimenCommon();
+ $this->title = '';
}
}
diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php
index dea3b46c946..30f3a5347dd 100644
--- a/htdocs/product/inventory/inventory.php
+++ b/htdocs/product/inventory/inventory.php
@@ -27,6 +27,7 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/inventory/lib/inventory.lib.php';
+include_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
// Load translation files required by the page
$langs->loadLangs(array("stocks", "other", "productbatch"));
@@ -98,6 +99,71 @@ $now = dol_now();
* Actions
*/
+if ($action == 'cancel_record' && $permissiontoadd) {
+ $object->setCanceled($user);
+}
+
+if ($action == 'update' && $user->rights->stock->mouvement->creer) {
+ $stockmovment = new MouvementStock($db);
+ $stockmovment->origin = $object;
+
+ $sql = 'SELECT id.rowid, id.datec as date_creation, id.tms as date_modification, id.fk_inventory, id.fk_warehouse,';
+ $sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated';
+ $sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id';
+ $sql .= ' WHERE id.fk_inventory = '.$object->id;
+ $resql = $db->query($sql);
+ if ($resql) {
+ $num = $db->num_rows($resql);
+ $i = 0;
+ $totalarray = array();
+ while ($i < $num) {
+ $line = $db->fetch_object($resql);
+ $qty_view = $line->qty_view;
+ $qty_stock = $line->qty_stock;
+ $stock_movement_qty = $qty_view - $qty_stock;
+ if ($stock_movement_qty != 0) {
+ if ($stock_movement_qty < 0) {
+ $movement_type = 1;
+ } else {
+ $movement_type = 0;
+ }
+ $idstockmove = $stockmovment->_create($user, $line->fk_product, $line->fk_warehouse, $stock_movement_qty, $movement_type, 0, $langs->trans('LabelOfInventoryMovemement', $object->id), 'INV'.$object->id);
+ if ($idstockmove < 0) {
+ $error++;
+ setEventMessages($stockmovment->error, $stockmovment->errors, 'errors');
+ }
+ }
+ $i++;
+ }
+ if (!$error) {
+ $object->setRecorded($user);
+ }
+ }
+}
+
+if ($action =='updateinventorylines' && $permissiontoadd) {
+ $sql = 'SELECT id.rowid, id.datec as date_creation, id.tms as date_modification, id.fk_inventory, id.fk_warehouse,';
+ $sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated';
+ $sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id';
+ $sql .= ' WHERE id.fk_inventory = '.$object->id;
+
+ $resql = $db->query($sql);
+ if ($resql) {
+ $num = $db->num_rows($resql);
+ $i = 0;
+ $totalarray = array();
+ while ($i < $num) {
+ $line = $db->fetch_object($resql);
+ $lineid = $line->rowid;
+ $inventoryline = new InventoryLine($db);
+ $inventoryline->fetch($lineid);
+ $inventoryline->qty_view = GETPOST("id_".$inventoryline->id);
+ $inventoryline->update($user);
+ $i++;
+ }
+ }
+}
+
$parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
@@ -223,6 +289,18 @@ if ($object->id > 0) {
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
}
+ // Confirmation to close
+ if ($action == 'record') {
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Close'), $langs->trans('ConfirmFinish'), 'update', '', 0, 1);
+ $action = 'view';
+ }
+
+ // Confirmation to close
+ if ($action == 'confirm_cancel') {
+ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Cancel'), $langs->trans('ConfirmCancel'), 'cancel_record', '', 0, 1);
+ $action = 'view';
+ }
+
// Call Hook formConfirm
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
@@ -307,24 +385,7 @@ if ($object->id > 0) {
// Buttons for actions
- if ($action == 'record') {
- print '';
- } else {
+ if ($action != 'record') {
print ''."\n";
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
@@ -360,7 +421,8 @@ if ($object->id > 0) {
if ($object->status == Inventory::STATUS_VALIDATED) {
if ($permissiontoadd) {
- print '
id.'&action=record">'.$langs->trans("Finish").' '."\n";
+ print '
id.'&action=confirm_cancel">'.$langs->trans("Cancel").' '."\n";
+ print '
id.'&action=record">'.$langs->trans("Close").' '."\n";
} else {
print '
'.$langs->trans('Finish').' '."\n";
}
@@ -419,10 +481,12 @@ if ($object->id > 0) {
print '
';
print $form->textwithpicto($langs->trans("RealQty"), $langs->trans("InventoryRealQtyHelp"));
print ' ';
- // Actions
- print '
';
- print ' ';
- print '';
+ if ($object->status == $object::STATUS_VALIDATED) {
+ // Actions
+ print '
';
+ print ' ';
+ print '';
+ }
// Line to add a new line in inventory
if ($object->status == $object::STATUS_VALIDATED) {
@@ -453,7 +517,7 @@ if ($object->id > 0) {
$sql = 'SELECT id.rowid, id.datec as date_creation, id.tms as date_modification, id.fk_inventory, id.fk_warehouse,';
$sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated';
$sql .= ' FROM '.MAIN_DB_PREFIX.'inventorydet as id';
- $sql .= ' WHERE id.fk_inventory = '.$object->id;
+ $sql .= ' WHERE id.fk_inventory = '.((int) $object->id);
$cacheOfProducts = array();
$cacheOfWarehouses = array();
@@ -505,15 +569,20 @@ if ($object->id > 0) {
}
print '
';
- print 'TODO';
+ print $obj->qty_stock;
print ' ';
print '
';
- print ' rowid).'">';
- print ' ';
- print '
';
- print ''.img_delete().' ';
- print ' ';
-
+ if ($object->status == $object::STATUS_VALIDATED) {
+ $qty_view = GETPOST("id_".$obj->rowid) ? GETPOST("id_".$obj->rowid) : $obj->qty_view;
+ print '
';
+ print '
';
+ print '';
+ print ''.img_delete().' ';
+ print ' ';
+ } else {
+ print $obj->qty_view;
+ print '';
+ }
print '';
$i++;
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index a7cbc76b103..dc035187f30 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -11,7 +11,7 @@
* Copyright (C) 2013 Adolfo segura
* Copyright (C) 2015 Jean-François Ferry
* Copyright (C) 2016 Ferran Marcet
- * Copyright (C) 2020 Alexandre Spangaro
+ * Copyright (C) 2020-2021 Open-DSI
*
* 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
@@ -191,6 +191,8 @@ if (empty($conf->global->PRODUIT_MULTIPRICES)) {
$isInEEC = isInEEC($mysoc);
+$alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p" : "pa";
+
// Definition of fields for lists
$arrayfields = array(
'p.ref'=>array('label'=>"Ref", 'checked'=>1),
@@ -226,12 +228,12 @@ $arrayfields = array(
'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(!empty($conf->productbatch->enabled)), 'position'=>60),
'p.fk_country'=>array('label'=>"Country", 'checked'=>0, 'position'=>100),
'p.fk_state'=>array('label'=>"State", 'checked'=>0, 'position'=>101),
- 'p.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'position'=>400),
- 'p.accountancy_code_sell_intra'=>array('label'=>"ProductAccountancySellIntraCode", 'checked'=>0, 'enabled'=>$isInEEC, 'position'=>401),
- 'p.accountancy_code_sell_export'=>array('label'=>"ProductAccountancySellExportCode", 'checked'=>0, 'position'=>402),
- 'p.accountancy_code_buy'=>array('label'=>"ProductAccountancyBuyCode", 'checked'=>0, 'position'=>403),
- 'p.accountancy_code_buy_intra'=>array('label'=>"ProductAccountancyBuyIntraCode", 'checked'=>0, 'enabled'=>$isInEEC, 'position'=>404),
- 'p.accountancy_code_buy_export'=>array('label'=>"ProductAccountancyBuyExportCode", 'checked'=>0, 'position'=>405),
+ $alias_product_perentity . '.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'position'=>400),
+ $alias_product_perentity . '.accountancy_code_sell_intra'=>array('label'=>"ProductAccountancySellIntraCode", 'checked'=>0, 'enabled'=>$isInEEC, 'position'=>401),
+ $alias_product_perentity . '.accountancy_code_sell_export'=>array('label'=>"ProductAccountancySellExportCode", 'checked'=>0, 'position'=>402),
+ $alias_product_perentity . '.accountancy_code_buy'=>array('label'=>"ProductAccountancyBuyCode", 'checked'=>0, 'position'=>403),
+ $alias_product_perentity . '.accountancy_code_buy_intra'=>array('label'=>"ProductAccountancyBuyIntraCode", 'checked'=>0, 'enabled'=>$isInEEC, 'position'=>404),
+ $alias_product_perentity . '.accountancy_code_buy_export'=>array('label'=>"ProductAccountancyBuyExportCode", 'checked'=>0, 'position'=>405),
'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'p.tosell'=>array('label'=>$langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Sell").')', 'checked'=>1, 'position'=>1000),
@@ -358,8 +360,12 @@ if ($search_type != '' && $search_type != '-1') {
$sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.fk_product_type, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type, p.entity,';
$sql .= ' p.fk_product_type, p.duration, p.finished, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,';
-$sql .= ' p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,';
-$sql .= ' p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,';
+$sql .= ' p.tobatch,';
+if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
+ $sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,";
+} else {
+ $sql .= " pa.accountancy_code_sell, pa.accountancy_code_sell_intra, pa.accountancy_code_sell_export, pa.accountancy_code_buy, pa.accountancy_code_buy_intra, pa.accountancy_code_buy_export,";
+}
$sql .= ' p.datec as date_creation, p.tms as date_update, p.pmp, p.stock, p.cost_price,';
$sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units, fk_country, fk_state,';
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
@@ -380,6 +386,9 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
+if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
+ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as pa ON pa.fk_product = p.rowid AND pa.entity = " . ((int) $conf->entity);
+}
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)";
}
@@ -464,7 +473,7 @@ if ($searchCategoryProductOperator == 1) {
if (intval($searchCategoryProduct) == -2) {
$searchCategoryProductSqlList[] = "cp.fk_categorie IS NULL";
} elseif (intval($searchCategoryProduct) > 0) {
- $searchCategoryProductSqlList[] = "p.rowid IN (SELECT fk_product FROM ".MAIN_DB_PREFIX."categorie_product WHERE fk_categorie = ".$searchCategoryProduct.")";
+ $searchCategoryProductSqlList[] = "p.rowid IN (SELECT fk_product FROM ".MAIN_DB_PREFIX."categorie_product WHERE fk_categorie = ".((int) $searchCategoryProduct).")";
}
}
if (!empty($searchCategoryProductSqlList)) {
@@ -484,22 +493,22 @@ if ($search_finished >= 0 && $search_finished !== '') {
$sql .= " AND p.finished = ".((int) $search_finished);
}
if ($search_accountancy_code_sell) {
- $sql .= natural_search('p.accountancy_code_sell', $search_accountancy_code_sell);
+ $sql .= natural_search($alias_product_perentity . '.accountancy_code_sell', $search_accountancy_code_sell);
}
if ($search_accountancy_code_sell_intra) {
- $sql .= natural_search('p.accountancy_code_sell_intra', $search_accountancy_code_sell_intra);
+ $sql .= natural_search($alias_product_perentity . '.accountancy_code_sell_intra', $search_accountancy_code_sell_intra);
}
if ($search_accountancy_code_sell_export) {
- $sql .= natural_search('p.accountancy_code_sell_export', $search_accountancy_code_sell_export);
+ $sql .= natural_search($alias_product_perentity . '.accountancy_code_sell_export', $search_accountancy_code_sell_export);
}
if ($search_accountancy_code_buy) {
- $sql .= natural_search('p.accountancy_code_buy', $search_accountancy_code_buy);
+ $sql .= natural_search($alias_product_perentity . '.accountancy_code_buy', $search_accountancy_code_buy);
}
if ($search_accountancy_code_buy_intra) {
- $sql .= natural_search('p.accountancy_code_buy_intra', $search_accountancy_code_buy_intra);
+ $sql .= natural_search($alias_product_perentity . '.accountancy_code_buy_intra', $search_accountancy_code_buy_intra);
}
if ($search_accountancy_code_buy_export) {
- $sql .= natural_search('p.accountancy_code_buy_export', $search_accountancy_code_buy_export);
+ $sql .= natural_search($alias_product_perentity . '.accountancy_code_buy_export', $search_accountancy_code_buy_export);
}
// Add where from extra fields
@@ -510,8 +519,12 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // No
$sql .= $hookmanager->resPrint;
$sql .= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type,";
$sql .= " p.fk_product_type, p.duration, p.finished, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,";
-$sql .= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,';
-$sql .= ' p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export, p.pmp, p.cost_price, p.stock,';
+$sql .= ' p.datec, p.tms, p.entity, p.tobatch, p.pmp, p.cost_price, p.stock,';
+if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
+ $sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export,";
+} else {
+ $sql .= " pa.accountancy_code_sell, pa.accountancy_code_sell_intra, pa.accountancy_code_sell_export, pa.accountancy_code_buy, pa.accountancy_code_buy_intra, pa.accountancy_code_buy_export,";
+}
$sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units, p.fk_country, p.fk_state';
if (!empty($conf->global->PRODUCT_USE_UNITS)) {
$sql .= ', p.fk_unit, cu.label';
@@ -991,23 +1004,23 @@ if ($resql) {
print ''.$formcompany->select_state($search_state, $search_country).' ';
}
// Accountancy code sell
- if (!empty($arrayfields['p.accountancy_code_sell']['checked'])) {
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['checked'])) {
print ' ';
}
- if (!empty($arrayfields['p.accountancy_code_sell_intra']['checked'])) {
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_intra']['checked'])) {
print ' ';
}
- if (!empty($arrayfields['p.accountancy_code_sell_export']['checked'])) {
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_export']['checked'])) {
print ' ';
}
// Accountancy code buy
- if (!empty($arrayfields['p.accountancy_code_buy']['checked'])) {
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy']['checked'])) {
print ' ';
}
- if (!empty($arrayfields['p.accountancy_code_buy_intra']['checked'])) {
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_intra']['checked'])) {
print ' ';
}
- if (!empty($arrayfields['p.accountancy_code_buy_export']['checked'])) {
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export']['checked'])) {
print ' ';
}
// Extra fields
@@ -1154,23 +1167,23 @@ if ($resql) {
if (!empty($arrayfields['p.fk_state']['checked'])) {
print_liste_field_titre($arrayfields['p.fk_state']['label'], $_SERVER["PHP_SELF"], "p.fk_state", "", $param, '', $sortfield, $sortorder);
}
- if (!empty($arrayfields['p.accountancy_code_sell']['checked'])) {
- print_liste_field_titre($arrayfields['p.accountancy_code_sell']['label'], $_SERVER["PHP_SELF"], "p.accountancy_code_sell", "", $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['checked'])) {
+ print_liste_field_titre($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity . ".accountancy_code_sell", "", $param, '', $sortfield, $sortorder);
}
- if (!empty($arrayfields['p.accountancy_code_sell_intra']['checked'])) {
- print_liste_field_titre($arrayfields['p.accountancy_code_sell_intra']['label'], $_SERVER["PHP_SELF"], "p.accountancy_code_sell_intra", "", $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_intra']['checked'])) {
+ print_liste_field_titre($arrayfields[$alias_product_perentity . '.accountancy_code_sell_intra']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity . ".accountancy_code_sell_intra", "", $param, '', $sortfield, $sortorder);
}
- if (!empty($arrayfields['p.accountancy_code_sell_export']['checked'])) {
- print_liste_field_titre($arrayfields['p.accountancy_code_sell_export']['label'], $_SERVER["PHP_SELF"], "p.accountancy_code_sell_export", "", $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_export']['checked'])) {
+ print_liste_field_titre($arrayfields[$alias_product_perentity . '.accountancy_code_sell_export']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity . ".accountancy_code_sell_export", "", $param, '', $sortfield, $sortorder);
}
- if (!empty($arrayfields['p.accountancy_code_buy']['checked'])) {
- print_liste_field_titre($arrayfields['p.accountancy_code_buy']['label'], $_SERVER["PHP_SELF"], "p.accountancy_code_buy", "", $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy']['checked'])) {
+ print_liste_field_titre($arrayfields[$alias_product_perentity . '.accountancy_code_buy']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity . ".accountancy_code_buy", "", $param, '', $sortfield, $sortorder);
}
- if (!empty($arrayfields['p.accountancy_code_buy_intra']['checked'])) {
- print_liste_field_titre($arrayfields['p.accountancy_code_buy_intra']['label'], $_SERVER["PHP_SELF"], "p.accountancy_code_buy_intra", "", $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_intra']['checked'])) {
+ print_liste_field_titre($arrayfields[$alias_product_perentity . '.accountancy_code_buy_intra']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity . ".accountancy_code_buy_intra", "", $param, '', $sortfield, $sortorder);
}
- if (!empty($arrayfields['p.accountancy_code_buy_export']['checked'])) {
- print_liste_field_titre($arrayfields['p.accountancy_code_buy_export']['label'], $_SERVER["PHP_SELF"], "p.accountancy_code_buy_export", "", $param, '', $sortfield, $sortorder);
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export']['checked'])) {
+ print_liste_field_titre($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export']['label'], $_SERVER["PHP_SELF"], $alias_product_perentity . ".accountancy_code_buy_export", "", $param, '', $sortfield, $sortorder);
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
@@ -1517,7 +1530,7 @@ if ($resql) {
// then reuse the cache array if we need prices for other price levels
$sqlp = "SELECT p.rowid, p.fk_product, p.price, p.price_ttc, p.price_level, p.date_price, p.price_base_type";
$sqlp .= " FROM ".MAIN_DB_PREFIX."product_price as p";
- $sqlp .= " WHERE fk_product = ".$obj->rowid;
+ $sqlp .= " WHERE fk_product = ".((int) $obj->rowid);
$sqlp .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC";
$resultp = $db->query($sqlp);
if ($resultp) {
@@ -1695,38 +1708,38 @@ if ($resql) {
}
}
// Accountancy code sell
- if (!empty($arrayfields['p.accountancy_code_sell']['checked'])) {
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell']['checked'])) {
print ''.$obj->accountancy_code_sell.' ';
if (!$i) {
$totalarray['nbfield']++;
}
}
- if (!empty($arrayfields['p.accountancy_code_sell_intra']['checked'])) {
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_intra']['checked'])) {
print ''.$obj->accountancy_code_sell_intra.' ';
if (!$i) {
$totalarray['nbfield']++;
}
}
- if (!empty($arrayfields['p.accountancy_code_sell_export']['checked'])) {
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_sell_export']['checked'])) {
print ''.$obj->accountancy_code_sell_export.' ';
if (!$i) {
$totalarray['nbfield']++;
}
}
// Accountancy code buy
- if (!empty($arrayfields['p.accountancy_code_buy']['checked'])) {
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy']['checked'])) {
print ''.$obj->accountancy_code_buy.' ';
if (!$i) {
$totalarray['nbfield']++;
}
}
- if (!empty($arrayfields['p.accountancy_code_buy_intra']['checked'])) {
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_intra']['checked'])) {
print ''.$obj->accountancy_code_buy_intra.' ';
if (!$i) {
$totalarray['nbfield']++;
}
}
- if (!empty($arrayfields['p.accountancy_code_buy_export']['checked'])) {
+ if (!empty($arrayfields[$alias_product_perentity . '.accountancy_code_buy_export']['checked'])) {
print ''.$obj->accountancy_code_buy_export.' ';
if (!$i) {
$totalarray['nbfield']++;
diff --git a/htdocs/product/note.php b/htdocs/product/note.php
index 348d5956588..add915181a2 100644
--- a/htdocs/product/note.php
+++ b/htdocs/product/note.php
@@ -43,7 +43,6 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
$object = new Product($db);
if ($id > 0 || !empty($ref)) {
@@ -52,6 +51,8 @@ if ($id > 0 || !empty($ref)) {
$permissionnote = $user->rights->produit->creer; // Used by the include of actions_setnotes.inc.php
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
/*
* Actions
diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php
index 2b84f11ac66..f23b6eae92d 100644
--- a/htdocs/product/popuprop.php
+++ b/htdocs/product/popuprop.php
@@ -42,7 +42,6 @@ $mode = GETPOST('mode', 'alpha') ? GETPOST('mode', 'alpha') : '';
if (!empty($user->socid)) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -61,9 +60,10 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
-
$staticproduct = new Product($db);
+$result = restrictedArea($user, 'produit|service', 0, 'product&product');
+
/*
* View
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index ee86d43c09f..a08eaa8558b 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -68,7 +68,6 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
if ($id > 0 || !empty($ref)) {
$object = new Product($db);
@@ -83,6 +82,8 @@ if ((!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productpricecard', 'globalcard'));
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
/*
* Actions
@@ -429,12 +430,12 @@ if (empty($reshook)) {
// Ajout / mise à jour
if ($rowid > 0) {
$sql = "UPDATE ".MAIN_DB_PREFIX."product_price_by_qty SET";
- $sql .= " price='".$db->escape($price)."',";
- $sql .= " unitprice=".$unitPrice.",";
- $sql .= " quantity=".$quantity.",";
- $sql .= " remise_percent=".$remise_percent.",";
- $sql .= " remise=".$remise;
- $sql .= " WHERE rowid = ".$rowid;
+ $sql .= " price=".((float) $price)."',";
+ $sql .= " unitprice=".((float) $unitPrice).",";
+ $sql .= " quantity=".((float) $quantity).",";
+ $sql .= " remise_percent=".((float) $remise_percent).",";
+ $sql .= " remise=".((float) $remise);
+ $sql .= " WHERE rowid = ".((int) $rowid);
$result = $db->query($sql);
if (!$result) {
@@ -442,7 +443,7 @@ if (empty($reshook)) {
}
} else {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_price_by_qty (fk_product_price,price,unitprice,quantity,remise_percent,remise) values (";
- $sql .= $priceid.','.$price.','.$unitPrice.','.$quantity.','.$remise_percent.','.$remise.')';
+ $sql .= ((int) $priceid).','.((float) $price).','.((float) $unitPrice).','.((float) $quantity).','.((float) $remise_percent).','.((float) $remise).')';
$result = $db->query($sql);
if (!$result) {
@@ -460,7 +461,7 @@ if (empty($reshook)) {
$rowid = GETPOST('rowid', 'int');
if (!empty($rowid)) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_price_by_qty";
- $sql .= " WHERE rowid = ".$rowid;
+ $sql .= " WHERE rowid = ".((int) $rowid);
$result = $db->query($sql);
} else {
@@ -472,7 +473,7 @@ if (empty($reshook)) {
$priceid = GETPOST('priceid', 'int');
if (!empty($rowid)) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_price_by_qty";
- $sql .= " WHERE fk_product_price = ".$priceid;
+ $sql .= " WHERE fk_product_price = ".((int) $priceid);
$result = $db->query($sql);
} else {
@@ -1413,11 +1414,11 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
$sql .= " p.date_price as dp, p.fk_price_expression, u.rowid as user_id, u.login";
$sql .= " FROM ".MAIN_DB_PREFIX."product_price as p,";
$sql .= " ".MAIN_DB_PREFIX."user as u";
- $sql .= " WHERE fk_product = ".$object->id;
+ $sql .= " WHERE fk_product = ".((int) $object->id);
$sql .= " AND p.entity IN (".getEntity('productprice').")";
$sql .= " AND p.fk_user_author = u.rowid";
if (!empty($socid) && !empty($conf->global->PRODUIT_MULTIPRICES)) {
- $sql .= " AND p.price_level = ".$soc->price_level;
+ $sql .= " AND p.price_level = ".((int) $soc->price_level);
}
$sql .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC";
// $sql .= $db->plimit();
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index 5e0720e106c..342acb49b6e 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -35,13 +35,6 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
// Load translation files required by the page
$langs->loadLangs(array('products', 'stocks'));
-// Security check
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result = restrictedArea($user, 'produit|service');
-
-
$action = GETPOST('action', 'aZ09');
$sref = GETPOST("sref", 'alpha');
$snom = GETPOST("snom", 'alpha');
@@ -99,6 +92,10 @@ if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productreassortlist'));
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'produit|service', 0, 'product&product');
/*
diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php
index a443fe10f62..38b16cea44a 100644
--- a/htdocs/product/reassortlot.php
+++ b/htdocs/product/reassortlot.php
@@ -37,13 +37,6 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
// Load translation files required by the page
$langs->loadLangs(array('products', 'stocks', 'productbatch'));
-// Security check
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result = restrictedArea($user, 'produit|service');
-
-
$action = GETPOST('action', 'aZ09');
$sref = GETPOST("sref", 'alpha');
$snom = GETPOST("snom", 'alpha');
@@ -89,6 +82,11 @@ if (!empty($canvas)) {
$objcanvas->getCanvas('product', 'list', $canvas);
}
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'produit|service', 0, 'product&product');
/*
diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index 30dba05e417..214a12ead14 100644
--- a/htdocs/product/stock/class/entrepot.class.php
+++ b/htdocs/product/stock/class/entrepot.class.php
@@ -436,7 +436,7 @@ class Entrepot extends CommonObject
$sql .= " model_pdf, import_key";
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot";
if ($id) {
- $sql .= " WHERE rowid = '".$id."'";
+ $sql .= " WHERE rowid = ".((int) $id);
} else {
$sql .= " WHERE entity = ".$conf->entity;
if ($ref) {
@@ -782,7 +782,7 @@ class Entrepot extends CommonObject
$parentid = $this->fk_parent; // If parent_id not defined on current object, we do not start consecutive searches of parents
$i = 0;
while ($parentid > 0 && $i < $protection) {
- $sql = 'SELECT fk_parent FROM '.MAIN_DB_PREFIX.'entrepot WHERE rowid = '.$parentid;
+ $sql = 'SELECT fk_parent FROM '.MAIN_DB_PREFIX.'entrepot WHERE rowid = '.((int) $parentid);
$resql = $this->db->query($sql);
if ($resql) {
$objarbo = $this->db->fetch_object($resql);
@@ -817,7 +817,7 @@ class Entrepot extends CommonObject
$sql = 'SELECT rowid
FROM '.MAIN_DB_PREFIX.'entrepot
- WHERE fk_parent = '.$id;
+ WHERE fk_parent = '.((int) $id);
$resql = $this->db->query($sql);
if ($resql) {
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index 8b2d729c29c..d8dad67bee2 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -488,7 +488,7 @@ class MouvementStock extends CommonObject
if (!$error)
{
$sql = "SELECT rowid, reel FROM ".MAIN_DB_PREFIX."product_stock";
- $sql .= " WHERE fk_entrepot = ".$entrepot_id." AND fk_product = ".$fk_product; // This is a unique key
+ $sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product); // This is a unique key
dol_syslog(get_class($this)."::_create check if a record already exists in product_stock", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -544,12 +544,12 @@ class MouvementStock extends CommonObject
{
if ($alreadyarecord > 0)
{
- $sql = "UPDATE ".MAIN_DB_PREFIX."product_stock SET reel = reel + ".$qty;
- $sql .= " WHERE fk_entrepot = ".$entrepot_id." AND fk_product = ".$fk_product;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."product_stock SET reel = reel + ".((float) $qty);
+ $sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product);
} else {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_stock";
$sql .= " (reel, fk_entrepot, fk_product) VALUES ";
- $sql .= " (".$qty.", ".$entrepot_id.", ".$fk_product.")";
+ $sql .= " (".((float) $qty).", ".((int) $entrepot_id).", ".((int) $fk_product).")";
}
dol_syslog(get_class($this)."::_create update stock value", LOG_DEBUG);
@@ -602,11 +602,11 @@ class MouvementStock extends CommonObject
$newpmp = price2num($newpmp, 'MU');
// $sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".$newpmp.", stock = ".$this->db->ifsql("stock IS NULL", 0, "stock") . " + ".$qty;
- // $sql.= " WHERE rowid = ".$fk_product;
+ // $sql.= " WHERE rowid = ".((int) $fk_product);
// Update pmp + denormalized fields because we change content of produt_stock. Warning: Do not use "SET p.stock", does not works with pgsql
- $sql = "UPDATE ".MAIN_DB_PREFIX."product as p SET pmp = ".$newpmp.",";
+ $sql = "UPDATE ".MAIN_DB_PREFIX."product as p SET pmp = ".((float) $newpmp).",";
$sql .= " stock=(SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock as ps WHERE ps.fk_product = p.rowid)";
- $sql .= " WHERE rowid = ".$fk_product;
+ $sql .= " WHERE rowid = ".((int) $fk_product);
dol_syslog(get_class($this)."::_create update AWP", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -763,7 +763,7 @@ class MouvementStock extends CommonObject
$sql = "SELECT fk_product_pere, fk_product_fils, qty";
$sql .= " FROM ".MAIN_DB_PREFIX."product_association";
- $sql .= " WHERE fk_product_pere = ".$idProduct;
+ $sql .= " WHERE fk_product_pere = ".((int) $idProduct);
$sql .= " AND incdec = 1";
dol_syslog(get_class($this)."::_createSubProduct for parent product ".$idProduct, LOG_DEBUG);
@@ -875,7 +875,7 @@ class MouvementStock extends CommonObject
$nbSP=0;
$resql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."product_association";
- $resql.= " WHERE fk_product_pere = ".$id;
+ $resql.= " WHERE fk_product_pere = ".((int) $id);
if ($this->db->query($resql))
{
$obj=$this->db->fetch_object($resql);
@@ -896,7 +896,7 @@ class MouvementStock extends CommonObject
$nb = 0;
$sql = 'SELECT SUM(value) as nb from '.MAIN_DB_PREFIX.'stock_mouvement';
- $sql .= ' WHERE fk_product = '.$productidselected;
+ $sql .= ' WHERE fk_product = '.((int) $productidselected);
$sql .= " AND datem < '".$this->db->idate($datebefore)."'";
dol_syslog(get_class($this).__METHOD__.'', LOG_DEBUG);
@@ -1284,7 +1284,7 @@ class MouvementStock extends CommonObject
$sql = "SELECT sum(pb.qty) as cpt";
$sql .= " FROM ".MAIN_DB_PREFIX."product_batch as pb";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."product_stock as ps ON ps.rowid = pb.fk_product_stock";
- $sql .= " WHERE ps.fk_product = " . $fk_product;
+ $sql .= " WHERE ps.fk_product = " . ((int) $fk_product);
$sql .= " AND pb.batch = '" . $this->db->escape($batch) . "'";
$result = $this->db->query($sql);
diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php
index 9b6c0a38a1c..f05d6ebc168 100644
--- a/htdocs/product/stock/class/productlot.class.php
+++ b/htdocs/product/stock/class/productlot.class.php
@@ -275,7 +275,7 @@ class Productlot extends CommonObject
$sql .= " t.import_key";
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
if ($product_id > 0 && $batch != '') {
- $sql .= " WHERE t.batch = '".$this->db->escape($batch)."' AND t.fk_product = ".$product_id;
+ $sql .= " WHERE t.batch = '".$this->db->escape($batch)."' AND t.fk_product = ".((int) $product_id);
} else {
$sql .= ' WHERE t.rowid = '.((int) $id);
}
diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php
index 88fc636e07e..aea8c3e1f14 100644
--- a/htdocs/product/stock/class/productstockentrepot.class.php
+++ b/htdocs/product/stock/class/productstockentrepot.class.php
@@ -196,7 +196,7 @@ class ProductStockEntrepot extends CommonObject
if (!empty($id)) {
$sql .= ' WHERE t.rowid = '.((int) $id);
} else {
- $sql .= ' WHERE t.fk_product = '.$fk_product.' AND t.fk_entrepot = '.$fk_entrepot;
+ $sql .= ' WHERE t.fk_product = '.((int) $fk_product).' AND t.fk_entrepot = '.((int) $fk_entrepot);
}
$resql = $this->db->query($sql);
diff --git a/htdocs/product/stock/fiche-valo.php b/htdocs/product/stock/fiche-valo.php
index 34380efbe7a..a2a15a34e53 100644
--- a/htdocs/product/stock/fiche-valo.php
+++ b/htdocs/product/stock/fiche-valo.php
@@ -28,7 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('products', 'stocks', 'companies'));
-$mesg = '';
+
+$id = GETPOST('id', 'int');
// Security check
$result = restrictedArea($user, 'stock');
@@ -43,18 +44,13 @@ $form = new Form($db);
$help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
llxHeader("", $langs->trans("WarehouseCard"), $help_url);
-if ($_GET["id"]) {
- if ($mesg) {
- print $mesg;
- }
-
+if ($id > 0) {
$entrepot = new Entrepot($db);
- $result = $entrepot->fetch($_GET["id"]);
+ $result = $entrepot->fetch($id);
if ($result < 0) {
dol_print_error($db);
}
-
$head = stock_prepare_head($entrepot);
print dol_get_fiche_head($head, 'value', $langs->trans("Warehouse"), 0, 'stock');
diff --git a/htdocs/product/stock/lib/replenishment.lib.php b/htdocs/product/stock/lib/replenishment.lib.php
index d0415ccad78..1faa67ad860 100644
--- a/htdocs/product/stock/lib/replenishment.lib.php
+++ b/htdocs/product/stock/lib/replenishment.lib.php
@@ -39,7 +39,7 @@ function dolDispatchToDo($order_id)
// Count nb of quantity dispatched per product
$sql = 'SELECT fk_product, SUM(qty) FROM '.MAIN_DB_PREFIX.'commande_fournisseur_dispatch';
- $sql .= ' WHERE fk_commande = '.$order_id;
+ $sql .= ' WHERE fk_commande = '.((int) $order_id);
$sql .= ' GROUP BY fk_product';
$sql .= ' ORDER by fk_product';
$resql = $db->query($sql);
@@ -51,7 +51,7 @@ function dolDispatchToDo($order_id)
// Count nb of quantity to dispatch per product
$sql = 'SELECT fk_product, SUM(qty) FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet';
- $sql .= ' WHERE fk_commande = '.$order_id;
+ $sql .= ' WHERE fk_commande = '.((int) $order_id);
$sql .= ' AND fk_product > 0';
if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) {
$sql .= ' AND product_type = 0';
diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php
index 5a5808b04f3..0627a6a1cf7 100644
--- a/htdocs/product/stock/massstockmove.php
+++ b/htdocs/product/stock/massstockmove.php
@@ -30,6 +30,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/modules/import/import_csv.modules.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/import.lib.php';
+
+$confirm = GETPOST('confirm', 'alpha');
+$filetoimport = GETPOST('filetoimport');
// Load translation files required by the page
$langs->loadLangs(array('products', 'stocks', 'orders', 'productbatch'));
@@ -80,7 +86,7 @@ if (!empty($_SESSION['massstockmove'])) {
* Actions
*/
-if ($action == 'addline') {
+if ($action == 'addline' && !empty($user->rights->stock->mouvement->creer)) {
if (!($id_product > 0)) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors');
@@ -142,7 +148,7 @@ if ($action == 'addline') {
}
}
-if ($action == 'delline' && $idline != '') {
+if ($action == 'delline' && $idline != '' && !empty($user->rights->stock->mouvement->creer)) {
if (!empty($listofdata[$idline])) {
unset($listofdata[$idline]);
}
@@ -153,7 +159,7 @@ if ($action == 'delline' && $idline != '') {
}
}
-if ($action == 'createmovements') {
+if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->creer)) {
$error = 0;
if (!GETPOST("label")) {
@@ -288,6 +294,131 @@ if ($action == 'createmovements') {
}
}
+if ($action == 'importCSV' && !empty($user->rights->stock->mouvement->creer)) {
+ dol_mkdir($conf->stock->dir_temp);
+ $nowyearmonth = dol_print_date(dol_now(), '%Y%m%d%H%M%S');
+
+ $fullpath = $conf->stock->dir_temp."/".$user->id.'-csvfiletotimport.csv';
+ if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $fullpath, 1) > 0) {
+ dol_syslog("File ".$fullpath." was added for import");
+ } else {
+ $error++;
+ $langs->load("errors");
+ setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors');
+ }
+
+ if (!$error) {
+ $importcsv = new ImportCsv($db, 'massstocklist');
+ //print $importcsv->separator;
+
+ $nblinesrecord = $importcsv->import_get_nb_of_lines($fullpath)-1;
+ $importcsv->import_open_file($fullpath);
+ $labelsrecord = $importcsv->import_read_record();
+
+ if ($nblinesrecord <= 1) {
+ setEventMessages($langs->trans("BadNumberOfLinesMustHaveAtLeastOneLinePlusTitle"), null, 'errors');
+ } else {
+ $i=0;
+ $data = array();
+ while (($i < $nblinesrecord) && !$error) {
+ $data[] = $importcsv->import_read_record();
+ if (count($data[$i]) == 1) {
+ // Only 1 empty line
+ unset($data[$i]);
+ $i++;
+ continue;
+ }
+ //var_dump($data);
+
+ $tmp_id_sw = $data[$i][0]['val'];
+ $tmp_id_tw = $data[$i][1]['val'];
+ $tmp_id_product = $data[$i][2]['val'];
+ $tmp_qty = $data[$i][3]['val'];
+ $tmp_batch = $data[$i][4]['val'];
+
+ // TODO If product is a ref (not numeric or starts with "ref:..."), retreive the id of product from the ref
+ if (!($tmp_id_product > 0)) {
+ $error++;
+ setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors');
+ }
+ // TODO If warehouse is a ref (not numeric or starts with "ref:..."), retreive the id of product from the ref
+ if (!($tmp_id_sw > 0)) {
+ $error++;
+ setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("WarehouseSource")), null, 'errors');
+ }
+ // TODO If warehouse is a ref (not numeric or starts with "ref:..."), retreive the id of product from the ref
+ if (!($tmp_id_tw > 0)) {
+ $error++;
+ setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("WarehouseTarget")), null, 'errors');
+ }
+ if ($tmp_id_sw > 0 && $tmp_id_tw == $tmp_id_sw) {
+ $error++;
+ $langs->load("errors");
+ setEventMessages($langs->trans("ErrorWarehouseMustDiffers"), null, 'errors');
+ }
+ if (!$tmp_qty) {
+ $error++;
+ setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Qty")), null, 'errors');
+ }
+
+ // Check a batch number is provided if product need it
+ if (!$error) {
+ $producttmp = new Product($db);
+ $producttmp->fetch($tmp_id_product);
+ if ($producttmp->hasbatch()) {
+ if (empty($tmp_batch)) {
+ $error++;
+ $langs->load("errors");
+ setEventMessages($langs->trans("ErrorTryToMakeMoveOnProductRequiringBatchData", $producttmp->ref), null, 'errors');
+ }
+ }
+ }
+
+ $i++;
+ }
+
+ if (!$error) {
+ foreach ($data as $key => $value) {
+ if (count(array_keys($listofdata)) > 0) {
+ $id = max(array_keys($listofdata)) + 1;
+ } else {
+ $id = 1;
+ }
+ $tmp_id_sw = $data[$key][0]['val'];
+ $tmp_id_tw = $data[$key][1]['val'];
+ $tmp_id_product = $data[$key][2]['val'];
+ $tmp_qty = $data[$key][3]['val'];
+ $tmp_batch = $data[$key][4]['val'];
+ $listofdata[$key] = array('id'=>$key, 'id_sw'=>$tmp_id_sw, 'id_tw'=>$tmp_id_tw, 'id_product'=>$tmp_id_product, 'qty'=>$tmp_qty, 'batch'=>$tmp_batch);
+ }
+ }
+ }
+ }
+
+ $_SESSION['massstockmove'] = json_encode($listofdata);
+}
+
+if ($action == 'confirm_deletefile' && $confirm == 'yes') {
+ $langs->load("other");
+
+ $param = '&datatoimport='.urlencode($datatoimport).'&format='.urlencode($format);
+ if ($excludefirstline) {
+ $param .= '&excludefirstline='.urlencode($excludefirstline);
+ }
+ if ($endatlinenb) {
+ $param .= '&endatlinenb='.urlencode($endatlinenb);
+ }
+
+ $file = $conf->stock->dir_temp.'/'.GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
+ $ret = dol_delete_file($file);
+ if ($ret) {
+ setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
+ } else {
+ setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
+ }
+ Header('Location: '.$_SERVER["PHP_SELF"]);
+ exit;
+}
/*
@@ -315,7 +446,79 @@ $buttonrecord = $langs->trans("RecordMovement");
$titletoaddnoent = $langs->transnoentitiesnoconv("Select");
$buttonrecordnoent = $langs->transnoentitiesnoconv("RecordMovement");
print ''.$langs->trans("SelectProductInAndOutWareHouse", $titletoaddnoent, $buttonrecordnoent).' ';
-print ' '."\n";
+
+print ' ';
+
+// Form to upload a file
+print '';
+
+print ' ';
// Form to add a line
print '