From 1b7854e69825206acea25602c6d12e6a60247d25 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 10:15:28 +0200 Subject: [PATCH 001/174] added security to suggestion page index.php (securekey and id encoded) --- htdocs/public/project/index.php | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 03f26ed2f37..65237be02ac 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -78,7 +78,23 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", // No check on module enabled. Done later according to $validpaymentmethod $action = GETPOST('action', 'aZ09'); -$id = dol_decode(GETPOST('id'), $dolibarr_main_instance_unique_id); + +$encodedid = GETPOST('id'); +$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); + +// Getting 'securekey'.'id' from Post and decoding it +$encodedsecurekeyandid = GETPOST('securekey', 'alpha'); +$securekeyandid = dol_decode($encodedsecurekeyandid, $dolibarr_main_instance_unique_id); + +// Securekey decomposition into pure securekey and id added at the end +$securekey = substr($securekeyandid, 0, strlen($securekeyandid)-strlen($encodedid)); +$idgotfromsecurekey = dol_decode(substr($securekeyandid, -strlen($encodedid), strlen($encodedid)), $dolibarr_main_instance_unique_id); + +// We check if the securekey collected is OK and if the id collected is the same than the id in the securekey +if ($securekey != $conf->global->EVENTORGANIZATION_SECUREKEY || $idgotfromsecurekey != $id) { + print $langs->trans('MissingOrBadSecureKey'); + exit; +} // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -113,15 +129,6 @@ $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); -// Show sandbox warning -if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled) && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'int'))) { // We can force sand box with param 'forcesandbox' - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), '', 'warning'); -} -if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'int'))) { - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); -} - - print ''."\n"; print '
'."\n"; print '
'."\n"; From 45531d0f1aab5d18a0c63793239a7ab4b4fc0af2 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 10:39:22 +0200 Subject: [PATCH 002/174] index suggestion page form added, needs to be improved to show only necessary fields --- htdocs/public/project/index.php | 600 +++++++++++++++++++++++++------- 1 file changed, 478 insertions(+), 122 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 65237be02ac..f493b2a379f 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -1,10 +1,11 @@ - * Copyright (C) 2006-2017 Laurent Destailleur - * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2018-2019 Thibault FOUCART - * Copyright (C) 2021 Waël Almoman +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018 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 @@ -18,21 +19,22 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * For Paypal test: https://developer.paypal.com/ - * For Paybox test: ??? - * For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing - * - * Variants: - * - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new PaymentIntent API - * - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API - * - If no option set, we use old APIS (charge) */ /** - * \file htdocs/public/payment/newpayment.php - * \ingroup core - * \brief File to offer a way to make a payment for a particular Dolibarr object + * \file htdocs/public/members/new.php + * \ingroup member + * \brief Example of form to add a new member + * + * Note that you can add following constant to change behaviour of page + * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form + * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited + * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe + * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) + * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted + * MEMBER_NEWFORM_FORCETYPE Force type of member + * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) + * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country */ if (!defined('NOLOGIN')) { @@ -47,41 +49,52 @@ if (!defined('NOIPCHECK')) { if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); } +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} // For MultiCompany module. -// Do not use GETPOST here, function is not defined and get of entity must be done before including main.inc.php -$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1)))); +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); if (is_numeric($entity)) { define("DOLENTITY", $entity); } require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.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.'/projet/class/project.class.php'; -// Hook to be used by external payment modules (ie Payzen, ...) -include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; -$hookmanager = new HookManager($db); -$hookmanager->initHooks(array('newpayment')); +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -// For encryption global $dolibarr_main_instance_unique_id; +global $dolibarr_main_url_root; -// Load translation files -$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data - -// Security check -// No check on module enabled. Done later according to $validpaymentmethod - +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); +$email = GETPOST("email"); +$societe = GETPOST("societe"); + +// Getting id from Post and decoding it $encodedid = GETPOST('id'); $id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; +} + // Getting 'securekey'.'id' from Post and decoding it $encodedsecurekeyandid = GETPOST('securekey', 'alpha'); $securekeyandid = dol_decode($encodedsecurekeyandid, $dolibarr_main_instance_unique_id); @@ -96,108 +109,447 @@ if ($securekey != $conf->global->EVENTORGANIZATION_SECUREKEY || $idgotfromsecure exit; } -// Define $urlwithroot -//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); -//$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file -$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. +// Load translation files +$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); -$project = new Project($db); -$resultproject = $project->fetch($id); -if ($resultproject < 0) { - $error++; - $errmsg .= $project->error; +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$user->loadDefaultValues(); + + +/** + * Show header for new member + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } + print '
'; + + print '
'; } +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
'; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + /* * Actions */ +global $mysoc; +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + + $urlback = ''; + + $db->begin(); + + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + // If the price has been set, name is required for the invoice + if (!GETPOST("societe") && !empty(floatval($project->price_registration))) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; + } + if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; + } + if (!GETPOST("country_id")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; + } + + if (!$error) { + // Check if attendee already exists (by email and for this event) + $confattendee = new ConferenceOrBoothAttendee($db); + $resultfetchconfattendee = $confattendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm'=>$id, 'customsql'=>'t.email="'.$email.'"')); + if ($resultfetchconfattendee > 0 && count($resultfetchconfattendee)>0) { + // Found confattendee + $confattendee = array_shift($resultfetchconfattendee); + } else { + // Need to create a confattendee + $confattendee->date_subscription = dol_now(); + $confattendee->email = $email; + $confattendee->fk_actioncomm = $id; + $resultconfattendee = $confattendee->create($user); + if ($resultconfattendee < 0) { + $error++; + $errmsg .= $confattendee->error; + } + } + // At this point, we have an attendee. It may not be linked to a thirdparty if we just created it + + // If the attendee has already paid + if ($confattendee->status == 1) { + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); + Header("Location: ".$redirection); + exit; + } + // Getting the thirdparty or creating it + $thirdparty = new Societe($db); + // Fetch using fk_soc if the attendee was already existing + if (!empty($confattendee->fk_soc)) { + $resultfetchthirdparty = $thirdparty->fetch($confattendee->fk_soc); + } else { + // Fetch using the input field by user if we just created the attendee + if (!empty($societe)) { + $resultfetchthirdparty = $thirdparty->fetch('', $societe); + if ($resultfetchthirdparty<=0) { + // Need to create a new one (not found or multiple with the same name) + $resultfetchthirdparty = 0; + } else { + // We found an unique result with that name, so we put in in fk_soc of attendee + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } + } else { + // Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences) + $resultfetchthirdparty = 0; + } + } + if ($resultfetchthirdparty<0) { + $error++; + $errmsg .= $thirdparty->error; + } elseif ($resultfetchthirdparty==0) { + // creation of a new thirdparty + if (!empty($societe)) { + $thirdparty->name = $societe; + } else { + $thirdparty->name = $email; + } + $thirdparty->address = GETPOST("address"); + $thirdparty->zip = GETPOST("zipcode"); + $thirdparty->town = GETPOST("town"); + $thirdparty->client = 2; + $thirdparty->fournisseur = 0; + $thirdparty->country_id = GETPOST("country_id", 'int'); + $thirdparty->state_id = GETPOST("state_id", 'int'); + $thirdparty->email = $email; + + // Load object modCodeTiers + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeClient = new $module($db); + + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); + } + $thirdparty->code_client = $tmpcode; + $readythirdparty = $thirdparty->create($user); + if ($readythirdparty <0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); + $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); + $confattendee->fk_soc = $thirdparty->id; + $confattendee->update($user); + } + } + } + + if (!$error) { + $db->commit(); + if (!empty(floatval($project->price_registration))) { + $productforinvoicerow = new Product($db); + $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION); + if ($resultprod < 0) { + $error++; + $errmsg .= $productforinvoicerow->error; + } else { + $facture = new Facture($db); + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $confattendee->cond_reglement_id; + + if (empty($facture->cond_reglement_id)) { + $paymenttermstatic = new PaymentTerm($confattendee->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $confattendee->error = 'ErrorNoPaymentTermRECEPFound'; + $confattendee->errors[] = $confattendee->error; + } + } + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $confattendee->error = $facture->error; + $confattendee->errors = $facture->errors; + $error++; + } else { + $facture->add_object_linked($confattendee->element, $confattendee->id); + } + } + + if (!$error) { + // Add line to draft invoice + $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); + $result = $facture->addline($langs->trans("ConferenceAttendeeFee", $conference->label, dol_print_date($conference->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conference->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $confattendee->error = $facture->error; + $confattendee->errors = $facture->errors; + $error++; + } + if (!$error) { + $valid = true; + $sourcetouse = 'conferencesubscription'; + $reftouse = $facture->id; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse; + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + } else { + $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + } + } + Header("Location: ".$redirection); + exit; + } + } + } else { + // No price has been set + // Validating the subscription + $confattendee->setStatut(1); + + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); + Header("Location: ".$redirection); + exit; + } + //Header("Location: ".$urlback); + //exit; + } else { + $db->rollback(); + } +} /* * View */ -$head = ''; -if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) { - $head = ''."\n"; -} +$form = new Form($db); +$formcompany = new FormCompany($db); -$conf->dol_hide_topmenu = 1; -$conf->dol_hide_leftmenu = 1; - -$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; -llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); +llxHeaderVierge($langs->trans("NewSuggestion")); -print ''."\n"; -print '
'."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''; -print ''; -print "\n"; +print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center'); -// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) -// Define logo and logosmall -$logosmall = $mysoc->logo_small; -$logo = $mysoc->logo; -$paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; -if (!empty($conf->global->$paramlogo)) { - $logosmall = $conf->global->$paramlogo; -} elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) { - $logosmall = $conf->global->ONLINE_PAYMENT_LOGO; -} -//print ''."\n"; -// Define urllogo -$urllogo = ''; -$urllogofull = ''; -if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); - $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); -} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); - $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); -} +print '
'; +print '
'; +print '
'; -// Output html code for logo -if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; - } - print '
'; -} - -print ''."\n"; - -$text = ''."\n"; +// Welcome message +$text = '
'; $text .= ''."\n"; -$text .= ''."\n";; - +$text .= ''."\n";; print $text; +print ''; -// Output payment summary form -print ''."\n"; - -print '

'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.

'.$project->note_public.'

'.$project->note_public.'
'; +dol_htmloutput_errors($errmsg); -$found = false; -$error = 0; -$var = false; +// Print form +print ''."\n"; +print ''; +print ''; +print ''; +print ''; +print ''; -$object = null; +print '
'; -print "\n"; +print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; +//print $langs->trans("FieldsWithIsForPublic",'**').'
'; + +print dol_get_fiche_head(''); + +print ''; + +print ''."\n"; + +// Email +print ''."\n"; +// Company +print ''."\n"; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} + +print "
'.$langs->trans("Email").'*
'.$langs->trans("Company"); +if (!empty(floatval($project->price_registration))) { + print '*'; +} +print '
'.$langs->trans("Address").''."\n"; +print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
'.$langs->trans('Country').'*'; +$country_id = GETPOST('country_id'); +if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
'.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } else { + print ''; + } + print '
\n"; + +print dol_get_fiche_end(); // Show all action buttons +print '
'; print '
'; // Output introduction text if ($project->accept_conference_suggestions) { @@ -209,20 +561,24 @@ print '

'; if ($project->accept_booth_suggestions) { print ''; } +print '
'; + +print '

'; + +// Save +print '
'; +print ''; +if (!empty($backtopage)) { + print '     '; +} +print '
'; - -print '
'."\n"; - -print ''."\n"; -print '
'."\n"; -print '
'; +print "\n"; +print "
"; +print '
'; -htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); - -llxFooter('', 'public'); +llxFooterVierge(); $db->close(); From bced3d60dd17cae8f3cb555f471b654aa350ed57 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 11:11:23 +0200 Subject: [PATCH 003/174] added required name to the form --- htdocs/public/project/index.php | 200 ++++---------------------------- 1 file changed, 23 insertions(+), 177 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index f493b2a379f..3aeab9997b5 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -208,8 +208,11 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; } - // If the price has been set, name is required for the invoice - if (!GETPOST("societe") && !empty(floatval($project->price_registration))) { + if (!GETPOST("lastname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."
\n"; + } + if (!GETPOST("societe")) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; } @@ -224,63 +227,12 @@ if (empty($reshook) && $action == 'add') { } if (!$error) { - // Check if attendee already exists (by email and for this event) - $confattendee = new ConferenceOrBoothAttendee($db); - $resultfetchconfattendee = $confattendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm'=>$id, 'customsql'=>'t.email="'.$email.'"')); - if ($resultfetchconfattendee > 0 && count($resultfetchconfattendee)>0) { - // Found confattendee - $confattendee = array_shift($resultfetchconfattendee); - } else { - // Need to create a confattendee - $confattendee->date_subscription = dol_now(); - $confattendee->email = $email; - $confattendee->fk_actioncomm = $id; - $resultconfattendee = $confattendee->create($user); - if ($resultconfattendee < 0) { - $error++; - $errmsg .= $confattendee->error; - } - } - // At this point, we have an attendee. It may not be linked to a thirdparty if we just created it - - // If the attendee has already paid - if ($confattendee->status == 1) { - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); - Header("Location: ".$redirection); - exit; - } // Getting the thirdparty or creating it $thirdparty = new Societe($db); - // Fetch using fk_soc if the attendee was already existing - if (!empty($confattendee->fk_soc)) { - $resultfetchthirdparty = $thirdparty->fetch($confattendee->fk_soc); - } else { - // Fetch using the input field by user if we just created the attendee - if (!empty($societe)) { - $resultfetchthirdparty = $thirdparty->fetch('', $societe); - if ($resultfetchthirdparty<=0) { - // Need to create a new one (not found or multiple with the same name) - $resultfetchthirdparty = 0; - } else { - // We found an unique result with that name, so we put in in fk_soc of attendee - $confattendee->fk_soc = $thirdparty->id; - $confattendee->update($user); - } - } else { - // Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences) - $resultfetchthirdparty = 0; - } - } - if ($resultfetchthirdparty<0) { - $error++; - $errmsg .= $thirdparty->error; - } elseif ($resultfetchthirdparty==0) { - // creation of a new thirdparty - if (!empty($societe)) { - $thirdparty->name = $societe; - } else { - $thirdparty->name = $email; - } + $resultfetchthirdparty = $thirdparty->fetch('', $societe); + if ($resultfetchthirdparty<=0) { + // Need to create a new one (not found or multiple with the same name) + $thirdparty->name = $societe; $thirdparty->address = GETPOST("address"); $thirdparty->zip = GETPOST("zipcode"); $thirdparty->town = GETPOST("town"); @@ -315,126 +267,16 @@ if (empty($reshook) && $action == 'add') { } else { $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); - $confattendee->fk_soc = $thirdparty->id; - $confattendee->update($user); } } - } - - if (!$error) { + // From there we have a thirdparty, now looking for the contact + $contact = new Contact($db); + $resultcontact = $contact->fetch('', $user, '', $email); + if ($resultcontact<=0) { + // Need to create a contact + } + // We have the contact and the thirdparty $db->commit(); - if (!empty(floatval($project->price_registration))) { - $productforinvoicerow = new Product($db); - $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION); - if ($resultprod < 0) { - $error++; - $errmsg .= $productforinvoicerow->error; - } else { - $facture = new Facture($db); - $facture->type = Facture::TYPE_STANDARD; - $facture->socid = $thirdparty->id; - $facture->paye = 0; - $facture->date = dol_now(); - $facture->cond_reglement_id = $confattendee->cond_reglement_id; - - if (empty($facture->cond_reglement_id)) { - $paymenttermstatic = new PaymentTerm($confattendee->db); - $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); - if (empty($facture->cond_reglement_id)) { - $error++; - $confattendee->error = 'ErrorNoPaymentTermRECEPFound'; - $confattendee->errors[] = $confattendee->error; - } - } - $resultfacture = $facture->create($user); - if ($resultfacture <= 0) { - $confattendee->error = $facture->error; - $confattendee->errors = $facture->errors; - $error++; - } else { - $facture->add_object_linked($confattendee->element, $confattendee->id); - } - } - - if (!$error) { - // Add line to draft invoice - $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); - $result = $facture->addline($langs->trans("ConferenceAttendeeFee", $conference->label, dol_print_date($conference->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conference->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); - if ($result <= 0) { - $confattendee->error = $facture->error; - $confattendee->errors = $facture->errors; - $error++; - } - if (!$error) { - $valid = true; - $sourcetouse = 'conferencesubscription'; - $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse; - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical - } else { - $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - } - } - Header("Location: ".$redirection); - exit; - } - } - } else { - // No price has been set - // Validating the subscription - $confattendee->setStatut(1); - - // Sending mail - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; - - $ishtml = dol_textishtml($texttosend); // May contain urls - - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - - $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); - } - - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); - Header("Location: ".$redirection); - exit; - } - //Header("Location: ".$urlback); - //exit; } else { $db->rollback(); } @@ -495,6 +337,10 @@ jQuery(document).ready(function () { print ''."\n"; +// Name +print ''; +print ''; +print ''; // Email print ''."\n"; // Company @@ -553,13 +399,13 @@ print '
'; print '
'; // Output introduction text if ($project->accept_conference_suggestions) { - print ''; + print ''; print '

'; } -print ''; +print ''; print '

'; if ($project->accept_booth_suggestions) { - print ''; + print ''; } print '
'; From de63c93ad4c1b832e17d324fc188d59df660b338 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 12:09:39 +0200 Subject: [PATCH 004/174] wip on creating the contact --- htdocs/public/project/index.php | 50 +++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 3aeab9997b5..0eb2acd209f 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -274,9 +274,55 @@ if (empty($reshook) && $action == 'add') { $resultcontact = $contact->fetch('', $user, '', $email); if ($resultcontact<=0) { // Need to create a contact + $contact->socid = $thirdparty->id; + $contact->lastname = (string) GETPOST("lastname", 'alpha'); + $contact->firstname = (string) GETPOST("firstname", 'alpha'); + $contact->address = (string) GETPOST("address", 'alpha'); + $contact->zip = (string) GETPOST("zipcode", 'alpha'); + $contact->town = (string) GETPOST("town", 'alpha'); + $contact->country_id = (int) GETPOST("country_id", 'int'); + $contact->state_id = (int) GETPOST("state_id", 'int'); + $contact->email = $email; + $contact->statut = 1; //Default status to Actif + + $resultcreatecontact = $contact->create($user); + if ($resultcreatecontact<0) { + $error++; + $errmsg .= $contact->error; + } + } + + if (!$error) { + // Adding supplier tag + $category = new Categorie($db); + if (GETPOST("suggestconference")) { + // Conference case + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); + } else { + // Booth case + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); + } + + if ($resultcategory<0) { + $error++; + $errmsg .= $category->error; + } else { + $contact->setCategoriesCommon($category->id, Categorie::TYPE_CONTACT, false); + $resultupdate = $contact->update($contact->id); + if ($resultupdate <= 0) { + $error++; + $errmsg .= $contact->error; + } + } + } + + if (!$error) { + // We have the contact and the thirdparty + + + + $db->commit(); } - // We have the contact and the thirdparty - $db->commit(); } else { $db->rollback(); } From 1b4b93bc6aca0ace30a9126fa8e6f62d3f599b50 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 14:28:37 +0200 Subject: [PATCH 005/174] thirdparty/contact creation seems ok --- htdocs/core/class/commonobject.class.php | 2 +- htdocs/public/project/index.php | 61 +++++++++++------------- 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2c9e81b369e..18868f70271 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9156,6 +9156,7 @@ abstract class CommonObject if ($c->fetch($add) > 0) { $result = $c->add_type($this, $type_categ); if ($result < 0) { + var_dump($result); $error++; $this->error = $c->error; $this->errors = $c->errors; @@ -9165,7 +9166,6 @@ abstract class CommonObject } } } - return $error ? -1 * $error : $ok; } diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 0eb2acd209f..ec8f0eca312 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -65,8 +65,9 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.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.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; @@ -270,29 +271,32 @@ if (empty($reshook) && $action == 'add') { } } // From there we have a thirdparty, now looking for the contact - $contact = new Contact($db); - $resultcontact = $contact->fetch('', $user, '', $email); - if ($resultcontact<=0) { - // Need to create a contact - $contact->socid = $thirdparty->id; - $contact->lastname = (string) GETPOST("lastname", 'alpha'); - $contact->firstname = (string) GETPOST("firstname", 'alpha'); - $contact->address = (string) GETPOST("address", 'alpha'); - $contact->zip = (string) GETPOST("zipcode", 'alpha'); - $contact->town = (string) GETPOST("town", 'alpha'); - $contact->country_id = (int) GETPOST("country_id", 'int'); - $contact->state_id = (int) GETPOST("state_id", 'int'); - $contact->email = $email; - $contact->statut = 1; //Default status to Actif - - $resultcreatecontact = $contact->create($user); - if ($resultcreatecontact<0) { - $error++; - $errmsg .= $contact->error; - } - } if (!$error) { + $contact = new Contact($db); + $resultcontact = $contact->fetch('', '', '', $email); + if ($resultcontact<=0) { + // Need to create a contact + $contact->socid = $thirdparty->id; + $contact->lastname = (string) GETPOST("lastname", 'alpha'); + $contact->firstname = (string) GETPOST("firstname", 'alpha'); + $contact->address = (string) GETPOST("address", 'alpha'); + $contact->zip = (string) GETPOST("zipcode", 'alpha'); + $contact->town = (string) GETPOST("town", 'alpha'); + $contact->country_id = (int) GETPOST("country_id", 'int'); + $contact->state_id = (int) GETPOST("state_id", 'int'); + $contact->email = $email; + $contact->statut = 1; //Default status to Actif + + $resultcreatecontact = $contact->create($user); + if ($resultcreatecontact<0) { + $error++; + $errmsg .= $contact->error; + } + } + } + // Only if we created the contact + if (!$error && $resultcontact<=0) { // Adding supplier tag $category = new Categorie($db); if (GETPOST("suggestconference")) { @@ -307,9 +311,8 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $category->error; } else { - $contact->setCategoriesCommon($category->id, Categorie::TYPE_CONTACT, false); - $resultupdate = $contact->update($contact->id); - if ($resultupdate <= 0) { + $resultsetcategory = $contact->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CONTACT, false); + if ($resultsetcategory <=0) { $error++; $errmsg .= $contact->error; } @@ -454,16 +457,8 @@ if ($project->accept_booth_suggestions) { print ''; } print ''; - print '

'; -// Save -print '
'; -print ''; -if (!empty($backtopage)) { - print '     '; -} -print '
'; print "\n"; From dd9c42876a381b01f1891122c2a39c064d658cd6 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 14:29:28 +0200 Subject: [PATCH 006/174] cleared test modif on core --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 18868f70271..2c9e81b369e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9156,7 +9156,6 @@ abstract class CommonObject if ($c->fetch($add) > 0) { $result = $c->add_type($this, $type_categ); if ($result < 0) { - var_dump($result); $error++; $this->error = $c->error; $this->errors = $c->errors; @@ -9166,6 +9165,7 @@ abstract class CommonObject } } } + return $error ? -1 * $error : $ok; } From a71697375764c9c20307ec04f204e2993eac199f Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 15:44:08 +0200 Subject: [PATCH 007/174] form completed, tags added to thirdparty --- htdocs/public/project/index.php | 90 ++++++++++++++++++++++++-- htdocs/societe/class/societe.class.php | 2 +- 2 files changed, 84 insertions(+), 8 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index ec8f0eca312..64fbea05505 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -84,6 +84,10 @@ $action = GETPOST('action', 'aZ09'); $email = GETPOST("email"); $societe = GETPOST("societe"); +$label = GETPOST("label"); +$note = GETPOST("note"); +$datestart = GETPOST("datestart"); +$dateend = GETPOST("dateend"); // Getting id from Post and decoding it $encodedid = GETPOST('id'); @@ -205,6 +209,26 @@ if (empty($reshook) && $action == 'add') { $db->begin(); + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + if (!GETPOST("label")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."
\n"; + } + if (!GETPOST("note")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
\n"; + } + if (!GETPOST("datestart")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
\n"; + } + if (!GETPOST("dateend")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
\n"; + } if (!GETPOST("email")) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; @@ -295,9 +319,9 @@ if (empty($reshook) && $action == 'add') { } } } - // Only if we created the contact - if (!$error && $resultcontact<=0) { - // Adding supplier tag + + if (!$error) { + // Adding supplier tag and tag from setup to thirdparty $category = new Categorie($db); if (GETPOST("suggestconference")) { // Conference case @@ -311,18 +335,58 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $category->error; } else { - $resultsetcategory = $contact->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CONTACT, false); + $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CUSTOMER, false); if ($resultsetcategory <=0) { $error++; - $errmsg .= $contact->error; + $errmsg .= $thirdparty->error; } + $thirdparty->fournisseur = 1; + // Load object modCodeFournisseur + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeFournisseur = new $module; + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { + $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 0); + } + $thirdparty->code_fournisseur = $tmpcode; + + $res = $thirdparty->update(0); } } if (!$error) { + /* // We have the contact and the thirdparty - - + $conforbooth = new ConferenceOrBooth($db); + $conforbooth->label = $label; + $conforbooth->fk_soc = $thirdparty->id; + $conforbooth->fk_project = $project->id; + $conforbooth->note = $note; + //$conforbooth->fk_action = + $conforbooth->datep =$datestart; + $conforbooth->datep2 = $dateend; + $conforbooth->datec = dol_now(); + $conforbooth->tms = dol_now(); + //$conforbooth->fk_user_author = + //$conforbooth->fk_user_mod = + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $resultconforbooth = $conforbooth->create($user); + if ($resultconforbooth<=0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + //conforbooth created + var_dump('gg'); + }*/ $db->commit(); } @@ -392,6 +456,18 @@ print '
'."\n"; +// Label +print ''."\n"; +print ''."\n"; +// Note +print ''."\n"; +print ''."\n"; +// Start Date +print ''."\n"; +print ''."\n"; +// End Date +print ''."\n"; +print ''."\n"; // Company print ''."\n"; print ''."\n"; // Start Date print ''."\n"; -print ''."\n"; +print ''."\n"; // End Date print ''."\n"; -print ''."\n"; +print ''."\n"; // Company print ''; print ''; } From cedb8adfe25280ca409495e1bfcf22e108ba590f Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 09:52:11 +0200 Subject: [PATCH 010/174] removal of vardump --- htdocs/societe/card.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 64a46f9d1a8..68efa8e694c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2468,7 +2468,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($tmpcheck != 0 && $tmpcheck != -5) { print ' ('.$langs->trans("WrongSupplierCode").')'; } - var_dump($tmpcheck); print ''; print ''; } From bfadcfc4bb430966330672c4d8cb969ac0a23e79 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 10:49:10 +0200 Subject: [PATCH 011/174] added red star on label and note, that are required --- htdocs/public/project/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index d6614c8ed29..3a40649b183 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -464,10 +464,10 @@ print ''; // Email print ''."\n"; // Label -print ''."\n"; +print ''."\n"; print ''."\n"; // Note -print ''."\n"; +print ''."\n"; print ''."\n"; // Start Date print ''."\n"; From 151819b7adbe58ed7f9f693bf7d94abb41fa3ab8 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 11:22:40 +0200 Subject: [PATCH 012/174] added payment redirection to pay a booth, or status update for free booth/conference --- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/project/index.php | 119 ++++++++++++++++++++-- 2 files changed, 113 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 6ef39e81ff6..6d15d599789 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -107,6 +107,7 @@ MissingOrBadSecureKey = The security key is invalid or missing EvntOrgWelcomeMessage = This form allows you to register as a new participant to the conference EvntOrgDuration = This conference starts on %s and ends on %s ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s +BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s # # SubscriptionOk page # diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 3a40649b183..06e46e465eb 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -371,7 +371,6 @@ if (empty($reshook) && $action == 'add') { } if (!$error) { - /* // We have the contact and the thirdparty $conforbooth = new ConferenceOrBooth($db); $conforbooth->label = $label; @@ -383,17 +382,123 @@ if (empty($reshook) && $action == 'add') { $conforbooth->datep2 = $dateend; $conforbooth->datec = dol_now(); $conforbooth->tms = dol_now(); - //$conforbooth->fk_user_author = - //$conforbooth->fk_user_mod = - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; $resultconforbooth = $conforbooth->create($user); if ($resultconforbooth<=0) { $error++; $errmsg .= $conforbooth->error; } else { - //conforbooth created - var_dump('gg'); - }*/ + // If this is a paying booth, we have to redirect to payment page and create an invoice + if (GETPOST("suggestbooth") && !empty(floatval($project->price_booth))) { + $productforinvoicerow = new Product($db); + $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); + if ($resultprod < 0) { + $error++; + $errmsg .= $productforinvoicerow->error; + } else { + $facture = new Facture($db); + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $contact->cond_reglement_id; + + if (empty($facture->cond_reglement_id)) { + $paymenttermstatic = new PaymentTerm($contact->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $contact->error = 'ErrorNoPaymentTermRECEPFound'; + $contact->errors[] = $contact->error; + } + } + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } else { + $facture->add_object_linked($contact->element, $contact->id); + } + } + + if (!$error) { + // Add line to draft invoice + $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); + $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } + if (!$error) { + $valid = true; + $sourcetouse = 'boothlocation'; + $reftouse = $facture->id; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse; + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + } else { + $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + } + } + Header("Location: ".$redirection); + exit; + } + } + } else { + // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update + $conforbooth->setStatut(CONFERENCEORBOOTH::STATUS_SUGGESTED); + $conforbooth->update($user); + + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); + Header("Location: ".$redirection); + exit; + } + } $db->commit(); } From b24b297a407da6d7fc4281b5ba6d2773de3fed5d Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 12:30:49 +0200 Subject: [PATCH 013/174] adaptation of the payment for the booth location case --- htdocs/langs/en_US/eventorganization.lang | 5 +- htdocs/public/payment/newpayment.php | 107 +++++++++ htdocs/public/payment/paymentok.php | 272 ++++++++++++++++++---- htdocs/public/project/index.php | 2 +- 4 files changed, 341 insertions(+), 45 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 6d15d599789..eb340795a1e 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -119,5 +119,6 @@ ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to a co # # Payment page # -Attendee = Participant -PaymentConferenceAttendee = Paiement de participation à une conférence +Attendee = Attendee +PaymentConferenceAttendee = Conference attendee payment +PaymentBoothLocation = Booth location payment diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index b351367f6ea..346e5f7bdda 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -142,6 +142,23 @@ if ($source == 'conferencesubscription') { } } } +} elseif ($source == 'boothlocation') { + // Getting the amount to pay, the invoice, finding the thirdparty + $invoiceid = GETPOST('ref'); + $invoice = new Facture($db); + $resultinvoice = $invoice->fetch($invoiceid); + if ($resultinvoice <= 0) { + setEventMessages(null, $invoice->errors, "errors"); + } else { + $amount = price2num($invoice->total_ttc); + // Finding the associated thirdparty + $thirdparty = new Societe($db); + $resultthirdparty = $thirdparty->fetch($invoice->socid); + if ($resultthirdparty <= 0) { + setEventMessages(null, $thirdparty->errors, "errors"); + } + $object = $thirdparty; + } } @@ -1862,6 +1879,96 @@ if ($source == 'conferencesubscription') { print ''."\n"; } +if ($source == 'boothlocation') { + $found = true; + $langs->load("members"); + + if (GETPOST('fulltag', 'alpha')) { + $fulltag = GETPOST('fulltag', 'alpha'); + } else { + $fulltag = 'BOO='.GETPOST("booth").'.DAT='.dol_print_date(dol_now(), '%Y%m%d%H%M%S'); + if (!empty($TAG)) { + $tag = $TAG; $fulltag .= '.TAG='.$TAG; + } + } + $fulltag = dol_string_unaccent($fulltag); + + // Creditor + print ''."\n"; + + // Debitor + print ''."\n"; + + // Object + $text = ''.$langs->trans("PaymentBoothLocation").''; + if (GETPOST('desc', 'alpha')) { + $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; + } + print ''."\n"; + + // Amount + print ''."\n"; + + // Tag + print ''."\n"; + + // Shipping address + $shipToName = $thirdparty->getFullName($langs); + $shipToStreet = $thirdparty->address; + $shipToCity = $thirdparty->town; + $shipToState = $thirdparty->state_code; + $shipToCountryCode = $thirdparty->country_code; + $shipToZip = $thirdparty->zip; + $shipToStreet2 = ''; + $phoneNum = $thirdparty->phone; + if ($shipToName && $shipToStreet && $shipToCity && $shipToCountryCode && $shipToZip) { + print ''; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + } else { + print ''."\n"; + } + print ''."\n"; + print ''."\n"; + $labeldesc = $langs->trans("PaymentSubscription"); + if (GETPOST('desc', 'alpha')) { + $labeldesc = GETPOST('desc', 'alpha'); + } + print ''."\n"; +} + + if (!$found && !$mesg) { $mesg = $langs->trans("ErrorBadParameters"); } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 3d3946927c8..d8905d86eac 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -104,7 +104,6 @@ if (empty($FULLTAG)) { } $source = GETPOST('s', 'alpha') ? GETPOST('s', 'alpha') : GETPOST('source', 'alpha'); $ref = GETPOST('ref'); -$invoiceref = GETPOST('invoice'); $suffix = GETPOST("suffix", 'aZ09'); $membertypeid = GETPOST("membertypeid", 'int'); @@ -893,48 +892,51 @@ if ($ispaymentok) { // Sending mail $thirdparty = new Societe($db); - $thirdparty->fetch($attendeetovalidate->fk_soc); - - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; - - $ishtml = dol_textishtml($texttosend); // May contain urls - - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - - $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + $resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc); + if ($resultthirdparty < 0) { + setEventMessages(null, $attendeetovalidate->errors, "errors"); } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } } } } else { @@ -951,6 +953,192 @@ if ($ispaymentok) { } } elseif (array_key_exists('BOO', $tmptag) && $tmptag['BOO'] > 0) { // @todo BOOTH CASE (to copy and adapt from above) + // Record payment + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $object = new Facture($db); + $result = $object->fetch($ref); + if ($result) { + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; + + $paymentTypeId = 0; + if ($paymentmethod == 'paybox') { + $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; + } + if ($paymentmethod == 'paypal') { + $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; + } + if ($paymentmethod == 'stripe') { + $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; + } + if (empty($paymentTypeId)) { + $paymentType = $_SESSION["paymentType"]; + if (empty($paymentType)) { + $paymentType = 'CB'; + } + $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); + } + + $currencyCodeType = $_SESSION['currencyCodeType']; + + // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) + if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { + $resultvalidate = $object->validate($user); + if ($resultvalidate < 0) { + $postactionmessages[] = 'Cannot validate invoice'; + $ispostactionok = -1; + $error++; // Not yet supported + } else { + $db->begin(); + + // Creation of payment line + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($db); + $paiement->datepaye = $now; + if ($currencyCodeType == $conf->currency) { + $paiement->amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id + } else { + $paiement->multicurrency_amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching + + $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; + $ispostactionok = -1; + $error++; // Not yet supported + } + $paiement->paiementid = $paymentTypeId; + $paiement->num_payment = ''; + $paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress; + $paiement->ext_payment_id = $TRANSACTIONID; + $paiement->ext_payment_site = $service; + + if (!$error) { + $paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents + if ($paiement_id < 0) { + $postactionmessages[] = $paiement->error.' '.join("
\n", $paiement->errors); + $ispostactionok = -1; + $error++; + } else { + $postactionmessages[] = 'Payment created'; + $ispostactionok = 1; + } + } + + if (!$error && !empty($conf->banque->enabled)) { + $bankaccountid = 0; + if ($paymentmethod == 'paybox') { + $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS; + } elseif ($paymentmethod == 'paypal') { + $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS; + } elseif ($paymentmethod == 'stripe') { + $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS; + } + + if ($bankaccountid > 0) { + $label = '(CustomerInvoicePayment)'; + if ($object->type == Facture::TYPE_CREDIT_NOTE) { + $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note + } + $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', ''); + if ($result < 0) { + $postactionmessages[] = $paiement->error.' '.join("
\n", $paiement->errors); + $ispostactionok = -1; + $error++; + } else { + $postactionmessages[] = 'Bank transaction of payment created'; + $ispostactionok = 1; + } + } else { + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.'; + $ispostactionok = -1; + $error++; + } + } + + if (!$error) { + // Putting the booth to "suggested" state + $booth = new ConferenceOrBooth($db); + $resultbooth = $booth->fetch($tmptag['BOO']); + if ($resultbooth < 0) { + $error++; + setEventMessages(null, $booth->errors, "errors"); + } else { + $booth->setStatut(CONFERENCEORBOOTH::STATUS_SUGGESTED); + $resultboothupdate = $booth->update($user); + if ($resultboothupdate<0) { + // Finding the thirdparty by getting the invoice + $invoice = new Facture($db); + $resultinvoice = $invoice->fetch($ref); + if ($resultinvoice<0) { + $postactionmessages[] = 'Could not find the associated invoice.'; + $ispostactionok = -1; + $error++; + } else { + $thirdparty = new Societe($db); + $resultthirdparty = $thirdparty->fetch($invoice->socid); + if ($resultthirdparty<0) { + $error++; + setEventMessages(null, $thirdparty->errors, "errors"); + } else { + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + } + } + } + } + } + + if (!$error) { + $db->commit(); + } else { + $db->rollback(); + } + } + } else { + $postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['ATT'].'. May be payment was already recorded.'; + $ispostactionok = -1; + } + } else { + $postactionmessages[] = 'Invoice paid '.$tmptag['ATT'].' was not found'; + $ispostactionok = -1; + } } else { // Nothing done } diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 06e46e465eb..7eb7f263a16 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -434,7 +434,7 @@ if (empty($reshook) && $action == 'add') { $valid = true; $sourcetouse = 'boothlocation'; $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical From f2f1eaa95e9ceb8f8d89fb0726d2e3407511053c Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 16:01:01 +0200 Subject: [PATCH 014/174] wip --- .../attendee_subscription.php | 28 +++++++++++-------- htdocs/public/project/index.php | 28 +++++++++---------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 4940f5965fe..7a377a7121a 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -374,15 +374,15 @@ if (empty($reshook) && $action == 'add') { $valid = true; $sourcetouse = 'conferencesubscription'; $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse; + $redirection = $dolibarr_main_url_root . '/public/payment/newpayment.php?source=' . $sourcetouse . '&ref=' . $reftouse; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + $redirection .= '&securekey=' . dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical } else { - $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + $redirection .= '&securekey=' . $conf->global->PAYMENT_SECURITY_TOKEN; } } - Header("Location: ".$redirection); + Header("Location: " . $redirection); exit; } } @@ -392,8 +392,8 @@ if (empty($reshook) && $action == 'add') { $confattendee->setStatut(1); // Sending mail - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; $formmail = new FormMail($db); // Set output language $outputlangs = new Translate('', $conf); @@ -410,7 +410,7 @@ if (empty($reshook) && $action == 'add') { if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; + $msg = $arraydefaultmessage->content; } $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); @@ -429,19 +429,23 @@ if (empty($reshook) && $action == 'add') { $result = $mailfile->sendfile(); if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + dol_syslog("EMail sent to " . $sendto, LOG_DEBUG, 0, '_payment'); } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + dol_syslog("Failed to send EMail to " . $sendto, LOG_ERR, 0, '_payment'); } $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); - $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; - Header("Location: ".$redirection); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY . 'conferenceorbooth' . $id, 2); + $redirection = $dolibarr_main_url_root . '/public/eventorganization/subscriptionok.php?id=' . $encodedid . '&securekey=' . $securekeyurl; + Header("Location: " . $redirection); exit; } //Header("Location: ".$urlback); //exit; + } + + if (!$error) { + $db->commit(); } else { $db->rollback(); } diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 7eb7f263a16..bbfe55a6522 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -100,16 +100,12 @@ if ($resultproject < 0) { $errmsg .= $project->error; } -// Getting 'securekey'.'id' from Post and decoding it -$encodedsecurekeyandid = GETPOST('securekey', 'alpha'); -$securekeyandid = dol_decode($encodedsecurekeyandid, $dolibarr_main_instance_unique_id); +// Security check +$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$securekeyreceived = GETPOST("securekey"); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); -// Securekey decomposition into pure securekey and id added at the end -$securekey = substr($securekeyandid, 0, strlen($securekeyandid)-strlen($encodedid)); -$idgotfromsecurekey = dol_decode(substr($securekeyandid, -strlen($encodedid), strlen($encodedid)), $dolibarr_main_instance_unique_id); - -// We check if the securekey collected is OK and if the id collected is the same than the id in the securekey -if ($securekey != $conf->global->EVENTORGANIZATION_SECUREKEY || $idgotfromsecurekey != $id) { +if ($securekeytocompare != $securekeyreceived) { print $langs->trans('MissingOrBadSecureKey'); exit; } @@ -377,12 +373,13 @@ if (empty($reshook) && $action == 'add') { $conforbooth->fk_soc = $thirdparty->id; $conforbooth->fk_project = $project->id; $conforbooth->note = $note; - //$conforbooth->fk_action = + $conforbooth->fk_action = 63; $conforbooth->datep =$datestart; $conforbooth->datep2 = $dateend; $conforbooth->datec = dol_now(); $conforbooth->tms = dol_now(); $resultconforbooth = $conforbooth->create($user); + var_dump($conforbooth); if ($resultconforbooth<=0) { $error++; $errmsg .= $conforbooth->error; @@ -494,14 +491,17 @@ if (empty($reshook) && $action == 'add') { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?securekey='.dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY, $dolibarr_main_instance_unique_id); + $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; Header("Location: ".$redirection); exit; } } - - $db->commit(); } + } + if (!$error) { + $db->commit(); } else { $db->rollback(); } @@ -540,7 +540,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print '
'; From 5203a417fe13d91d93909817def137b334c0139b Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 16:31:14 +0200 Subject: [PATCH 015/174] select array OK for event type --- htdocs/public/project/index.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index bbfe55a6522..ce3f06a4cc3 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -82,6 +82,7 @@ $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); +$eventtype = GETPOST("eventtype"); $email = GETPOST("email"); $societe = GETPOST("societe"); $label = GETPOST("label"); @@ -120,6 +121,8 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); +$cactioncomm = new CActionComm($db); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); /** * Show header for new member @@ -373,13 +376,12 @@ if (empty($reshook) && $action == 'add') { $conforbooth->fk_soc = $thirdparty->id; $conforbooth->fk_project = $project->id; $conforbooth->note = $note; - $conforbooth->fk_action = 63; + $conforbooth->fk_action = $eventtype; $conforbooth->datep =$datestart; $conforbooth->datep2 = $dateend; $conforbooth->datec = dol_now(); $conforbooth->tms = dol_now(); $resultconforbooth = $conforbooth->create($user); - var_dump($conforbooth); if ($resultconforbooth<=0) { $error++; $errmsg .= $conforbooth->error; @@ -568,6 +570,9 @@ print '
'."\n"; +// Type of event +print ''."\n"; +print ''; // Label print ''."\n"; print ''."\n"; From 54b5a43006174ccfec34c9cdc57f5622d906b227 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 17:06:25 +0200 Subject: [PATCH 016/174] wip --- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/project/index.php | 15 ++++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 9ad2d45ddf4..7b5ddd8160c 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -108,6 +108,7 @@ EvntOrgWelcomeMessage = This form allows you to register as a new participant to EvntOrgDuration = This conference starts on %s and ends on %s. ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s. BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s +EventType = Event type # # SubscriptionOk page # diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index ce3f06a4cc3..4f376a2f10f 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -295,7 +295,6 @@ if (empty($reshook) && $action == 'add') { } } // From there we have a thirdparty, now looking for the contact - if (!$error) { $contact = new Contact($db); $resultcontact = $contact->fetch('', '', '', $email); @@ -447,9 +446,8 @@ if (empty($reshook) && $action == 'add') { } } else { // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update - $conforbooth->setStatut(CONFERENCEORBOOTH::STATUS_SUGGESTED); + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; $conforbooth->update($user); - // Sending mail require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; @@ -492,18 +490,17 @@ if (empty($reshook) && $action == 'add') { } else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } - - $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); - $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; - Header("Location: ".$redirection); - exit; } } } } if (!$error) { $db->commit(); + $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; + Header("Location: ".$redirection); + exit; } else { $db->rollback(); } From 15e65729f6abf38cc744e2047a04cc8134f297e7 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Tue, 27 Apr 2021 17:19:13 +0200 Subject: [PATCH 017/174] put company under email in the form --- htdocs/public/project/index.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 4f376a2f10f..e4c030c9718 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -567,6 +567,9 @@ print ''."\n"; +// Company +print ''."\n"; // Type of event print ''."\n"; print ''; @@ -582,12 +585,6 @@ print ''."\n"; -// Company -print ''."\n"; // Address print ''."\n"; From 4c50d210dd0af5f0ef97b1dff27a385ead9c788d Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 11:26:42 +0200 Subject: [PATCH 018/174] creation of the 3 main pages --- htdocs/public/project/suggestbooth.php | 1 + htdocs/public/project/suggestconference.php | 1 + htdocs/public/project/viewandvote.php | 1 + 3 files changed, 3 insertions(+) create mode 100644 htdocs/public/project/suggestbooth.php create mode 100644 htdocs/public/project/suggestconference.php create mode 100644 htdocs/public/project/viewandvote.php diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php new file mode 100644 index 00000000000..b3d9bbc7f37 --- /dev/null +++ b/htdocs/public/project/suggestbooth.php @@ -0,0 +1 @@ + Date: Thu, 6 May 2021 11:27:48 +0200 Subject: [PATCH 019/174] wip --- htdocs/public/project/index.php | 8 - htdocs/public/project/suggestbooth.php | 657 ++++++++++++++++++++ htdocs/public/project/suggestconference.php | 657 ++++++++++++++++++++ 3 files changed, 1314 insertions(+), 8 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index e4c030c9718..fcbc786be4c 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -82,14 +82,6 @@ $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); -$eventtype = GETPOST("eventtype"); -$email = GETPOST("email"); -$societe = GETPOST("societe"); -$label = GETPOST("label"); -$note = GETPOST("note"); -$datestart = GETPOST("datestart"); -$dateend = GETPOST("dateend"); - // Getting id from Post and decoding it $encodedid = GETPOST('id'); $id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index b3d9bbc7f37..e4c030c9718 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -1 +1,658 @@ + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018 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 + * 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/public/members/new.php + * \ingroup member + * \brief Example of form to add a new member + * + * Note that you can add following constant to change behaviour of page + * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form + * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited + * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe + * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) + * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted + * MEMBER_NEWFORM_FORCETYPE Force type of member + * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) + * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +global $dolibarr_main_instance_unique_id; +global $dolibarr_main_url_root; + +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); +$action = GETPOST('action', 'aZ09'); + +$eventtype = GETPOST("eventtype"); +$email = GETPOST("email"); +$societe = GETPOST("societe"); +$label = GETPOST("label"); +$note = GETPOST("note"); +$datestart = GETPOST("datestart"); +$dateend = GETPOST("dateend"); + +// Getting id from Post and decoding it +$encodedid = GETPOST('id'); +$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); + +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; +} + +// Security check +$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$securekeyreceived = GETPOST("securekey"); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + +if ($securekeytocompare != $securekeyreceived) { + print $langs->trans('MissingOrBadSecureKey'); + exit; +} + +// Load translation files +$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$user->loadDefaultValues(); + +$cactioncomm = new CActionComm($db); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); + +/** + * Show header for new member + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } + print '
'; + + print '
'; +} + +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
'; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + +/* + * Actions + */ +global $mysoc; +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + + $urlback = ''; + + $db->begin(); + + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + if (!GETPOST("label")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."
\n"; + } + if (!GETPOST("note")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
\n"; + } + if (!GETPOST("datestart")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
\n"; + } + if (!GETPOST("dateend")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
\n"; + } + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + if (!GETPOST("lastname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."
\n"; + } + if (!GETPOST("societe")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; + } + if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; + } + if (!GETPOST("country_id")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; + } + + if (!$error) { + // Getting the thirdparty or creating it + $thirdparty = new Societe($db); + $resultfetchthirdparty = $thirdparty->fetch('', $societe); + + if ($resultfetchthirdparty<=0) { + // Need to create a new one (not found or multiple with the same name) + $thirdparty->name = $societe; + $thirdparty->address = GETPOST("address"); + $thirdparty->zip = GETPOST("zipcode"); + $thirdparty->town = GETPOST("town"); + $thirdparty->client = 2; + $thirdparty->fournisseur = 0; + $thirdparty->country_id = GETPOST("country_id", 'int'); + $thirdparty->state_id = GETPOST("state_id", 'int'); + $thirdparty->email = $email; + + // Load object modCodeTiers + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeClient = new $module($db); + + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); + } + $thirdparty->code_client = $tmpcode; + $readythirdparty = $thirdparty->create($user); + if ($readythirdparty <0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); + $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); + } + } + // From there we have a thirdparty, now looking for the contact + if (!$error) { + $contact = new Contact($db); + $resultcontact = $contact->fetch('', '', '', $email); + if ($resultcontact<=0) { + // Need to create a contact + $contact->socid = $thirdparty->id; + $contact->lastname = (string) GETPOST("lastname", 'alpha'); + $contact->firstname = (string) GETPOST("firstname", 'alpha'); + $contact->address = (string) GETPOST("address", 'alpha'); + $contact->zip = (string) GETPOST("zipcode", 'alpha'); + $contact->town = (string) GETPOST("town", 'alpha'); + $contact->country_id = (int) GETPOST("country_id", 'int'); + $contact->state_id = (int) GETPOST("state_id", 'int'); + $contact->email = $email; + $contact->statut = 1; //Default status to Actif + + $resultcreatecontact = $contact->create($user); + if ($resultcreatecontact<0) { + $error++; + $errmsg .= $contact->error; + } + } + } + + if (!$error) { + // Adding supplier tag and tag from setup to thirdparty + $category = new Categorie($db); + if (GETPOST("suggestconference")) { + // Conference case + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); + } else { + // Booth case + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); + } + + if ($resultcategory<=0) { + $error++; + $errmsg .= $category->error; + } else { + $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CUSTOMER, false); + if ($resultsetcategory < 0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->fournisseur = 1; + + // Load object modCodeFournisseur + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeFournisseur = new $module; + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { + $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1); + } + $thirdparty->code_fournisseur = $tmpcode; + + $res = $thirdparty->update(0, $user, 1, 1, 1); + + if ($res <= 0) { + $error++; + } + } + } + } + + if (!$error) { + // We have the contact and the thirdparty + $conforbooth = new ConferenceOrBooth($db); + $conforbooth->label = $label; + $conforbooth->fk_soc = $thirdparty->id; + $conforbooth->fk_project = $project->id; + $conforbooth->note = $note; + $conforbooth->fk_action = $eventtype; + $conforbooth->datep =$datestart; + $conforbooth->datep2 = $dateend; + $conforbooth->datec = dol_now(); + $conforbooth->tms = dol_now(); + $resultconforbooth = $conforbooth->create($user); + if ($resultconforbooth<=0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + // If this is a paying booth, we have to redirect to payment page and create an invoice + if (GETPOST("suggestbooth") && !empty(floatval($project->price_booth))) { + $productforinvoicerow = new Product($db); + $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); + if ($resultprod < 0) { + $error++; + $errmsg .= $productforinvoicerow->error; + } else { + $facture = new Facture($db); + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $contact->cond_reglement_id; + + if (empty($facture->cond_reglement_id)) { + $paymenttermstatic = new PaymentTerm($contact->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $contact->error = 'ErrorNoPaymentTermRECEPFound'; + $contact->errors[] = $contact->error; + } + } + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } else { + $facture->add_object_linked($contact->element, $contact->id); + } + } + + if (!$error) { + // Add line to draft invoice + $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); + $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } + if (!$error) { + $valid = true; + $sourcetouse = 'boothlocation'; + $reftouse = $facture->id; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + } else { + $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + } + } + Header("Location: ".$redirection); + exit; + } + } + } else { + // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->update($user); + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + } + } + } + } + if (!$error) { + $db->commit(); + $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; + Header("Location: ".$redirection); + exit; + } else { + $db->rollback(); + } +} + + +/* + * View + */ + +$form = new Form($db); +$formcompany = new FormCompany($db); + +llxHeaderVierge($langs->trans("NewSuggestion")); + + +print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center'); + + +print '
'; +print '
'; +print '
'; + +// Welcome message +$text = '

'; +$text .= ''."\n"; +$text .= ''."\n";; +print $text; +print ''; + +dol_htmloutput_errors($errmsg); + +// Print form +print ''."\n"; +print ''; +print ''; +print ''; +print ''; +print ''; + +print '
'; + +print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; +//print $langs->trans("FieldsWithIsForPublic",'**').'
'; + +print dol_get_fiche_head(''); + +print ''; + +print '
lastname).'" autofocus="autofocus">
'.$langs->trans("Email").'*
*
'.$langs->trans("Label").'
'.$langs->trans("Note").'
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("Company"); if (!empty(floatval($project->price_registration))) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9d449922dd2..4ce6211c767 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1322,7 +1322,7 @@ class Societe extends CommonObject } } } - + var_dump($result); if ($result >= 0) { dol_syslog(get_class($this)."::update verify ok or not done"); From c8440a62836e8cdf8d6e8764fdce17da503619e2 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 16:17:42 +0200 Subject: [PATCH 008/174] fix on form dates --- htdocs/public/project/index.php | 6 ++++-- htdocs/societe/class/societe.class.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 64fbea05505..932a36dad92 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -340,7 +340,9 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $thirdparty->error; } + $thirdparty->fournisseur = 1; + // Load object modCodeFournisseur $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { @@ -464,10 +466,10 @@ print '
'.$langs->trans("Note").'
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("Company"); if (!empty(floatval($project->price_registration))) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 4ce6211c767..9d449922dd2 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1322,7 +1322,7 @@ class Societe extends CommonObject } } } - var_dump($result); + if ($result >= 0) { dol_syslog(get_class($this)."::update verify ok or not done"); From a3628954b21b82bfad96b69d4fa396322778d77e Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 26 Apr 2021 17:46:30 +0200 Subject: [PATCH 009/174] fix for the supplier code --- htdocs/public/project/index.php | 47 ++++++++++++++++++--------------- htdocs/societe/card.php | 1 + 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 932a36dad92..d6614c8ed29 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -255,6 +255,7 @@ if (empty($reshook) && $action == 'add') { // Getting the thirdparty or creating it $thirdparty = new Societe($db); $resultfetchthirdparty = $thirdparty->fetch('', $societe); + if ($resultfetchthirdparty<=0) { // Need to create a new one (not found or multiple with the same name) $thirdparty->name = $societe; @@ -331,37 +332,41 @@ if (empty($reshook) && $action == 'add') { $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); } - if ($resultcategory<0) { + if ($resultcategory<=0) { $error++; $errmsg .= $category->error; } else { $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CUSTOMER, false); - if ($resultsetcategory <=0) { + if ($resultsetcategory < 0) { $error++; $errmsg .= $thirdparty->error; - } + } else { + $thirdparty->fournisseur = 1; - $thirdparty->fournisseur = 1; + // Load object modCodeFournisseur + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeFournisseur = new $module; + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { + $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1); + } + $thirdparty->code_fournisseur = $tmpcode; - // Load object modCodeFournisseur - $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); - if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { - $module = substr($module, 0, dol_strlen($module) - 4); - } - $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) { - $res = dol_include_once($dirroot.$module.'.php'); - if ($res) { - break; + $res = $thirdparty->update(0, $user, 1, 1, 1); + + if ($res <= 0) { + $error++; } } - $modCodeFournisseur = new $module; - if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { - $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 0); - } - $thirdparty->code_fournisseur = $tmpcode; - - $res = $thirdparty->update(0); } } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 68efa8e694c..64a46f9d1a8 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2468,6 +2468,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($tmpcheck != 0 && $tmpcheck != -5) { print ' ('.$langs->trans("WrongSupplierCode").')'; } + var_dump($tmpcheck); print '
'.$langs->trans("Email").'*
'.$langs->trans("Label").'
'.$langs->trans("Label").'*
'.$langs->trans("Note").'
'.$langs->trans("Note").'*
'.$langs->trans("DateStart").'
'.$langs->trans("Creditor"); + print ''.$creditor.''; + print ''; + print '
'.$langs->trans("Attendee"); + print ''; + print $thirdparty->name; + print ''; + print '
'.$langs->trans("Designation"); + print ''.$text; + print ''; + print ''; + print '
'.$langs->trans("Amount"); + print ''; + $valtoshow = $amount; + print ''.price($valtoshow).''; + print ''; + print ''; + + // Currency + print ' '.$langs->trans("Currency".$currency).''; + print ''; + print '
'.$langs->trans("PaymentCode"); + print ''.$fulltag.''; + print ''; + print ''; + print '
*
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("Label").'*
*
'.$langs->trans("Company").'*'; +print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).''."\n"; print '
'.$langs->trans("Company"); -if (!empty(floatval($project->price_registration))) { - print '*'; -} -print '
'.$langs->trans("Address").''."\n"; print '
'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.

'.$project->note_public.'
'."\n"; + +// Name +print ''; +print ''; +print ''; +// Email +print ''."\n"; +// Company +print ''."\n"; +// Type of event +print ''."\n"; +print ''; +// Label +print ''."\n"; +print ''."\n"; +// Note +print ''."\n"; +print ''."\n"; +// Start Date +print ''."\n"; +print ''."\n"; +// End Date +print ''."\n"; +print ''."\n"; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} + +print "
lastname).'" autofocus="autofocus">
'.$langs->trans("Email").'*
'.$langs->trans("Company").'*'; +print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("Label").'*
'.$langs->trans("Note").'*
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("Address").''."\n"; +print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
'.$langs->trans('Country').'*'; +$country_id = GETPOST('country_id'); +if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
'.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } else { + print ''; + } + print '
\n"; + +print dol_get_fiche_end(); + + +// Show all action buttons +print '
'; +print '
'; +// Output introduction text +if ($project->accept_conference_suggestions) { + print ''; + print '

'; +} +print ''; +print '

'; +if ($project->accept_booth_suggestions) { + print ''; +} +print '
'; +print '

'; + + + +print "\n"; +print "
"; +print '
'; + + +llxFooterVierge(); + +$db->close(); diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index b3d9bbc7f37..e4c030c9718 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -1 +1,658 @@ + * Copyright (C) 2001-2002 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 J. Fernando Lagrange + * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018 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 + * 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/public/members/new.php + * \ingroup member + * \brief Example of form to add a new member + * + * Note that you can add following constant to change behaviour of page + * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form + * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited + * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe + * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) + * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted + * MEMBER_NEWFORM_FORCETYPE Force type of member + * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) + * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php +// TODO This should be useless. Because entity must be retrieve from object ref and not from url. +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; + +global $dolibarr_main_instance_unique_id; +global $dolibarr_main_url_root; + +// Init vars +$errmsg = ''; +$num = 0; +$error = 0; +$backtopage = GETPOST('backtopage', 'alpha'); +$action = GETPOST('action', 'aZ09'); + +$eventtype = GETPOST("eventtype"); +$email = GETPOST("email"); +$societe = GETPOST("societe"); +$label = GETPOST("label"); +$note = GETPOST("note"); +$datestart = GETPOST("datestart"); +$dateend = GETPOST("dateend"); + +// Getting id from Post and decoding it +$encodedid = GETPOST('id'); +$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); + +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; +} + +// Security check +$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$securekeyreceived = GETPOST("securekey"); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + +if ($securekeytocompare != $securekeyreceived) { + print $langs->trans('MissingOrBadSecureKey'); + exit; +} + +// Load translation files +$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); + +$extrafields = new ExtraFields($db); + +$user->loadDefaultValues(); + +$cactioncomm = new CActionComm($db); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); + +/** + * Show header for new member + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param array $arrayofjs Array of complementary js files + * @param array $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') +{ + global $user, $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; + } + print '
'; + + print '
'; +} + +/** + * Show footer for new member + * + * @return void + */ +function llxFooterVierge() +{ + print '
'; + + printCommonFooter('public'); + + print "\n"; + print "\n"; +} + + + +/* + * Actions + */ +global $mysoc; +$parameters = array(); +// Note that $action and $object may have been modified by some hooks +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +// Action called when page is submitted +if (empty($reshook) && $action == 'add') { + $error = 0; + + $urlback = ''; + + $db->begin(); + + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + if (!GETPOST("label")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."
\n"; + } + if (!GETPOST("note")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
\n"; + } + if (!GETPOST("datestart")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
\n"; + } + if (!GETPOST("dateend")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
\n"; + } + if (!GETPOST("email")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; + } + if (!GETPOST("lastname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."
\n"; + } + if (!GETPOST("societe")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; + } + if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { + $error++; + $langs->load("errors"); + $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; + } + if (!GETPOST("country_id")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; + } + + if (!$error) { + // Getting the thirdparty or creating it + $thirdparty = new Societe($db); + $resultfetchthirdparty = $thirdparty->fetch('', $societe); + + if ($resultfetchthirdparty<=0) { + // Need to create a new one (not found or multiple with the same name) + $thirdparty->name = $societe; + $thirdparty->address = GETPOST("address"); + $thirdparty->zip = GETPOST("zipcode"); + $thirdparty->town = GETPOST("town"); + $thirdparty->client = 2; + $thirdparty->fournisseur = 0; + $thirdparty->country_id = GETPOST("country_id", 'int'); + $thirdparty->state_id = GETPOST("state_id", 'int'); + $thirdparty->email = $email; + + // Load object modCodeTiers + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeClient = new $module($db); + + if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { + $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); + } + $thirdparty->code_client = $tmpcode; + $readythirdparty = $thirdparty->create($user); + if ($readythirdparty <0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); + $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); + } + } + // From there we have a thirdparty, now looking for the contact + if (!$error) { + $contact = new Contact($db); + $resultcontact = $contact->fetch('', '', '', $email); + if ($resultcontact<=0) { + // Need to create a contact + $contact->socid = $thirdparty->id; + $contact->lastname = (string) GETPOST("lastname", 'alpha'); + $contact->firstname = (string) GETPOST("firstname", 'alpha'); + $contact->address = (string) GETPOST("address", 'alpha'); + $contact->zip = (string) GETPOST("zipcode", 'alpha'); + $contact->town = (string) GETPOST("town", 'alpha'); + $contact->country_id = (int) GETPOST("country_id", 'int'); + $contact->state_id = (int) GETPOST("state_id", 'int'); + $contact->email = $email; + $contact->statut = 1; //Default status to Actif + + $resultcreatecontact = $contact->create($user); + if ($resultcreatecontact<0) { + $error++; + $errmsg .= $contact->error; + } + } + } + + if (!$error) { + // Adding supplier tag and tag from setup to thirdparty + $category = new Categorie($db); + if (GETPOST("suggestconference")) { + // Conference case + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); + } else { + // Booth case + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); + } + + if ($resultcategory<=0) { + $error++; + $errmsg .= $category->error; + } else { + $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CUSTOMER, false); + if ($resultsetcategory < 0) { + $error++; + $errmsg .= $thirdparty->error; + } else { + $thirdparty->fournisseur = 1; + + // Load object modCodeFournisseur + $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); + if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { + $module = substr($module, 0, dol_strlen($module) - 4); + } + $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); + foreach ($dirsociete as $dirroot) { + $res = dol_include_once($dirroot.$module.'.php'); + if ($res) { + break; + } + } + $modCodeFournisseur = new $module; + if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { + $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1); + } + $thirdparty->code_fournisseur = $tmpcode; + + $res = $thirdparty->update(0, $user, 1, 1, 1); + + if ($res <= 0) { + $error++; + } + } + } + } + + if (!$error) { + // We have the contact and the thirdparty + $conforbooth = new ConferenceOrBooth($db); + $conforbooth->label = $label; + $conforbooth->fk_soc = $thirdparty->id; + $conforbooth->fk_project = $project->id; + $conforbooth->note = $note; + $conforbooth->fk_action = $eventtype; + $conforbooth->datep =$datestart; + $conforbooth->datep2 = $dateend; + $conforbooth->datec = dol_now(); + $conforbooth->tms = dol_now(); + $resultconforbooth = $conforbooth->create($user); + if ($resultconforbooth<=0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + // If this is a paying booth, we have to redirect to payment page and create an invoice + if (GETPOST("suggestbooth") && !empty(floatval($project->price_booth))) { + $productforinvoicerow = new Product($db); + $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); + if ($resultprod < 0) { + $error++; + $errmsg .= $productforinvoicerow->error; + } else { + $facture = new Facture($db); + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $contact->cond_reglement_id; + + if (empty($facture->cond_reglement_id)) { + $paymenttermstatic = new PaymentTerm($contact->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $contact->error = 'ErrorNoPaymentTermRECEPFound'; + $contact->errors[] = $contact->error; + } + } + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } else { + $facture->add_object_linked($contact->element, $contact->id); + } + } + + if (!$error) { + // Add line to draft invoice + $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); + $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } + if (!$error) { + $valid = true; + $sourcetouse = 'boothlocation'; + $reftouse = $facture->id; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + } else { + $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + } + } + Header("Location: ".$redirection); + exit; + } + } + } else { + // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->update($user); + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } + } + } + } + } + if (!$error) { + $db->commit(); + $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; + Header("Location: ".$redirection); + exit; + } else { + $db->rollback(); + } +} + + +/* + * View + */ + +$form = new Form($db); +$formcompany = new FormCompany($db); + +llxHeaderVierge($langs->trans("NewSuggestion")); + + +print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center'); + + +print '
'; +print '
'; +print '
'; + +// Welcome message +$text = ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'; +$text .= ''.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.

'."\n"; +$text .= ''.$project->note_public.''."\n";; +print $text; +print '
'; + +dol_htmloutput_errors($errmsg); + +// Print form +print '
'."\n"; +print ''; +print ''; +print ''; +print ''; +print ''; + +print '
'; + +print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; +//print $langs->trans("FieldsWithIsForPublic",'**').'
'; + +print dol_get_fiche_head(''); + +print ''; + +print ''."\n"; + +// Name +print ''; +print ''; +print ''; +// Email +print ''."\n"; +// Company +print ''."\n"; +// Type of event +print ''."\n"; +print ''; +// Label +print ''."\n"; +print ''."\n"; +// Note +print ''."\n"; +print ''."\n"; +// Start Date +print ''."\n"; +print ''."\n"; +// End Date +print ''."\n"; +print ''."\n"; +// Address +print ''."\n"; +// Zip / Town +print ''; +// Country +print ''; +// State +if (empty($conf->global->SOCIETE_DISABLE_STATE)) { + print ''; +} + +print "
lastname).'" autofocus="autofocus">
'.$langs->trans("Email").'*
'.$langs->trans("Company").'*'; +print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("Label").'*
'.$langs->trans("Note").'*
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("Address").''."\n"; +print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; +print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); +print ' / '; +print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); +print '
'.$langs->trans('Country').'*'; +$country_id = GETPOST('country_id'); +if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { + $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); +} +if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { + $country_code = dol_user_country(); + //print $country_code; + if ($country_code) { + $new_country_id = getCountry($country_code, 3, $db, $langs); + //print 'xxx'.$country_code.' - '.$new_country_id; + if ($new_country_id) { + $country_id = $new_country_id; + } + } +} +$country_code = getCountry($country_id, 2, $db, $langs); +print $form->select_country($country_id, 'country_id'); +print '
'.$langs->trans('State').''; + if ($country_code) { + print $formcompany->select_state(GETPOST("state_id"), $country_code); + } else { + print ''; + } + print '
\n"; + +print dol_get_fiche_end(); + + +// Show all action buttons +print '
'; +print '
'; +// Output introduction text +if ($project->accept_conference_suggestions) { + print ''; + print '

'; +} +print ''; +print '

'; +if ($project->accept_booth_suggestions) { + print ''; +} +print '
'; +print '

'; + + + +print "
\n"; +print "
"; +print '
'; + + +llxFooterVierge(); + +$db->close(); From 10c9e9b77c3017d618209de8bd4a8cd4ec8757ae Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 11:31:23 +0200 Subject: [PATCH 020/174] wip --- htdocs/public/project/index.php | 688 ++++++-------------------------- 1 file changed, 133 insertions(+), 555 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index fcbc786be4c..ce48db9e729 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -1,11 +1,10 @@ - * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France - * Copyright (C) 2018 Alexandre Spangaro +/* Copyright (C) 2001-2002 Rodolphe Quiedeville + * Copyright (C) 2006-2017 Laurent Destailleur + * Copyright (C) 2009-2012 Regis Houssin + * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2018-2019 Thibault FOUCART + * Copyright (C) 2021 Waël Almoman * * 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 @@ -19,22 +18,21 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . + * + * For Paypal test: https://developer.paypal.com/ + * For Paybox test: ??? + * For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing + * + * Variants: + * - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new PaymentIntent API + * - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API + * - If no option set, we use old APIS (charge) */ /** - * \file htdocs/public/members/new.php - * \ingroup member - * \brief Example of form to add a new member - * - * Note that you can add following constant to change behaviour of page - * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form - * MEMBER_NEWFORM_EDITAMOUNT 0 or 1 = Amount can be edited - * MEMBER_NEWFORM_PAYONLINE Suggest payment with paypal, paybox or stripe - * MEMBER_NEWFORM_DOLIBARRTURNOVER Show field turnover (specific for dolibarr foundation) - * MEMBER_URL_REDIRECT_SUBSCRIPTION Url to redirect once subscribe submitted - * MEMBER_NEWFORM_FORCETYPE Force type of member - * MEMBER_NEWFORM_FORCEMORPHY Force nature of member (mor/phy) - * MEMBER_NEWFORM_FORCECOUNTRYCODE Force country + * \file htdocs/public/payment/newpayment.php + * \ingroup core + * \brief File to offer a way to make a payment for a particular Dolibarr object */ if (!defined('NOLOGIN')) { @@ -49,52 +47,38 @@ if (!defined('NOIPCHECK')) { if (!defined('NOBROWSERNOTIF')) { define('NOBROWSERNOTIF', '1'); } -if (!defined('NOIPCHECK')) { - define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -} // For MultiCompany module. -// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php -// TODO This should be useless. Because entity must be retrieve from object ref and not from url. -$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); +// Do not use GETPOST here, function is not defined and get of entity must be done before including main.inc.php +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1)))); if (is_numeric($entity)) { define("DOLENTITY", $entity); } require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/paymentterm.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +// Hook to be used by external payment modules (ie Payzen, ...) +include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; +$hookmanager = new HookManager($db); +$hookmanager->initHooks(array('newpayment')); +// For encryption global $dolibarr_main_instance_unique_id; -global $dolibarr_main_url_root; -// Init vars -$errmsg = ''; -$num = 0; -$error = 0; -$backtopage = GETPOST('backtopage', 'alpha'); -$action = GETPOST('action', 'aZ09'); - -// Getting id from Post and decoding it -$encodedid = GETPOST('id'); -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); - -$project = new Project($db); -$resultproject = $project->fetch($id); -if ($resultproject < 0) { - $error++; - $errmsg .= $project->error; -} +// Load translation files +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data // Security check -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +// No check on module enabled. Done later according to $validpaymentmethod + +$action = GETPOST('action', 'aZ09'); +$id = GETPOST('id'); $securekeyreceived = GETPOST("securekey"); $securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); @@ -103,548 +87,142 @@ if ($securekeytocompare != $securekeyreceived) { exit; } -// Load translation files -$langs->loadLangs(array("main", "companies", "install", "other", "eventorganization")); +// Define $urlwithroot +//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +//$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('publicnewmembercard', 'globalcard')); - -$extrafields = new ExtraFields($db); - -$user->loadDefaultValues(); - -$cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); - -/** - * Show header for new member - * - * @param string $title Title - * @param string $head Head array - * @param int $disablejs More content into html header - * @param int $disablehead More content into html header - * @param array $arrayofjs Array of complementary js files - * @param array $arrayofcss Array of complementary css files - * @return void - */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '') -{ - global $user, $conf, $langs, $mysoc; - - top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - - print ''; - - // Define urllogo - $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; - - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; - } - - print '
'; - // Output html code for logo - if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { - print ''; - } - print '
'; - } - print '
'; - - print '
'; +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; } -/** - * Show footer for new member - * - * @return void - */ -function llxFooterVierge() -{ - print '
'; - - printCommonFooter('public'); - - print "\n"; - print "\n"; -} - - - /* * Actions */ -global $mysoc; -$parameters = array(); -// Note that $action and $object may have been modified by some hooks -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); -if ($reshook < 0) { - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -} - -// Action called when page is submitted -if (empty($reshook) && $action == 'add') { - $error = 0; - - $urlback = ''; - - $db->begin(); - - if (!GETPOST("email")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; - } - if (!GETPOST("label")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."
\n"; - } - if (!GETPOST("note")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
\n"; - } - if (!GETPOST("datestart")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
\n"; - } - if (!GETPOST("dateend")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
\n"; - } - if (!GETPOST("email")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; - } - if (!GETPOST("lastname")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."
\n"; - } - if (!GETPOST("societe")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; - } - if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { - $error++; - $langs->load("errors"); - $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; - } - if (!GETPOST("country_id")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; - } - - if (!$error) { - // Getting the thirdparty or creating it - $thirdparty = new Societe($db); - $resultfetchthirdparty = $thirdparty->fetch('', $societe); - - if ($resultfetchthirdparty<=0) { - // Need to create a new one (not found or multiple with the same name) - $thirdparty->name = $societe; - $thirdparty->address = GETPOST("address"); - $thirdparty->zip = GETPOST("zipcode"); - $thirdparty->town = GETPOST("town"); - $thirdparty->client = 2; - $thirdparty->fournisseur = 0; - $thirdparty->country_id = GETPOST("country_id", 'int'); - $thirdparty->state_id = GETPOST("state_id", 'int'); - $thirdparty->email = $email; - - // Load object modCodeTiers - $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); - if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { - $module = substr($module, 0, dol_strlen($module) - 4); - } - $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) { - $res = dol_include_once($dirroot.$module.'.php'); - if ($res) { - break; - } - } - $modCodeClient = new $module($db); - - if (empty($tmpcode) && !empty($modCodeClient->code_auto)) { - $tmpcode = $modCodeClient->getNextValue($thirdparty, 0); - } - $thirdparty->code_client = $tmpcode; - $readythirdparty = $thirdparty->create($user); - if ($readythirdparty <0) { - $error++; - $errmsg .= $thirdparty->error; - } else { - $thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs); - $thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs); - } - } - // From there we have a thirdparty, now looking for the contact - if (!$error) { - $contact = new Contact($db); - $resultcontact = $contact->fetch('', '', '', $email); - if ($resultcontact<=0) { - // Need to create a contact - $contact->socid = $thirdparty->id; - $contact->lastname = (string) GETPOST("lastname", 'alpha'); - $contact->firstname = (string) GETPOST("firstname", 'alpha'); - $contact->address = (string) GETPOST("address", 'alpha'); - $contact->zip = (string) GETPOST("zipcode", 'alpha'); - $contact->town = (string) GETPOST("town", 'alpha'); - $contact->country_id = (int) GETPOST("country_id", 'int'); - $contact->state_id = (int) GETPOST("state_id", 'int'); - $contact->email = $email; - $contact->statut = 1; //Default status to Actif - - $resultcreatecontact = $contact->create($user); - if ($resultcreatecontact<0) { - $error++; - $errmsg .= $contact->error; - } - } - } - - if (!$error) { - // Adding supplier tag and tag from setup to thirdparty - $category = new Categorie($db); - if (GETPOST("suggestconference")) { - // Conference case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); - } else { - // Booth case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); - } - - if ($resultcategory<=0) { - $error++; - $errmsg .= $category->error; - } else { - $resultsetcategory = $thirdparty->setCategoriesCommon(array($category->id), CATEGORIE::TYPE_CUSTOMER, false); - if ($resultsetcategory < 0) { - $error++; - $errmsg .= $thirdparty->error; - } else { - $thirdparty->fournisseur = 1; - - // Load object modCodeFournisseur - $module = (!empty($conf->global->SOCIETE_CODECLIENT_ADDON) ? $conf->global->SOCIETE_CODECLIENT_ADDON : 'mod_codeclient_leopard'); - if (substr($module, 0, 15) == 'mod_codeclient_' && substr($module, -3) == 'php') { - $module = substr($module, 0, dol_strlen($module) - 4); - } - $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); - foreach ($dirsociete as $dirroot) { - $res = dol_include_once($dirroot.$module.'.php'); - if ($res) { - break; - } - } - $modCodeFournisseur = new $module; - if (empty($tmpcode) && !empty($modCodeFournisseur->code_auto)) { - $tmpcode = $modCodeFournisseur->getNextValue($thirdparty, 1); - } - $thirdparty->code_fournisseur = $tmpcode; - - $res = $thirdparty->update(0, $user, 1, 1, 1); - - if ($res <= 0) { - $error++; - } - } - } - } - - if (!$error) { - // We have the contact and the thirdparty - $conforbooth = new ConferenceOrBooth($db); - $conforbooth->label = $label; - $conforbooth->fk_soc = $thirdparty->id; - $conforbooth->fk_project = $project->id; - $conforbooth->note = $note; - $conforbooth->fk_action = $eventtype; - $conforbooth->datep =$datestart; - $conforbooth->datep2 = $dateend; - $conforbooth->datec = dol_now(); - $conforbooth->tms = dol_now(); - $resultconforbooth = $conforbooth->create($user); - if ($resultconforbooth<=0) { - $error++; - $errmsg .= $conforbooth->error; - } else { - // If this is a paying booth, we have to redirect to payment page and create an invoice - if (GETPOST("suggestbooth") && !empty(floatval($project->price_booth))) { - $productforinvoicerow = new Product($db); - $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); - if ($resultprod < 0) { - $error++; - $errmsg .= $productforinvoicerow->error; - } else { - $facture = new Facture($db); - $facture->type = Facture::TYPE_STANDARD; - $facture->socid = $thirdparty->id; - $facture->paye = 0; - $facture->date = dol_now(); - $facture->cond_reglement_id = $contact->cond_reglement_id; - - if (empty($facture->cond_reglement_id)) { - $paymenttermstatic = new PaymentTerm($contact->db); - $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); - if (empty($facture->cond_reglement_id)) { - $error++; - $contact->error = 'ErrorNoPaymentTermRECEPFound'; - $contact->errors[] = $contact->error; - } - } - $resultfacture = $facture->create($user); - if ($resultfacture <= 0) { - $contact->error = $facture->error; - $contact->errors = $facture->errors; - $error++; - } else { - $facture->add_object_linked($contact->element, $contact->id); - } - } - - if (!$error) { - // Add line to draft invoice - $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); - $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); - if ($result <= 0) { - $contact->error = $facture->error; - $contact->errors = $facture->errors; - $error++; - } - if (!$error) { - $valid = true; - $sourcetouse = 'boothlocation'; - $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical - } else { - $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - } - } - Header("Location: ".$redirection); - exit; - } - } - } else { - // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; - $conforbooth->update($user); - // Sending mail - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; - - $ishtml = dol_textishtml($texttosend); // May contain urls - - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - - $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); - } - } - } - } - } - if (!$error) { - $db->commit(); - $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); - $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; - Header("Location: ".$redirection); - exit; - } else { - $db->rollback(); - } -} /* * View */ -$form = new Form($db); -$formcompany = new FormCompany($db); +$head = ''; +if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) { + $head = ''."\n"; +} -llxHeaderVierge($langs->trans("NewSuggestion")); +$conf->dol_hide_topmenu = 1; +$conf->dol_hide_leftmenu = 1; + +$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; +llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); -print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center'); +// Show sandbox warning +if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled) && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'int'))) { // We can force sand box with param 'forcesandbox' + dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), '', 'warning'); +} +if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'int'))) { + dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); +} -print '
'; -print '
'; -print '
'; +print ''."\n"; +print '
'."\n"; +print '
'."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''; +print ''; +print "\n"; -// Welcome message -$text = ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'; + +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) +// Define logo and logosmall +$logosmall = $mysoc->logo_small; +$logo = $mysoc->logo; +$paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; +if (!empty($conf->global->$paramlogo)) { + $logosmall = $conf->global->$paramlogo; +} elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) { + $logosmall = $conf->global->ONLINE_PAYMENT_LOGO; +} +//print ''."\n"; +// Define urllogo +$urllogo = ''; +$urllogofull = ''; +if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); +} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); +} + +// Output html code for logo +if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; +} + +print ''."\n"; + +$text = ''."\n"; $text .= ''."\n"; -$text .= ''."\n";; +$text .= ''."\n";; + print $text; -print ''; -dol_htmloutput_errors($errmsg); +// Output payment summary form +print ''."\n"; + +print '

'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.

'.$project->note_public.'
'.$project->note_public.'

'; -// Print form -print ''."\n"; -print ''; -print ''; -print ''; -print ''; -print ''; +$found = false; +$error = 0; +$var = false; -print '
'; +$object = null; -print '
'.$langs->trans("FieldsWithAreMandatory", '*').'
'; -//print $langs->trans("FieldsWithIsForPublic",'**').'
'; - -print dol_get_fiche_head(''); - -print ''; - -print ''."\n"; - -// Name -print ''; -print ''; -print ''; -// Email -print ''."\n"; -// Company -print ''."\n"; -// Type of event -print ''."\n"; -print ''; -// Label -print ''."\n"; -print ''."\n"; -// Note -print ''."\n"; -print ''."\n"; -// Start Date -print ''."\n"; -print ''."\n"; -// End Date -print ''."\n"; -print ''."\n"; -// Address -print ''."\n"; -// Zip / Town -print ''; -// Country -print ''; -// State -if (empty($conf->global->SOCIETE_DISABLE_STATE)) { - print ''; -} - -print "
lastname).'" autofocus="autofocus">
'.$langs->trans("Email").'*
'.$langs->trans("Company").'*'; -print '
'.$langs->trans("EventType").'*'.FORM::selectarray('eventtype', $arrayofeventtype, $eventtype).'
'.$langs->trans("Label").'*
'.$langs->trans("Note").'*
'.$langs->trans("DateStart").'
'.$langs->trans("DateEnd").'
'.$langs->trans("Address").''."\n"; -print '
'.$langs->trans('Zip').' / '.$langs->trans('Town').''; -print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1); -print ' / '; -print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); -print '
'.$langs->trans('Country').'*'; -$country_id = GETPOST('country_id'); -if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { - $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); -} -if (!$country_id && !empty($conf->geoipmaxmind->enabled)) { - $country_code = dol_user_country(); - //print $country_code; - if ($country_code) { - $new_country_id = getCountry($country_code, 3, $db, $langs); - //print 'xxx'.$country_code.' - '.$new_country_id; - if ($new_country_id) { - $country_id = $new_country_id; - } - } -} -$country_code = getCountry($country_id, 2, $db, $langs); -print $form->select_country($country_id, 'country_id'); -print '
'.$langs->trans('State').''; - if ($country_code) { - print $formcompany->select_state(GETPOST("state_id"), $country_code); - } else { - print ''; - } - print '
\n"; - -print dol_get_fiche_end(); +print "\n"; // Show all action buttons -print '
'; print '
'; // Output introduction text if ($project->accept_conference_suggestions) { - print ''; + print ''; print '

'; } -print ''; +print ''; print '

'; if ($project->accept_booth_suggestions) { - print ''; + print ''; } -print '
'; -print '

'; -print "\n"; -print "
"; -print ''; +print '
'."\n"; + +print ''."\n"; +print '
'."\n"; +print '
'; -llxFooterVierge(); +htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); + +llxFooter('', 'public'); $db->close(); From 099ad77d44b282417187c3003479c4bc60c457a4 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 11:32:07 +0200 Subject: [PATCH 021/174] encryption change for url --- htdocs/eventorganization/conferenceorbooth_list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index e3ba815121c..be8770b6390 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -364,8 +364,7 @@ if ($projectid > 0) { // Link to the vote/register page print ''.$langs->trans("RegisterPage").''; - $encodedid = dol_encode($project->id, $dolibarr_main_instance_unique_id); - $linkregister = $dolibarr_main_url_root.'/public/project/index.php?id='.$encodedid; + $linkregister = $dolibarr_main_url_root.'/public/project/index.php?id='.$project->id; $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 2); $linkregister .= '&securekey='.urlencode($encodedsecurekey); print ''.$linkregister.''; From df78aaff889bfab4b3803e07b8d4267ce47ea895 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 11:49:00 +0200 Subject: [PATCH 022/174] now 2 distinct pages to suggest a conf or a booth --- htdocs/public/project/index.php | 45 ++++++++++++--------- htdocs/public/project/suggestbooth.php | 16 ++------ htdocs/public/project/suggestconference.php | 16 ++------ 3 files changed, 35 insertions(+), 42 deletions(-) diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index ce48db9e729..9ddfc8ce759 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -103,6 +103,23 @@ if ($resultproject < 0) { * Actions */ +if (GETPOST('suggestbooth')) { + header("Location: ".dol_buildpath('/public/project/suggestbooth.php', 1).'?id='.$id."&securekey=".$securekeyreceived); + exit; +} + +if (GETPOST('suggestconference')) { + header("Location: ".dol_buildpath('/public/project/suggestconference.php', 1).'?id='.$id."&securekey=".$securekeyreceived); + exit; +} + +if (GETPOST('viewandvote')) { + header("Location: ".dol_buildpath('/public/project/viewandvote.php', 1).'?id='.$id."&securekey=".$securekeyreceived); + exit; +} + + + /* * View @@ -119,24 +136,15 @@ $conf->dol_hide_leftmenu = 1; $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); - -// Show sandbox warning -if ((empty($paymentmethod) || $paymentmethod == 'paypal') && !empty($conf->paypal->enabled) && (!empty($conf->global->PAYPAL_API_SANDBOX) || GETPOST('forcesandbox', 'int'))) { // We can force sand box with param 'forcesandbox' - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Paypal'), '', 'warning'); -} -if ((empty($paymentmethod) || $paymentmethod == 'stripe') && !empty($conf->stripe->enabled) && (empty($conf->global->STRIPE_LIVE) || GETPOST('forcesandbox', 'int'))) { - dol_htmloutput_mesg($langs->trans('YouAreCurrentlyInSandboxMode', 'Stripe'), '', 'warning'); -} - - print ''."\n"; print '
'."\n"; print '
'."\n"; print ''."\n"; print ''."\n"; print ''."\n"; -print ''."\n"; -print ''."\n"; +//print ''."\n"; +print ''."\n"; +print ''."\n"; print ''; print ''; print "\n"; @@ -200,15 +208,16 @@ print "\n"; // Show all action buttons print '
'; // Output introduction text -if ($project->accept_conference_suggestions) { - print ''; +if ($project->accept_booth_suggestions) { + print ''; print '

'; } -print ''; -print '

'; -if ($project->accept_booth_suggestions) { - print ''; +if ($project->accept_conference_suggestions) { + print ''; + print '

'; } +print ''; + diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index e4c030c9718..119741f6233 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -90,9 +90,7 @@ $note = GETPOST("note"); $datestart = GETPOST("datestart"); $dateend = GETPOST("dateend"); -// Getting id from Post and decoding it -$encodedid = GETPOST('id'); -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$id = GETPOST('id'); $project = new Project($db); $resultproject = $project->fetch($id); @@ -102,7 +100,6 @@ if ($resultproject < 0) { } // Security check -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); $securekeyreceived = GETPOST("securekey"); $securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); @@ -122,7 +119,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'booth@eventorganization\''); /** * Show header for new member @@ -322,13 +319,8 @@ if (empty($reshook) && $action == 'add') { if (!$error) { // Adding supplier tag and tag from setup to thirdparty $category = new Categorie($db); - if (GETPOST("suggestconference")) { - // Conference case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); - } else { - // Booth case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); - } + + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); if ($resultcategory<=0) { $error++; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index e4c030c9718..68ed90fc260 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -90,9 +90,7 @@ $note = GETPOST("note"); $datestart = GETPOST("datestart"); $dateend = GETPOST("dateend"); -// Getting id from Post and decoding it -$encodedid = GETPOST('id'); -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$id = GETPOST('id'); $project = new Project($db); $resultproject = $project->fetch($id); @@ -102,7 +100,6 @@ if ($resultproject < 0) { } // Security check -$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); $securekeyreceived = GETPOST("securekey"); $securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); @@ -122,7 +119,7 @@ $extrafields = new ExtraFields($db); $user->loadDefaultValues(); $cactioncomm = new CActionComm($db); -$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\' OR module=\'booth@eventorganization\''); +$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\''); /** * Show header for new member @@ -322,13 +319,8 @@ if (empty($reshook) && $action == 'add') { if (!$error) { // Adding supplier tag and tag from setup to thirdparty $category = new Categorie($db); - if (GETPOST("suggestconference")) { - // Conference case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); - } else { - // Booth case - $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH); - } + + $resultcategory = $category->fetch($conf->global->EVENTORGANIZATION_CATEG_THIRDPARTY_CONF); if ($resultcategory<=0) { $error++; From c56c7afa89f79761b18392649603ce79d343c5de Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 11:59:24 +0200 Subject: [PATCH 023/174] update on specifications on suggesting a booth/conf since its now two separated pages --- htdocs/public/project/suggestbooth.php | 4 +- htdocs/public/project/suggestconference.php | 141 ++++++-------------- 2 files changed, 42 insertions(+), 103 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 119741f6233..bec7c1c55a1 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -378,7 +378,7 @@ if (empty($reshook) && $action == 'add') { $errmsg .= $conforbooth->error; } else { // If this is a paying booth, we have to redirect to payment page and create an invoice - if (GETPOST("suggestbooth") && !empty(floatval($project->price_booth))) { + if (!empty(floatval($project->price_booth))) { $productforinvoicerow = new Product($db); $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); if ($resultprod < 0) { @@ -437,7 +437,7 @@ if (empty($reshook) && $action == 'add') { } } } else { - // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update + // If no price has been set for the booth, we confirm it as suggested and we update $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; $conforbooth->update($user); // Sending mail diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 68ed90fc260..fc452c740bb 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -378,110 +378,49 @@ if (empty($reshook) && $action == 'add') { $errmsg .= $conforbooth->error; } else { // If this is a paying booth, we have to redirect to payment page and create an invoice - if (GETPOST("suggestbooth") && !empty(floatval($project->price_booth))) { - $productforinvoicerow = new Product($db); - $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); - if ($resultprod < 0) { - $error++; - $errmsg .= $productforinvoicerow->error; - } else { - $facture = new Facture($db); - $facture->type = Facture::TYPE_STANDARD; - $facture->socid = $thirdparty->id; - $facture->paye = 0; - $facture->date = dol_now(); - $facture->cond_reglement_id = $contact->cond_reglement_id; + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->update($user); + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; - if (empty($facture->cond_reglement_id)) { - $paymenttermstatic = new PaymentTerm($contact->db); - $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); - if (empty($facture->cond_reglement_id)) { - $error++; - $contact->error = 'ErrorNoPaymentTermRECEPFound'; - $contact->errors[] = $contact->error; - } - } - $resultfacture = $facture->create($user); - if ($resultfacture <= 0) { - $contact->error = $facture->error; - $contact->errors = $facture->errors; - $error++; - } else { - $facture->add_object_linked($contact->element, $contact->id); - } - } + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } - if (!$error) { - // Add line to draft invoice - $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); - $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); - if ($result <= 0) { - $contact->error = $facture->error; - $contact->errors = $facture->errors; - $error++; - } - if (!$error) { - $valid = true; - $sourcetouse = 'boothlocation'; - $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical - } else { - $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; - } - } - Header("Location: ".$redirection); - exit; - } - } + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); } else { - // If no price has been set for the booth or this is a conference, we confirm it as suggested and we update - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; - $conforbooth->update($user); - // Sending mail - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; - - $ishtml = dol_textishtml($texttosend); // May contain urls - - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - - $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); - } + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } } From 4d8d94bfbf254aee0af122821d8f04c42c0a0560 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 12:13:49 +0200 Subject: [PATCH 024/174] fixes: show only correspond button on specific page, id no longer encoded in hidden parameter --- htdocs/public/project/suggestbooth.php | 13 ++----------- htdocs/public/project/suggestconference.php | 15 +++------------ 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index bec7c1c55a1..96a00434374 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -530,7 +530,7 @@ print ''. print ''; print ''; print ''; -print ''; +print ''; print ''; print '
'; @@ -625,16 +625,7 @@ print dol_get_fiche_end(); // Show all action buttons print '
'; print '
'; -// Output introduction text -if ($project->accept_conference_suggestions) { - print ''; - print '

'; -} -print ''; -print '

'; -if ($project->accept_booth_suggestions) { - print ''; -} +print ''; print '
'; print '

'; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index fc452c740bb..1350716072b 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -469,7 +469,7 @@ print ''. print ''; print ''; print ''; -print ''; +print ''; print ''; print '
'; @@ -564,21 +564,12 @@ print dol_get_fiche_end(); // Show all action buttons print '
'; print '
'; -// Output introduction text -if ($project->accept_conference_suggestions) { - print ''; - print '

'; -} -print ''; -print '

'; -if ($project->accept_booth_suggestions) { - print ''; -} -print '
'; +print ''; print '

'; + print "\n"; print "
"; print '
'; From abeb1c644c7721bc931eaf97611d0ac6b09489da Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 13:50:13 +0200 Subject: [PATCH 025/174] country now only required when paying a booth, dates of start and end required --- htdocs/public/project/suggestbooth.php | 13 +++++++++---- htdocs/public/project/suggestconference.php | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 96a00434374..e8b7ad44874 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -242,7 +242,7 @@ if (empty($reshook) && $action == 'add') { $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; } - if (!GETPOST("country_id")) { + if (!GETPOST("country_id") && !empty(floatval($project->price_booth))) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; } @@ -407,6 +407,7 @@ if (empty($reshook) && $action == 'add') { $contact->errors = $facture->errors; $error++; } else { + $db->commit(); $facture->add_object_linked($contact->element, $contact->id); } } @@ -572,10 +573,10 @@ print '*'."\n"; print ''."\n"; // Start Date -print ''.$langs->trans("DateStart").''."\n"; +print ''.$langs->trans("DateStart").'*'."\n"; print ''."\n"; // End Date -print ''.$langs->trans("DateEnd").''."\n"; +print ''.$langs->trans("DateEnd").'*'."\n"; print ''."\n"; // Address print ''.$langs->trans("Address").''."\n"; @@ -587,7 +588,11 @@ print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print ''; // Country -print ''.$langs->trans('Country').'*'; +print ''.$langs->trans('Country'); +if (!empty(floatval($project->price_booth))) { + print '*'; +} +print ''; $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 1350716072b..0483312e519 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -526,7 +526,7 @@ print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print ''; // Country -print ''.$langs->trans('Country').'*'; +print ''.$langs->trans('Country').''; $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); From 9c20e92e179eb86ac4f49b9321e221edcc9be662 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 14:06:53 +0200 Subject: [PATCH 026/174] country no longer required for conf, preparation of add_contact to conforbooth (not done, commented) and page name change --- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/project/index.php | 2 +- htdocs/public/project/suggestbooth.php | 10 +++- htdocs/public/project/suggestconference.php | 61 +++++++++++---------- 4 files changed, 43 insertions(+), 31 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 7b5ddd8160c..1d7b16c17f6 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -96,6 +96,7 @@ EvntOrgCancelled = Cancelled # # Public page # +SuggestForm = Suggestion page RegisterPage = Page for conferences or booth EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page. EvntOrgRegistrationHelpMessage = Here, you can suggest a new conference or a new booth for the project diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 9ddfc8ce759..b05f2b1fc6f 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -134,7 +134,7 @@ $conf->dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; -llxHeader($head, $langs->trans("PaymentForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); +llxHeader($head, $langs->trans("SuggestForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); print ''."\n"; print '
'."\n"; diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index e8b7ad44874..3db61f67129 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -377,7 +377,14 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $conforbooth->error; } else { - // If this is a paying booth, we have to redirect to payment page and create an invoice + // Adding the contact to the project + /*$resultaddcontact = $conforbooth->add_contact($contact); + if ($resultaddcontact<0) { + $error++; + $errmsg .= $conforbooth->error; + } else {*/ + + // If this is a paying booth, we have to redirect to payment page and create an invoice if (!empty(floatval($project->price_booth))) { $productforinvoicerow = new Product($db); $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); @@ -484,6 +491,7 @@ if (empty($reshook) && $action == 'add') { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } + //} } } } diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 0483312e519..21cbe7d77bd 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -242,10 +242,6 @@ if (empty($reshook) && $action == 'add') { $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; } - if (!GETPOST("country_id")) { - $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; - } if (!$error) { // Getting the thirdparty or creating it @@ -377,22 +373,28 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $conforbooth->error; } else { - // If this is a paying booth, we have to redirect to payment page and create an invoice - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; - $conforbooth->update($user); - // Sending mail - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; + // Adding the contact to the project + /*$resultaddcontact = $conforbooth->add_contact($contact); + if ($resultaddcontact<0) { + $error++; + $errmsg .= $conforbooth->error; + } else {*/ + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->update($user); - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; if (!empty($labeltouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); } @@ -402,26 +404,27 @@ if (empty($reshook) && $action == 'add') { $msg = $arraydefaultmessage->content; } - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; - $ishtml = dol_textishtml($texttosend); // May contain urls + $ishtml = dol_textishtml($texttosend); // May contain urls - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - $result = $mailfile->sendfile(); + $result = $mailfile->sendfile(); if ($result) { dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); } else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } + //} } } } From a00c9c44c35f3e98542de2b50b804638210f496f Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 14:26:41 +0200 Subject: [PATCH 027/174] now adding contact to conforbooth, not only to thirdparty --- htdocs/public/project/suggestbooth.php | 203 ++++++++++---------- htdocs/public/project/suggestconference.php | 28 +-- 2 files changed, 115 insertions(+), 116 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 3db61f67129..bb03c0d3782 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -378,120 +378,119 @@ if (empty($reshook) && $action == 'add') { $errmsg .= $conforbooth->error; } else { // Adding the contact to the project - /*$resultaddcontact = $conforbooth->add_contact($contact); + $resultaddcontact = $conforbooth->add_contact($contact->id, 'RESPONSIBLE'); if ($resultaddcontact<0) { $error++; $errmsg .= $conforbooth->error; - } else {*/ - + } else { // If this is a paying booth, we have to redirect to payment page and create an invoice - if (!empty(floatval($project->price_booth))) { - $productforinvoicerow = new Product($db); - $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); - if ($resultprod < 0) { - $error++; - $errmsg .= $productforinvoicerow->error; - } else { - $facture = new Facture($db); - $facture->type = Facture::TYPE_STANDARD; - $facture->socid = $thirdparty->id; - $facture->paye = 0; - $facture->date = dol_now(); - $facture->cond_reglement_id = $contact->cond_reglement_id; - - if (empty($facture->cond_reglement_id)) { - $paymenttermstatic = new PaymentTerm($contact->db); - $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); - if (empty($facture->cond_reglement_id)) { - $error++; - $contact->error = 'ErrorNoPaymentTermRECEPFound'; - $contact->errors[] = $contact->error; - } - } - $resultfacture = $facture->create($user); - if ($resultfacture <= 0) { - $contact->error = $facture->error; - $contact->errors = $facture->errors; + if (!empty(floatval($project->price_booth))) { + $productforinvoicerow = new Product($db); + $resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_BOOTH_LOCATION); + if ($resultprod < 0) { $error++; + $errmsg .= $productforinvoicerow->error; } else { - $db->commit(); - $facture->add_object_linked($contact->element, $contact->id); - } - } + $facture = new Facture($db); + $facture->type = Facture::TYPE_STANDARD; + $facture->socid = $thirdparty->id; + $facture->paye = 0; + $facture->date = dol_now(); + $facture->cond_reglement_id = $contact->cond_reglement_id; - if (!$error) { - // Add line to draft invoice - $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); - $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); - if ($result <= 0) { - $contact->error = $facture->error; - $contact->errors = $facture->errors; - $error++; - } - if (!$error) { - $valid = true; - $sourcetouse = 'boothlocation'; - $reftouse = $facture->id; - $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { - if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { - $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical - } else { - $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + if (empty($facture->cond_reglement_id)) { + $paymenttermstatic = new PaymentTerm($contact->db); + $facture->cond_reglement_id = $paymenttermstatic->getDefaultId(); + if (empty($facture->cond_reglement_id)) { + $error++; + $contact->error = 'ErrorNoPaymentTermRECEPFound'; + $contact->errors[] = $contact->error; } } - Header("Location: ".$redirection); - exit; + $resultfacture = $facture->create($user); + if ($resultfacture <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } else { + $db->commit(); + $facture->add_object_linked($contact->element, $contact->id); + } + } + + if (!$error) { + // Add line to draft invoice + $vattouse = get_default_tva($mysoc, $thirdparty, $productforinvoicerow->id); + $result = $facture->addline($langs->trans("BoothLocationFee", $conforbooth->label, dol_print_date($conforbooth->datep, '%d/%m/%y %H:%M:%S'), dol_print_date($conforbooth->datep2, '%d/%m/%y %H:%M:%S')), floatval($project->price_booth), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, dol_now(), '', 0, 0, '', 'HT', 0, 1); + if ($result <= 0) { + $contact->error = $facture->error; + $contact->errors = $facture->errors; + $error++; + } + if (!$error) { + $valid = true; + $sourcetouse = 'boothlocation'; + $reftouse = $facture->id; + $redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$conforbooth->id; + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { + $redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical + } else { + $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; + } + } + Header("Location: ".$redirection); + exit; + } + } + } else { + // If no price has been set for the booth, we confirm it as suggested and we update + $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->update($user); + // Sending mail + require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); + + $sendto = $thirdparty->email; + $from = $conf->global->MAILING_EMAIL_FROM; + $urlback = $_SERVER["REQUEST_URI"]; + + $ishtml = dol_textishtml($texttosend); // May contain urls + + $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); + + $result = $mailfile->sendfile(); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } } - } else { - // If no price has been set for the booth, we confirm it as suggested and we update - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; - $conforbooth->update($user); - // Sending mail - require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - // Set output language - $outputlangs = new Translate('', $conf); - $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang); - // Load traductions files required by page - $outputlangs->loadLangs(array("main", "members")); - // Get email content from template - $arraydefaultmessage = null; - - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } - - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } - - $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); - complete_substitutions_array($substitutionarray, $outputlangs, $object); - - $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); - $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs); - - $sendto = $thirdparty->email; - $from = $conf->global->MAILING_EMAIL_FROM; - $urlback = $_SERVER["REQUEST_URI"]; - - $ishtml = dol_textishtml($texttosend); // May contain urls - - $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); - - $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); - } } - //} } } } diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 21cbe7d77bd..92c53795004 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -374,11 +374,11 @@ if (empty($reshook) && $action == 'add') { $errmsg .= $conforbooth->error; } else { // Adding the contact to the project - /*$resultaddcontact = $conforbooth->add_contact($contact); + $resultaddcontact = $conforbooth->add_contact($contact->id, 'SPEAKER'); if ($resultaddcontact<0) { $error++; $errmsg .= $conforbooth->error; - } else {*/ + } else { $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; $conforbooth->update($user); @@ -395,14 +395,14 @@ if (empty($reshook) && $action == 'add') { $arraydefaultmessage = null; $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; - if (!empty($labeltouse)) { - $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); - } + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); + } - if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { - $subject = $arraydefaultmessage->topic; - $msg = $arraydefaultmessage->content; - } + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); complete_substitutions_array($substitutionarray, $outputlangs, $object); @@ -419,12 +419,12 @@ if (empty($reshook) && $action == 'add') { $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml); $result = $mailfile->sendfile(); - if ($result) { - dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); - } else { - dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + if ($result) { + dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment'); + } else { + dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); + } } - //} } } } From 2f7dd4e8070bbc3cb877c0559cba3875cd747659 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 14:53:23 +0200 Subject: [PATCH 028/174] wip vote page --- htdocs/langs/en_US/eventorganization.lang | 4 +- htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- htdocs/public/project/viewandvote.php | 216 ++++++++++++++++++++ 4 files changed, 221 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 1d7b16c17f6..1940c9674c1 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -99,7 +99,9 @@ EvntOrgCancelled = Cancelled SuggestForm = Suggestion page RegisterPage = Page for conferences or booth EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page. -EvntOrgRegistrationHelpMessage = Here, you can suggest a new conference or a new booth for the project +EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project +EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project +EvntOrgVoteHelpMessage = Here, you can view and vote for the suggested events for the project SuggestConference = Suggest a new conference SuggestBooth = Suggest a booth ViewAndVote = View and vote for suggested events diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index bb03c0d3782..ecaf524c034 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -526,7 +526,7 @@ print '
'; // Welcome message $text = ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'; -$text .= ''.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.

'."\n"; +$text .= ''.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$id.'.

'."\n"; $text .= ''.$project->note_public.''."\n";; print $text; print '
'; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 92c53795004..53dc9581d9a 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -460,7 +460,7 @@ print '
'; // Welcome message $text = ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'; -$text .= ''.$langs->trans("EvntOrgRegistrationHelpMessage").' '.$id.'.

'."\n"; +$text .= ''.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$id.'.

'."\n"; $text .= ''.$project->note_public.''."\n";; print $text; print '
'; diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index b3d9bbc7f37..fe7d4d2ed59 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -1 +1,217 @@ + * Copyright (C) 2006-2017 Laurent Destailleur + * Copyright (C) 2009-2012 Regis Houssin + * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2018-2019 Thibault FOUCART + * Copyright (C) 2021 Waël Almoman + * + * 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 . + * + * For Paypal test: https://developer.paypal.com/ + * For Paybox test: ??? + * For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing + * + * Variants: + * - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new PaymentIntent API + * - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API + * - If no option set, we use old APIS (charge) + */ + +/** + * \file htdocs/public/payment/newpayment.php + * \ingroup core + * \brief File to offer a way to make a payment for a particular Dolibarr object + */ + +if (!defined('NOLOGIN')) { + define("NOLOGIN", 1); // This means this output page does not require to be logged. +} +if (!defined('NOCSRFCHECK')) { + define("NOCSRFCHECK", 1); // We accept to go on this page from external web site. +} +if (!defined('NOIPCHECK')) { + define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} + +// For MultiCompany module. +// Do not use GETPOST here, function is not defined and get of entity must be done before including main.inc.php +$entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1)))); +if (is_numeric($entity)) { + define("DOLENTITY", $entity); +} + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; +require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +// Hook to be used by external payment modules (ie Payzen, ...) +include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; +$hookmanager = new HookManager($db); +$hookmanager->initHooks(array('newpayment')); + +// For encryption +global $dolibarr_main_instance_unique_id; + +// Load translation files +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data + +// Security check +// No check on module enabled. Done later according to $validpaymentmethod + +$action = GETPOST('action', 'aZ09'); +$id = GETPOST('id'); +$securekeyreceived = GETPOST("securekey"); +$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); + +if ($securekeytocompare != $securekeyreceived) { + print $langs->trans('MissingOrBadSecureKey'); + exit; +} + +// Define $urlwithroot +//$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +//$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file +$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. + +$project = new Project($db); +$resultproject = $project->fetch($id); +if ($resultproject < 0) { + $error++; + $errmsg .= $project->error; +} + +/* + * Actions + */ + +$listOfEvents = 'oui'; + + + +/* + * View + */ + +$head = ''; +if (!empty($conf->global->ONLINE_PAYMENT_CSS_URL)) { + $head = ''."\n"; +} + +$conf->dol_hide_topmenu = 1; +$conf->dol_hide_leftmenu = 1; + +$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; +llxHeader($head, $langs->trans("SuggestForm"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea); + +print ''."\n"; +print '
'."\n"; +print '
'."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; +//print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''; +print ''; +print "\n"; + + +// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo) +// Define logo and logosmall +$logosmall = $mysoc->logo_small; +$logo = $mysoc->logo; +$paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix; +if (!empty($conf->global->$paramlogo)) { + $logosmall = $conf->global->$paramlogo; +} elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) { + $logosmall = $conf->global->ONLINE_PAYMENT_LOGO; +} +//print ''."\n"; +// Define urllogo +$urllogo = ''; +$urllogofull = ''; +if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall); +} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); + $urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo); +} + +// Output html code for logo +if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { + print ''; + } + print '
'; +} + +print ''."\n"; + +$text = ''."\n"; +$text .= ''."\n"; +$text .= ''."\n";; + +print $text; + +print $listOfEvents; + +// Output payment summary form +print ''."\n"; + +print '

'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgVoteHelpMessage").' '.$id.'.

'.$project->note_public.'

'; + +$found = false; +$error = 0; +$var = false; + +$object = null; + +print "\n"; + + +// Show all action buttons +print '
'; + +print ''; + + + + +print '
'."\n"; + +print '
'."\n"; +print '
'."\n"; +print '
'; + + +htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); + +llxFooter('', 'public'); + +$db->close(); From 295c63468b7ac1a22dac7db7dac89f4222a49b92 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 16:32:39 +0200 Subject: [PATCH 029/174] wip vote page --- htdocs/langs/en_US/eventorganization.lang | 2 + htdocs/public/project/viewandvote.php | 79 ++++++++++++++++++++--- 2 files changed, 73 insertions(+), 8 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 1940c9674c1..8f36876fddc 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -102,6 +102,8 @@ EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestio EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project EvntOrgVoteHelpMessage = Here, you can view and vote for the suggested events for the project +ListOfSuggestedConferences = List of suggested conferences +ListOfSuggestedBooths = List of suggested booths SuggestConference = Suggest a new conference SuggestBooth = Suggest a booth ViewAndVote = View and vote for suggested events diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index fe7d4d2ed59..89cdca7591b 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -63,6 +63,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; // Hook to be used by external payment modules (ie Payzen, ...) include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $hookmanager = new HookManager($db); @@ -102,10 +103,62 @@ if ($resultproject < 0) { /* * Actions */ +$tmpthirdparty = new Societe($db); -$listOfEvents = 'oui'; +$listOfConferences = $listOfBooths = ''.$langs->trans('Label').' + '.$langs->trans('Type').' + '.$langs->trans('DateStart').' + '.$langs->trans('DateEnd').' + '.$langs->trans('Thirdparty').' + '.$langs->trans('Note').''; +// For conferences +$sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle + FROM ".MAIN_DB_PREFIX."actioncomm as a + INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) + WHERE ca.module='conference@eventorganization' + AND a.status<2"; +$result = $db->query($sql); + +$i = 0; +while ($i < $db->num_rows($result)) { + $obj = $db->fetch_object($result); + + $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); + if ($resultthirdparty) { + $thirdpartyname = $tmpthirdparty->name; + } else { + $thirdpartyname = ''; + } + + $listOfConferences .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; + $listOfConferences .= ''; + $i++; +} + +// For booths +$sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle + FROM ".MAIN_DB_PREFIX."actioncomm as a + INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) + WHERE ca.module='booth@eventorganization' + AND a.status<2"; +$result = $db->query($sql); +$i = 0; +while ($i < $db->num_rows($result)) { + $obj = $db->fetch_object($result); + + $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); + if ($resultthirdparty) { + $thirdpartyname = $tmpthirdparty->name; + } else { + $thirdpartyname = ''; + } + + $listOfBooths .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; + $listOfBooths .= ''; + $i++; +} /* * View @@ -170,16 +223,26 @@ if ($urllogo) { } print '
'; } - -print ''."\n"; - +print '
'."\n"; $text = ''."\n"; -$text .= ''."\n"; +$text .= ''."\n"; $text .= ''."\n";; - print $text; +print '

'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgVoteHelpMessage").' '.$id.'.

'.$langs->trans("EvntOrgVoteHelpMessage").' : "'.$project->title.'".

'.$project->note_public.'

'."\n"; -print $listOfEvents; +print dol_get_fiche_head(''); + +print ''."\n"; +print ''; +print $listOfConferences.'
'; +print '
'.$langs->trans("ListOfSuggestedConferences").'
'."\n"; + + +print ''."\n"; +print ''; +print $listOfBooths.'
'; +print '
'.$langs->trans("ListOfSuggestedBooths").'
'."\n"; +print dol_get_fiche_end(); // Output payment summary form print ''; @@ -196,7 +259,7 @@ print "\n"; // Show all action buttons print '
'; -print ''; +//print ''; From 166e15633b2d6e5ac6a0b8f2521bfedd01d6c12c Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 17:30:11 +0200 Subject: [PATCH 030/174] factorisation --- htdocs/public/project/viewandvote.php | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 89cdca7591b..7b6f8776d3a 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -110,51 +110,44 @@ $listOfConferences = $listOfBooths = ''.$langs->trans('Label').' '.$langs->trans('DateStart').' '.$langs->trans('DateEnd').' '.$langs->trans('Thirdparty').' - '.$langs->trans('Note').''; + '.$langs->trans('Note').''; - -// For conferences $sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle FROM ".MAIN_DB_PREFIX."actioncomm as a INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) - WHERE ca.module='conference@eventorganization' - AND a.status<2"; -$result = $db->query($sql); + WHERE a.status<2"; +$sqlforconf = $sql." AND ca.module='conference@eventorganization'"; +$sqlforbooth = $sql." AND ca.module='booth@eventorganization'"; + + +// For conferences +$result = $db->query($sqlforconf); $i = 0; while ($i < $db->num_rows($result)) { $obj = $db->fetch_object($result); - $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); if ($resultthirdparty) { $thirdpartyname = $tmpthirdparty->name; } else { $thirdpartyname = ''; } - $listOfConferences .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; $listOfConferences .= ''; $i++; } // For booths -$sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, ca.libelle - FROM ".MAIN_DB_PREFIX."actioncomm as a - INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as ca ON (a.fk_action=ca.id) - WHERE ca.module='booth@eventorganization' - AND a.status<2"; -$result = $db->query($sql); +$result = $db->query($sqlforbooth); $i = 0; while ($i < $db->num_rows($result)) { $obj = $db->fetch_object($result); - $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); if ($resultthirdparty) { $thirdpartyname = $tmpthirdparty->name; } else { $thirdpartyname = ''; } - $listOfBooths .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; $listOfBooths .= ''; $i++; From 27cffbddf368ec8c47c0133dfdf5560cdccc8d19 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 12:21:15 +0200 Subject: [PATCH 031/174] vote page ok --- htdocs/langs/en_US/eventorganization.lang | 12 ++++- htdocs/public/payment/paymentok.php | 1 - htdocs/public/project/viewandvote.php | 61 +++++++++++++++++++++-- 3 files changed, 67 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 8f36876fddc..97293f3cbb0 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -98,10 +98,8 @@ EvntOrgCancelled = Cancelled # SuggestForm = Suggestion page RegisterPage = Page for conferences or booth -EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page. EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project -EvntOrgVoteHelpMessage = Here, you can view and vote for the suggested events for the project ListOfSuggestedConferences = List of suggested conferences ListOfSuggestedBooths = List of suggested booths SuggestConference = Suggest a new conference @@ -114,6 +112,16 @@ EvntOrgDuration = This conference starts on %s and ends on %s. ConferenceAttendeeFee = Conference attendee fee for the event : '%s' occurring from %s to %s. BoothLocationFee = Booth location for the event : '%s' occurring from %s to %s EventType = Event type + +# +# Vote page +# +EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page. +EvntOrgVoteHelpMessage = Here, you can view and vote for the suggested events for the project +VoteOk = Your vote has been accepted. +AlreadyVoted = You have already voted for this event. +VoteError = An error has occurred during the vote, please try again. + # # SubscriptionOk page # diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index bf140bdd600..5cbd3da966b 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1068,7 +1068,6 @@ if ($ispaymentok) { $ispostactionok = -1; } } elseif (array_key_exists('BOO', $tmptag) && $tmptag['BOO'] > 0) { - // @todo BOOTH CASE (to copy and adapt from above) // Record payment include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $object = new Facture($db); diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 7b6f8776d3a..355156d73cb 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -70,7 +70,7 @@ $hookmanager = new HookManager($db); $hookmanager->initHooks(array('newpayment')); // For encryption -global $dolibarr_main_instance_unique_id; +global $dolibarr_main_instance_unique_id, $dolibarr_main_url_root; // Load translation files $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data @@ -88,6 +88,14 @@ if ($securekeytocompare != $securekeyreceived) { exit; } +if (GETPOST("votestatus")=="ok") { + setEventMessage($langs->trans("VoteOk"), 'mesgs'); +} else if (GETPOST("votestatus")=="ko") { + setEventMessage($langs->trans("AlreadyVoted"), 'warnings'); +} else if (GETPOST("votestatus")=="err") { + setEventMessage($langs->trans("VoteError"), 'warnings'); +} + // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); //$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file @@ -120,7 +128,6 @@ $sql = "SELECT a.id, a.fk_action, a.datep, a.datep2, a.label, a.fk_soc, a.note, $sqlforconf = $sql." AND ca.module='conference@eventorganization'"; $sqlforbooth = $sql." AND ca.module='booth@eventorganization'"; - // For conferences $result = $db->query($sqlforconf); $i = 0; @@ -133,7 +140,7 @@ while ($i < $db->num_rows($result)) { $thirdpartyname = ''; } $listOfConferences .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; - $listOfConferences .= ''; + $listOfConferences .= ''; $i++; } @@ -149,10 +156,56 @@ while ($i < $db->num_rows($result)) { $thirdpartyname = ''; } $listOfBooths .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; - $listOfBooths .= ''; + $listOfBooths .= ''; $i++; } +// Get vote result +$idvote = GETPOST("vote"); +$hashedvote = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'vote'.$idvote); + +if (strlen($idvote)) { + if ($_COOKIE['VOTE_SUGGESTED_EVENTS_'.$hashedvote]==1) { + // Has already voted + $votestatus = 'ko'; + } else { + // Has not already voted + $conforbooth = new ActionComm($db); + $resultconforbooth = $conforbooth->fetch($idvote); + if ($resultconforbooth<=0) { + $error++; + $errmsg .= $conforbooth->error; + } else { + // Cookie expiration date : start of event, or 30 days if not specified + $startdate = $conforbooth->datep; + if (strlen($startdate)) { + $timeleftbeforestartofevent = $startdate; + } else { + // Cookie duration by default + $timeleftbeforestartofevent = time()+86400*30; + } + + // Process to vote + $res = setcookie('VOTE_SUGGESTED_EVENTS_'.$hashedvote, 1, 0); + if ($res) { + $conforbooth->num_vote++; + $resupdate = $conforbooth->update($user); + if ($resupdate) { + $votestatus = 'ok'; + } else { + //Error during update + $votestatus = 'err'; + $res = setcookie('VOTE_SUGGESTED_EVENTS_'.$hashedvote, 0, 0); + } + } else { + $votestatus = 'err'; + } + } + } + header("Refresh:0;url=".dol_buildpath('/public/project/viewandvote.php?votestatus='.$votestatus.'&id='.$id.'&securekey=', 1).$securekeyreceived); +} + + /* * View */ From 5bb100de29cb305728f057584c33587527b75774 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 13:02:34 +0200 Subject: [PATCH 032/174] conforbooth class required in paymentok to confirm the booth --- htdocs/public/payment/paymentok.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 5cbd3da966b..09ffc2318b0 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -52,6 +52,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; +require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; if (!empty($conf->paypal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; From 2169a106fa040afec242b1786999b6c012c8c642 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 14:34:29 +0200 Subject: [PATCH 033/174] note is now saved in database --- htdocs/eventorganization/class/conferenceorbooth.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 0df30ac61db..6227fb668ec 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -212,6 +212,7 @@ class ConferenceOrBooth extends ActionComm $this->type_id=$this->fk_action; $this->socid=$this->fk_soc; $this->datef=$this->datep2; + $this->note_private=$this->note; } /** From 6111f4394660511ec3c554e110f00b271046a2f0 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 14:49:00 +0200 Subject: [PATCH 034/174] security fix, id was encoded where it should not be encoded --- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/project/suggestbooth.php | 3 +-- htdocs/public/project/suggestconference.php | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 97293f3cbb0..97090c343cf 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -98,6 +98,7 @@ EvntOrgCancelled = Cancelled # SuggestForm = Suggestion page RegisterPage = Page for conferences or booth +EvntOrgRegistrationHelpMessage = Here, you can vote for an event, or suggest a new conference or booth for the project EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project ListOfSuggestedConferences = List of suggested conferences diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index ecaf524c034..71663a7f15c 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -496,9 +496,8 @@ if (empty($reshook) && $action == 'add') { } if (!$error) { $db->commit(); - $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; Header("Location: ".$redirection); exit; } else { diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 53dc9581d9a..844641fc4cf 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -430,9 +430,8 @@ if (empty($reshook) && $action == 'add') { } if (!$error) { $db->commit(); - $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); - $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$encodedid.'&securekey='.$securekeyurl; + $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; Header("Location: ".$redirection); exit; } else { From dbde0f0b02e96d0db4fd954f762cb7086f6df693 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 15:05:37 +0200 Subject: [PATCH 035/174] fix on status change when a booth is paid --- htdocs/public/payment/paymentok.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 09ffc2318b0..390ce6ef555 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1176,7 +1176,7 @@ if ($ispaymentok) { $error++; setEventMessages(null, $booth->errors, "errors"); } else { - $booth->setStatut(CONFERENCEORBOOTH::STATUS_SUGGESTED); + $booth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; $resultboothupdate = $booth->update($user); if ($resultboothupdate<0) { // Finding the thirdparty by getting the invoice From dfd3742d91370735775864520aa53c8428024610 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 15:33:00 +0200 Subject: [PATCH 036/174] fix on label on payment page --- htdocs/public/payment/newpayment.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 9cadab8deb4..67323190e44 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1810,9 +1810,6 @@ if ($source == 'conferencesubscription') { // Object $text = ''.$langs->trans("PaymentConferenceAttendee").''; - if (GETPOST('desc', 'alpha')) { - $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; - } print ''.$langs->trans("Designation"); print ''.$text; print ''; @@ -1899,9 +1896,6 @@ if ($source == 'boothlocation') { // Object $text = ''.$langs->trans("PaymentBoothLocation").''; - if (GETPOST('desc', 'alpha')) { - $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; - } print ''.$langs->trans("Designation"); print ''.$text; print ''; From d344ce5e08d4392cbf5cb7006d4485835ebafb8c Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 15:59:25 +0200 Subject: [PATCH 037/174] clean viewandvote page --- htdocs/public/project/viewandvote.php | 28 --------------------------- 1 file changed, 28 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 355156d73cb..f167fcf1717 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -18,15 +18,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * - * For Paypal test: https://developer.paypal.com/ - * For Paybox test: ??? - * For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing - * - * Variants: - * - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new PaymentIntent API - * - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API - * - If no option set, we use old APIS (charge) */ /** @@ -288,7 +279,6 @@ print ''."\n"; print ''; print $listOfBooths.'
'; print '
'.$langs->trans("ListOfSuggestedBooths").'
'."\n"; -print dol_get_fiche_end(); // Output payment summary form print ''; @@ -301,24 +291,6 @@ $object = null; print "\n"; - -// Show all action buttons -print '
'; - -//print ''; - - - - -print ''."\n"; - -print ''."\n"; - -print ''."\n"; -print '
'."\n"; -print '
'; - - htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); llxFooter('', 'public'); From c48234409b30b811b341fe254cd370e7071d5923 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 16:15:13 +0200 Subject: [PATCH 038/174] added copyright --- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/eventorganization/attendee_subscription.php | 8 +------- htdocs/public/eventorganization/subscriptionok.php | 1 + htdocs/public/payment/newpayment.php | 1 + htdocs/public/payment/paymentok.php | 1 + htdocs/public/project/index.php | 7 +------ htdocs/public/project/suggestbooth.php | 8 +------- htdocs/public/project/suggestconference.php | 8 +------- htdocs/public/project/viewandvote.php | 7 +------ 9 files changed, 9 insertions(+), 33 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 97090c343cf..1a663c0b713 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -1,4 +1,5 @@ # Copyright (C) 2021 Florian Henry +# Copyright (C) 2021 Dorian Vabre # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 37972628eed..82e82d58129 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -1,11 +1,5 @@ - * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France - * Copyright (C) 2018 Alexandre Spangaro +/* Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index 02fb456f7d2..8586535f5ab 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -3,6 +3,7 @@ * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 67323190e44..9de10b44cac 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -5,6 +5,7 @@ * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2018-2019 Thibault FOUCART * Copyright (C) 2021 Waël Almoman + * Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 390ce6ef555..8ea5d6a2587 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -4,6 +4,7 @@ * Copyright (C) 2012 Regis Houssin * Copyright (C) 2021 Waël Almoman * Copyright (C) 2021 Maxime Demarest + * Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index b05f2b1fc6f..1231617768d 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -1,10 +1,5 @@ - * Copyright (C) 2006-2017 Laurent Destailleur - * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2018-2019 Thibault FOUCART - * Copyright (C) 2021 Waël Almoman +/* Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 71663a7f15c..90fb7046bab 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -1,11 +1,5 @@ - * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France - * Copyright (C) 2018 Alexandre Spangaro +/* Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 844641fc4cf..c4cb3e298ec 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -1,11 +1,5 @@ - * Copyright (C) 2001-2002 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2012 J. Fernando Lagrange - * Copyright (C) 2018-2019 Frédéric France - * Copyright (C) 2018 Alexandre Spangaro +/* Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index f167fcf1717..8ade643b8ce 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -1,10 +1,5 @@ - * Copyright (C) 2006-2017 Laurent Destailleur - * Copyright (C) 2009-2012 Regis Houssin - * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2018-2019 Thibault FOUCART - * Copyright (C) 2021 Waël Almoman +/* Copyright (C) 2021 Dorian Vabre * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 05bbb3dbf6dc5927946f68a210920e6e1f1333f5 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 16:39:03 +0200 Subject: [PATCH 039/174] improved welcome msg on suggestbooth/conf pages --- htdocs/langs/en_US/eventorganization.lang | 2 ++ htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index 1a663c0b713..f990779b305 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -119,6 +119,8 @@ EventType = Event type # Vote page # EvntOrgRegistrationWelcomeMessage = Welcome on the conference or booth suggestion page. +EvntOrgRegistrationConfWelcomeMessage = Welcome on the conference suggestion page. +EvntOrgRegistrationBoothWelcomeMessage = Welcome on the booth suggestion page. EvntOrgVoteHelpMessage = Here, you can view and vote for the suggested events for the project VoteOk = Your vote has been accepted. AlreadyVoted = You have already voted for this event. diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 90fb7046bab..32ca05d1b09 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -518,7 +518,7 @@ print '
'; print '
'; // Welcome message -$text = ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'; +$text = ''.$langs->trans("EvntOrgRegistrationBoothWelcomeMessage").'
'; $text .= ''.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$id.'.

'."\n"; $text .= ''.$project->note_public.''."\n";; print $text; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index c4cb3e298ec..485d18ee2c6 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -452,7 +452,7 @@ print '
'; print '
'; // Welcome message -$text = ''.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'; +$text = ''.$langs->trans("EvntOrgRegistrationConfWelcomeMessage").'
'; $text .= ''.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$id.'.

'."\n"; $text .= ''.$project->note_public.''."\n";; print $text; From 9ab12e24551ca712a1a6025ca3d78af540f99d14 Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Fri, 7 May 2021 17:06:53 +0200 Subject: [PATCH 040/174] add (getNomUrl) --- htdocs/fourn/class/fournisseur.commande.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 331e211e5ac..3728771c8aa 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -765,7 +765,7 @@ class CommandeFournisseur extends CommonOrder */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0) { - global $langs, $conf, $user; + global $langs, $conf, $user, $hookmanager; $result = ''; @@ -774,7 +774,15 @@ class CommandeFournisseur extends CommonOrder if ($user->rights->fournisseur->commande->lire) { $label = ''.$langs->trans("SupplierOrder").''; if (isset($this->statut)) { - $label .= ' '.$this->getLibStatut(5); + $statusText = ' '.$this->getLibStatut(5); + $parameters = array('obj' => $this); + $reshook = $hookmanager->executeHooks('moreHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $statusText .= $hookmanager->resPrint; + } else { + $statusText = $hookmanager->resPrint; + } + $label .= $statusText; } if (!empty($this->ref)) { $label .= '
'.$langs->trans('Ref').': '.$this->ref; From c6d646f39e0ad1047493ef2960d4b3155770c3dc Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Fri, 7 May 2021 17:08:36 +0200 Subject: [PATCH 041/174] add(prop)list --- htdocs/fourn/commande/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index d32e466444c..a294d2a4712 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1283,6 +1283,7 @@ if ($resql) { $objectstatic->id = $obj->rowid; $objectstatic->ref = $obj->ref; + $objectstatic->socid = $obj->socid; $objectstatic->ref_supplier = $obj->ref_supplier; $objectstatic->total_ht = $obj->total_ht; $objectstatic->total_tva = $obj->total_tva; From a91d1b2e07d9262c9aeecf53f5777e9b90c6a891 Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Fri, 7 May 2021 17:09:39 +0200 Subject: [PATCH 042/174] add(list) hook --- htdocs/fourn/commande/list.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index a294d2a4712..0aae47cd7fc 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1537,7 +1537,15 @@ if ($resql) { } // Status if (!empty($arrayfields['cf.fk_statut']['checked'])) { - print ''.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).''; + $parameters = array('obj' => $obj); + $morehtmlstatus = $objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed); + $reshook = $hookmanager->executeHooks('moreHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { + $morehtmlstatus .= $hookmanager->resPrint; + } else { + $morehtmlstatus = $hookmanager->resPrint; + } + print '' . $morehtmlstatus . ''; if (!$i) { $totalarray['nbfield']++; } From 058bef1a79d03f73c099854ebbff8c96a2029b11 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 7 May 2021 17:20:36 +0200 Subject: [PATCH 043/174] clean viewandvote page --- htdocs/public/project/viewandvote.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 8ade643b8ce..1f9b4d32dab 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -258,7 +258,7 @@ if ($urllogo) { print ''."\n"; $text = ''."\n"; $text .= ''."\n"; -$text .= ''."\n";; +$text .= ''."\n";; print $text; print '

'.$langs->trans("EvntOrgRegistrationWelcomeMessage").'
'.$langs->trans("EvntOrgVoteHelpMessage").' : "'.$project->title.'".

'.$project->note_public.'

'.$project->note_public.'
'."\n"; @@ -269,23 +269,15 @@ print ''.$langs->trans("ListOfSuggestedConferences").''; print $listOfConferences.'
'; print ''."\n"; +print '
'; print ''."\n"; print ''; print $listOfBooths.'
'; print '
'.$langs->trans("ListOfSuggestedBooths").'
'."\n"; -// Output payment summary form -print ''; - -$found = false; -$error = 0; -$var = false; - $object = null; -print "\n"; - htmlPrintOnlinePaymentFooter($mysoc, $langs, 1, $suffix, $object); llxFooter('', 'public'); From d86b393d6023868bedef93c4a76a9e05dce37426 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 09:54:26 +0200 Subject: [PATCH 044/174] useless line removed --- htdocs/public/eventorganization/attendee_subscription.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 82e82d58129..4fdde7c7181 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -425,8 +425,7 @@ if (empty($reshook) && $action == 'add') { } else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } - - $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id); + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; Header("Location: ".$redirection); From 0dce9ee359746ca359566135e2bc04f7d773431c Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 10:22:45 +0200 Subject: [PATCH 045/174] now using correct email templates after booth/conf suggestion --- htdocs/public/eventorganization/attendee_subscription.php | 2 +- htdocs/public/payment/newpayment.php | 1 - htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 4fdde7c7181..a81ac456353 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -425,7 +425,7 @@ if (empty($reshook) && $action == 'add') { } else { dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment'); } - + $securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; Header("Location: ".$redirection); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 9de10b44cac..574085ac623 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1954,7 +1954,6 @@ if ($source == 'boothlocation') { print ''."\n"; } - if (!$found && !$mesg) { $mesg = $langs->trans("ErrorBadParameters"); } diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 32ca05d1b09..f510a5274f0 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -453,7 +453,7 @@ if (empty($reshook) && $action == 'add') { // Get email content from template $arraydefaultmessage = null; - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH; if (!empty($labeltouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); } diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 485d18ee2c6..3eff5fad3a9 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -388,7 +388,7 @@ if (empty($reshook) && $action == 'add') { // Get email content from template $arraydefaultmessage = null; - $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT; + $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF; if (!empty($labeltouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); } From 0e62edfd42fc06056b1dfb355683151077eb251b Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 12:47:09 +0200 Subject: [PATCH 046/174] fix error on fetching thirdparty when there is none --- htdocs/public/project/viewandvote.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 1f9b4d32dab..283d50eda8f 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -119,12 +119,17 @@ $result = $db->query($sqlforconf); $i = 0; while ($i < $db->num_rows($result)) { $obj = $db->fetch_object($result); - $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); - if ($resultthirdparty) { - $thirdpartyname = $tmpthirdparty->name; + if (!empty($obj->fk_soc)) { + $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); + if ($resultthirdparty) { + $thirdpartyname = $tmpthirdparty->name; + } else { + $thirdpartyname = ''; + } } else { $thirdpartyname = ''; } + $listOfConferences .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; $listOfConferences .= ''; $i++; @@ -135,12 +140,17 @@ $result = $db->query($sqlforbooth); $i = 0; while ($i < $db->num_rows($result)) { $obj = $db->fetch_object($result); - $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); - if ($resultthirdparty) { - $thirdpartyname = $tmpthirdparty->name; + if (!empty($obj->fk_soc)) { + $resultthirdparty = $tmpthirdparty->fetch($obj->fk_soc); + if ($resultthirdparty) { + $thirdpartyname = $tmpthirdparty->name; + } else { + $thirdpartyname = ''; + } } else { $thirdpartyname = ''; } + $listOfBooths .= ''.$obj->label.''.$obj->libelle.''.$obj->datep.''.$obj->datep2.''.$thirdpartyname.''.$obj->note.''; $listOfBooths .= ''; $i++; From c5dc20b9dc611434037fe4f27fece9a7a7f5725b Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 15:31:52 +0200 Subject: [PATCH 047/174] opti --- htdocs/public/project/viewandvote.php | 5 ++--- htdocs/societe/card.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 283d50eda8f..0f07e5e297e 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -180,18 +180,17 @@ if (strlen($idvote)) { // Cookie duration by default $timeleftbeforestartofevent = time()+86400*30; } - + // Process to vote - $res = setcookie('VOTE_SUGGESTED_EVENTS_'.$hashedvote, 1, 0); if ($res) { $conforbooth->num_vote++; $resupdate = $conforbooth->update($user); if ($resupdate) { $votestatus = 'ok'; + $res = setcookie('VOTE_SUGGESTED_EVENTS_'.$hashedvote, 1, 0); } else { //Error during update $votestatus = 'err'; - $res = setcookie('VOTE_SUGGESTED_EVENTS_'.$hashedvote, 0, 0); } } else { $votestatus = 'err'; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 8102c5064f2..104f45de979 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2467,7 +2467,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - // Supplier code + // Su+pplier code if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print ''; print $langs->trans('SupplierCode').''; From ee4e8dd99f6992ee96d4f14e6a717f623a1ea45f Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 15:37:25 +0200 Subject: [PATCH 048/174] cookies to session transition --- htdocs/public/project/viewandvote.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 0f07e5e297e..304f42d637b 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -74,6 +74,8 @@ if ($securekeytocompare != $securekeyreceived) { exit; } +$listofvotes = explode(',', $_SESSION["savevotes"]); + if (GETPOST("votestatus")=="ok") { setEventMessage($langs->trans("VoteOk"), 'mesgs'); } else if (GETPOST("votestatus")=="ko") { @@ -161,7 +163,7 @@ $idvote = GETPOST("vote"); $hashedvote = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'vote'.$idvote); if (strlen($idvote)) { - if ($_COOKIE['VOTE_SUGGESTED_EVENTS_'.$hashedvote]==1) { + if (in_array($hashedvote, $listofvotes)) { // Has already voted $votestatus = 'ko'; } else { @@ -172,22 +174,13 @@ if (strlen($idvote)) { $error++; $errmsg .= $conforbooth->error; } else { - // Cookie expiration date : start of event, or 30 days if not specified - $startdate = $conforbooth->datep; - if (strlen($startdate)) { - $timeleftbeforestartofevent = $startdate; - } else { - // Cookie duration by default - $timeleftbeforestartofevent = time()+86400*30; - } - // Process to vote if ($res) { $conforbooth->num_vote++; $resupdate = $conforbooth->update($user); if ($resupdate) { $votestatus = 'ok'; - $res = setcookie('VOTE_SUGGESTED_EVENTS_'.$hashedvote, 1, 0); + $_SESSION["savevotes"] = $hashedvote.','.(empty($_SESSION["savevotes"]) ? '' : $_SESSION["savevotes"]); // Save voter } else { //Error during update $votestatus = 'err'; From d71dc37a75f8d3f8dac486c130cd369c88879ef5 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 15:39:39 +0200 Subject: [PATCH 049/174] fix --- htdocs/public/project/viewandvote.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 304f42d637b..333edd81755 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -175,17 +175,13 @@ if (strlen($idvote)) { $errmsg .= $conforbooth->error; } else { // Process to vote - if ($res) { - $conforbooth->num_vote++; - $resupdate = $conforbooth->update($user); - if ($resupdate) { - $votestatus = 'ok'; - $_SESSION["savevotes"] = $hashedvote.','.(empty($_SESSION["savevotes"]) ? '' : $_SESSION["savevotes"]); // Save voter - } else { - //Error during update - $votestatus = 'err'; - } + $conforbooth->num_vote++; + $resupdate = $conforbooth->update($user); + if ($resupdate) { + $votestatus = 'ok'; + $_SESSION["savevotes"] = $hashedvote.','.(empty($_SESSION["savevotes"]) ? '' : $_SESSION["savevotes"]); // Save voter } else { + //Error during update $votestatus = 'err'; } } From 7d0c3dcf6d64b61893c4d0158c2a285f14bd49bc Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 15:50:29 +0200 Subject: [PATCH 050/174] transition done from cookies to session --- htdocs/public/project/viewandvote.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 333edd81755..0468a9c2e59 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -76,13 +76,6 @@ if ($securekeytocompare != $securekeyreceived) { $listofvotes = explode(',', $_SESSION["savevotes"]); -if (GETPOST("votestatus")=="ok") { - setEventMessage($langs->trans("VoteOk"), 'mesgs'); -} else if (GETPOST("votestatus")=="ko") { - setEventMessage($langs->trans("AlreadyVoted"), 'warnings'); -} else if (GETPOST("votestatus")=="err") { - setEventMessage($langs->trans("VoteError"), 'warnings'); -} // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -186,7 +179,15 @@ if (strlen($idvote)) { } } } - header("Refresh:0;url=".dol_buildpath('/public/project/viewandvote.php?votestatus='.$votestatus.'&id='.$id.'&securekey=', 1).$securekeyreceived); + if ($votestatus=="ok") { + setEventMessage($langs->trans("VoteOk"), 'mesgs'); + } else if ($votestatus=="ko") { + setEventMessage($langs->trans("AlreadyVoted"), 'warnings'); + } else if ($votestatus=="err") { + setEventMessage($langs->trans("VoteError"), 'warnings'); + } + header("Refresh:0;url=".dol_buildpath('/public/project/viewandvote.php?id='.$id.'&securekey=', 1).$securekeyreceived); + exit; } From f6956d6a6272a14208f5b0d9da68f219f0b6751c Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 15:58:54 +0200 Subject: [PATCH 051/174] using validate() function instead of settStatut(1) to validate an attendee --- htdocs/public/payment/paymentok.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 8ea5d6a2587..2e6cd630694 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -1006,7 +1006,7 @@ if ($ispaymentok) { if ($resultattendee < 0) { setEventMessages(null, $attendeetovalidate->errors, "errors"); } else { - $attendeetovalidate->setStatut(1); + $attendeetovalidate->validate($user); // Sending mail $thirdparty = new Societe($db); From bf25fd083404a84f90512e3f7a2342876f8dc96b Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 16:04:13 +0200 Subject: [PATCH 052/174] confattendee merge OK to replace thirdparty --- .../class/conferenceorboothattendee.class.php | 17 +++++++++++++++++ htdocs/societe/card.php | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 6418d73580b..58bd38c35d8 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -1070,6 +1070,23 @@ class ConferenceOrBoothAttendee extends CommonObject return $error; } + + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $db Database handler + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) + { + $tables = array( + 'conferenceorboothattendee' + ); + + return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + } } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 104f45de979..20e8c06833d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -270,7 +270,8 @@ if (empty($reshook)) { 'Product' => '/product/class/product.class.php', 'Project' => '/projet/class/project.class.php', 'Ticket' => '/ticket/class/ticket.class.php', - 'User' => '/user/class/user.class.php' + 'User' => '/user/class/user.class.php', + 'ConfOrBoothAttendee' => '/eventorganization/class/conferenceorboothattendee.class.php' ); //First, all core objects must update their tables From 48bbb500d3b98d1f10a29534477b5a136de5061a Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 16:25:44 +0200 Subject: [PATCH 053/174] fix on replacing thirdparty in attendees when merging multiple thirdparties --- .../class/conferenceorboothattendee.class.php | 2 +- htdocs/societe/card.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 58bd38c35d8..1cb24460523 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -1082,7 +1082,7 @@ class ConferenceOrBoothAttendee extends CommonObject public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) { $tables = array( - 'conferenceorboothattendee' + 'eventorganization_conferenceorboothattendee' ); return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 20e8c06833d..18cfdfa1f16 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -57,6 +57,10 @@ if (! empty($conf->accounting->enabled)) { if (! empty($conf->accounting->enabled)) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; } +if (! empty($conf->eventorganization->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; +} + $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); if (!empty($conf->adherent->enabled)) { @@ -271,7 +275,7 @@ if (empty($reshook)) { 'Project' => '/projet/class/project.class.php', 'Ticket' => '/ticket/class/ticket.class.php', 'User' => '/user/class/user.class.php', - 'ConfOrBoothAttendee' => '/eventorganization/class/conferenceorboothattendee.class.php' + 'ConferenceOrBoothAttendee' => '/eventorganization/class/conferenceorboothattendee.class.php' ); //First, all core objects must update their tables From c85b75924fc205648e67eeadb95c726100c53900 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 16:57:48 +0200 Subject: [PATCH 054/174] wip on adding a filter for the ics file + fix on class name --- htdocs/comm/action/class/actioncomm.class.php | 3 +++ htdocs/public/agenda/agendaexport.php | 3 +++ htdocs/public/project/suggestbooth.php | 2 +- htdocs/public/project/suggestconference.php | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index d8bcd0efb1b..bf6fa9fcc56 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1901,6 +1901,9 @@ class ActionComm extends CommonObject $sql .= " AND ar.fk_element = 0"; } } + if ($key == 'author') { + $sql .= " AND c.type = '".$this->db->escape($value)."'"; + } } $sql .= " AND a.datep IS NOT NULL"; // To exclude corrupted events and avoid errors in lightning/sunbird import diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index d40d75c0acf..00514cd026c 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -135,6 +135,9 @@ if (GETPOST("notolderthan", 'int')) { } else { $filters['notolderthan'] = $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY; } +if (GETPOST("author", 'apha')) { + $filters['author'] = GETPOST("author", 'apha'); +} // Check config if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) { diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index f510a5274f0..65b15578b7d 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -439,7 +439,7 @@ if (empty($reshook) && $action == 'add') { } } else { // If no price has been set for the booth, we confirm it as suggested and we update - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->status = ConferenceOrBooth::STATUS_SUGGESTED; $conforbooth->update($user); // Sending mail require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 3eff5fad3a9..0028f544f9f 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -373,7 +373,7 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $conforbooth->error; } else { - $conforbooth->status = CONFERENCEORBOOTH::STATUS_SUGGESTED; + $conforbooth->status = ConferenceOrBooth::STATUS_SUGGESTED; $conforbooth->update($user); // Sending mail From e31d8f89f5592ae5f3a5fbc8d089b9b62c45319d Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 17:13:57 +0200 Subject: [PATCH 055/174] wip filter --- htdocs/comm/action/class/actioncomm.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index bf6fa9fcc56..a6f9faf353f 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1902,7 +1902,7 @@ class ActionComm extends CommonObject } } if ($key == 'author') { - $sql .= " AND c.type = '".$this->db->escape($value)."'"; + $sql .= " AND u.lastname = '".$this->db->escape($value)."'"; } } From 1e90e618f04a54b3b4eee79668740acb7f95469f Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Mon, 10 May 2021 17:25:00 +0200 Subject: [PATCH 056/174] wip filter --- htdocs/eventorganization/conferenceorbooth_list.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 3e480efca54..24d6853abda 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -427,7 +427,17 @@ if ($projectid > 0) { print ""; print ''.$langs->trans("EventOrganizationICSLink").''; - print ''; + // Define $urlwithroot + $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); + $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; + $getentity = ($conf->entity > 1 ? "&entity=".$conf->entity : ""); + + // Show message + $message = ''; + $message .= '
'; + $message .= '
'; + print $message; print ""; From 1bfcfc3a0ca69e8c44fb55d0d8c16b9059843056 Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Wed, 12 May 2021 16:55:03 +0200 Subject: [PATCH 057/174] rename Hook and moved it into LibStatut method --- htdocs/fourn/class/fournisseur.commande.class.php | 7 ++++++- htdocs/fourn/commande/list.php | 10 +--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 3728771c8aa..99b64ccead4 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -690,7 +690,7 @@ class CommandeFournisseur extends CommonOrder public function LibStatut($status, $mode = 0, $billed = 0) { // phpcs:enable - global $conf, $langs; + global $conf, $langs, $hookmanager; if (empty($this->statuts) || empty($this->statutshort)) { $langs->load('orders'); @@ -749,6 +749,11 @@ class CommandeFournisseur extends CommonOrder $statusLong = $langs->transnoentitiesnoconv($this->statuts[$status]).$billedtext; $statusShort = $langs->transnoentitiesnoconv($this->statutshort[$status]); + $parameters = array('status' => $status, 'mode' => $mode, 'billed' => $billed, 'obj'=>$this); + $reshook = $hookmanager->executeHooks('diffHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook + if ($reshook > 0) { + return $hookmanager->resPrint; + } return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode); } diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 0aae47cd7fc..a294d2a4712 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1537,15 +1537,7 @@ if ($resql) { } // Status if (!empty($arrayfields['cf.fk_statut']['checked'])) { - $parameters = array('obj' => $obj); - $morehtmlstatus = $objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed); - $reshook = $hookmanager->executeHooks('moreHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $morehtmlstatus .= $hookmanager->resPrint; - } else { - $morehtmlstatus = $hookmanager->resPrint; - } - print '' . $morehtmlstatus . ''; + print ''.$objectstatic->LibStatut($obj->fk_statut, 5, $obj->billed).''; if (!$i) { $totalarray['nbfield']++; } From ea0d8605930e51a0e84bd38c739cdcf2cc3e3a0e Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 12 May 2021 14:55:32 +0000 Subject: [PATCH 058/174] Fixing style errors. --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 99b64ccead4..abfe6df1edc 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -753,7 +753,7 @@ class CommandeFournisseur extends CommonOrder $reshook = $hookmanager->executeHooks('diffHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook if ($reshook > 0) { return $hookmanager->resPrint; - } + } return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode); } From f95bd2f4396f9f159c1e872b96a16f7a84ebd92c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 17 May 2021 11:40:36 +0200 Subject: [PATCH 059/174] fixw that --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 7c9f4e6fe77..8ce23e6f9ad 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -424,7 +424,7 @@ class pdf_cyan extends ModelePDFPropales $salereparray = $object->thirdparty->getSalesRepresentatives($user); $salerepobj = new User($this->db); $salerepobj->fetch($salereparray[0]['id']); - if (!empty($salerepobj->signature)) $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature); + if (!empty($salerepobj->signature)) $notetoshow .= dol_concatdesc($notetoshow, $salerepobj->signature); } } From c6aa078892f89198178258484550681ad1762e2b Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Mon, 17 May 2021 13:46:01 +0200 Subject: [PATCH 060/174] renamed LibStatut hook + removed useless hook --- htdocs/fourn/class/fournisseur.commande.class.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index abfe6df1edc..e8d6c0ed9c9 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -750,7 +750,7 @@ class CommandeFournisseur extends CommonOrder $statusShort = $langs->transnoentitiesnoconv($this->statutshort[$status]); $parameters = array('status' => $status, 'mode' => $mode, 'billed' => $billed, 'obj'=>$this); - $reshook = $hookmanager->executeHooks('diffHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('LibStatut', $parameters, $object); // Note that $action and $object may have been modified by hook if ($reshook > 0) { return $hookmanager->resPrint; } @@ -779,15 +779,7 @@ class CommandeFournisseur extends CommonOrder if ($user->rights->fournisseur->commande->lire) { $label = ''.$langs->trans("SupplierOrder").''; if (isset($this->statut)) { - $statusText = ' '.$this->getLibStatut(5); - $parameters = array('obj' => $this); - $reshook = $hookmanager->executeHooks('moreHtmlStatus', $parameters, $object); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $statusText .= $hookmanager->resPrint; - } else { - $statusText = $hookmanager->resPrint; - } - $label .= $statusText; + $label = ' '.$this->getLibStatut(5); } if (!empty($this->ref)) { $label .= '
'.$langs->trans('Ref').': '.$this->ref; From 779c868eaede3368a6d5b3f8674942565df26e84 Mon Sep 17 00:00:00 2001 From: Antonin MARCHAL Date: Mon, 17 May 2021 13:48:21 +0200 Subject: [PATCH 061/174] fix mistake and removed hookmanager unused --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index e8d6c0ed9c9..9b643ff1464 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -770,7 +770,7 @@ class CommandeFournisseur extends CommonOrder */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0) { - global $langs, $conf, $user, $hookmanager; + global $langs, $conf, $user; $result = ''; @@ -779,7 +779,7 @@ class CommandeFournisseur extends CommonOrder if ($user->rights->fournisseur->commande->lire) { $label = ''.$langs->trans("SupplierOrder").''; if (isset($this->statut)) { - $label = ' '.$this->getLibStatut(5); + $label .= ' '.$this->getLibStatut(5); } if (!empty($this->ref)) { $label .= '
'.$langs->trans('Ref').': '.$this->ref; From 6f3d19b7b63c3fb62997dc64f8a32b16065501de Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 17 May 2021 15:12:25 +0200 Subject: [PATCH 062/174] dol_concatdesc better than concat operator --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 8ce23e6f9ad..2b40dffa30e 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -424,7 +424,7 @@ class pdf_cyan extends ModelePDFPropales $salereparray = $object->thirdparty->getSalesRepresentatives($user); $salerepobj = new User($this->db); $salerepobj->fetch($salereparray[0]['id']); - if (!empty($salerepobj->signature)) $notetoshow .= dol_concatdesc($notetoshow, $salerepobj->signature); + if (!empty($salerepobj->signature)) $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature); } } @@ -438,9 +438,11 @@ class pdf_cyan extends ModelePDFPropales { $tmpuser = new User($this->db); $tmpuser->fetch($object->user_author_id); - $notetoshow .= $langs->trans("CaseFollowedBy").' '.$tmpuser->getFullName($langs); - if ($tmpuser->email) $notetoshow .= ', Mail: '.$tmpuser->email; - if ($tmpuser->office_phone) $notetoshow .= ', Tel: '.$tmpuser->office_phone; + $creator_info = $langs->trans("CaseFollowedBy").' '.$tmpuser->getFullName($langs); + if ($tmpuser->email) $creator_info .= ', Mail: '.$tmpuser->email; + if ($tmpuser->office_phone) $creator_info .= ', Tel: '.$tmpuser->office_phone; + + $notetoshow = dol_concatdesc($notetoshow, $creator_info); } $tab_height = $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter; From df81ac8622f4718986832136bdd60d5c2148b4e0 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 20 May 2021 16:30:49 +0200 Subject: [PATCH 063/174] wip --- htdocs/public/agenda/agendaexport.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index 00514cd026c..6a07680c9b9 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -138,7 +138,9 @@ if (GETPOST("notolderthan", 'int')) { if (GETPOST("author", 'apha')) { $filters['author'] = GETPOST("author", 'apha'); } - +if (GETPOST("module", 'apha')) { + $filters['module'] = GETPOST("module", 'apha'); +} // Check config if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) { $user->getrights(); From 720a368b297cc38f82a150e428220488ee9bb7d1 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 20 May 2021 17:24:27 +0200 Subject: [PATCH 064/174] link ics ok (todo: add name of speaker) --- htdocs/comm/action/class/actioncomm.class.php | 7 +++++-- .../class/conferenceorbooth.class.php | 2 ++ .../conferenceorbooth_list.php | 7 ++++--- htdocs/langs/en_US/eventorganization.lang | 1 + htdocs/public/agenda/agendaexport.php | 17 +++++++++++++---- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a6f9faf353f..747c50c9640 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1901,8 +1901,11 @@ class ActionComm extends CommonObject $sql .= " AND ar.fk_element = 0"; } } - if ($key == 'author') { - $sql .= " AND u.lastname = '".$this->db->escape($value)."'"; + if ($key == 'module') { + $sql .= " AND c.module LIKE '%".$value."'"; + } + if ($key == 'status') { + $sql .= " AND a.status =".$value; } } diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 1719f0c508d..ff26d192301 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -134,6 +134,8 @@ class ConferenceOrBooth extends ActionComm public $status; // END MODULEBUILDER PROPERTIES + public $pubregister; + /** * Constructor * diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 24d6853abda..15664896700 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -430,11 +430,11 @@ if ($projectid > 0) { // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; - $getentity = ($conf->entity > 1 ? "&entity=".$conf->entity : ""); // Show message - $message = ''; + $message = 'global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...'); + $message .= "&project=".$projectid.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').''; $message .= '
'; $message .= '
'; print $message; @@ -457,6 +457,7 @@ if ($projectid > 0) { // -------------------------------------------------------------------- $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) { diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang index f990779b305..335c257b224 100644 --- a/htdocs/langs/en_US/eventorganization.lang +++ b/htdocs/langs/en_US/eventorganization.lang @@ -82,6 +82,7 @@ PriceOfBoothHelp=Subscription price to stand a booth EventOrganizationICSLink=Link ICS for events ConferenceOrBoothInformation=Conference Or Booth informations Attendees = Attendees +DownloadICSLink = Download ICS link EVENTORGANIZATION_SECUREKEY = Secure Key of the public registration link to a conference SERVICE_BOOTH_LOCATION = Service used for the invoice row about a booth location SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION = Service used for the invoice row about an attendee subscription to a conference diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index 6a07680c9b9..5d48ffb06fe 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -135,11 +135,11 @@ if (GETPOST("notolderthan", 'int')) { } else { $filters['notolderthan'] = $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY; } -if (GETPOST("author", 'apha')) { - $filters['author'] = GETPOST("author", 'apha'); +if (GETPOST("module", 'alpha')) { + $filters['module'] = GETPOST("module", 'alpha'); } -if (GETPOST("module", 'apha')) { - $filters['module'] = GETPOST("module", 'apha'); +if (GETPOST("status", 'int')) { + $filters['status'] = GETPOST("status", 'int'); } // Check config if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) { @@ -206,6 +206,15 @@ foreach ($filters as $key => $value) { if ($key == 'notactiontype') { $filename .= '-notactiontype'.$value; } + if ($key == 'actiontype') { + $filename .= '-actiontype'.$value; + } + if ($key == 'module') { + $filename .= '-module'.$value; + } + if ($key == 'status') { + $filename .= '-status'.$value; + } } // Add extension if ($format == 'vcal') { From bbce806cb5e64c45e57a27f68b6ca9e61562ffc5 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 20 May 2021 17:32:48 +0200 Subject: [PATCH 065/174] typo --- htdocs/societe/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 16818e86d4f..15a7565780b 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2473,7 +2473,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - // Su+pplier code + // Supplier code if (((!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (!empty($conf->supplier_order->enabled) && !empty($user->rights->supplier_order->lire)) || (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->supplier_invoice->lire))) && $object->fournisseur) { print ''; print $langs->trans('SupplierCode').''; From 6f050fc23a93e0aef0628096efefe3ec5ce1bf45 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 20 May 2021 15:48:04 +0000 Subject: [PATCH 066/174] Fixing style errors. --- htdocs/public/project/viewandvote.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 0468a9c2e59..9177e0edc8d 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -181,9 +181,9 @@ if (strlen($idvote)) { } if ($votestatus=="ok") { setEventMessage($langs->trans("VoteOk"), 'mesgs'); - } else if ($votestatus=="ko") { + } elseif ($votestatus=="ko") { setEventMessage($langs->trans("AlreadyVoted"), 'warnings'); - } else if ($votestatus=="err") { + } elseif ($votestatus=="err") { setEventMessage($langs->trans("VoteError"), 'warnings'); } header("Refresh:0;url=".dol_buildpath('/public/project/viewandvote.php?id='.$id.'&securekey=', 1).$securekeyreceived); From fe272d32925657b0fe12482eaf56264eda8d21f2 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Fri, 21 May 2021 16:01:44 +0200 Subject: [PATCH 067/174] wip name of contact to add on ics file --- htdocs/comm/action/class/actioncomm.class.php | 1 + .../class/conferenceorbooth.class.php | 1 + htdocs/public/project/suggestconference.php | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 747c50c9640..5790811fc2e 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1944,6 +1944,7 @@ class ActionComm extends CommonObject $duration = ($datestart && $dateend) ? ($dateend - $datestart) : 0; $event['summary'] = $obj->label.($obj->socname ? " (".$obj->socname.")" : ""); + $event['desc'] = $obj->note; $event['startdate'] = $datestart; $event['enddate'] = $dateend; // Not required with type 'journal' diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index ff26d192301..bb8649106b9 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -215,6 +215,7 @@ class ConferenceOrBooth extends ActionComm $this->socid=$this->fk_soc; $this->datef=$this->datep2; $this->note_private=$this->note; + $this->fk_user_author=$this->fk_user_author; } /** diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 0028f544f9f..19eb0801c6a 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -225,7 +225,11 @@ if (empty($reshook) && $action == 'add') { } if (!GETPOST("lastname")) { $error++; - $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Name"))."
\n"; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n"; + } + if (!GETPOST("firstname")) { + $error++; + $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n"; } if (!GETPOST("societe")) { $error++; @@ -297,7 +301,6 @@ if (empty($reshook) && $action == 'add') { $contact->state_id = (int) GETPOST("state_id", 'int'); $contact->email = $email; $contact->statut = 1; //Default status to Actif - $resultcreatecontact = $contact->create($user); if ($resultcreatecontact<0) { $error++; @@ -362,6 +365,8 @@ if (empty($reshook) && $action == 'add') { $conforbooth->datep2 = $dateend; $conforbooth->datec = dol_now(); $conforbooth->tms = dol_now(); + $conforbooth->firstname = $contact->firstname; + $conforbooth->lastname = $contact->lastname; $resultconforbooth = $conforbooth->create($user); if ($resultconforbooth<=0) { $error++; @@ -488,10 +493,14 @@ jQuery(document).ready(function () { print ''."\n"; -// Name +// Last Name print ''; print ''; print ''; +// First Name +print ''; +print ''; +print ''; // Email print ''."\n"; // Company From 60176f7f5ed78b0e43a2240cb286722280c1bde7 Mon Sep 17 00:00:00 2001 From: piernov Date: Mon, 24 May 2021 18:01:27 +0200 Subject: [PATCH 068/174] Fix add/del user to group modifies LDAP group Adding or removing a user from a group modifies the user object on Dolibarr's side. In LDAP however, members of a group are stored in the group itself. Therefore group must be updated after adding/removing a user from it. Update group in LDAP with new list of users at the end of USER_MODIFY trigger. --- ...interface_50_modLdap_Ldapsynchro.class.php | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index d0b91bcbe37..d92f4c3ecc4 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -126,6 +126,52 @@ class InterfaceLdapsynchro extends DolibarrTriggers $newparent = $object->_load_ldap_dn($info, 1); $result = $ldap->update($dn, $info, $user, $olddn, $newrdn, $newparent); + + if ($result > 0 && !empty($object->context['newgroupid'])) { // We are in context of adding a new group to user + $usergroup = new Usergroup($this->db); + + $usergroup->fetch($object->context['newgroupid']); + + $oldinfo = $usergroup->_load_ldap_info(); + $olddn = $usergroup->_load_ldap_dn($oldinfo); + + // Verify if entry exist + $container = $usergroup->_load_ldap_dn($oldinfo, 1); + $search = "(".$usergroup->_load_ldap_dn($oldinfo, 2).")"; + $records = $ldap->search($container, $search); + if (count($records) && $records['count'] == 0) + { + $olddn = ''; + } + + $info = $usergroup->_load_ldap_info(); // Contains all members, included the new one (insert already done before trigger call) + $dn = $usergroup->_load_ldap_dn($info); + + $result = $ldap->update($dn, $info, $user, $olddn); + } + + if ($result > 0 && !empty($object->context['oldgroupid'])) { // We are in context of removing a group from user + $usergroup = new Usergroup($this->db); + + $usergroup->fetch($object->context['oldgroupid']); + + $oldinfo = $usergroup->_load_ldap_info(); + $olddn = $usergroup->_load_ldap_dn($oldinfo); + + // Verify if entry exist + $container = $usergroup->_load_ldap_dn($oldinfo, 1); + $search = "(".$usergroup->_load_ldap_dn($oldinfo, 2).")"; + $records = $ldap->search($container, $search); + if (count($records) && $records['count'] == 0) + { + $olddn = ''; + } + + $info = $usergroup->_load_ldap_info(); // Contains all members, except the old one (remove already done before trigger call) + $dn = $usergroup->_load_ldap_dn($info); + + $result = $ldap->update($dn, $info, $user, $olddn); + } } if ($result < 0) $this->error = "ErrorLDAP ".$ldap->error; From bad90240bc8b6fda2ecf88489af2ae4ec22f0cc9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 May 2021 21:39:50 +0200 Subject: [PATCH 069/174] Update pdf_cyan.modules.php --- htdocs/core/modules/propale/doc/pdf_cyan.modules.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index 2b40dffa30e..4d2d159ec02 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -434,13 +434,12 @@ class pdf_cyan extends ModelePDFPropales $notetoshow = dol_concatdesc($notetoshow, $extranote); } - if (!empty($conf->global->MAIN_ADD_CREATOR_IN_NOTE) && $object->user_author_id > 0) - { + if (!empty($conf->global->MAIN_ADD_CREATOR_IN_NOTE) && $object->user_author_id > 0) { $tmpuser = new User($this->db); $tmpuser->fetch($object->user_author_id); $creator_info = $langs->trans("CaseFollowedBy").' '.$tmpuser->getFullName($langs); - if ($tmpuser->email) $creator_info .= ', Mail: '.$tmpuser->email; - if ($tmpuser->office_phone) $creator_info .= ', Tel: '.$tmpuser->office_phone; + if ($tmpuser->email) $creator_info .= ', '.$langs->trans("EMail").': '.$tmpuser->email; + if ($tmpuser->office_phone) $creator_info .= ', '.$langs->trans("Phone").': '.$tmpuser->office_phone; $notetoshow = dol_concatdesc($notetoshow, $creator_info); } From fe6b25ede698f047f6a4864d43c95080b73c6e05 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Wed, 26 May 2021 09:48:13 +0200 Subject: [PATCH 070/174] fix on $value --- htdocs/comm/action/class/actioncomm.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 5790811fc2e..3943a37e5a7 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1902,10 +1902,10 @@ class ActionComm extends CommonObject } } if ($key == 'module') { - $sql .= " AND c.module LIKE '%".$value."'"; + $sql .= " AND c.module LIKE '%".$this->db->escape($value)."'"; } if ($key == 'status') { - $sql .= " AND a.status =".$value; + $sql .= " AND a.status =".((int) $value); } } From 1d5b8cbb19f82a4c6192ee1c66bd677f5ce2a9bc Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 26 May 2021 14:59:28 +0200 Subject: [PATCH 071/174] Fix Quadra accountancy export for due date --- htdocs/accountancy/class/accountancyexport.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 114d0edf35a..0459c20a380 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -498,9 +498,8 @@ class AccountancyExport $Tab['contrepartie'] = str_repeat(' ', 8); // elarifr: date format must be fixed format : 6 char ddmmyy = %d%m%yand not defined by user / dolibarr setting - if (!empty($data->date_echeance)) - //$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE); - $Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y'); // elarifr: format must be ddmmyy + if (!empty($data->date_lim_reglement)) + $Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%y'); // elarifr: format must be ddmmyy else $Tab['date_echeance'] = '000000'; From b3a6bcd34f6b66a69b8614eadb4d1b9b8c90da0c Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Wed, 26 May 2021 15:01:31 +0200 Subject: [PATCH 072/174] Fix Winfic accountancy export for due date --- htdocs/accountancy/class/accountancyexport.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 6fd3518689d..358d0e282c8 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -617,9 +617,8 @@ class AccountancyExport $Tab['code_stat'] = str_repeat(' ', 4); - if (!empty($data->date_echeance)) - //$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE); - $Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%Y'); + if (!empty($data->date_lim_reglement)) + $Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%Y'); else $Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y'); From 421681cda4c9ed77c8fefcaece3f18681a1fe01f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 May 2021 15:22:49 +0200 Subject: [PATCH 073/174] FIX Navigation in list of holiday Conflicts: htdocs/holiday/view_log.php --- htdocs/holiday/view_log.php | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index 2f2e223c87c..86562ef5f96 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -323,7 +323,7 @@ if (!empty($arrayfields['cpl.fk_type']['checked'])) { // Filter: Previous balance if (!empty($arrayfields['cpl.prev_solde']['checked'])) { - print ''; } @@ -335,7 +335,7 @@ if (!empty($arrayfields['variation']['checked'])) { // Filter: New Balance if (!empty($arrayfields['cpl.new_solde']['checked'])) { - print ''; } @@ -360,13 +360,20 @@ if (!empty($arrayfields['cpl.new_solde']['checked'])) print_liste_field_titre($a print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); print ''; -// TODO: $i = 0; -$i = 1; -while ($i < min($num, $limit)) -{ - //TODO: $obj = $db->fetch_object($resql); +$j = 0; +while ($j < ($page * $limit)) { $obj = next($object->logs); + $j++; +} + +$i = 0; +while ($i < min($num, $limit)) { + //TODO: $obj = $db->fetch_object($resql); + $obj = current($object->logs); + if (empty($obj)) { + break; + } $holidaylogstatic->id = $obj['rowid']; $holidaylogstatic->date = $obj['date_action']; @@ -444,6 +451,7 @@ while ($i < min($num, $limit)) print ''; $i++; + next($object->logs); } if ($log_holiday == '2') { From 9c83bdff519aa2a6ce88ad98083efcbb79c6b184 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Wed, 26 May 2021 17:02:34 +0200 Subject: [PATCH 074/174] FIX : Add parameters (object and action) for user list DoActions hook --- htdocs/user/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 1f59656dcbd..e2b4fd3889d 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -154,7 +154,7 @@ if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; } if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction = ''; } $parameters = array(); -$reshook = $hookmanager->executeHooks('doActions', $parameters); // Note that $action and $object may have been modified by some hooks +$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)) From 60250443a1c91cbe17d62215a9440ebde030225b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 18:55:48 +0200 Subject: [PATCH 075/174] fix warning --- htdocs/adherents/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 5182a6ff778..d20318090e0 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1908,7 +1908,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Reactivate - if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $Object->statut) { + if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) { if ($user->rights->adherent->creer) { print ''.$langs->trans("Reenable")."\n"; } else { From 9b51699228ef234b547eb94f9f6dab4d31b517cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 19:55:47 +0200 Subject: [PATCH 076/174] fix warnings --- htdocs/societe/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 0a3e9207a96..3999158acaa 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -11,7 +11,7 @@ * Copyright (C) 2017 Juanjo Menent * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2020 Open-Dsi - + * 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 @@ -221,7 +221,7 @@ $checkedprofid6 = 0; $checkprospectlevel = (in_array($contextpage, array('prospectlist')) ? 1 : 0); $checkstcomm = (in_array($contextpage, array('prospectlist')) ? 1 : 0); $arrayfields = array( - 's.rowid'=>array('label'=>"TechnicalID", 'position'=>1, 'checked'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0), 'enabled'=>($conf->global->MAIN_SHOW_TECHNICAL_ID ? 1 : 0)), + 's.rowid'=>array('label'=>"TechnicalID", 'position'=>1, 'checked'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID)), 'enabled'=>(!empty($conf->global->MAIN_SHOW_TECHNICAL_ID))), 's.nom'=>array('label'=>"ThirdPartyName", 'position'=>2, 'checked'=>1), 's.name_alias'=>array('label'=>"AliasNameShort", 'position'=>3, 'checked'=>1), 's.barcode'=>array('label'=>"Gencod", 'position'=>5, 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))), From 879a401724798510c93b3a1d8c0db90f532fa541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 20:00:23 +0200 Subject: [PATCH 077/174] fix warnings --- htdocs/societe/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 0a3e9207a96..1a6c0ea6baf 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -942,7 +942,7 @@ if (empty($type) || $type == 'c' || $type == 'p') { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('Categories'); - $moreforfilter .= img_picto($tmptile, 'category', 'class="pictofixedwidth"'); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"'); $moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $langs->trans('CustomersProspectsCategoriesShort')); $moreforfilter .= '
'; } @@ -953,7 +953,7 @@ if (empty($type) || $type == 'f') { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('Categories'); - $moreforfilter .= img_picto($tmptilte, 'category', 'class="pictofixedwidth"'); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"'); $moreforfilter .= $formother->select_categories('supplier', $search_categ_sup, 'search_categ_sup', 1, $langs->trans('SuppliersCategoriesShort')); $moreforfilter .= '
'; } @@ -962,8 +962,8 @@ if (empty($type) || $type == 'f') { // If the user can view prospects other than his' if ($user->rights->societe->client->voir || $socid) { $moreforfilter .= '
'; - $tmptile = $langs->trans('SalesRepresentatives'); - $moreforfilter .= img_picto($tmptile, 'user', 'class="pictofixedwidth"'); + $tmptitle = $langs->trans('SalesRepresentatives'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"'); $moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $langs->trans('SalesRepresentatives'), ($conf->dol_optimize_smallscreen ? 'maxwidth200' : 'maxwidth300'), 1); $moreforfilter .= '
'; } From 0d62d3bace46532c60964c0031f6f77f9783c203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 23:36:36 +0200 Subject: [PATCH 078/174] fix warnings --- htdocs/contrat/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 19a040bf091..e1166fe385a 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -494,14 +494,14 @@ $moreforfilter = ''; if ($user->rights->societe->client->voir || $socid) { $langs->load("commercial"); $moreforfilter .= '
'; - $tmpttile = $langs->trans('ThirdPartiesOfSaleRepresentative'); + $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmpttile, 'maxwidth250'); $moreforfilter .= '
'; } // If the user can view other users if ($user->rights->user->user->lire) { $moreforfilter .= '
'; - $tmpttile = $langs->trans('LinkedToSpecificUsers'); + $tmptitle = $langs->trans('LinkedToSpecificUsers'); $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmpttile, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250'); $moreforfilter .= '
'; } @@ -509,7 +509,7 @@ if ($user->rights->user->user->lire) { if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; - $tmpttile = $langs->trans('IncludingProductWithTag'); + $tmptitle = $langs->trans('IncludingProductWithTag'); $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmpttile, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); $moreforfilter .= '
'; From 223ece5ca5a4e14cc926aae034f6756348ec4033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 23:43:14 +0200 Subject: [PATCH 079/174] Update list.php --- htdocs/contrat/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index e1166fe385a..aea778f884c 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -495,14 +495,14 @@ if ($user->rights->societe->client->voir || $socid) { $langs->load("commercial"); $moreforfilter .= '
'; $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmpttile, 'maxwidth250'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth250'); $moreforfilter .= '
'; } // If the user can view other users if ($user->rights->user->user->lire) { $moreforfilter .= '
'; $tmptitle = $langs->trans('LinkedToSpecificUsers'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmpttile, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250'); $moreforfilter .= '
'; } // If the user can view categories of products @@ -511,7 +511,7 @@ if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($use $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmpttile, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); $moreforfilter .= '
'; } From 4237b374dda29e08558cd13692ea3382ceb69393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 26 May 2021 23:45:45 +0200 Subject: [PATCH 080/174] Update list.php --- htdocs/contrat/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index aea778f884c..cf19f1178f6 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -706,6 +706,7 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $ print "\n"; $totalarray = array(); +$totalarray['nbfield'] = 0; $typenArray = array(); $cacheCountryIDCode = array(); From 61753791b47eb270abf09d545c6e5a07754612f3 Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Thu, 27 May 2021 12:20:42 +0200 Subject: [PATCH 081/174] Update card.php Add Batchinfo on invoice detail lines if hidden feature INCUDE_BATCHINFO_ON_INVOICE is set --- htdocs/compta/facture/card.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a088d94a01c..2d147c86b07 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2232,6 +2232,15 @@ if (empty($reshook)) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { + + // Add batchinfo if the detailline has batchinfo + + if (!empty($lines[$i]->detail_batch) && ! empty($conf->global->INCUDE_BATCHINFO_ON_INVOICE)){ + foreach ($lines[$i]->detail_batch as $batchline){ + $desc .= ' Batch: '.$batchline->batch.' aantal: '.$batchline->qty; + } + } + // Insert line $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $date_start, $date_end, 0, $info_bits, '', $price_base_type, $pu_ttc, $type, - 1, $special_code, '', 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $_POST['progress'], '', $fk_unit, $pu_ht_devise); From c31530e7edcc308ae7775020d07a5f698b60eef5 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 27 May 2021 10:24:18 +0000 Subject: [PATCH 082/174] Fixing style errors. --- htdocs/compta/facture/card.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 2d147c86b07..beb9463acab 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2232,15 +2232,14 @@ if (empty($reshook)) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { - // Add batchinfo if the detailline has batchinfo - - if (!empty($lines[$i]->detail_batch) && ! empty($conf->global->INCUDE_BATCHINFO_ON_INVOICE)){ - foreach ($lines[$i]->detail_batch as $batchline){ - $desc .= ' Batch: '.$batchline->batch.' aantal: '.$batchline->qty; - } + + if (!empty($lines[$i]->detail_batch) && ! empty($conf->global->INCUDE_BATCHINFO_ON_INVOICE)) { + foreach ($lines[$i]->detail_batch as $batchline) { + $desc .= ' Batch: '.$batchline->batch.' aantal: '.$batchline->qty; + } } - + // Insert line $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $date_start, $date_end, 0, $info_bits, '', $price_base_type, $pu_ttc, $type, - 1, $special_code, '', 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $_POST['progress'], '', $fk_unit, $pu_ht_devise); From ca7e52d86185e5a65be20e496f227ead8e77a05d Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 27 May 2021 13:09:03 +0200 Subject: [PATCH 083/174] Update llx_c_email_templates.sql - formatting - removed *tms* at eventorganization --- .../mysql/data/llx_c_email_templates.sql | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index 5ca98be8545..acc09bad008 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -20,21 +20,24 @@ -- de l'install et tous les sigles '--' sont supprimés. -- -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'$conf->societe->enabled && $conf->banque->enabled && $conf->prelevement->enabled',0,'__(YourSEPAMandate)__','__(Hello)__,

\n\n__(FindYourSEPAMandate)__ :
\n__MYCOMPANY_NAME__
\n__MYCOMPANY_FULLADDRESS__

\n__(Sincerely)__
\n__USER_SIGNATURE__',null); +-- Bank Thirdparty +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines) VALUES (0,'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,'$conf->societe->enabled && $conf->banque->enabled && $conf->prelevement->enabled',0,'__(YourSEPAMandate)__','__(Hello)__,

\n\n__(FindYourSEPAMandate)__ :
\n__MYCOMPANY_NAME__
\n__MYCOMPANY_FULLADDRESS__

\n__(Sincerely)__
\n__USER_SIGNATURE__',null); +-- Members +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
__(FirstName)__ : __MEMBER_FIRSTNAME__
__(LastName)__ : __MEMBER_LASTNAME__
__(ID)__ : __MEMBER_ID__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
__(FirstName)__ : __MEMBER_FIRSTNAME__
__(LastName)__ : __MEMBER_LASTNAME__
__(ID)__ : __MEMBER_ID__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,'$conf->adherent->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); +-- Recruiting +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

\n\n__(YourCandidatureAnswerMessage)__
__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,

\n\n__(YourCandidatureAnswerMessage)__
__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 0); - -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', 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__

__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', '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)__

__(Sincerely)__

__MYCOMPANY_NAME__
__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); +-- Event organization +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__

__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, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '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, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '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, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__

__(Sincerely)__

__MYCOMPANY_NAME__
__USER_SIGNATURE__', null, '1', null); +INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, '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, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'eventorganization_send', '', 0, null, null, 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,

__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__

__(Sincerely)__
__USER_SIGNATURE__', null, '1', null); From d0a8dc9df969c8432d4a0cf30a35c72407b4cd52 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Thu, 27 May 2021 13:25:00 +0200 Subject: [PATCH 084/174] Update llx_c_chargesociales.sql idea: fk_pays at first - id as second (based on fk_pays) --- htdocs/install/mysql/data/llx_c_chargesociales.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/data/llx_c_chargesociales.sql b/htdocs/install/mysql/data/llx_c_chargesociales.sql index b728d9c6414..a7e12df0d31 100644 --- a/htdocs/install/mysql/data/llx_c_chargesociales.sql +++ b/htdocs/install/mysql/data/llx_c_chargesociales.sql @@ -50,10 +50,10 @@ insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays -- -- Belgique -- -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (201, 'ONSS', 1,1,'TAXBEONSS' ,'2'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (210, 'Precompte professionnel', 1,1,'TAXBEPREPRO' ,'2'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (220, 'Prime existence', 1,1,'TAXBEPRIEXI' ,'2'); -insert into llx_c_chargesociales (id, libelle, deductible, active, code, fk_pays) values (230, 'Precompte immobilier', 1,1,'TAXBEPREIMMO','2'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ('2', 201, 'ONSS', 1,1,'TAXBEONSS'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ('2', 210, 'Precompte professionnel', 1,1,'TAXBEPREPRO'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ('2', 220, 'Prime existence', 1,1,'TAXBEPRIEXI'); +insert into llx_c_chargesociales (fk_pays, id, libelle, deductible, active, code) values ('2', 230, 'Precompte immobilier', 1,1,'TAXBEPREIMMO'); -- -- Austria From 8ed24d67969bf7a5375c90da5855a898e5cd8211 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Thu, 27 May 2021 16:02:12 +0200 Subject: [PATCH 085/174] Add missing trigger LINERECEPTION_DELETE --- .../fournisseur.commande.dispatch.class.php | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 0f8b8341a3d..5457a9ee376 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -333,7 +333,6 @@ class CommandeFournisseurDispatch extends CommonObject */ public function update($user, $notrigger = 0) { - global $conf, $langs; $error = 0; // Clean parameters @@ -411,12 +410,12 @@ class CommandeFournisseurDispatch extends CommonObject } if (!$notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you + // Call triggers $result = $this->call_trigger('LINERECEPTION_UPDATE', $user); if ($result < 0) { $error++; } - //// End call triggers + // End call triggers } } @@ -444,24 +443,22 @@ class CommandeFournisseurDispatch extends CommonObject */ public function delete($user, $notrigger = 0) { - global $conf, $langs; $error = 0; $this->db->begin(); if (!$error) { if (!$notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. - - //// Call triggers - //$result=$this->call_trigger('MYOBJECT_DELETE',$user); - //if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail} - //// End call triggers + // Call triggers + $result = $this->call_trigger('LINERECEPTION_DELETE', $user); + if ($result < 0) { + $error++; + } + // End call triggers } } - // Remove extrafields + // Remove extrafields if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) { @@ -496,7 +493,6 @@ class CommandeFournisseurDispatch extends CommonObject } - /** * Load an object from its id and create a new one in database * From 48f5cea91776bd8f3c47d1c45847844d0f2956dc Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Thu, 27 May 2021 16:03:17 +0200 Subject: [PATCH 086/174] Fix update receipt eatby --- htdocs/fourn/commande/dispatch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 4b8812cf22e..2c847b9a421 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -443,7 +443,7 @@ if ($action == 'updateline' && $user->rights->fournisseur->commande->receptionne $product = $supplierorderdispatch->fk_product; $price = price2num(GETPOST('price'), '', 2); $comment = $supplierorderdispatch->comment; - $eatby = $supplierorderdispatch->fk_product; + $eatby = $supplierorderdispatch->eatby; $sellby = $supplierorderdispatch->sellby; $batch = $supplierorderdispatch->batch; From fd2d10d443d73816b78b35120d7d954b4a1ceb03 Mon Sep 17 00:00:00 2001 From: Frans Bosman Date: Thu, 27 May 2021 16:23:33 +0200 Subject: [PATCH 087/174] Update card.php --- htdocs/compta/facture/card.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index beb9463acab..c7c9202c18c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -67,7 +67,7 @@ if (!empty($conf->accounting->enabled)) { } // Load translation files required by the page -$langs->loadLangs(array('bills', 'companies', 'compta', 'products', 'banks', 'main', 'withdrawals')); +$langs->loadLangs(array('bills', 'companies', 'compta', 'products', 'banks', 'main', 'withdrawals','productbatch')); if (!empty($conf->incoterm->enabled)) { $langs->load('incoterm'); } @@ -2236,7 +2236,8 @@ if (empty($reshook)) { if (!empty($lines[$i]->detail_batch) && ! empty($conf->global->INCUDE_BATCHINFO_ON_INVOICE)) { foreach ($lines[$i]->detail_batch as $batchline) { - $desc .= ' Batch: '.$batchline->batch.' aantal: '.$batchline->qty; + $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty',$batchline->qty).' '; + } } From dfb2e547500646ddd5563fa1cf4fc8e0fe5907c2 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 27 May 2021 14:25:42 +0000 Subject: [PATCH 088/174] Fixing style errors. --- htdocs/compta/facture/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index c7c9202c18c..02fb8467e21 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2236,8 +2236,7 @@ if (empty($reshook)) { if (!empty($lines[$i]->detail_batch) && ! empty($conf->global->INCUDE_BATCHINFO_ON_INVOICE)) { foreach ($lines[$i]->detail_batch as $batchline) { - $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty',$batchline->qty).' '; - + $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; } } From 14fdd4d0c6ff9be688b683ae330f965e500993b7 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 27 May 2021 16:43:49 +0200 Subject: [PATCH 089/174] fix rollback to rollbac --- htdocs/product/inventory/inventory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 2abc830eb7c..4344c2c7e08 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -160,7 +160,7 @@ if ($action == 'update' && !empty($user->rights->stock->mouvement->creer)) { if (! $error) { $db->commit(); } else { - $db->rollbak(); + $db->rollback(); } } From 00d60aa65a94b6b2f2e580261bceb3163907b0d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 16:54:41 +0200 Subject: [PATCH 090/174] doxygen --- .../core/modules/supplier_invoice/doc/pdf_canelle.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 8f6d12df1d0..07961dd3500 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2010-2014 Laurent Destailleur * Copyright (C) 2015 Marcos García - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-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 @@ -1062,7 +1062,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices * @param FactureFournisseur $object Object to show * @param int $showaddress 0=no, 1=yes * @param Translate $outputlangs Object lang for output - * @return void + * @return int */ protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { From f1b32dce17dfc86dbaf8a8726a1758f02b10260f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 17:07:59 +0200 Subject: [PATCH 091/174] Update pdf_canelle.modules.php --- .../core/modules/supplier_invoice/doc/pdf_canelle.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 8f6d12df1d0..ed4f8ed6590 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -376,7 +376,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow); $pdf->SetFont('', '', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($object->note_public), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($notetoshow), 0, 1); $nexY = $pdf->GetY(); $height_note = $nexY - $tab_top; From 4095c69582d5fc62bf15107283d6c38af4acb744 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Thu, 27 May 2021 21:09:49 +0200 Subject: [PATCH 092/174] Fix #17743 newpayement source membersubscription is member Fix #17743 newpayement source membersubscription is not valid anymore @eldy I'm not sure, but the bug may still occure with external module referring to membersubscription instead of member. --- htdocs/core/lib/payments.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 59d9eb4aa4c..4621e22d122 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -158,7 +158,7 @@ function getValidOnlinePaymentMethods($paymentmethod = '') /** * Return string with full online payment Url * - * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...) + * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...) * @param string $ref Ref of object * @return string Url string */ @@ -182,7 +182,7 @@ function showOnlinePaymentUrl($type, $ref) /** * Return string with HTML link for online payment * - * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...) + * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...) * @param string $ref Ref of object * @param string $label Text or HTML tag to display, if empty it display the URL * @return string Url string @@ -199,7 +199,7 @@ function getHtmlOnlinePaymentLink($type, $ref, $label = '') * Return string with full Url * * @param int $mode 0=True url, 1=Url formated with colors - * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...) + * @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'member' ...) * @param string $ref Ref of object * @param int $amount Amount (required for $type='free' only) * @param string $freetag Free tag @@ -304,7 +304,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag } } elseif ($type == 'member' || $type == 'membersubscription') { $newtype = 'member'; - $out = $urltouse.'/public/payment/newpayment.php?source=membersubscription&ref='.($mode ? '' : ''); + $out = $urltouse.'/public/payment/newpayment.php?source=member&ref='.($mode ? '' : ''); if ($mode == 1) { $out .= 'member_ref'; } From 52d44bd75e1413345a4a5b86d165734d94b01a91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 22:28:59 +0200 Subject: [PATCH 093/174] fix warnings --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1f90b5f4fdc..28c3152359c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8325,10 +8325,10 @@ class Form $nophoto = 'company'; } else { $nophoto = '/public/theme/common/user_anonymous.png'; - if ($object->gender == 'man') { + if (!empty($object->gender) && $object->gender == 'man') { $nophoto = '/public/theme/common/user_man.png'; } - if ($object->gender == 'woman') { + if (!empty($object->gender) && $object->gender == 'woman') { $nophoto = '/public/theme/common/user_woman.png'; } } From 3b381dccc3af3a71a608ab897034fb7e34c2cf24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 22:33:25 +0200 Subject: [PATCH 094/174] fix warnings --- htdocs/comm/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 589559ea426..95ba96abd74 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -580,9 +580,9 @@ if ($object->id > 0) { print '
lastname).'" autofocus="autofocus">
firstname).'" autofocus="autofocus">
'.$langs->trans("Email").'*
'; + print ''; print ''; print ''; + print ''; print ''; print '
'; print ''; if ($action == 'edittransportmode') { - $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_transport_mode, 'fk_transport_mode', 1); + $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, (!empty($object->fk_transport_mode) ? $object->fk_transport_mode : ''), 'fk_transport_mode', 1); } else { - $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_transport_mode, 'none'); + $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, (!empty($object->fk_transport_mode) ? $object->fk_transport_mode : ''), 'none'); } print ""; print ''; From e1a427f1601bc2aa1224ee95e3f9034505cdeeb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 22:40:26 +0200 Subject: [PATCH 095/174] fix warnings --- htdocs/comm/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 589559ea426..ce7d4242b6b 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -874,6 +874,7 @@ if ($object->id > 0) { $sql .= ", c.total_ttc"; $sql .= ", c.ref, c.ref_client, c.fk_statut, c.facture"; $sql .= ", c.date_commande as dc"; + $sql .= ", c.facture as billed"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; $sql .= " WHERE c.fk_soc = s.rowid "; $sql .= " AND s.rowid = ".$object->id; From 0b6457d83fae635dab80a6f65f21c24a8117aa83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 22:44:05 +0200 Subject: [PATCH 096/174] fix warning --- htdocs/holiday/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index b00abadb9c3..dbc4b78be1a 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -722,6 +722,7 @@ if ($resql) { $i = 0; $totalarray = array(); + $totalarray['nbfield'] = 0; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); From 4c1503a93bd825c1ec3571729104f9abda1cd60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 22:50:56 +0200 Subject: [PATCH 097/174] fix warnings --- htdocs/expensereport/class/expensereport.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 25ee6072a90..34bef81e5a2 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2015 Laurent Destailleur * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (c) 2018 Frédéric France + * Copyright (c) 2018-2021 Frédéric France * Copyright (C) 2016-2020 Ferran Marcet * * This program is free software; you can redistribute it and/or modify @@ -2478,9 +2478,9 @@ class ExpenseReport extends CommonObject $now = dol_now(); if ($option == 'toapprove') { - return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay); + return (!empty($this->datevalid) ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay); } else { - return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); + return (!empty($this->datevalid) ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); } } From d0b8a80c7a59cc87926aa1650db633a51e61cf79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 22:56:20 +0200 Subject: [PATCH 098/174] fix warning --- htdocs/core/tpl/commonfields_add.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index 639be537dba..3a43f04c149 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -82,7 +82,7 @@ foreach ($object->fields as $key => $val) { } else { $value = GETPOST($key, 'alphanohtml'); } - if ($val['noteditable']) { + if (!empty($val['noteditable'])) { print $object->showOutputField($val, $key, $value, '', '', '', 0); } else { print $object->showInputField($val, $key, $value, '', '', '', 0); From ca0654323f0ab7da9e2000af21f289eeb4c481c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 May 2021 23:11:05 +0200 Subject: [PATCH 099/174] fix warnings --- htdocs/core/class/commonobject.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3f4b2dd9ee6..32cffe9e4f8 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6397,7 +6397,7 @@ abstract class CommonObject $param = array(); $param['options'] = array(); $reg = array(); - $size = $this->fields[$key]['size']; + $size = !empty($this->fields[$key]['size']) ? $this->fields[$key]['size'] : 0; // Because we work on extrafields if (preg_match('/^(integer|link):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); @@ -6430,21 +6430,21 @@ abstract class CommonObject } // Special case that force options and type ($type can be integer, varchar, ...) - if (is_array($this->fields[$key]['arrayofkeyval'])) { + if (!empty($this->fields[$key]['arrayofkeyval']) && is_array($this->fields[$key]['arrayofkeyval'])) { $param['options'] = $this->fields[$key]['arrayofkeyval']; $type = 'select'; } $label = $this->fields[$key]['label']; //$elementtype=$this->fields[$key]['elementtype']; // Seems not used - $default = $this->fields[$key]['default']; - $computed = $this->fields[$key]['computed']; - $unique = $this->fields[$key]['unique']; - $required = $this->fields[$key]['required']; - $autofocusoncreate = $this->fields[$key]['autofocusoncreate']; + $default = (!empty($this->fields[$key]['default']) ? $this->fields[$key]['default'] : ''); + $computed = (!empty($this->fields[$key]['computed']) ? $this->fields[$key]['computed'] : ''); + $unique = (!empty($this->fields[$key]['unique']) ? $this->fields[$key]['unique'] : 0); + $required = (!empty($this->fields[$key]['required']) ? $this->fields[$key]['required'] : 0); + $autofocusoncreate = (!empty($this->fields[$key]['autofocusoncreate']) ? $this->fields[$key]['autofocusoncreate'] : 0); - $langfile = $this->fields[$key]['langfile']; - $list = $this->fields[$key]['list']; + $langfile = (!empty($this->fields[$key]['langfile']) ? $this->fields[$key]['langfile'] : ''); + $list = (!empty($this->fields[$key]['list']) ? $this->fields[$key]['list'] : 0); $hidden = (in_array(abs($this->fields[$key]['visible']), array(0, 2)) ? 1 : 0); $objectid = $this->id; From e87d1750415679b2556f961fedd0c2aa64775446 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 28 May 2021 09:57:21 +0200 Subject: [PATCH 100/174] Fix inventory/inventory.php --- htdocs/langs/en_US/stocks.lang | 1 + htdocs/product/inventory/inventory.php | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index 93cf9e9e037..977aab588a2 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -255,3 +255,4 @@ MakeMovementsAndClose=Generate movements and close AutofillWithExpected=Fill real quantity with expected quantity ShowAllBatchByDefault=By default, show batch details on product "stock" tab CollapseBatchDetailHelp=You can set batch detail default display in stocks module configuration +FieldCannotBeNegative=Field "%s" cannot be negative \ No newline at end of file diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 2abc830eb7c..212f0404bd9 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -185,8 +185,11 @@ if ($action =='updateinventorylines' && $permissiontoadd) { if (GETPOST("id_".$lineid, 'alpha') != '') { // If a value was set ('0' or something else) $qtytoupdate = price2num(GETPOST("id_".$lineid, 'alpha'), 'MS'); - $result = $inventoryline->fetch($lineid); + if ($qtytoupdate < 0) { + $result = -1; + setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors'); + } if ($result > 0) { $inventoryline->qty_view = $qtytoupdate; $resultupdate = $inventoryline->update($user); @@ -251,7 +254,10 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); } - + if (GETPOST('qtytoadd') < 0) { + $error++; + setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors'); + } if (!$error && !empty($conf->productbatch->enabled)) { $tmpproduct = new Product($db); $result = $tmpproduct->fetch($fk_product); @@ -654,7 +660,7 @@ if ($object->id > 0) { // Real quantity print ''; if ($object->status == $object::STATUS_VALIDATED) { - $qty_view = GETPOST("id_".$obj->rowid) ? GETPOST("id_".$obj->rowid) : $obj->qty_view; + $qty_view = GETPOST("id_".$obj->rowid) && GETPOST("id_".$obj->rowid) >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view; $totalfound += price2num($qty_view, 'MS'); print ''; print ''; From e3a5abe20e9e1c1941d489f936b8e06edb921770 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 28 May 2021 10:02:48 +0200 Subject: [PATCH 101/174] Fix error name of menu knowledge management system --- htdocs/langs/en_US/knowledgemanagement.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/knowledgemanagement.lang b/htdocs/langs/en_US/knowledgemanagement.lang index 269007e60f8..68f5cced76c 100644 --- a/htdocs/langs/en_US/knowledgemanagement.lang +++ b/htdocs/langs/en_US/knowledgemanagement.lang @@ -47,7 +47,7 @@ KnowledgeManagementArea = Knowledge Management # Menu # MenuKnowledgeRecord = Knowledge base -ListOfArticles = List of articles +ListKnowledgeRecord = List of articles NewKnowledgeRecord = New article ValidateReply = Validate solution KnowledgeRecords = Articles From 05a966b93e2834a6c946dbbb00885d0c0aafe06e Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 28 May 2021 10:29:46 +0200 Subject: [PATCH 102/174] Fix of a bug on mass mailing --- htdocs/comm/mailing/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 86aff8a36e0..73f31f34f01 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -677,6 +677,7 @@ if (empty($reshook)) { $form = new Form($db); $htmlother = new FormOther($db); +$object->fetch($id); $help_url = 'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing'; llxHeader( '', From fed5db032a0e83b1c87d6063a2779e7659175b23 Mon Sep 17 00:00:00 2001 From: Matthias Haberl Date: Fri, 28 May 2021 11:26:55 +0200 Subject: [PATCH 103/174] Fix label of subaccount --- htdocs/accountancy/bookkeeping/listbysubaccount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php index 129e695de3c..43d4acf343f 100644 --- a/htdocs/accountancy/bookkeeping/listbysubaccount.php +++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php @@ -682,7 +682,7 @@ while ($i < min($num, $limit)) { print ""; print ''; if ($line->subledger_account != "" && $line->subledger_account != '-1') { - print $object->get_compte_desc($line->numero_compte).' : '.length_accounta($line->subledger_account); + print $line->subledger_label.' : '.length_accounta($line->subledger_account); } else { // Should not happen: subledger account must be null or a non empty value print ''.$langs->trans("Unknown"); From 81a94f5642b22507a07b82085412854b57d4f1d8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 28 May 2021 18:04:45 +0200 Subject: [PATCH 104/174] FIX option MAIN_GENERATE_SUPPLIER_PROPOSAL_WITH_PICTURE --- .../doc/pdf_aurore.modules.php | 2 +- htdocs/product/class/product.class.php | 32 +++++++++++-------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index e9e2179823b..3da4d72746b 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -239,7 +239,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdir = get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto, 'product').$object->lines[$i]->fk_product."/photos/"; $dir = $conf->product->dir_output.'/'.$pdir; } else { - $pdir = get_exdir(0, 2, 0, 0, $objphoto, 'product').dol_sanitizeFileName($objphoto->ref).'/'; + $pdir = get_exdir(0, 0, 0, 0, $objphoto, 'product'); $dir = $conf->product->dir_output.'/'.$pdir; } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 685180e4659..1e60a0f63d3 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5208,11 +5208,11 @@ class Product extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Retourne tableau de toutes les photos du produit + * Return an array with all photos of product found on disk. There is no sorting criteria. * - * @param string $dir Repertoire a scanner - * @param int $nbmax Nombre maximum de photos (0=pas de max) - * @return array Tableau de photos + * @param string $dir Directory to scan + * @param int $nbmax Number maxium of photos (0=no maximum) + * @return array Array of photos */ public function liste_photos($dir, $nbmax = 0) { @@ -5226,16 +5226,17 @@ class Product extends CommonObject $dir_osencoded = dol_osencode($dir); $handle = @opendir($dir_osencoded); if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) - { - if (!utf8_check($file)) { $file = utf8_encode($file); // readdir returns ISO + while (($file = readdir($handle)) !== false) { + if (!utf8_check($file)) { + $file = utf8_encode($file); // readdir returns ISO } if (dol_is_file($dir.$file) && image_format_supported($file) >= 0) { $nbphoto++; - // On determine nom du fichier vignette + // We forge name of thumb. $photo = $file; $photo_vignette = ''; + $regs = array(); if (preg_match('/('.$this->regeximgext.')$/i', $photo, $regs)) { $photo_vignette = preg_replace('/'.$regs[0].'/i', '', $photo).'_small'.$regs[0]; } @@ -5245,14 +5246,17 @@ class Product extends CommonObject // Objet $obj = array(); $obj['photo'] = $photo; - if ($photo_vignette && dol_is_file($dirthumb.$photo_vignette)) { $obj['photo_vignette'] = 'thumbs/'.$photo_vignette; - } else { $obj['photo_vignette'] = ""; + if ($photo_vignette && dol_is_file($dirthumb.$photo_vignette)) { + $obj['photo_vignette'] = 'thumbs/'.$photo_vignette; + } else { + $obj['photo_vignette'] = ""; } $tabobj[$nbphoto - 1] = $obj; - // On continue ou on arrete de boucler ? - if ($nbmax && $nbphoto >= $nbmax) { break; + // Do we have to continue with next photo ? + if ($nbmax && $nbphoto >= $nbmax) { + break; } } } @@ -5265,9 +5269,9 @@ class Product extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Efface la photo du produit et sa vignette + * Delete a photo and its thumbs * - * @param string $file Chemin de l'image + * @param string $file Path to image file * @return void */ public function delete_photo($file) From f33869bf1c9432cb3a0f65c2daa14c9aac1cdebc Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 28 May 2021 18:08:01 +0200 Subject: [PATCH 105/174] fix: uploaddir for productlot --- htdocs/product/stock/productlot_document.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 5b19288deff..820ad4d38bb 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -94,7 +94,9 @@ $usercanread = $user->rights->produit->lire; $usercancreate = $user->rights->produit->creer; $usercandelete = $user->rights->produit->supprimer; -$upload_dir = $conf->productbatch->multidir_output[$conf->entity]; +if (empty($upload_dir)) { + $upload_dir = $conf->productbatch->multidir_output[$conf->entity]; +} $permissiontoread = $usercanread; $permissiontoadd = $usercancreate; From ab4941a558ff55ce00aabbc7bab1807216abd0c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 29 May 2021 02:22:30 +0200 Subject: [PATCH 106/174] Fix not visible button when missing permission --- htdocs/fichinter/card.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 0b919c3eb4b..84c4fd61c62 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1606,8 +1606,9 @@ if ($action == 'create') // Validate if ($object->statut == Fichinter::STATUS_DRAFT && (count($object->lines) > 0 || !empty($conf->global->FICHINTER_DISABLE_DETAILS))) { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->creer) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->ficheinter->ficheinter_advance->validate)) { - print ''; + print ''; + } else { + print '
'.$langs->trans("Validate").'
'; } } @@ -1640,7 +1641,7 @@ if ($action == 'create') } } - // create intervention model + // Create intervention model if ($conf->global->MAIN_FEATURES_LEVEL >= 1 && $object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) { print '
'; print ''.$langs->trans("ChangeIntoRepeatableIntervention").''; From baea57ec05617e8f95b6b1898ad2e5f434d18e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 30 May 2021 08:38:07 +0200 Subject: [PATCH 107/174] force reload css after activate/desactivate module --- htdocs/admin/modules.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 1a6d99261bd..5dc660adb9b 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -8,6 +8,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2018 Nicolas ZABOURI + * 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 @@ -246,6 +247,7 @@ if ($action == 'install') { if ($action == 'set' && $user->admin) { $resarray = activateModule($value); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); if (!empty($resarray['errors'])) { setEventMessages('', $resarray['errors'], 'errors'); } else { @@ -269,6 +271,7 @@ if ($action == 'set' && $user->admin) { exit; } elseif ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes') { $result = unActivateModule($value); + dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity); if ($result) { setEventMessages($result, null, 'errors'); } From ab64f467f52c5e9f62d7d6cb510868355e777b1a Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 31 May 2021 09:31:38 +0200 Subject: [PATCH 108/174] add of a new param in selectGroupTicket --- htdocs/core/class/html.formticket.class.php | 244 ++++++++++++++------ 1 file changed, 174 insertions(+), 70 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 3cec6c19789..23c220d43df 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -569,90 +569,194 @@ class FormTicket * @param int $noadmininfo 0=Add admin info, 1=Disable admin info * @param int $maxlength Max length of label * @param string $morecss More CSS + * @param int $use_multilevel if != 0 create a multilevel select ( Do not use any of the other params) * @return void */ - public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '') + public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0) { global $langs, $user; - $ticketstat = new Ticket($this->db); + if ($use_multilevel == 0) { + $ticketstat = new Ticket($this->db); - dol_syslog(get_class($this)."::selectCategoryTickets ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); + dol_syslog(get_class($this)."::selectCategoryTickets ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG); - $ticketstat->loadCacheCategoriesTickets(); + $ticketstat->loadCacheCategoriesTickets(); - print ''; + if ($empty) { + print ''; + } - if (is_array($ticketstat->cache_category_tickets) && count($ticketstat->cache_category_tickets)) { - foreach ($ticketstat->cache_category_tickets as $id => $arraycategories) { - // Exclude some record - if ($filtertype == 'public=1') { - if (empty($arraycategories['public'])) { + if (is_array($ticketstat->cache_category_tickets) && count($ticketstat->cache_category_tickets)) { + foreach ($ticketstat->cache_category_tickets as $id => $arraycategories) { + // Exclude some record + if ($filtertype == 'public=1') { + if (empty($arraycategories['public'])) { + continue; + } + } + + // We discard empty line if showempty is on because an empty line has already been output. + if ($empty && empty($arraycategories['code'])) { continue; } + + if ($format == 0) { + print ''; } - - // We discard empty line if showempty is on because an empty line has already been output. - if ($empty && empty($arraycategories['code'])) { - continue; - } - - if ($format == 0) { - print ''; } - } - print ''; - if ($user->admin && !$noadmininfo) { - print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); - } + print ''; + if ($user->admin && !$noadmininfo) { + print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); + } - print ajax_combobox('select'.$htmlname); + print ajax_combobox('select'.$htmlname); + } else { + $groupticket=GETPOST('groupticket', 'aZ09'); + $groupticketchild=GETPOST('groupticket_child', 'aZ09'); + $arraycodenotparent[] = ""; + $stringtoprint = ''.$langs->trans("GroupOfTicket").' '; + $stringtoprint .= ''; + } + $stringtoprint .= ' '; + + $stringtoprint .= ''; + + $stringtoprint .=''; + return $stringtoprint; + } } /** From 2c6eee2528b0fc0f0edf4d7a73e297a44f525f6e Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 31 May 2021 10:26:05 +0200 Subject: [PATCH 109/174] Update llx_00_c_country.sql MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Roumanie -> Romania Rwanda = Rwanda Sainte-Hélène -> Saint Helena Saint-Christophe-et-Niévès -> Saint Kitts and Nevis Sainte-Lucie -> Saint Lucia Saint-Pierre-et-Miquelon -> Saint Pierre and Miquelon Saint-Vincent-et-les-Grenadines -> Saint Vincent and the Grenadines Samoa = Samoa Saint-Marin -> San Marino Sao Tomé-et-Principe -> Saint Thomas and Prince Serbie -> Serbia Seychelles = Seychelles Sierra Leone = Sierra Leone Slovaquie -> Slovakia Slovénie -> Slovenia --- .../install/mysql/data/llx_00_c_country.sql | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql index 677447f1af2..1e2e8b69c39 100644 --- a/htdocs/install/mysql/data/llx_00_c_country.sql +++ b/htdocs/install/mysql/data/llx_00_c_country.sql @@ -216,21 +216,21 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (18 INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (184,'PL','POL','Pologne',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (185,'PR','PRI','Puerto Rico',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (186,'QA','QAT','Qatar',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (188,'RO','ROU','Roumanie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (188,'RO','ROU','Romania',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (189,'RW','RWA','Rwanda',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (190,'SH','SHN','Sainte-Hélène',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (191,'KN','KNA','Saint-Christophe-et-Niévès',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (192,'LC','LCA','Sainte-Lucie',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (193,'PM','SPM','Saint-Pierre-et-Miquelon',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (194,'VC','VCT','Saint-Vincent-et-les-Grenadines',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (190,'SH','SHN','Saint Helena',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (191,'KN','KNA','Saint Kitts and Nevis',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (192,'LC','LCA','Saint Lucia',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (193,'PM','SPM','Saint Pierre and Miquelon',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (194,'VC','VCT','Saint Vincent and the Grenadines',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (195,'WS','WSM','Samoa',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (196,'SM','SMR','Saint-Marin',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (197,'ST','STP','Sao Tomé-et-Principe',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (198,'RS','SRB','Serbie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (196,'SM','SMR','San Marino ',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (197,'ST','STP','Saint Thomas and Prince',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (198,'RS','SRB','Serbia',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (199,'SC','SYC','Seychelles',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (200,'SL','SLE','Sierra Leone',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (201,'SK','SVK','Slovaquie',1,0); -INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (202,'SI','SVN','Slovénie',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (201,'SK','SVK','Slovakia',1,0); +INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (202,'SI','SVN','Slovenia',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (203,'SB','SLB','Iles Salomon',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (204,'SO','SOM','Somalie',1,0); INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (205,'ZA','ZAF','South Africa',1,0); From a97efdbdfa12ef4e121a556c3b5ed64822abd670 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 31 May 2021 10:31:25 +0200 Subject: [PATCH 110/174] Update list.php $title = $langs->trans('Supplier')." - ".$langs->trans('ProductsAndServices'); --- htdocs/fourn/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index f411d70af25..ed137fd5d86 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -121,7 +121,7 @@ $form = new Form($db); $productstatic = new Product($db); $companystatic = new Societe($db); -$title = $langs->trans("ProductsAndServices"); +$title = $langs->trans('Supplier')." - ".$langs->trans('ProductsAndServices'); if ($fourn_id) { $supplier = new Fournisseur($db); From fed7878d18ad9273560129fdaffdfd27f1f61645 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 31 May 2021 10:33:36 +0200 Subject: [PATCH 111/174] Update card.php $lineid was duplicate --- htdocs/fourn/commande/card.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 8c4aa1e2a54..21cd61536ee 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -70,8 +70,6 @@ $socid = GETPOST('socid', 'int'); $projectid = GETPOST('projectid', 'int'); $cancel = GETPOST('cancel', 'alpha'); $lineid = GETPOST('lineid', 'int'); - -$lineid = GETPOST('lineid', 'int'); $origin = GETPOST('origin', 'alpha'); $originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility From 7aae5be54a86d704d63ea61bf5bf878cc3b78e9a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 31 May 2021 10:36:43 +0200 Subject: [PATCH 112/174] Update card.php --- htdocs/fourn/facture/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 0bc26ea8f2b..86cd9e439f9 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1791,8 +1791,8 @@ if (!empty($conf->projet->enabled)) { $now = dol_now(); $title = $langs->trans('SupplierInvoice')." - ".$langs->trans('Card'); -$helpurl = "EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores"; -llxHeader('', $title, $helpurl); +$help_url = 'EN:Module_Suppliers_Invoices|FR:Module_Fournisseurs_Factures|ES:Módulo_Facturas_de_proveedores|DE:Modul_Lieferantenrechnungen'; +llxHeader('', $title, $help_url); // Mode creation if ($action == 'create') { From 55d48077a32301e509aa67925d19f07c11287e91 Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Mon, 31 May 2021 09:26:53 +0200 Subject: [PATCH 113/174] ADD note to supplier order refusal --- .../interface_50_modAgenda_ActionsAuto.class.php | 7 ++++++- htdocs/fourn/commande/card.php | 14 +++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 8e98030b484..3c7c8cb6e1c 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -544,13 +544,18 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->sendtoid = 0; } elseif ($action == 'ORDER_SUPPLIER_REFUSE') { // Load translation files required by the page - $langs->loadLangs(array("agenda", "other", "orders")); + $langs->loadLangs(array("agenda", "other", "orders", "main")); if (empty($object->actionmsg2)) { $object->actionmsg2 = $langs->transnoentities("OrderRefusedInDolibarr", $object->ref); } $object->actionmsg = $langs->transnoentities("OrderRefusedInDolibarr", $object->ref); + if (!empty($object->refuse_note)) { + $object->actionmsg .= '
'; + $object->actionmsg .= $langs->trans("Reason") . ': '.$object->refuse_note; + } + $object->sendtoid = 0; } elseif ($action == 'ORDER_SUPPLIER_SUBMIT') { // Load translation files required by the page diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 8c4aa1e2a54..d5ff9bc229f 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -960,6 +960,9 @@ if (empty($reshook)) { } if ($action == 'confirm_refuse' && $confirm == 'yes' && $usercanapprove) { + if (GETPOST('refuse_note')) { + $object->refuse_note = GETPOST('refuse_note'); + } $result = $object->refuse($user); if ($result > 0) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); @@ -1875,7 +1878,16 @@ if ($action == 'create') { // Confirmation de la desapprobation if ($action == 'refuse') { - $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", '', 0, 1); + $formquestion = array( + array( + 'type' => 'text', + 'name' => 'refuse_note', + 'label' => $langs->trans("MotifCP"), + 'value' => '', + 'morecss' => 'minwidth300' + ) + ); + $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", $formquestion, 0, 1); } // Confirmation de l'annulation From e1de510c389396730d4aef03ccecd780b226f3c3 Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Mon, 31 May 2021 11:06:52 +0200 Subject: [PATCH 114/174] Do a strict comparison when check if stock is enough --- htdocs/product/stock/class/mouvementstock.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 2429a4c09c5..ec2dfbc257e 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -355,7 +355,7 @@ class MouvementStock extends CommonObject $qtyisnotenough = 0; foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch) { - if ($batch != $batchcursor) continue; + if ($batch !== $batchcursor) continue; // Do a strict comparison because $batchcursar can be an integer $foundforbatch = 1; if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty; break; From 90ae16372c7d2cc0a6d8939b224230b267909744 Mon Sep 17 00:00:00 2001 From: Pierre Payet Date: Mon, 31 May 2021 12:11:16 +0200 Subject: [PATCH 115/174] add missing hooks in societe list.php --- htdocs/societe/list.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 0df74bc166e..fe55d05dda4 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -429,6 +429,10 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."c_stcomm as st ON s.fk_stcomm = st.id"; // We'll need this table joined to the select in order to filter by sale if ($search_sale == -2) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = s.rowid"; elseif ($search_sale || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +// 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; $sql .= " WHERE s.entity IN (".getEntity('societe').")"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; if ($search_sale && $search_sale != -2) $sql .= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale @@ -490,6 +494,11 @@ if (empty($reshook)) { } $sql .= $hookmanager->resPrint; +// Add GroupBy from hooks +$parameters = array('all' => $all, 'fieldstosearchall' => $fieldstosearchall); +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $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 From c91b9d613afc5c72f27b59e554b53a75ed3cc299 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 1 Jun 2021 15:30:17 +0200 Subject: [PATCH 116/174] FIX: order supplier stats by category now display figures --- htdocs/commande/class/commandestats.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index cbb93b940de..7d98c5be996 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -78,6 +78,7 @@ class CommandeStats extends Stats $this->field = 'total_ht'; $this->field_line = 'total_ht'; $this->where .= " c.fk_statut > 0"; // Not draft and not cancelled + $this->categ_link=MAIN_DB_PREFIX.'categorie_societe'; } elseif ($mode == 'supplier') { @@ -87,6 +88,7 @@ class CommandeStats extends Stats $this->field = 'total_ht'; $this->field_line = 'total_ht'; $this->where .= " c.fk_statut > 2"; // Only approved & ordered + $this->categ_link=MAIN_DB_PREFIX.'categorie_fournisseur'; } //$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity; $this->where .= ' AND c.entity IN ('.getEntity('commande').')'; @@ -106,7 +108,7 @@ class CommandeStats extends Stats if ($categid) { - $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cats ON cats.fk_soc = c.fk_soc'; + $this->join .= ' LEFT JOIN '.$this->categ_link.' as cats ON cats.fk_soc = c.fk_soc'; $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cat.rowid = cats.fk_categorie'; $this->where .= ' AND cat.rowid = '.$categid; } From af509742e6a16910f55b9e95e21527dc1726a0b3 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 1 Jun 2021 16:34:39 +0200 Subject: [PATCH 117/174] Fix #17726 : holliday with advanced perms works --- htdocs/holiday/card.php | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index bab0655b4c2..97a70782e36 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -163,19 +163,23 @@ if (empty($reshook)) { $description = trim(GETPOST('description', 'restricthtml')); // Check that leave is for a user inside the hierarchy or advanced permission for all is set - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->holiday->write)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->id == $fuserid && empty($user->rights->holiday->write)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->id != $fuserid && empty($user->rights->holiday->writeall_advance)) - ) { - $error++; - setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { + if (empty($user->rights->holiday->write)) { + $error++; + setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); + } elseif (!in_array($fuserid, $childids)) { + $error++; + setEventMessages($langs->trans("UserNotInHierachy"), null, 'errors'); + $action = 'create'; + } } else { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->holiday->writeall_advance)) { - if (!in_array($fuserid, $childids)) { - $error++; - setEventMessages($langs->trans("UserNotInHierachy"), null, 'errors'); - $action = 'create'; - } + if (empty($user->rights->holiday->write) && empty($user->rights->holiday->writeall_advance)) { + $error++; + setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); + } elseif (empty($user->rights->holiday->writeall_advance) && !in_array($fuserid, $childids)) { + $error++; + setEventMessages($langs->trans("UserNotInHierachy"), null, 'errors'); + $action = 'create'; } } @@ -1136,7 +1140,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') { } // On vérifie si l'utilisateur à le droit de lire cette demande - if ($cancreate) { + if ($canread) { $head = holiday_prepare_head($object); if (($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) || ($action == 'editvalidator')) { From bda42403b259550a30003cc0053d830dda862cee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 04:15:21 +0200 Subject: [PATCH 118/174] FIX Creation of reception (missing extrafields). Lose data if error. --- htdocs/reception/card.php | 84 ++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 32 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 75f5401d401..493a400c891 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -72,7 +72,7 @@ if (!empty($conf->productbatch->enabled)) { } $origin = GETPOST('origin', 'alpha') ?GETPOST('origin', 'alpha') : 'reception'; // Example: commande, propal -$origin_id = GETPOST('id', 'int') ?GETPOST('id', 'int') : ''; +$origin_id = GETPOST('id', 'int') ? GETPOST('id', 'int') : ''; $id = $origin_id; if (empty($origin_id)) { $origin_id = GETPOST('origin_id', 'int'); // Id of order or propal @@ -86,12 +86,12 @@ if (empty($origin_id)) { $ref = GETPOST('ref', 'alpha'); $line_id = GETPOST('lineid', 'int') ?GETPOST('lineid', 'int') : ''; -$action = GETPOST('action', 'alpha'); +$action = GETPOST('action', 'alpha'); //Select mail models is same action as presend if (GETPOST('modelselected')) { $action = 'presend'; } -$confirm = GETPOST('confirm', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); //PDF @@ -117,7 +117,6 @@ $permissiondellink = $user->rights->reception->creer; // Used by the include of $date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int')); -$object = new Reception($db); if ($id > 0 || !empty($ref)) { $object->fetch($id, $ref); $object->fetch_thirdparty(); @@ -725,13 +724,13 @@ if ($action == 'create') { $classname = ucfirst($origin); } - $object = new $classname($db); - if ($object->fetch($origin_id)) { // This include the fetch_lines + $objectsrc = new $classname($db); + if ($objectsrc->fetch($origin_id)) { // This include the fetch_lines $soc = new Societe($db); - $soc->fetch($object->socid); + $soc->fetch($objectsrc->socid); $author = new User($db); - $author->fetch($object->user_author_id); + $author->fetch($objectsrc->user_author_id); if (!empty($conf->stock->enabled)) { $entrepot = new Entrepot($db); @@ -741,8 +740,7 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; - print ''; + print ''; if (GETPOST('entrepot_id', 'int')) { print ''; } @@ -754,10 +752,10 @@ if ($action == 'create') { // Ref print ''; if ($origin == 'supplierorder' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) { - print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$object->ref; + print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$objectsrc->ref; } if ($origin == 'propal' && !empty($conf->propal->enabled)) { - print $langs->trans("RefProposal").''.img_object($langs->trans("ShowProposal"), 'propal').' '.$object->ref; + print $langs->trans("RefProposal").''.img_object($langs->trans("ShowProposal"), 'propal').' '.$objectsrc->ref; } print ''; print "\n"; @@ -770,7 +768,7 @@ if ($action == 'create') { print $langs->trans('RefSupplier'); } print ''; - print ''; + print ''; print ''; print ''; @@ -782,8 +780,8 @@ if ($action == 'create') { // Project if (!empty($conf->projet->enabled)) { $projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0; - if (empty($projectid) && !empty($object->fk_project)) { - $projectid = $object->fk_project; + if (empty($projectid) && !empty($objectsrc->fk_project)) { + $projectid = $objectsrc->fk_project; } if ($origin == 'project') { $projectid = ($originid ? $originid : 0); @@ -802,7 +800,7 @@ if ($action == 'create') { // Date delivery planned print ''.$langs->trans("DateDeliveryPlanned").''; print ''; - $date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST + $date_delivery = ($date_delivery ? $date_delivery : $objectsrc->delivery_date); // $date_delivery comes from GETPOST print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print "\n"; print ''; @@ -810,15 +808,15 @@ if ($action == 'create') { // Note Public print ''.$langs->trans("NotePublic").''; print ''; - $doleditor = new DolEditor('note_public', $object->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%'); + $doleditor = new DolEditor('note_public', $objectsrc->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print ""; // Note Private - if ($object->note_private && !$user->socid) { + if ($objectsrc->note_private && !$user->socid) { print ''.$langs->trans("NotePrivate").''; print ''; - $doleditor = new DolEditor('note_private', $object->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%'); + $doleditor = new DolEditor('note_private', $objectsrc->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print ""; } @@ -861,15 +859,15 @@ if ($action == 'create') { // Other attributes $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3', 'socid'=>$socid); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $objectsrc may have been modified by hook print $hookmanager->resPrint; - // Here $object can be of an object Order + // Here $object can be of an object Reception $extrafields->fetch_name_optionals_label($object->table_element); if (empty($reshook) && !empty($extrafields->attributes[$object->table_element]['label'])) { // copy from order - if ($object->fetch_optionals() > 0) { - $recept->array_options = array_merge($recept->array_options, $object->array_options); + if ($objectsrc->fetch_optionals() > 0) { + $recept->array_options = array_merge($recept->array_options, $objectsrc->array_options); } print $object->showOptionals($extrafields, 'edit', $parameters); } @@ -877,9 +875,9 @@ if ($action == 'create') { // Incoterms if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; - print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : '')); + print $form->select_incoterms((!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : ''), (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : '')); print ''; } @@ -898,12 +896,14 @@ if ($action == 'create') { print dol_get_fiche_end(); - // Reception lines $numAsked = 0; $dispatchLines = array(); foreach ($_POST as $key => $value) { + // If create form is coming from the button "Create Reception" of previous page + // without batch module enabled + $reg = array(); if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) { $numAsked++; @@ -934,6 +934,25 @@ if ($action == 'create') { $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2]; $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); } + + // If create form is coming from same page post was sent but an error occured + if (preg_match('/^productid([0-9]+)$/i', $key, $reg)) { + $numAsked++; + + // eat-by date dispatch + // $numline=$reg[2] + 1; // line of product + $numline = $numAsked; + $prod = 'productid'.$reg[1]; + $comment = 'comment'.$reg[1]; + $qty = 'qtyl'.$reg[1]; + $ent = 'entl'.$reg[1]; + $pu = 'pul'.$reg[1]; + $lot = 'batch'.$reg[1]; + $dDLUO = dol_mktime(12, 0, 0, GETPOST('dluo'.$reg[1].'month', 'int'), GETPOST('dluo'.$reg[1].'day', 'int'), GETPOST('dluo'.$reg[1].'year', 'int')); + $dDLC = dol_mktime(12, 0, 0, GETPOST('dlc'.$reg[1].'month', 'int'), GETPOST('dlc'.$reg[1].'day', 'int'), GETPOST('dlc'.$reg[1].'year', 'int')); + $fk_commandefourndet = 'fk_commandefournisseurdet'.$reg[1]; + $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST($comment), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); + } } @@ -961,7 +980,7 @@ if ($action == 'create') { print ''; // Load receptions already done for same order - $object->loadReceptions(); + $objectsrc->loadReceptions(); if ($numAsked) { print ''; @@ -993,14 +1012,13 @@ if ($action == 'create') { $indiceAsked = 1; while ($indiceAsked <= $numAsked) { $product = new Product($db); - foreach ($object->lines as $supplierLine) { + foreach ($objectsrc->lines as $supplierLine) { if ($dispatchLines[$indiceAsked]['fk_commandefourndet'] == $supplierLine->id) { $line = $supplierLine; break; } } - // Show product and description $type = $line->product_type ? $line->product_type : $line->fk_product_type; // Try to enhance type detection using date_start and date_end for free lines where type @@ -1012,7 +1030,7 @@ if ($action == 'create') { $type = 1; } - print ''."\n"; + print ''."\n"; print ''."\n"; @@ -1024,6 +1042,7 @@ if ($action == 'create') { print ''; @@ -1075,13 +1094,14 @@ if ($action == 'create') { // Qty print ''; $qtyProdCom = $line->qty; // Qty already received print ''; From 5a260865dc32c90c573c3b2889bbfee0e50d555b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 04:15:21 +0200 Subject: [PATCH 119/174] FIX Creation of reception (missing extrafields). Lose data if error. Conflicts: htdocs/reception/card.php --- htdocs/reception/card.php | 105 ++++++++++++++++++++++---------------- 1 file changed, 60 insertions(+), 45 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 18aa08b0d85..8b49f143176 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -62,7 +62,7 @@ if (!empty($conf->incoterm->enabled)) $langs->load('incoterm'); if (!empty($conf->productbatch->enabled)) $langs->load('productbatch'); $origin = GETPOST('origin', 'alpha') ?GETPOST('origin', 'alpha') : 'reception'; // Example: commande, propal -$origin_id = GETPOST('id', 'int') ?GETPOST('id', 'int') : ''; +$origin_id = GETPOST('id', 'int') ? GETPOST('id', 'int') : ''; $id = $origin_id; if (empty($origin_id)) $origin_id = GETPOST('origin_id', 'int'); // Id of order or propal if (empty($origin_id)) $origin_id = GETPOST('object_id', 'int'); // Id of order or propal @@ -87,7 +87,7 @@ $action = GETPOST('action', 'alpha'); if (GETPOST('modelselected')) { $action = 'presend'; } -$confirm = GETPOST('confirm', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); //PDF @@ -707,14 +707,13 @@ if ($action == 'create') if ($origin == 'supplierorder')$classname = 'CommandeFournisseur'; else $classname = ucfirst($origin); - $object = new $classname($db); - if ($object->fetch($origin_id)) // This include the fetch_lines - { + $objectsrc = new $classname($db); + if ($objectsrc->fetch($origin_id)) { // This include the fetch_lines $soc = new Societe($db); - $soc->fetch($object->socid); + $soc->fetch($objectsrc->socid); $author = new User($db); - $author->fetch($object->user_author_id); + $author->fetch($objectsrc->user_author_id); if (!empty($conf->stock->enabled)) $entrepot = new Entrepot($db); @@ -722,10 +721,8 @@ if ($action == 'create') print ''; print ''; print ''; - print ''; - print ''; - if (GETPOST('entrepot_id', 'int')) - { + print ''; + if (GETPOST('entrepot_id', 'int')) { print ''; } @@ -735,13 +732,11 @@ if ($action == 'create') // Ref print ''; print "\n"; @@ -751,7 +746,7 @@ if ($action == 'create') if ($origin == 'supplier_order') print $langs->trans('SupplierOrder'); else print $langs->trans('RefSupplier'); print ''; print ''; @@ -764,8 +759,12 @@ if ($action == 'create') if (!empty($conf->projet->enabled)) { $projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0; - if (empty($projectid) && !empty($object->fk_project)) $projectid = $object->fk_project; - if ($origin == 'project') $projectid = ($originid ? $originid : 0); + if (empty($projectid) && !empty($objectsrc->fk_project)) { + $projectid = $objectsrc->fk_project; + } + if ($origin == 'project') { + $projectid = ($originid ? $originid : 0); + } $langs->load("projects"); print ''; @@ -779,7 +778,7 @@ if ($action == 'create') // Date delivery planned print ''; print '\n"; print ''; @@ -787,16 +786,15 @@ if ($action == 'create') // Note Public print ''; print '"; // Note Private - if ($object->note_private && !$user->socid) - { + if ($objectsrc->note_private && !$user->socid) { print ''; print '"; } @@ -837,15 +835,15 @@ if ($action == 'create') // Other attributes $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"', 'cols' => '3', 'socid'=>$socid); - $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $recept, $action); // Note that $action and $objectsrc may have been modified by hook print $hookmanager->resPrint; - // Here $object can be of an object Order + // Here $object can be of an object Reception $extrafields->fetch_name_optionals_label($object->table_element); if (empty($reshook) && !empty($extrafields->attributes[$object->table_element]['label'])) { // copy from order - if ($object->fetch_optionals() > 0) { - $recept->array_options = array_merge($recept->array_options, $object->array_options); + if ($objectsrc->fetch_optionals() > 0) { + $recept->array_options = array_merge($recept->array_options, $objectsrc->array_options); } print $object->showOptionals($extrafields, 'edit', $parameters); } @@ -854,9 +852,9 @@ if ($action == 'create') if (!empty($conf->incoterm->enabled)) { print ''; - print ''; + print ''; print ''; } @@ -876,15 +874,15 @@ if ($action == 'create') print dol_get_fiche_end(); - // Reception lines $numAsked = 0; $dispatchLines = array(); - foreach ($_POST as $key => $value) - { + foreach ($_POST as $key => $value) { + // If create form is coming from the button "Create Reception" of previous page + // without batch module enabled - if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) - { + $reg = array(); + if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg)) { $numAsked++; // $numline=$reg[2] + 1; // line of product @@ -915,6 +913,25 @@ if ($action == 'create') $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2]; $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST('comment'), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); } + + // If create form is coming from same page post was sent but an error occured + if (preg_match('/^productid([0-9]+)$/i', $key, $reg)) { + $numAsked++; + + // eat-by date dispatch + // $numline=$reg[2] + 1; // line of product + $numline = $numAsked; + $prod = 'productid'.$reg[1]; + $comment = 'comment'.$reg[1]; + $qty = 'qtyl'.$reg[1]; + $ent = 'entl'.$reg[1]; + $pu = 'pul'.$reg[1]; + $lot = 'batch'.$reg[1]; + $dDLUO = dol_mktime(12, 0, 0, GETPOST('dluo'.$reg[1].'month', 'int'), GETPOST('dluo'.$reg[1].'day', 'int'), GETPOST('dluo'.$reg[1].'year', 'int')); + $dDLC = dol_mktime(12, 0, 0, GETPOST('dlc'.$reg[1].'month', 'int'), GETPOST('dlc'.$reg[1].'day', 'int'), GETPOST('dlc'.$reg[1].'year', 'int')); + $fk_commandefourndet = 'fk_commandefournisseurdet'.$reg[1]; + $dispatchLines[$numAsked] = array('prod' => GETPOST($prod, 'int'), 'qty' =>GETPOST($qty), 'ent' =>GETPOST($ent, 'int'), 'pu' =>GETPOST($pu), 'comment' =>GETPOST($comment), 'fk_commandefourndet' => GETPOST($fk_commandefourndet, 'int'), 'DLC'=> $dDLC, 'DLUO'=> $dDLUO, 'lot'=> GETPOST($lot, 'alpha')); + } } @@ -944,7 +961,7 @@ if ($action == 'create') print '
'; print ''; // ancre pour retourner sur la ligne + print ''; // Show product and description $product_static->type = $line->fk_product_type; @@ -1067,7 +1086,7 @@ if ($action == 'create') { // Comment //$defaultcomment = 'Line create from order line id '.$line->id; - $defaultcomment = ''; + $defaultcomment = $dispatchLines[$indiceAsked]['comment']; print ''; print ''; print ''.$line->qty; print ''; + print ''; print ''; print ''; - $quantityDelivered = $object->receptions[$line->id]; + $quantityDelivered = $objectsrc->receptions[$line->id]; print $quantityDelivered; print ''; print '
'; - if ($origin == 'supplierorder' && !empty($conf->fournisseur->enabled)) - { - print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$object->ref; + if ($origin == 'supplierorder' && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled))) { + print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"), 'order').' '.$objectsrc->ref; } - if ($origin == 'propal' && !empty($conf->propal->enabled)) - { - print $langs->trans("RefProposal").''.img_object($langs->trans("ShowProposal"), 'propal').' '.$object->ref; + if ($origin == 'propal' && !empty($conf->propal->enabled)) { + print $langs->trans("RefProposal").''.img_object($langs->trans("ShowProposal"), 'propal').' '.$objectsrc->ref; } print '
'; - print ''; + print ''; print '
'.$langs->trans("DateDeliveryPlanned").''; - $date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date); // $date_delivery comes from GETPOST + $date_delivery = ($date_delivery ? $date_delivery : $objectsrc->delivery_date); // $date_delivery comes from GETPOST print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print "
'.$langs->trans("NotePublic").''; - $doleditor = new DolEditor('note_public', $object->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); + $doleditor = new DolEditor('note_public', $objectsrc->note_public, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print "
'.$langs->trans("NotePrivate").''; - $doleditor = new DolEditor('note_private', $object->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%'); + $doleditor = new DolEditor('note_private', $objectsrc->note_private, '', 60, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) ? 0 : 1, ROWS_3, '90%'); print $doleditor->Create(1); print "
'; - print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : '')); + print $form->select_incoterms((!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : ''), (!empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : '')); print '
'; // Load receptions already done for same order - $object->loadReceptions(); + $objectsrc->loadReceptions(); if ($numAsked) { @@ -980,14 +997,13 @@ if ($action == 'create') while ($indiceAsked <= $numAsked) { $product = new Product($db); - foreach ($object->lines as $supplierLine) { + foreach ($objectsrc->lines as $supplierLine) { if ($dispatchLines[$indiceAsked]['fk_commandefourndet'] == $supplierLine->id) { $line = $supplierLine; break; } } - // Show product and description $type = $line->product_type ? $line->product_type : $line->fk_product_type; // Try to enhance type detection using date_start and date_end for free lines where type @@ -995,7 +1011,7 @@ if ($action == 'create') if (!empty($line->date_start)) $type = 1; if (!empty($line->date_end)) $type = 1; - print ''."\n"; + print ''."\n"; print ''."\n"; @@ -1008,6 +1024,7 @@ if ($action == 'create') print ''; $qtyProdCom = $line->qty; // Qty already received print ''; From 33a4c98dc3b2ecc134fdda48a0ed15a3f1d7a69c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 04:33:35 +0200 Subject: [PATCH 120/174] Fix popup --- htdocs/reception/card.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 8b49f143176..8a4d5edc611 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1027,10 +1027,7 @@ if ($action == 'create') print ''; // Show product and description - $product_static->type = $line->fk_product_type; - $product_static->id = $line->fk_product; - $product_static->ref = $line->ref; - $product_static->status_batch = $line->product_tobatch; + $product_static = $product; $text = $product_static->getNomUrl(1); $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); From 68579f9cda31df18f0d61789da37c96a06e0d0ef Mon Sep 17 00:00:00 2001 From: Christian Foellmann Date: Wed, 2 Jun 2021 08:17:34 +0200 Subject: [PATCH 121/174] fix html linebreak --- .../core/triggers/interface_50_modAgenda_ActionsAuto.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 3c7c8cb6e1c..8e23c258d88 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -552,7 +552,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg = $langs->transnoentities("OrderRefusedInDolibarr", $object->ref); if (!empty($object->refuse_note)) { - $object->actionmsg .= '
'; + $object->actionmsg .= '
'; $object->actionmsg .= $langs->trans("Reason") . ': '.$object->refuse_note; } From 6d049f5c2e018603ec04219fa4586f544952ce60 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 2 Jun 2021 09:31:04 +0200 Subject: [PATCH 122/174] Fix #17791 : Error when loading chart of accounts --- .../mysql/data/llx_accounting_account_es.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_es.sql b/htdocs/install/mysql/data/llx_accounting_account_es.sql index b3301de496f..c3d194fab2a 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_es.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_es.sql @@ -42,7 +42,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, active) VALUES (__ENTITY__, 4008, 'PCG08-PYME','CAPIT', '10', '4001', 'CAPITAL', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4009, 'PCG08-PYME','CAPIT', '100', '4008', 'Capital social', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4010, 'PCG08-PYME','CAPIT', '101', '4008', 'Fondo social', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4011, 'PCG08-PYME','CAPIT', 'CAPITAL', '102', '4008', 'Capital', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4011, 'PCG08-PYME','CAPIT', '102', '4008', 'Capital', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4012, 'PCG08-PYME','CAPIT', '103', '4008', 'Socios por desembolsos no exigidos', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4013, 'PCG08-PYME','CAPIT', '1030', '4012', 'Socios por desembolsos no exigidos capital social', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4014, 'PCG08-PYME','CAPIT', '1034', '4012', 'Socios por desembolsos no exigidos capital pendiente de inscripción', 1); @@ -291,8 +291,8 @@ 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, active) VALUES (__ENTITY__, 4257, 'PCG08-PYME','EXISTENCIAS', '394', '4252', 'Deterioro de valor de los productos semiterminados', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4258, 'PCG08-PYME','EXISTENCIAS', '395', '4252', 'Deterioro de valor de los productos terminados', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4259, 'PCG08-PYME','EXISTENCIAS', '396', '4252', 'Deterioro de valor de los subproductos, residuos y materiales recuperados', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4260, 'PCG08-PYME','ACREEDORES_DEUDORES', 'PROVEEDORES', '40', '4004', 'Proveedores', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4261, 'PCG08-PYME','ACREEDORES_DEUDORES', 'PROVEEDORES', '400', '4260', 'Proveedores', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4260, 'PCG08-PYME','ACREEDORES_DEUDORES', '40', '4004', 'Proveedores', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4261, 'PCG08-PYME','ACREEDORES_DEUDORES', '400', '4260', 'Proveedores', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4262, 'PCG08-PYME','ACREEDORES_DEUDORES', '4000', '4261', 'Proveedores euros', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4263, 'PCG08-PYME','ACREEDORES_DEUDORES', '4004', '4261', 'Proveedores moneda extranjera', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4264, 'PCG08-PYME','ACREEDORES_DEUDORES', '4009', '4261', 'Proveedores facturas pendientes de recibir o formalizar', 1); @@ -314,8 +314,8 @@ 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, active) VALUES (__ENTITY__, 4280, 'PCG08-PYME','ACREEDORES_DEUDORES', '4109', '4277', 'Acreedores por prestaciones de servicios facturas pendientes de recibir o formalizar', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4281, 'PCG08-PYME','ACREEDORES_DEUDORES', '411', '4276', 'Acreedores efectos comerciales a pagar', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4282, 'PCG08-PYME','ACREEDORES_DEUDORES', '419', '4276', 'Acreedores por operaciones en común', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4283, 'PCG08-PYME','ACREEDORES_DEUDORES', 'CLIENTES', '43', '4004', 'Clientes', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4284, 'PCG08-PYME','ACREEDORES_DEUDORES', 'CLIENTES', '430', '4283', 'Clientes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4283, 'PCG08-PYME','ACREEDORES_DEUDORES', '43', '4004', 'Clientes', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4284, 'PCG08-PYME','ACREEDORES_DEUDORES', '430', '4283', 'Clientes', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4285, 'PCG08-PYME','ACREEDORES_DEUDORES', '4300', '4284', 'Clientes euros', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4286, 'PCG08-PYME','ACREEDORES_DEUDORES', '4304', '4284', 'Clientes moneda extranjera', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4287, 'PCG08-PYME','ACREEDORES_DEUDORES', '4309', '4284', 'Clientes facturas pendientes de formalizar', 1); @@ -501,9 +501,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, active) VALUES (__ENTITY__, 4467, 'PCG08-PYME','FINAN', '567', '4462', 'Intereses pagados por anticipado', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4468, 'PCG08-PYME','FINAN', '568', '4462', 'Intereses cobrados a corto plazo', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4469, 'PCG08-PYME','FINAN', '57', '4005', 'Tesorería', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4470, 'PCG08-PYME','FINAN', 'CAJA', '570', '4469', 'Caja euros', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4470, 'PCG08-PYME','FINAN', '570', '4469', 'Caja euros', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4471, 'PCG08-PYME','FINAN', '571', '4469', 'Caja moneda extranjera', 1); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4472, 'PCG08-PYME','FINAN', 'BANCOS', '572', '4469', 'Bancos e instituciones de crédito cc vista euros', 1); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4472, 'PCG08-PYME','FINAN', '572', '4469', 'Bancos e instituciones de crédito cc vista euros', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4473, 'PCG08-PYME','FINAN', '573', '4469', 'Bancos e instituciones de crédito cc vista moneda extranjera', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4474, 'PCG08-PYME','FINAN', '574', '4469', 'Bancos e instituciones de crédito cuentas de ahorro euros', 1); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 4475, 'PCG08-PYME','FINAN', '575', '4469', 'Bancos e instituciones de crédito cuentas de ahorro moneda extranjera', 1); From f875bcfe09be360570096a8b610396a4574a3b09 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 2 Jun 2021 10:30:48 +0200 Subject: [PATCH 123/174] update ->nom field if different from ->name --- htdocs/user/class/usergroup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 20ac35b370f..b271eec5754 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -675,7 +675,7 @@ class UserGroup extends CommonObject { global $user, $conf; - if (empty($this->nom) && !empty($this->name)) { + if ((empty($this->nom) || $this->nom != $this->name) && !empty($this->name)) { $this->nom = $this->name; } From 3aca9bdb9e62973d0f3217589c5d6d8384cb7f48 Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 2 Jun 2021 12:02:27 +0200 Subject: [PATCH 124/174] Fix warehouse id --- htdocs/expedition/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 264089ac48a..a4597fee291 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2211,7 +2211,8 @@ if ($action == 'create') // only show lot numbers from src warehouse when shipping from multiple warehouses $line->fetch($detail_batch->fk_expeditiondet); } - print '
'; + $entrepot_id = !empty($detail_batch->entrepot_id)?$detail_batch->entrepot_id:$lines[$i]->entrepot_id; + print ''; print ''; } // add a 0 qty lot row to be able to add a lot From a4d213a0c9e115c94876f471ad6c751db145957a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 12:29:05 +0200 Subject: [PATCH 125/174] Update doc --- README-FR.md | 20 ++++++++++++++++---- README.md | 5 +++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README-FR.md b/README-FR.md index 77bb5a3e27a..81fdff13047 100644 --- a/README-FR.md +++ b/README-FR.md @@ -8,10 +8,12 @@ Il est simple d'utilisation et modulaire, vous permettant de n'activez que les f ![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) + ## LICENCE Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure. + ## INSTALLER DOLIBARR ### Configuration simple @@ -52,6 +54,7 @@ Vous pouvez aussi utiliser un serveur Web et une base de données prise en charg - Suivez les instructions de l'installateur + ## METTRE A JOUR DOLIBARR Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: @@ -64,9 +67,11 @@ Pour mettre à jour Dolibarr depuis une vieille version vers celle ci: *Note: Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/* + ## CE QUI EST NOUVEAU -Voir fichier ChangeLog. +See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file. + ## CE QUE DOLIBARR PEUT FAIRE @@ -82,15 +87,17 @@ Voir fichier ChangeLog. - Calendrier/Agenda partagé (avec export ical, vcal) - Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...) - Gestion de contrats de services -- Gestion de stock +- Gestion de stock et inventaires - Gestion des expéditions - Gestion des demandes de congès - Gestion des notes de frais +- Gestion de recrutement - GED (Gestion Electronique de Documents) - EMailings de masse - Réalisation de sondages +- Gestion d'adhérents - Point de vente/Caisse enregistreuse -- … +- … (près de 100 modules disponibles en standard, près de 1000 autre sur la place de marché d'extensions) ### Autres modules @@ -135,31 +142,36 @@ Voir fichier ChangeLog. Dolibarr peut aussi être étendu à volonté avec l'ajout de module/applications externes développées par des développeus tiers, disponible sur [DoliStore](https://www.dolistore.com). + ## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE Voici un liste de fonctionnalités pas encore gérées par Dolibarr: -- Dolibarr ne contient pas de module de Gestion de la paie. +- Dolibarr ne contient pas de module de génération de feuille de paie. - Les tâches du module de gestion de projets n'ont pas de dépendances entre elle. - Dolibarr n'embarque pas de Webmail intégré nativement. - Dolibarr ne fait pas le café (pas encore). + ## DOCUMENTATION La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org). + ## CONTRIBUER Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]. + ## CREDITS Dolibarr est le résultat du travail de nombreux contributeurs depuis des années et utilise des librairies d'autres contributeurs. Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) + ## ACTUALITES ET RESEAUX SOCIAUX Suivez le projet Dolibarr project sur les réseaux francophones diff --git a/README.md b/README.md index 0a3aeecb9f4..531a19e0be9 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Customer & Supplier Orders management - Invoices and payment management - Shipping management -- Warehouse/Stock management +- Warehouse/Stock management/Inventory - Manufacturing Orders - Bank accounts management - Direct debit orders management (European SEPA) @@ -117,11 +117,12 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Interventions management - Employee's leave requests management - Expense reports +- Recruitment management - Timesheets - Electronic Document Management (EDM) - Foundations members management - Point of Sale (POS) -- … +- … (around 100 modules available by default, + 1000 on the addon market place) ### Other application/modules From b5680a91d0cfc7699cd8dffc79f48136f26172ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 13:03:20 +0200 Subject: [PATCH 126/174] css --- htdocs/user/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 693590ff7d2..ba737dfbc62 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -933,13 +933,13 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } if (!empty($arrayfields['u.office_phone']['checked'])) { - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } } if (!empty($arrayfields['u.user_mobile']['checked'])) { - print "\n"; + print '\n"; if (!$i) { $totalarray['nbfield']++; } From db5bcd1b99a8bd4e4043d7bb0cb06cb86e9a0d10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 13:41:08 +0200 Subject: [PATCH 127/174] Fix css --- htdocs/user/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/list.php b/htdocs/user/list.php index ba737dfbc62..bd82824cb05 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -992,7 +992,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { // Salary if (!empty($arrayfields['u.salary']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } From 431691cec4a4d4bf879e5366de218adbd6a3b35d Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Wed, 2 Jun 2021 15:18:45 +0200 Subject: [PATCH 128/174] Fix propal/index.php error on thirdparty display --- htdocs/comm/propal/index.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 359084ddabe..3973071d1f0 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -150,7 +150,7 @@ print '
'; */ $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, date_cloture as datec"; -$sql .= ", s.nom as socname, s.rowid as socid, s.canvas, s.client"; +$sql .= ", s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as c"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) { @@ -185,6 +185,8 @@ if ($resql) { $companystatic->name = $obj->socname; $companystatic->client = $obj->client; $companystatic->canvas = $obj->canvas; + $companystatic->email = $obj->email; + $companystatic->code_compta = $obj->code_compta; $filename = dol_sanitizeFileName($obj->ref); $filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref); @@ -223,7 +225,7 @@ if ($resql) { * Open (validated) proposals */ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { - $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client"; + $sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta"; $sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= ", ".MAIN_DB_PREFIX."propal as p"; @@ -260,6 +262,8 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { $companystatic->name = $obj->socname; $companystatic->client = $obj->client; $companystatic->canvas = $obj->canvas; + $companystatic->email = $obj->email; + $companystatic->code_compta = $obj->code_compta; $filename = dol_sanitizeFileName($obj->ref); $filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref); From da7d821a3e18fa283cf79abe1d6a660c41b131dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 15:32:39 +0200 Subject: [PATCH 129/174] css --- htdocs/holiday/month_report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index 62991a6e0ee..966dd7e8dee 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -413,7 +413,7 @@ if ($num == 0) { print '
'; } if (!empty($arrayfields['cp.description']['checked'])) { - print ''; + print ''; } print ''; From 1468761073884ccc039a2fdbc25e01051712343b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 16:29:38 +0200 Subject: [PATCH 130/174] Fix select --- htdocs/holiday/month_report.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index b83d957b27f..922c313840b 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -138,13 +138,21 @@ $sql .= " FROM ".MAIN_DB_PREFIX."holiday cp"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid"; $sql .= " WHERE cp.rowid > 0"; -$sql .= " AND cp.statut = 3"; // 3 = Approved +$sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED; $sql .= " AND (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')"; -if (!empty($search_ref)) $sql .= natural_search('cp.ref', $search_ref); -if (!empty($search_employee)) $sql .= " AND cp.fk_user = '".$db->escape($search_employee)."'"; -if (!empty($search_type)) $sql .= ' AND cp.fk_type IN ('.$db->escape($search_type).')'; -if (!empty($search_description)) $sql .= natural_search('cp.description', $search_description); +if (!empty($search_ref)) { + $sql .= natural_search('cp.ref', $search_ref); +} +if (!empty($search_employee) && $search_employee > 0) { + $sql .= " AND cp.fk_user = ".((int) $search_employee); +} +if (!empty($search_type) && $search_type != '-1') { + $sql .= ' AND cp.fk_type IN ('.$db->escape($search_type).')'; +} +if (!empty($search_description)) { + $sql .= natural_search('cp.description', $search_description); +} $sql .= $db->order($sortfield, $sortorder); From 38423ba2600303665faf18626f2a89c0f6e93504 Mon Sep 17 00:00:00 2001 From: ATM john Date: Wed, 2 Jun 2021 16:31:31 +0200 Subject: [PATCH 131/174] Fix wrong hook context --- htdocs/product/stock/stockatdate.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 91159984a35..8d355e5c1dc 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -45,7 +45,7 @@ if ($user->socid) { $result = restrictedArea($user, 'produit|service'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('stockreplenishlist')); +$hookmanager->initHooks(array('stockatdate')); //checks if a product has been ordered From 456356ded7ac9b5271fe3d6b2e63e1fb2e818979 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Jun 2021 18:45:48 +0200 Subject: [PATCH 132/174] Fix migration --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 7 +++++++ 1 file changed, 7 insertions(+) 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 c9736e429c4..25a6a6b09e8 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 @@ -67,6 +67,13 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1); +UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'auguria'; +UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'bureau2crea'; +UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'amarok'; +UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'cameleo'; +DELETE FROM llx_user_param where param = 'MAIN_THEME' and value in ('auguria', 'amarok', 'cameleo'); + + -- For v14 ALTER TABLE llx_product_lot ADD COLUMN eol_date datetime NULL; From ef032f9fa0f27eafaa8007fa7a8c4ed04857811a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Jun 2021 08:33:44 +0200 Subject: [PATCH 133/174] fix warning --- htdocs/core/lib/project.lib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index ffa06ebd508..9c33744ceb0 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -2693,6 +2693,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide // define progress color according to time spend vs workload $progressBarClass = 'progress-bar-info'; + $progressCalculated = 0; if ($task->planned_workload) { $progressCalculated = round(100 * floatval($task->duration_effective) / floatval($task->planned_workload), 2); From c3d58ad044cbeb5e39979ff5963e624c4ec3b60a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Jun 2021 08:36:50 +0200 Subject: [PATCH 134/174] fix warning --- htdocs/user/group/list.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index edd34dfe9b8..302d697c563 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2011 Herve Prot - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-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 @@ -34,6 +34,7 @@ $langs->load("users"); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_group = GETPOST('search_group'); $optioncss = GETPOST('optioncss', 'alpha'); +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) // Defini si peux lire/modifier utilisateurs et permisssions $caneditperms = ($user->admin || $user->rights->user->user->creer); From aa1ade5224f0925ff5c9b4188b46278edbbe7509 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 3 Jun 2021 09:13:48 +0200 Subject: [PATCH 135/174] Fix #17791 : fix for SKR03 --- .../mysql/data/llx_accounting_account_de.sql | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_de.sql b/htdocs/install/mysql/data/llx_accounting_account_de.sql index ddb0ab18356..d1b6b00f800 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_de.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_de.sql @@ -2725,20 +2725,20 @@ 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__, 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, 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__, 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'); From 583acfbad4c18c8ba748485c584f24678521bed9 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 3 Jun 2021 09:29:12 +0200 Subject: [PATCH 136/174] Fix #17791 : fix at account --- htdocs/accountancy/admin/account.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 6f510ad3706..ba5bb2105d2 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -165,7 +165,7 @@ if (empty($reshook)) { } $offsetforchartofaccount += ($conf->entity * 100000000); - $result = run_sql($sqlfile, 1, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount); + $result = run_sql($sqlfile, 0, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount); if ($result > 0) { setEventMessages($langs->trans("ChartLoaded"), null, 'mesgs'); From 8f7daf7f5719355c7f6a928e637fc45da568eb9e Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 3 Jun 2021 09:32:58 +0200 Subject: [PATCH 137/174] Fix 17791 : fix for at account --- htdocs/accountancy/admin/account.php | 2 +- .../mysql/data/llx_accounting_account_at.sql | 642 +++++++++--------- 2 files changed, 322 insertions(+), 322 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index ba5bb2105d2..6f510ad3706 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -165,7 +165,7 @@ if (empty($reshook)) { } $offsetforchartofaccount += ($conf->entity * 100000000); - $result = run_sql($sqlfile, 0, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount); + $result = run_sql($sqlfile, 1, $conf->entity, 1, '', 'default', 32768, 0, $offsetforchartofaccount); if ($result > 0) { setEventMessages($langs->trans("ChartLoaded"), null, 'mesgs'); diff --git a/htdocs/install/mysql/data/llx_accounting_account_at.sql b/htdocs/install/mysql/data/llx_accounting_account_at.sql index c20d5877dc2..402e6893e6b 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_at.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_at.sql @@ -22,324 +22,324 @@ -- Descriptif des plans comptables autrichiens standard -- ADD 4100000 to rowid # Do no remove this comment -- -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','0','GROUP0','110','0','Patentrechte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2, 'AT-BASE','0','GROUP0','120','0','Software'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3, 'AT-BASE','0','GROUP0','121','0','ERP System'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 4, 'AT-BASE','0','GROUP0','122','0','Homepage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 5, 'AT-BASE','0','GROUP0','125','0','Software Fremdentwicklung_noch nicht aktivieren'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 6, 'AT-BASE','0','GROUP0','160','0','Umgründungsmehrwert'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 7, 'AT-BASE','0','GROUP0','250','0','Mieterinvestitionen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 8, 'AT-BASE','0','GROUP0','400','0','Maschinen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 9, 'AT-BASE','0','GROUP0','600','0','Betriebs u. Geschäftsausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 10, 'AT-BASE','0','GROUP0','601','0','Ausstellungsstücke'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 11, 'AT-BASE','0','GROUP0','602','0','Leihstellungsstücke'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 12, 'AT-BASE','0','GROUP0','603','0','Getriebeprüfstand_hinten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 13, 'AT-BASE','0','GROUP0','604','0','Wuchtstand_links_AQ'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 14, 'AT-BASE','0','GROUP0','605','0','Messlabor(Messraum)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 15, 'AT-BASE','0','GROUP0','606','0','PAK-System'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 16, 'AT-BASE','0','GROUP0','607','0','Server'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 17, 'AT-BASE','0','GROUP0','608','0','EDV-Ausstattung (Hardware)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 18, 'AT-BASE','0','GROUP0','609','0','Werkstattausstattung (Werkzeug)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 19, 'AT-BASE','0','GROUP0','610','0','Wuchtprüfstand neu_noch nicht in Betrieb genommen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 20, 'AT-BASE','0','GROUP0','611','0','Messequipment/Ausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 21, 'AT-BASE','0','GROUP0','630','0','PKW'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 22, 'AT-BASE','0','GROUP0','640','0','LKW'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 23, 'AT-BASE','0','GROUP0','680','0','GWG-Geschäftsausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 24, 'AT-BASE','0','GROUP0','710','0','Anlagen in Bau'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 25, 'AT-BASE','1','GROUP1','1100','0','Rohstoffe'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 26, 'AT-BASE','1','GROUP1','1200','0','Bezogenen Teile'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 27, 'AT-BASE','1','GROUP1','1300','0','Hilfsstoffe und Betriebsstoffe'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 28, 'AT-BASE','1','GROUP1','1400','0','fertige Erzeugnisse'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 29, 'AT-BASE','1','GROUP1','1500','0','unfertige Erzeugnisse'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 30, 'AT-BASE','1','GROUP1','1600','0','Waren'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 31, 'AT-BASE','1','GROUP1','1700','0','Noch nicht abrechenbare Leist.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 32, 'AT-BASE','1','GROUP1','1701','0','Bestandsveränderung laufend'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 33, 'AT-BASE','1','GROUP1','1800','0','Vorrat Verpackungsmaterial'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 34, 'AT-BASE','1','GROUP1','1810','0','Vorrat Werbematerial'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 35, 'AT-BASE','2','GROUP2','2000','0','Lieferforderungen Inland I'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 36, 'AT-BASE','2','GROUP2','2080','0','Einzelwertb. Ford. Inland'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 37, 'AT-BASE','2','GROUP2','2292','0','geleistete Anzahlungen (20%)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 38, 'AT-BASE','2','GROUP2','2293','0','gel. Anzahlungen i.g.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 39, 'AT-BASE','2','GROUP2','2301','0','Forderung Forschungsprämie'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 40, 'AT-BASE','2','GROUP2','2302','0','Forderungen gelieferte (noch nicht fakturierte Waren)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 41, 'AT-BASE','2','GROUP2','2303','0','Vorauszahlung Leasing Server'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 42, 'AT-BASE','2','GROUP2','2306','0','Kaution Pfauengarten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 43, 'AT-BASE','2','GROUP2','2307','0','Kaution Werkstatt'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 44, 'AT-BASE','2','GROUP2','2308','0','Kaution Parkplatz PKW'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 45, 'AT-BASE','2','GROUP2','2309','0','Kaution Werkstatt'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 46, 'AT-BASE','2','GROUP2','2310','0','Kaution Studentenwohnheim'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 47, 'AT-BASE','2','GROUP2','2311','0','Kaution China'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 48, 'AT-BASE','2','GROUP2','2312','0','Vorauszahlung Xerox'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 49, 'AT-BASE','2','GROUP2','2313','0','Verrechnung Bildungsscheck'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 50, 'AT-BASE','2','GROUP2','2315','0','Aktivierung Körperschaftsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 51, 'AT-BASE','2','GROUP2','2500','0','Vorsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 52, 'AT-BASE','2','GROUP2','2501','0','Vorsteuer aus i. g. Erwerb'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 53, 'AT-BASE','2','GROUP2','2502','0','Vorsteuer reverse charge syst.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 54, 'AT-BASE','2','GROUP2','2503','0','Vorsteuer Reverse Charge § 19/1d'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 55, 'AT-BASE','2','GROUP2','2508','0','Vorsteuer sonstige Leistungen EU'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 56, 'AT-BASE','2','GROUP2','2509','0','EUSt Forderung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 57, 'AT-BASE','2','GROUP2','2510','0','Einfuhrumsatzsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 58, 'AT-BASE','2','GROUP2','2531','0','Vorsteuer Frankreich'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 59, 'AT-BASE','2','GROUP2','2532','0','Vorsteuer Niederlande'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 60, 'AT-BASE','2','GROUP2','2533','0','Vorsteuer GB'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 61, 'AT-BASE','2','GROUP2','2534','0','Vorsteuer Belgien'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 62, 'AT-BASE','2','GROUP2','2535','0','Vorsteuer GB'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 63, 'AT-BASE','2','GROUP2','2901','0','Leasingvorauszahlung Vito'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 64, 'AT-BASE','3','GROUP3','3020','0','Rückstellung für Körperschaftsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 65, 'AT-BASE','3','GROUP3','3060','0','Rst. für Beratungskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 66, 'AT-BASE','3','GROUP3','3064','0','Rst. für Sonderzahlungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 67, 'AT-BASE','3','GROUP3','3072','0','Rst. für nicht konsum. Urlaube'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 68, 'AT-BASE','3','GROUP3','3214','0','Raika 40-00.800.185'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 69, 'AT-BASE','3','GROUP3','3286','0','Darlehen Dipl. Ing. REICH GMBH'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 70, 'AT-BASE','3','GROUP3','3287','0','Darlehen Dr.Höfler'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 71, 'AT-BASE','3','GROUP3','3288','0','Darlehen DI Mayrhofer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 72, 'AT-BASE','3','GROUP3','3289','0','Darlehen AWS'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 73, 'AT-BASE','3','GROUP3','3292','0','Anzahlungen von Kunden 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 74, 'AT-BASE','3','GROUP3','3294','0','Anzahlungen von Kunden Drittland'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 75, 'AT-BASE','3','GROUP3','3300','0','Lieferverbindlichkeiten I'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 76, 'AT-BASE','3','GROUP3','3481','0','Verrechnungskto DI Mayrhofer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 77, 'AT-BASE','3','GROUP3','3500','0','Umsatzsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 78, 'AT-BASE','3','GROUP3','3501','0','Umsatzsteuer aus i. g. Erwerb'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 79, 'AT-BASE','3','GROUP3','3502','0','USt § 19/Art 19 (reverse Charge)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 80, 'AT-BASE','3','GROUP3','3503','0','Umsatzsteuer Reverse Charge § 19/1d'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 81, 'AT-BASE','3','GROUP3','3508','0','Umsatzsteuer sonstige Leistung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 82, 'AT-BASE','3','GROUP3','3531','0','FA-Zahllast Dezember'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 83, 'AT-BASE','3','GROUP3','3533','0','Umsatzsteuer 2012'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 84, 'AT-BASE','3','GROUP3','3535','0','Umsatzsteuer 2013'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 85, 'AT-BASE','3','GROUP3','3536','0','Umsatzsteuer 2014'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 86, 'AT-BASE','3','GROUP3','3537','0','Umsatzsteuer 2015'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 87, 'AT-BASE','3','GROUP3','3632','0','Verrechnungskonto EUSt'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 88, 'AT-BASE','3','GROUP3','3892','0','Verbindlichkeiten Anzahlungsrechn.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 89, 'AT-BASE','3','GROUP3','3898','0','Abgrenzung Sonderzahlungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 90, 'AT-BASE','4','GROUP4','4000','0','Erlöse Lieferungen 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 91, 'AT-BASE','4','GROUP4','4001','0','Erlöse i.g. Lieferung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 92, 'AT-BASE','4','GROUP4','4002','0','Erlöse Dienstleistungen EU'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 93, 'AT-BASE','4','GROUP4','4003','0','Erlöse Dienstleistungen 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 94, 'AT-BASE','4','GROUP4','4004','0','Erlöse Software 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 95, 'AT-BASE','4','GROUP4','4005','0','Erlöse Software EU'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 96, 'AT-BASE','4','GROUP4','4006','0','Evidenz Kfd. Reverse Charge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 97, 'AT-BASE','4','GROUP4','4050','0','Erlöse 0 % Drittland'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 98, 'AT-BASE','4','GROUP4','4051','0','Erlöse Dienstleistungen Drittland'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 99, 'AT-BASE','4','GROUP4','4052','0','Erlöse Software Drittland'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 100, 'AT-BASE','4','GROUP4','4069','0','Erlöse § 19/1d Schrott'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 101, 'AT-BASE','4','GROUP4','4400','0','Kundenskonto 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 102, 'AT-BASE','4','GROUP4','4405','0','Kundenskonto 0 % Ausfuhrlieferungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 103, 'AT-BASE','4','GROUP4','4410','0','Skontoaufwand i.g. Lieferung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 104, 'AT-BASE','4','GROUP4','4413','0','Kundenskonto sonstige Leistung EU'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 105, 'AT-BASE','4','GROUP4','4420','0','Kundenskonto EU-Land A x %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 106, 'AT-BASE','4','GROUP4','4450','0','Kundenrabatt 20%'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 107, 'AT-BASE','4','GROUP4','4500','0','Bestandsveränderungen fertige Erzeugnisse'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 108, 'AT-BASE','4','GROUP4','4510','0','Best.Veränd.Halbf.Erzeugnisse'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 109, 'AT-BASE','4','GROUP4','4519','0','Bestandsveränderung laufend'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 110, 'AT-BASE','4','GROUP4','4520','0','Best.Veränd.n.n.abger.Leist.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 111, 'AT-BASE','4','GROUP4','4530','0','Gelieferte (noch nicht fakturierte Waren)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 112, 'AT-BASE','4','GROUP4','4580','0','Aktivierte Eigenleistung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 113, 'AT-BASE','4','GROUP4','4630','0','Erträge aus d.Abgang v.Anlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 114, 'AT-BASE','4','GROUP4','4801','0','Zuwendungen a.öffentl. Mitteln'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 115, 'AT-BASE','4','GROUP4','4831','0','sonstige betriebliche Erträge (nicht steuerbar)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 116, 'AT-BASE','4','GROUP4','4840','0','Sonstige Erlöse 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 117, 'AT-BASE','4','GROUP4','4850','0','Erl. Aufwandersätze'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 118, 'AT-BASE','4','GROUP4','4881','0','Versicherungsvergütungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 119, 'AT-BASE','4','GROUP4','4885','0','Zuschreibungen zum Umlaufvermögen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 120, 'AT-BASE','4','GROUP4','4950','0','Privatanteil 20 %'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 121, 'AT-BASE','4','GROUP4','4991','0','Sachbezüge 20%'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 122, 'AT-BASE','5','GROUP5','5000','0','Handelswareneinsatz'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 123, 'AT-BASE','5','GROUP5','5001','0','Materialeinkauf Fremdfertigung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 124, 'AT-BASE','5','GROUP5','5002','0','Wareneinkauf Verkauf'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 125, 'AT-BASE','5','GROUP5','5020','0','Materialeinkauf'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 126, 'AT-BASE','5','GROUP5','5090','0','Bezugskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 127, 'AT-BASE','5','GROUP5','5100','0','Verbrauch Rohstoffe'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 128, 'AT-BASE','5','GROUP5','5199','0','Aufwand für TW-AFA Vorräte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 129, 'AT-BASE','5','GROUP5','5200','0','Verbrauch bezogenen Teile'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 130, 'AT-BASE','5','GROUP5','5300','0','Verbrauch Hilfsstoffe'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 131, 'AT-BASE','5','GROUP5','5400','0','Hilfsstoffverbrauch'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 132, 'AT-BASE','5','GROUP5','5440','0','Inventurveränderung Fremdbarb. + GK'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 133, 'AT-BASE','5','GROUP5','5441','0','GWG Fremdbarb. + GK'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 134, 'AT-BASE','5','GROUP5','5450','0','Verpackungsmaterial'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 135, 'AT-BASE','5','GROUP5','5800','0','Fremdleistungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 136, 'AT-BASE','5','GROUP5','5880','0','Lieferantenskonti'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 137, 'AT-BASE','5','GROUP5','5900','0','Skontoertrag ig.E. 0% (m.VST)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 138, 'AT-BASE','5','GROUP5','5920','0','Skontoertrag ig.E. 20% (m.VST)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 139, 'AT-BASE','6','GROUP6','6000','0','Löhne'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 140, 'AT-BASE','6','GROUP6','6001','0','Rückerstattung AUVA Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 141, 'AT-BASE','6','GROUP6','6010','0','Lehrlingsentschädigung Arb.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 142, 'AT-BASE','6','GROUP6','6020','0','Nichtleistungslöhne'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 143, 'AT-BASE','6','GROUP6','6100','0','Leihpersonal Aufwand'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 144, 'AT-BASE','6','GROUP6','6150','0','Sonderzahlungen Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 145, 'AT-BASE','6','GROUP6','6200','0','Gehälter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 146, 'AT-BASE','6','GROUP6','6201','0','Förderung AMS'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 147, 'AT-BASE','6','GROUP6','6202','0','Rückerstattung AUVA Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 148, 'AT-BASE','6','GROUP6','6210','0','Veränderung Mehrarbeitsvergütung RSt Ang'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 149, 'AT-BASE','6','GROUP6','6211','0','Veränderung Mehrarbeitsvergütung RSt Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 150, 'AT-BASE','6','GROUP6','6230','0','Sonderzahlungen Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 151, 'AT-BASE','6','GROUP6','6231','0','Dotierung RST Sonderzahlungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 152, 'AT-BASE','6','GROUP6','6255','0','Geschäftsführerbezüge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 153, 'AT-BASE','6','GROUP6','6256','0','Geschäftsführersachbezüge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 154, 'AT-BASE','6','GROUP6','6300','0','Sonderzahlung aliquot vorläufig'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 155, 'AT-BASE','6','GROUP6','6310','0','Dotierung Urlaubsrückstellung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 156, 'AT-BASE','6','GROUP6','6311','0','Veränderung Urlaubsrückstellung Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 157, 'AT-BASE','6','GROUP6','6402','0','Betriebliche Vorsorgekassa Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 158, 'AT-BASE','6','GROUP6','6407','0','Betriebliche Vorsorgekassa Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 159, 'AT-BASE','6','GROUP6','6416','0','Veränderung Pensionsrückstellung (Angestellte)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 160, 'AT-BASE','6','GROUP6','6435','0','sonstige Beiträge für die Altersversorgung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 161, 'AT-BASE','6','GROUP6','6500','0','Gesetzlicher Sozialaufwand'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 162, 'AT-BASE','6','GROUP6','6600','0','Gesetzlicher Sozialaufwand Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 163, 'AT-BASE','6','GROUP6','6605','0','Gesetzlicher Sozialaufwand Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 164, 'AT-BASE','6','GROUP6','6610','0','Dienstgeberbeitrag Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 165, 'AT-BASE','6','GROUP6','6611','0','Dienstgeberbeitrag Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 166, 'AT-BASE','6','GROUP6','6620','0','Zuschlag zum DB'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 167, 'AT-BASE','6','GROUP6','6621','0','Zuschlag zum DB Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 168, 'AT-BASE','6','GROUP6','6630','0','Ausgleichstaxe'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 169, 'AT-BASE','6','GROUP6','6690','0','Lohnsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 170, 'AT-BASE','6','GROUP6','6693','0','Kommunalsteuer Arbeiter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 171, 'AT-BASE','6','GROUP6','6694','0','Kommunalsteuer Angestellte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 172, 'AT-BASE','6','GROUP6','6700','0','Freiwilliger Sozialaufwand'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 173, 'AT-BASE','6','GROUP6','6710','0','Arbeitskleidung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 174, 'AT-BASE','6','GROUP6','6720','0','Fahrspesen Dienstnehmer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 175, 'AT-BASE','6','GROUP6','6730','0','Weihnachtsgeschenke Arbeitnehmer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 176, 'AT-BASE','6','GROUP6','6740','0','Betriebsveranstaltungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 177, 'AT-BASE','6','GROUP6','6750','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 178, 'AT-BASE','6','GROUP6','6760','0','Vergleichszahlung Dienstnehmer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 179, 'AT-BASE','7','GROUP7','7030','0','Abschreibung G W G'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 180, 'AT-BASE','7','GROUP7','7070','0','Buchwert ausgeschiedener Anlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 181, 'AT-BASE','7','GROUP7','7080','0','Planmäßige AFA immat.WG.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 182, 'AT-BASE','7','GROUP7','7081','0','Planmäßige Abschreibung für Sachanlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 183, 'AT-BASE','7','GROUP7','7100','0','Nicht abzugsfähige Vorsteuer (VStK)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 184, 'AT-BASE','7','GROUP7','7110','0','Gebühren und Abgaben_Zoll'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 185, 'AT-BASE','7','GROUP7','7111','0','Kammerumlage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 186, 'AT-BASE','7','GROUP7','7200','0','Instandhaltung Gebäude'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 187, 'AT-BASE','7','GROUP7','7201','0','Instandhaltung Außenanlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 188, 'AT-BASE','7','GROUP7','7202','0','Instandh. - Maschinen u. Anl.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 189, 'AT-BASE','7','GROUP7','7204','0','Instandhaltung und Betriebskosten Betriebs und Geschäftsgebäude'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 190, 'AT-BASE','7','GROUP7','7205','0','Verbrauchsmaterial Werkstatt'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 191, 'AT-BASE','7','GROUP7','7210','0','Müllentsorgung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 192, 'AT-BASE','7','GROUP7','7211','0','Entsorgungskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 193, 'AT-BASE','7','GROUP7','7230','0','Reinigungsmaterial (div. Verbrauchsmaterial)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 194, 'AT-BASE','7','GROUP7','7231','0','Berufsbekleidung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 195, 'AT-BASE','7','GROUP7','7235','0','Reinigung durch Dritte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 196, 'AT-BASE','7','GROUP7','7240','0','LKW-Betriebskosten Vito G 437 MB'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 197, 'AT-BASE','7','GROUP7','7241','0','Leasing Mercedes Vito G 437 MB'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 198, 'AT-BASE','7','GROUP7','7250','0','KFZ Betriebskosten allgemein'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 199, 'AT-BASE','7','GROUP7','7251','0','KFZ Leasing allgemein'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 200, 'AT-BASE','7','GROUP7','7252','0','KFZ Versicherungen allgemein'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 201, 'AT-BASE','7','GROUP7','7253','0','Wachdienst'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 202, 'AT-BASE','7','GROUP7','7254','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 203, 'AT-BASE','7','GROUP7','7255','0','Aufwand Leihwagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 204, 'AT-BASE','7','GROUP7','7256','0','PKW-Betriebskosten VW Golf G 854 SH Versuchsfahrzeug'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 205, 'AT-BASE','7','GROUP7','7257','0','Leasing VW Golf G 854 SH'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 206, 'AT-BASE','7','GROUP7','7258','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 207, 'AT-BASE','7','GROUP7','7285','0','Strom'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 208, 'AT-BASE','7','GROUP7','7286','0','Betriebskosten/Beheizung Mietobjekte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 209, 'AT-BASE','7','GROUP7','7300','0','Transporte durch Dritte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 210, 'AT-BASE','7','GROUP7','7330','0','Reise und Fahrtspesen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 211, 'AT-BASE','7','GROUP7','7331','0','Kilometergelder'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 212, 'AT-BASE','7','GROUP7','7360','0','Reisediäten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 213, 'AT-BASE','7','GROUP7','7380','0','Telefon'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 214, 'AT-BASE','7','GROUP7','7381','0','Internet'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 215, 'AT-BASE','7','GROUP7','7382','0','Wartung Homepage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 216, 'AT-BASE','7','GROUP7','7390','0','Postgebühren'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 217, 'AT-BASE','7','GROUP7','7400','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 218, 'AT-BASE','7','GROUP7','7401','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 219, 'AT-BASE','7','GROUP7','7402','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 220, 'AT-BASE','7','GROUP7','7403','0','Miete Büro Linz'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 221, 'AT-BASE','7','GROUP7','7404','0','Miete Gradnerstraße'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 222, 'AT-BASE','7','GROUP7','7410','0','Maschinen u. Gerätemieten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 223, 'AT-BASE','7','GROUP7','7411','0','Wartungskosten BuG Ausstattung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 224, 'AT-BASE','7','GROUP7','7420','0','Mobilien-Leasing '); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 225, 'AT-BASE','7','GROUP7','7421','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 226, 'AT-BASE','7','GROUP7','7422','0','Leasing Server'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 227, 'AT-BASE','7','GROUP7','7423','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 228, 'AT-BASE','7','GROUP7','7424','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 229, 'AT-BASE','7','GROUP7','7480','0','Lizenzgebühren'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 230, 'AT-BASE','7','GROUP7','7540','0','Provisionen an Dritte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 231, 'AT-BASE','7','GROUP7','7600','0','Büromaterial'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 232, 'AT-BASE','7','GROUP7','7601','0','EDV-Material'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 233, 'AT-BASE','7','GROUP7','7610','0','Drucksorten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 234, 'AT-BASE','7','GROUP7','7620','0','Fachliteratur und Zeitungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 235, 'AT-BASE','7','GROUP7','7630','0','Gästeunt. u. Zeitschriften'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 236, 'AT-BASE','7','GROUP7','7650','0','Werbeaufwand/Inserate'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 237, 'AT-BASE','7','GROUP7','7651','0','Anbahnung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 238, 'AT-BASE','7','GROUP7','7652','0','Aufwand Messen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 239, 'AT-BASE','7','GROUP7','7653','0','Konto frei'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 240, 'AT-BASE','7','GROUP7','7654','0','Inserate'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 241, 'AT-BASE','7','GROUP7','7670','0','Bewirtungskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 242, 'AT-BASE','7','GROUP7','7690','0','Trinkgelder u. Spenden'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 243, 'AT-BASE','7','GROUP7','7691','0','Spenden an begünstigte Institutionen/Sponsoring'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 244, 'AT-BASE','7','GROUP7','7696','0','Säumnis- und Verspätungszuschläge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 245, 'AT-BASE','7','GROUP7','7700','0','Betriebsversicherungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 246, 'AT-BASE','7','GROUP7','7701','0','Transportversicherungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 247, 'AT-BASE','7','GROUP7','7710','0','Pflichtversich. Unternehmer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 248, 'AT-BASE','7','GROUP7','7749','0','Aufwand Japan'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 249, 'AT-BASE','7','GROUP7','7750','0','Steuerberatung (Lohnverrechnung, Buchhaltung)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 250, 'AT-BASE','7','GROUP7','7751','0','Patentkosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 251, 'AT-BASE','7','GROUP7','7752','0','Rechtsberatung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 252, 'AT-BASE','7','GROUP7','7753','0','Unternehmensberatung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 253, 'AT-BASE','7','GROUP7','7754','0','Aufwand tectos China'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 254, 'AT-BASE','7','GROUP7','7755','0','Wartung (Betreuung EDV)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 255, 'AT-BASE','7','GROUP7','7756','0','Lizenzgebühren Abaqus'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 256, 'AT-BASE','7','GROUP7','7757','0','Lizenzgebühren Sonstige'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 257, 'AT-BASE','7','GROUP7','7758','0','Sonstige Beratungskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 258, 'AT-BASE','7','GROUP7','7759','0','EDV-Beratung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 259, 'AT-BASE','7','GROUP7','7760','0','Mitgliedsbeiträge/freiwillige Beiträge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 260, 'AT-BASE','7','GROUP7','7761','0','Prüfung Jahresabschluss'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 261, 'AT-BASE','7','GROUP7','7770','0','Aus- und Fortbildung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 262, 'AT-BASE','7','GROUP7','7775','0','Forschung und Entwicklung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 263, 'AT-BASE','7','GROUP7','7776','0','Messentwicklung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 264, 'AT-BASE','7','GROUP7','7777','0','Produktentwicklung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 265, 'AT-BASE','7','GROUP7','7785','0','Freiwillige Verbandsbeiträge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 266, 'AT-BASE','7','GROUP7','7790','0','Spesen des Geldverkehrs'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 267, 'AT-BASE','7','GROUP7','7791','0','Kursdifferenzen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 268, 'AT-BASE','7','GROUP7','7800','0','Betriebsbedingte Schadensfälle'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 269, 'AT-BASE','7','GROUP7','7801','0','Ausgaben nicht absetzbar'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 270, 'AT-BASE','7','GROUP7','7802','0','Strafen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 271, 'AT-BASE','7','GROUP7','7805','0','Forderungsverluste 20'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 272, 'AT-BASE','7','GROUP7','7806','0','Abschreibungen auf Forderungen (EU)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 273, 'AT-BASE','7','GROUP7','7807','0','Abschreibungen auf Forderungen (Drittland)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 274, 'AT-BASE','7','GROUP7','7810','0','Zuweisung an Einzel-WB Forderungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 275, 'AT-BASE','7','GROUP7','7811','0','Zuweisung pauschale Wertberichtigungen zu Exportforderungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 276, 'AT-BASE','7','GROUP7','7812','0','Abschreibungen auf Vorräte'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 277, 'AT-BASE','7','GROUP7','7820','0','Buchwert abgegangener Sachanlagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 278, 'AT-BASE','7','GROUP7','7840','0','Gründungskosten'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 279, 'AT-BASE','7','GROUP7','7850','0','Sonstiger Aufwand'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 280, 'AT-BASE','7','GROUP7','7851','0','Sonstiger Aufwand Gewinnanteil Reich'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 281, 'AT-BASE','7','GROUP7','7930','0','Aufw. Gewährleistungsverpfl.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 282, 'AT-BASE','7','GROUP7','7940','0','Aufwand aus Vorperioden'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 283, 'AT-BASE','8','GROUP8','8020','0','Gewinnüberrg. v. Organgesell.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 284, 'AT-BASE','8','GROUP8','8060','0','Zinserträge'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 285, 'AT-BASE','8','GROUP8','8090','0','Ertr.a.Ant.a.and. Unternehmen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 286, 'AT-BASE','8','GROUP8','8100','0','Habenzinsen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 287, 'AT-BASE','8','GROUP8','8280','0','Zinsen f. Kredite u. Darlehen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 288, 'AT-BASE','8','GROUP8','8286','0','Kursgewinne/Kursverluste'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 289, 'AT-BASE','8','GROUP8','8288','0','Zinsen auf Lieferantenkredite'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 290, 'AT-BASE','8','GROUP8','8291','0','Sonst. Zinsen und ähnliche Aufwendungen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 291, 'AT-BASE','8','GROUP8','8500','0','Körperschaftsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 292, 'AT-BASE','8','GROUP8','8505','0','Kapitalertragsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 293, 'AT-BASE','8','GROUP8','8510','0','Körperschaftsteuervorauszahl.'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 294, 'AT-BASE','8','GROUP8','8511','0','Dotierung KöSt-Rückstellung'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 295, 'AT-BASE','8','GROUP8','8512','0','Aktivierung Körperschaftsteuer'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 296, 'AT-BASE','8','GROUP8','8513','0','Köst Vorperioden'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 297, 'AT-BASE','8','GROUP8','8520','0','Forschungsprämie'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 298, 'AT-BASE','8','GROUP8','8595','0','Ertrag aus der Aktivierung latenter Steuern'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 299, 'AT-BASE','8','GROUP8','8610','0','Auflösung sonstiger unversteuerter Rücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 300, 'AT-BASE','8','GROUP8','8700','0','Auflösung gebundener Kapitalrücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 301, 'AT-BASE','8','GROUP8','8710','0','Auflösung Rücklage für eigene Anteile'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 302, 'AT-BASE','8','GROUP8','8720','0','Auflösung nicht gebundene Kapitalrücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 303, 'AT-BASE','8','GROUP8','8750','0','Auflösung gesetzliche Rücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 304, 'AT-BASE','8','GROUP8','8760','0','Auflösung satzungsmäßige Rücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 305, 'AT-BASE','8','GROUP8','8770','0','Auflösung andere (freie) Rücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 306, 'AT-BASE','8','GROUP8','8810','0','Zuweisung sonstige unversteuerte Rücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 307, 'AT-BASE','8','GROUP8','8820','0','Zuweisung Inv. Rücklage'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 308, 'AT-BASE','8','GROUP8','8890','0','Zuw.Bew.Res.GWG'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 309, 'AT-BASE','8','GROUP8','8900','0','Zuweisung gesetzliche Rücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 310, 'AT-BASE','8','GROUP8','8910','0','Zuweisung satzungsmäßige Rücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 311, 'AT-BASE','8','GROUP8','8920','0','Zuweisung andere (freie) Rücklagen'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 312, 'AT-BASE','9','GROUP9','9390','0','Bilanzgewinn'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 313, 'AT-BASE','9','GROUP9','9391','0','Bilanzverlust'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 314, 'AT-BASE','9','GROUP9','9700','0','Wachdienst'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 315, 'AT-BASE','9','GROUP9','9991','0','Gewinnvortrag'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 316, 'AT-BASE','9','GROUP9','9993','0','Verlustvortrag'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 317, 'AT-BASE','9','GROUP9','9994','0','Verlustvortrag'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 318, 'AT-BASE','5','GROUP5','50200','0','Materialeinkauf'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 319, 'AT-BASE','6','GROUP6','60000','0','kalk. Löhne u Gehälter'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 320, 'AT-BASE','6','GROUP6','64160','0','Veränderung Pensionsrückstellung (Angestellte)'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 321, 'AT-BASE','6','GROUP6','66300','0','Leistungserfassung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','GROUP0','110','0','Patentrechte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2, 'AT-BASE','GROUP0','120','0','Software'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3, 'AT-BASE','GROUP0','121','0','ERP System'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 4, 'AT-BASE','GROUP0','122','0','Homepage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 5, 'AT-BASE','GROUP0','125','0','Software Fremdentwicklung_noch nicht aktivieren'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 6, 'AT-BASE','GROUP0','160','0','Umgründungsmehrwert'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 7, 'AT-BASE','GROUP0','250','0','Mieterinvestitionen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 8, 'AT-BASE','GROUP0','400','0','Maschinen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 9, 'AT-BASE','GROUP0','600','0','Betriebs u. Geschäftsausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 10, 'AT-BASE','GROUP0','601','0','Ausstellungsstücke'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 11, 'AT-BASE','GROUP0','602','0','Leihstellungsstücke'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 12, 'AT-BASE','GROUP0','603','0','Getriebeprüfstand_hinten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 13, 'AT-BASE','GROUP0','604','0','Wuchtstand_links_AQ'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 14, 'AT-BASE','GROUP0','605','0','Messlabor(Messraum)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 15, 'AT-BASE','GROUP0','606','0','PAK-System'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 16, 'AT-BASE','GROUP0','607','0','Server'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 17, 'AT-BASE','GROUP0','608','0','EDV-Ausstattung (Hardware)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 18, 'AT-BASE','GROUP0','609','0','Werkstattausstattung (Werkzeug)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 19, 'AT-BASE','GROUP0','610','0','Wuchtprüfstand neu_noch nicht in Betrieb genommen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 20, 'AT-BASE','GROUP0','611','0','Messequipment/Ausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 21, 'AT-BASE','GROUP0','630','0','PKW'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 22, 'AT-BASE','GROUP0','640','0','LKW'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 23, 'AT-BASE','GROUP0','680','0','GWG-Geschäftsausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 24, 'AT-BASE','GROUP0','710','0','Anlagen in Bau'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 25, 'AT-BASE','GROUP1','1100','0','Rohstoffe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 26, 'AT-BASE','GROUP1','1200','0','Bezogenen Teile'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 27, 'AT-BASE','GROUP1','1300','0','Hilfsstoffe und Betriebsstoffe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 28, 'AT-BASE','GROUP1','1400','0','fertige Erzeugnisse'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 29, 'AT-BASE','GROUP1','1500','0','unfertige Erzeugnisse'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 30, 'AT-BASE','GROUP1','1600','0','Waren'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 31, 'AT-BASE','GROUP1','1700','0','Noch nicht abrechenbare Leist.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 32, 'AT-BASE','GROUP1','1701','0','Bestandsveränderung laufend'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 33, 'AT-BASE','GROUP1','1800','0','Vorrat Verpackungsmaterial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 34, 'AT-BASE','GROUP1','1810','0','Vorrat Werbematerial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 35, 'AT-BASE','GROUP2','2000','0','Lieferforderungen Inland I'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 36, 'AT-BASE','GROUP2','2080','0','Einzelwertb. Ford. Inland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 37, 'AT-BASE','GROUP2','2292','0','geleistete Anzahlungen (20%)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 38, 'AT-BASE','GROUP2','2293','0','gel. Anzahlungen i.g.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 39, 'AT-BASE','GROUP2','2301','0','Forderung Forschungsprämie'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 40, 'AT-BASE','GROUP2','2302','0','Forderungen gelieferte (noch nicht fakturierte Waren)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 41, 'AT-BASE','GROUP2','2303','0','Vorauszahlung Leasing Server'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 42, 'AT-BASE','GROUP2','2306','0','Kaution Pfauengarten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 43, 'AT-BASE','GROUP2','2307','0','Kaution Werkstatt'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 44, 'AT-BASE','GROUP2','2308','0','Kaution Parkplatz PKW'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 45, 'AT-BASE','GROUP2','2309','0','Kaution Werkstatt'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 46, 'AT-BASE','GROUP2','2310','0','Kaution Studentenwohnheim'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 47, 'AT-BASE','GROUP2','2311','0','Kaution China'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 48, 'AT-BASE','GROUP2','2312','0','Vorauszahlung Xerox'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 49, 'AT-BASE','GROUP2','2313','0','Verrechnung Bildungsscheck'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 50, 'AT-BASE','GROUP2','2315','0','Aktivierung Körperschaftsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 51, 'AT-BASE','GROUP2','2500','0','Vorsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 52, 'AT-BASE','GROUP2','2501','0','Vorsteuer aus i. g. Erwerb'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 53, 'AT-BASE','GROUP2','2502','0','Vorsteuer reverse charge syst.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 54, 'AT-BASE','GROUP2','2503','0','Vorsteuer Reverse Charge § 19/1d'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 55, 'AT-BASE','GROUP2','2508','0','Vorsteuer sonstige Leistungen EU'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 56, 'AT-BASE','GROUP2','2509','0','EUSt Forderung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 57, 'AT-BASE','GROUP2','2510','0','Einfuhrumsatzsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 58, 'AT-BASE','GROUP2','2531','0','Vorsteuer Frankreich'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 59, 'AT-BASE','GROUP2','2532','0','Vorsteuer Niederlande'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 60, 'AT-BASE','GROUP2','2533','0','Vorsteuer GB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 61, 'AT-BASE','GROUP2','2534','0','Vorsteuer Belgien'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 62, 'AT-BASE','GROUP2','2535','0','Vorsteuer GB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 63, 'AT-BASE','GROUP2','2901','0','Leasingvorauszahlung Vito'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 64, 'AT-BASE','GROUP3','3020','0','Rückstellung für Körperschaftsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 65, 'AT-BASE','GROUP3','3060','0','Rst. für Beratungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 66, 'AT-BASE','GROUP3','3064','0','Rst. für Sonderzahlungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 67, 'AT-BASE','GROUP3','3072','0','Rst. für nicht konsum. Urlaube'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 68, 'AT-BASE','GROUP3','3214','0','Raika 40-00.800.185'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 69, 'AT-BASE','GROUP3','3286','0','Darlehen Dipl. Ing. REICH GMBH'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 70, 'AT-BASE','GROUP3','3287','0','Darlehen Dr.Höfler'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 71, 'AT-BASE','GROUP3','3288','0','Darlehen DI Mayrhofer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 72, 'AT-BASE','GROUP3','3289','0','Darlehen AWS'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 73, 'AT-BASE','GROUP3','3292','0','Anzahlungen von Kunden 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 74, 'AT-BASE','GROUP3','3294','0','Anzahlungen von Kunden Drittland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 75, 'AT-BASE','GROUP3','3300','0','Lieferverbindlichkeiten I'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 76, 'AT-BASE','GROUP3','3481','0','Verrechnungskto DI Mayrhofer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 77, 'AT-BASE','GROUP3','3500','0','Umsatzsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 78, 'AT-BASE','GROUP3','3501','0','Umsatzsteuer aus i. g. Erwerb'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 79, 'AT-BASE','GROUP3','3502','0','USt § 19/Art 19 (reverse Charge)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 80, 'AT-BASE','GROUP3','3503','0','Umsatzsteuer Reverse Charge § 19/1d'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 81, 'AT-BASE','GROUP3','3508','0','Umsatzsteuer sonstige Leistung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 82, 'AT-BASE','GROUP3','3531','0','FA-Zahllast Dezember'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 83, 'AT-BASE','GROUP3','3533','0','Umsatzsteuer 2012'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 84, 'AT-BASE','GROUP3','3535','0','Umsatzsteuer 2013'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 85, 'AT-BASE','GROUP3','3536','0','Umsatzsteuer 2014'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 86, 'AT-BASE','GROUP3','3537','0','Umsatzsteuer 2015'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 87, 'AT-BASE','GROUP3','3632','0','Verrechnungskonto EUSt'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 88, 'AT-BASE','GROUP3','3892','0','Verbindlichkeiten Anzahlungsrechn.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 89, 'AT-BASE','GROUP3','3898','0','Abgrenzung Sonderzahlungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 90, 'AT-BASE','GROUP4','4000','0','Erlöse Lieferungen 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 91, 'AT-BASE','GROUP4','4001','0','Erlöse i.g. Lieferung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 92, 'AT-BASE','GROUP4','4002','0','Erlöse Dienstleistungen EU'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 93, 'AT-BASE','GROUP4','4003','0','Erlöse Dienstleistungen 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 94, 'AT-BASE','GROUP4','4004','0','Erlöse Software 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 95, 'AT-BASE','GROUP4','4005','0','Erlöse Software EU'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 96, 'AT-BASE','GROUP4','4006','0','Evidenz Kfd. Reverse Charge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 97, 'AT-BASE','GROUP4','4050','0','Erlöse 0 % Drittland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 98, 'AT-BASE','GROUP4','4051','0','Erlöse Dienstleistungen Drittland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 99, 'AT-BASE','GROUP4','4052','0','Erlöse Software Drittland'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 100, 'AT-BASE','GROUP4','4069','0','Erlöse § 19/1d Schrott'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 101, 'AT-BASE','GROUP4','4400','0','Kundenskonto 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 102, 'AT-BASE','GROUP4','4405','0','Kundenskonto 0 % Ausfuhrlieferungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 103, 'AT-BASE','GROUP4','4410','0','Skontoaufwand i.g. Lieferung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 104, 'AT-BASE','GROUP4','4413','0','Kundenskonto sonstige Leistung EU'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 105, 'AT-BASE','GROUP4','4420','0','Kundenskonto EU-Land A x %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 106, 'AT-BASE','GROUP4','4450','0','Kundenrabatt 20%'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 107, 'AT-BASE','GROUP4','4500','0','Bestandsveränderungen fertige Erzeugnisse'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 108, 'AT-BASE','GROUP4','4510','0','Best.Veränd.Halbf.Erzeugnisse'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 109, 'AT-BASE','GROUP4','4519','0','Bestandsveränderung laufend'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 110, 'AT-BASE','GROUP4','4520','0','Best.Veränd.n.n.abger.Leist.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 111, 'AT-BASE','GROUP4','4530','0','Gelieferte (noch nicht fakturierte Waren)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 112, 'AT-BASE','GROUP4','4580','0','Aktivierte Eigenleistung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 113, 'AT-BASE','GROUP4','4630','0','Erträge aus d.Abgang v.Anlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 114, 'AT-BASE','GROUP4','4801','0','Zuwendungen a.öffentl. Mitteln'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 115, 'AT-BASE','GROUP4','4831','0','sonstige betriebliche Erträge (nicht steuerbar)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 116, 'AT-BASE','GROUP4','4840','0','Sonstige Erlöse 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 117, 'AT-BASE','GROUP4','4850','0','Erl. Aufwandersätze'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 118, 'AT-BASE','GROUP4','4881','0','Versicherungsvergütungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 119, 'AT-BASE','GROUP4','4885','0','Zuschreibungen zum Umlaufvermögen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 120, 'AT-BASE','GROUP4','4950','0','Privatanteil 20 %'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 121, 'AT-BASE','GROUP4','4991','0','Sachbezüge 20%'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 122, 'AT-BASE','GROUP5','5000','0','Handelswareneinsatz'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 123, 'AT-BASE','GROUP5','5001','0','Materialeinkauf Fremdfertigung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 124, 'AT-BASE','GROUP5','5002','0','Wareneinkauf Verkauf'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 125, 'AT-BASE','GROUP5','5020','0','Materialeinkauf'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 126, 'AT-BASE','GROUP5','5090','0','Bezugskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 127, 'AT-BASE','GROUP5','5100','0','Verbrauch Rohstoffe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 128, 'AT-BASE','GROUP5','5199','0','Aufwand für TW-AFA Vorräte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 129, 'AT-BASE','GROUP5','5200','0','Verbrauch bezogenen Teile'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 130, 'AT-BASE','GROUP5','5300','0','Verbrauch Hilfsstoffe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 131, 'AT-BASE','GROUP5','5400','0','Hilfsstoffverbrauch'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 132, 'AT-BASE','GROUP5','5440','0','Inventurveränderung Fremdbarb. + GK'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 133, 'AT-BASE','GROUP5','5441','0','GWG Fremdbarb. + GK'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 134, 'AT-BASE','GROUP5','5450','0','Verpackungsmaterial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 135, 'AT-BASE','GROUP5','5800','0','Fremdleistungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 136, 'AT-BASE','GROUP5','5880','0','Lieferantenskonti'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 137, 'AT-BASE','GROUP5','5900','0','Skontoertrag ig.E. 0% (m.VST)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 138, 'AT-BASE','GROUP5','5920','0','Skontoertrag ig.E. 20% (m.VST)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 139, 'AT-BASE','GROUP6','6000','0','Löhne'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 140, 'AT-BASE','GROUP6','6001','0','Rückerstattung AUVA Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 141, 'AT-BASE','GROUP6','6010','0','Lehrlingsentschädigung Arb.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 142, 'AT-BASE','GROUP6','6020','0','Nichtleistungslöhne'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 143, 'AT-BASE','GROUP6','6100','0','Leihpersonal Aufwand'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 144, 'AT-BASE','GROUP6','6150','0','Sonderzahlungen Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 145, 'AT-BASE','GROUP6','6200','0','Gehälter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 146, 'AT-BASE','GROUP6','6201','0','Förderung AMS'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 147, 'AT-BASE','GROUP6','6202','0','Rückerstattung AUVA Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 148, 'AT-BASE','GROUP6','6210','0','Veränderung Mehrarbeitsvergütung RSt Ang'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 149, 'AT-BASE','GROUP6','6211','0','Veränderung Mehrarbeitsvergütung RSt Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 150, 'AT-BASE','GROUP6','6230','0','Sonderzahlungen Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 151, 'AT-BASE','GROUP6','6231','0','Dotierung RST Sonderzahlungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 152, 'AT-BASE','GROUP6','6255','0','Geschäftsführerbezüge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 153, 'AT-BASE','GROUP6','6256','0','Geschäftsführersachbezüge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 154, 'AT-BASE','GROUP6','6300','0','Sonderzahlung aliquot vorläufig'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 155, 'AT-BASE','GROUP6','6310','0','Dotierung Urlaubsrückstellung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 156, 'AT-BASE','GROUP6','6311','0','Veränderung Urlaubsrückstellung Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 157, 'AT-BASE','GROUP6','6402','0','Betriebliche Vorsorgekassa Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 158, 'AT-BASE','GROUP6','6407','0','Betriebliche Vorsorgekassa Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 159, 'AT-BASE','GROUP6','6416','0','Veränderung Pensionsrückstellung (Angestellte)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 160, 'AT-BASE','GROUP6','6435','0','sonstige Beiträge für die Altersversorgung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 161, 'AT-BASE','GROUP6','6500','0','Gesetzlicher Sozialaufwand'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 162, 'AT-BASE','GROUP6','6600','0','Gesetzlicher Sozialaufwand Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 163, 'AT-BASE','GROUP6','6605','0','Gesetzlicher Sozialaufwand Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 164, 'AT-BASE','GROUP6','6610','0','Dienstgeberbeitrag Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 165, 'AT-BASE','GROUP6','6611','0','Dienstgeberbeitrag Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 166, 'AT-BASE','GROUP6','6620','0','Zuschlag zum DB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 167, 'AT-BASE','GROUP6','6621','0','Zuschlag zum DB Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 168, 'AT-BASE','GROUP6','6630','0','Ausgleichstaxe'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 169, 'AT-BASE','GROUP6','6690','0','Lohnsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 170, 'AT-BASE','GROUP6','6693','0','Kommunalsteuer Arbeiter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 171, 'AT-BASE','GROUP6','6694','0','Kommunalsteuer Angestellte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 172, 'AT-BASE','GROUP6','6700','0','Freiwilliger Sozialaufwand'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 173, 'AT-BASE','GROUP6','6710','0','Arbeitskleidung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 174, 'AT-BASE','GROUP6','6720','0','Fahrspesen Dienstnehmer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 175, 'AT-BASE','GROUP6','6730','0','Weihnachtsgeschenke Arbeitnehmer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 176, 'AT-BASE','GROUP6','6740','0','Betriebsveranstaltungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 177, 'AT-BASE','GROUP6','6750','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 178, 'AT-BASE','GROUP6','6760','0','Vergleichszahlung Dienstnehmer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 179, 'AT-BASE','GROUP7','7030','0','Abschreibung G W G'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 180, 'AT-BASE','GROUP7','7070','0','Buchwert ausgeschiedener Anlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 181, 'AT-BASE','GROUP7','7080','0','Planmäßige AFA immat.WG.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 182, 'AT-BASE','GROUP7','7081','0','Planmäßige Abschreibung für Sachanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 183, 'AT-BASE','GROUP7','7100','0','Nicht abzugsfähige Vorsteuer (VStK)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 184, 'AT-BASE','GROUP7','7110','0','Gebühren und Abgaben_Zoll'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 185, 'AT-BASE','GROUP7','7111','0','Kammerumlage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 186, 'AT-BASE','GROUP7','7200','0','Instandhaltung Gebäude'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 187, 'AT-BASE','GROUP7','7201','0','Instandhaltung Außenanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 188, 'AT-BASE','GROUP7','7202','0','Instandh. - Maschinen u. Anl.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 189, 'AT-BASE','GROUP7','7204','0','Instandhaltung und Betriebskosten Betriebs und Geschäftsgebäude'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 190, 'AT-BASE','GROUP7','7205','0','Verbrauchsmaterial Werkstatt'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 191, 'AT-BASE','GROUP7','7210','0','Müllentsorgung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 192, 'AT-BASE','GROUP7','7211','0','Entsorgungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 193, 'AT-BASE','GROUP7','7230','0','Reinigungsmaterial (div. Verbrauchsmaterial)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 194, 'AT-BASE','GROUP7','7231','0','Berufsbekleidung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 195, 'AT-BASE','GROUP7','7235','0','Reinigung durch Dritte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 196, 'AT-BASE','GROUP7','7240','0','LKW-Betriebskosten Vito G 437 MB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 197, 'AT-BASE','GROUP7','7241','0','Leasing Mercedes Vito G 437 MB'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 198, 'AT-BASE','GROUP7','7250','0','KFZ Betriebskosten allgemein'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 199, 'AT-BASE','GROUP7','7251','0','KFZ Leasing allgemein'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 200, 'AT-BASE','GROUP7','7252','0','KFZ Versicherungen allgemein'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 201, 'AT-BASE','GROUP7','7253','0','Wachdienst'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 202, 'AT-BASE','GROUP7','7254','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 203, 'AT-BASE','GROUP7','7255','0','Aufwand Leihwagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 204, 'AT-BASE','GROUP7','7256','0','PKW-Betriebskosten VW Golf G 854 SH Versuchsfahrzeug'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 205, 'AT-BASE','GROUP7','7257','0','Leasing VW Golf G 854 SH'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 206, 'AT-BASE','GROUP7','7258','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 207, 'AT-BASE','GROUP7','7285','0','Strom'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 208, 'AT-BASE','GROUP7','7286','0','Betriebskosten/Beheizung Mietobjekte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 209, 'AT-BASE','GROUP7','7300','0','Transporte durch Dritte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 210, 'AT-BASE','GROUP7','7330','0','Reise und Fahrtspesen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 211, 'AT-BASE','GROUP7','7331','0','Kilometergelder'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 212, 'AT-BASE','GROUP7','7360','0','Reisediäten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 213, 'AT-BASE','GROUP7','7380','0','Telefon'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 214, 'AT-BASE','GROUP7','7381','0','Internet'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 215, 'AT-BASE','GROUP7','7382','0','Wartung Homepage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 216, 'AT-BASE','GROUP7','7390','0','Postgebühren'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 217, 'AT-BASE','GROUP7','7400','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 218, 'AT-BASE','GROUP7','7401','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 219, 'AT-BASE','GROUP7','7402','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 220, 'AT-BASE','GROUP7','7403','0','Miete Büro Linz'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 221, 'AT-BASE','GROUP7','7404','0','Miete Gradnerstraße'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 222, 'AT-BASE','GROUP7','7410','0','Maschinen u. Gerätemieten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 223, 'AT-BASE','GROUP7','7411','0','Wartungskosten BuG Ausstattung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 224, 'AT-BASE','GROUP7','7420','0','Mobilien-Leasing '); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 225, 'AT-BASE','GROUP7','7421','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 226, 'AT-BASE','GROUP7','7422','0','Leasing Server'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 227, 'AT-BASE','GROUP7','7423','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 228, 'AT-BASE','GROUP7','7424','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 229, 'AT-BASE','GROUP7','7480','0','Lizenzgebühren'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 230, 'AT-BASE','GROUP7','7540','0','Provisionen an Dritte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 231, 'AT-BASE','GROUP7','7600','0','Büromaterial'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 232, 'AT-BASE','GROUP7','7601','0','EDV-Material'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 233, 'AT-BASE','GROUP7','7610','0','Drucksorten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 234, 'AT-BASE','GROUP7','7620','0','Fachliteratur und Zeitungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 235, 'AT-BASE','GROUP7','7630','0','Gästeunt. u. Zeitschriften'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 236, 'AT-BASE','GROUP7','7650','0','Werbeaufwand/Inserate'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 237, 'AT-BASE','GROUP7','7651','0','Anbahnung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 238, 'AT-BASE','GROUP7','7652','0','Aufwand Messen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 239, 'AT-BASE','GROUP7','7653','0','Konto frei'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 240, 'AT-BASE','GROUP7','7654','0','Inserate'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 241, 'AT-BASE','GROUP7','7670','0','Bewirtungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 242, 'AT-BASE','GROUP7','7690','0','Trinkgelder u. Spenden'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 243, 'AT-BASE','GROUP7','7691','0','Spenden an begünstigte Institutionen/Sponsoring'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 244, 'AT-BASE','GROUP7','7696','0','Säumnis- und Verspätungszuschläge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 245, 'AT-BASE','GROUP7','7700','0','Betriebsversicherungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 246, 'AT-BASE','GROUP7','7701','0','Transportversicherungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 247, 'AT-BASE','GROUP7','7710','0','Pflichtversich. Unternehmer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 248, 'AT-BASE','GROUP7','7749','0','Aufwand Japan'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 249, 'AT-BASE','GROUP7','7750','0','Steuerberatung (Lohnverrechnung, Buchhaltung)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 250, 'AT-BASE','GROUP7','7751','0','Patentkosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 251, 'AT-BASE','GROUP7','7752','0','Rechtsberatung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 252, 'AT-BASE','GROUP7','7753','0','Unternehmensberatung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 253, 'AT-BASE','GROUP7','7754','0','Aufwand tectos China'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 254, 'AT-BASE','GROUP7','7755','0','Wartung (Betreuung EDV)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 255, 'AT-BASE','GROUP7','7756','0','Lizenzgebühren Abaqus'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 256, 'AT-BASE','GROUP7','7757','0','Lizenzgebühren Sonstige'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 257, 'AT-BASE','GROUP7','7758','0','Sonstige Beratungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 258, 'AT-BASE','GROUP7','7759','0','EDV-Beratung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 259, 'AT-BASE','GROUP7','7760','0','Mitgliedsbeiträge/freiwillige Beiträge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 260, 'AT-BASE','GROUP7','7761','0','Prüfung Jahresabschluss'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 261, 'AT-BASE','GROUP7','7770','0','Aus- und Fortbildung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 262, 'AT-BASE','GROUP7','7775','0','Forschung und Entwicklung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 263, 'AT-BASE','GROUP7','7776','0','Messentwicklung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 264, 'AT-BASE','GROUP7','7777','0','Produktentwicklung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 265, 'AT-BASE','GROUP7','7785','0','Freiwillige Verbandsbeiträge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 266, 'AT-BASE','GROUP7','7790','0','Spesen des Geldverkehrs'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 267, 'AT-BASE','GROUP7','7791','0','Kursdifferenzen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 268, 'AT-BASE','GROUP7','7800','0','Betriebsbedingte Schadensfälle'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 269, 'AT-BASE','GROUP7','7801','0','Ausgaben nicht absetzbar'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 270, 'AT-BASE','GROUP7','7802','0','Strafen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 271, 'AT-BASE','GROUP7','7805','0','Forderungsverluste 20'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 272, 'AT-BASE','GROUP7','7806','0','Abschreibungen auf Forderungen (EU)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 273, 'AT-BASE','GROUP7','7807','0','Abschreibungen auf Forderungen (Drittland)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 274, 'AT-BASE','GROUP7','7810','0','Zuweisung an Einzel-WB Forderungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 275, 'AT-BASE','GROUP7','7811','0','Zuweisung pauschale Wertberichtigungen zu Exportforderungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 276, 'AT-BASE','GROUP7','7812','0','Abschreibungen auf Vorräte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 277, 'AT-BASE','GROUP7','7820','0','Buchwert abgegangener Sachanlagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 278, 'AT-BASE','GROUP7','7840','0','Gründungskosten'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 279, 'AT-BASE','GROUP7','7850','0','Sonstiger Aufwand'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 280, 'AT-BASE','GROUP7','7851','0','Sonstiger Aufwand Gewinnanteil Reich'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 281, 'AT-BASE','GROUP7','7930','0','Aufw. Gewährleistungsverpfl.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 282, 'AT-BASE','GROUP7','7940','0','Aufwand aus Vorperioden'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 283, 'AT-BASE','GROUP8','8020','0','Gewinnüberrg. v. Organgesell.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 284, 'AT-BASE','GROUP8','8060','0','Zinserträge'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 285, 'AT-BASE','GROUP8','8090','0','Ertr.a.Ant.a.and. Unternehmen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 286, 'AT-BASE','GROUP8','8100','0','Habenzinsen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 287, 'AT-BASE','GROUP8','8280','0','Zinsen f. Kredite u. Darlehen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 288, 'AT-BASE','GROUP8','8286','0','Kursgewinne/Kursverluste'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 289, 'AT-BASE','GROUP8','8288','0','Zinsen auf Lieferantenkredite'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 290, 'AT-BASE','GROUP8','8291','0','Sonst. Zinsen und ähnliche Aufwendungen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 291, 'AT-BASE','GROUP8','8500','0','Körperschaftsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 292, 'AT-BASE','GROUP8','8505','0','Kapitalertragsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 293, 'AT-BASE','GROUP8','8510','0','Körperschaftsteuervorauszahl.'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 294, 'AT-BASE','GROUP8','8511','0','Dotierung KöSt-Rückstellung'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 295, 'AT-BASE','GROUP8','8512','0','Aktivierung Körperschaftsteuer'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 296, 'AT-BASE','GROUP8','8513','0','Köst Vorperioden'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 297, 'AT-BASE','GROUP8','8520','0','Forschungsprämie'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 298, 'AT-BASE','GROUP8','8595','0','Ertrag aus der Aktivierung latenter Steuern'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 299, 'AT-BASE','GROUP8','8610','0','Auflösung sonstiger unversteuerter Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 300, 'AT-BASE','GROUP8','8700','0','Auflösung gebundener Kapitalrücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 301, 'AT-BASE','GROUP8','8710','0','Auflösung Rücklage für eigene Anteile'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 302, 'AT-BASE','GROUP8','8720','0','Auflösung nicht gebundene Kapitalrücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 303, 'AT-BASE','GROUP8','8750','0','Auflösung gesetzliche Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 304, 'AT-BASE','GROUP8','8760','0','Auflösung satzungsmäßige Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 305, 'AT-BASE','GROUP8','8770','0','Auflösung andere (freie) Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 306, 'AT-BASE','GROUP8','8810','0','Zuweisung sonstige unversteuerte Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 307, 'AT-BASE','GROUP8','8820','0','Zuweisung Inv. Rücklage'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 308, 'AT-BASE','GROUP8','8890','0','Zuw.Bew.Res.GWG'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 309, 'AT-BASE','GROUP8','8900','0','Zuweisung gesetzliche Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 310, 'AT-BASE','GROUP8','8910','0','Zuweisung satzungsmäßige Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 311, 'AT-BASE','GROUP8','8920','0','Zuweisung andere (freie) Rücklagen'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 312, 'AT-BASE','GROUP9','9390','0','Bilanzgewinn'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 313, 'AT-BASE','GROUP9','9391','0','Bilanzverlust'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 314, 'AT-BASE','GROUP9','9700','0','Wachdienst'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 315, 'AT-BASE','GROUP9','9991','0','Gewinnvortrag'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 316, 'AT-BASE','GROUP9','9993','0','Verlustvortrag'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 317, 'AT-BASE','GROUP9','9994','0','Verlustvortrag'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 318, 'AT-BASE','GROUP5','50200','0','Materialeinkauf'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 319, 'AT-BASE','GROUP6','60000','0','kalk. Löhne u Gehälter'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 320, 'AT-BASE','GROUP6','64160','0','Veränderung Pensionsrückstellung (Angestellte)'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 321, 'AT-BASE','GROUP6','66300','0','Leistungserfassung'); From fa71402a9b74393bb76e3d3df922880794a6d027 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 3 Jun 2021 09:34:49 +0200 Subject: [PATCH 138/174] Fix 17791 : fix for at account --- htdocs/install/mysql/data/llx_accounting_account_at.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_at.sql b/htdocs/install/mysql/data/llx_accounting_account_at.sql index 402e6893e6b..f05dc2572c2 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_at.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_at.sql @@ -22,7 +22,7 @@ -- Descriptif des plans comptables autrichiens standard -- ADD 4100000 to rowid # Do no remove this comment -- -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','GROUP0','110','0','Patentrechte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','0','GROUP0','110','0','Patentrechte'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2, 'AT-BASE','GROUP0','120','0','Software'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3, 'AT-BASE','GROUP0','121','0','ERP System'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 4, 'AT-BASE','GROUP0','122','0','Homepage'); From 71856984a3555e0e90ed8b80b0f8139730c170a8 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 3 Jun 2021 09:35:31 +0200 Subject: [PATCH 139/174] Fix #17791 : fix for at account --- htdocs/install/mysql/data/llx_accounting_account_at.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_at.sql b/htdocs/install/mysql/data/llx_accounting_account_at.sql index f05dc2572c2..402e6893e6b 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_at.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_at.sql @@ -22,7 +22,7 @@ -- Descriptif des plans comptables autrichiens standard -- ADD 4100000 to rowid # Do no remove this comment -- -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','0','GROUP0','110','0','Patentrechte'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 1, 'AT-BASE','GROUP0','110','0','Patentrechte'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 2, 'AT-BASE','GROUP0','120','0','Software'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 3, 'AT-BASE','GROUP0','121','0','ERP System'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label) VALUES (__ENTITY__, 4, 'AT-BASE','GROUP0','122','0','Homepage'); From 093705a1b552d18450c968001e4eafa4d65c127e Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Thu, 3 Jun 2021 11:32:41 +0200 Subject: [PATCH 140/174] FIX : field name is search_status and not search_statut --- htdocs/holiday/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index cb8da24052b..cbd9b76e45e 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -106,7 +106,7 @@ $search_month_end = GETPOST('search_month_end', 'int'); $search_year_end = GETPOST('search_year_end', 'int'); $search_employee = GETPOST('search_employee', 'int'); $search_valideur = GETPOST('search_valideur', 'int'); -$search_status = GETPOST('search_statut', 'int'); +$search_status = GETPOST('search_status', 'int'); $search_type = GETPOST('search_type', 'int'); // Initialize technical objects From c534b7fcce8808189b9ef108aa69f9697e584a08 Mon Sep 17 00:00:00 2001 From: Inovea Conseil Date: Thu, 3 Jun 2021 14:36:47 +0200 Subject: [PATCH 141/174] FIX delete object actionComm --- htdocs/core/actions_massactions.inc.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 99f1271ff0b..3cbcd30af7f 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018-2021 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent * Copyright (C) 2019 Ferran Marcet * Copyright (C) 2019-2021 Frédéric France @@ -1241,8 +1241,13 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == ' } if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1); - else $result = $objecttmp->delete($user); - + else { + if (get_class($objecttmp) === "ActionComm") { + $result = $objecttmp->delete(); + } else { + $result = $objecttmp->delete($user); + } + } if ($result <= 0) { setEventMessages($objecttmp->error, $objecttmp->errors, 'errors'); From ee55a5568f1985c33c865dedfc6a833350cdb8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Jun 2021 15:14:31 +0200 Subject: [PATCH 142/174] fix warning --- htdocs/core/tpl/commonfields_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/commonfields_view.tpl.php b/htdocs/core/tpl/commonfields_view.tpl.php index 4b7821c2dad..f9da77c5894 100644 --- a/htdocs/core/tpl/commonfields_view.tpl.php +++ b/htdocs/core/tpl/commonfields_view.tpl.php @@ -74,7 +74,7 @@ foreach ($object->fields as $key => $val) { if ($val['type'] == 'text') { print ' wordbreak'; } - if ($val['cssview']) { + if (!empty($val['cssview'])) { print ' '.$val['cssview']; } print '">'; From e83e399cb6f069125aa6392b955767af341cab06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Jun 2021 15:19:54 +0200 Subject: [PATCH 143/174] fix warning --- htdocs/compta/paiement.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 12a6eb97d13..9c99fab4657 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -8,7 +8,7 @@ * Copyright (C) 2014 Raphaël Doursenaud * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-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 @@ -465,7 +465,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Date payment print ''; From 0b28587e658e12ec1ab8b018c8e5c74771d28441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Jun 2021 15:28:47 +0200 Subject: [PATCH 144/174] fix warnings --- htdocs/compta/paiement.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 12a6eb97d13..b6a63b32466 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -598,7 +598,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print "\n"; - $total = 0; + $total_ttc = 0; $totalrecu = 0; $totalrecucreditnote = 0; $totalrecudeposits = 0; @@ -754,15 +754,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Warning print ''; print "\n"; - $total += $objp->total; $total_ttc += $objp->total_ttc; $totalrecu += $paiement; $totalrecucreditnote += $creditnotes; From ca66cdad01f5a86728684d11da652b65fd8e3078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 3 Jun 2021 21:47:10 +0200 Subject: [PATCH 145/174] debug intracomm report transport mode --- htdocs/comm/card.php | 13 +++++++++++-- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/fourn/class/fournisseur.facture.class.php | 15 +++++++++++---- htdocs/fourn/facture/card.php | 12 ++++++------ 5 files changed, 31 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 589559ea426..fc7378ecd93 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -184,6 +184,15 @@ if (empty($reshook)) { } } + // transport mode + if ($action == 'settransportmode' && $user->rights->societe->creer) { + $object->fetch($id); + $result = $object->setTransportMode(GETPOST('transport_mode_id', 'alpha')); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + // Bank account if ($action == 'setbankaccount' && $user->rights->societe->creer) { $object->fetch($id); @@ -580,9 +589,9 @@ if ($object->id > 0) { print '
'; print ''; // ancre pour retourner sur la ligne + print ''; // Show product and description $product_static->type = $line->fk_product_type; @@ -1049,17 +1066,15 @@ if ($action == 'create') // Qty print ''.$line->qty; - print 'id.'\' />'; - print ''; + print ''; + print ''; print ''; print ''; - - - $quantityDelivered = $object->receptions[$line->id]; + $quantityDelivered = $objectsrc->receptions[$line->id]; print $quantityDelivered; print ''; print ''.$formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $line->entrepot_id).''.$formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $entrepot_id).'
".dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."'.dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')."".dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'mobile')."'.dol_print_phone($obj->user_mobile, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'mobile')."'.($obj->salary ? price($obj->salary) : '').''.($obj->salary ? price($obj->salary) : '').''.num_open_day($date_start_inmonth, $date_end_inmonth, 0, 1, $halfdayinmonth).''.dol_escape_htmltag(dolGetFirstLineOfText($obj->description)).''.dol_escape_htmltag(dolGetFirstLineOfText($obj->description)).'
'.$langs->trans('Date').''; - $datepayment = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + $datepayment = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $datepayment = ($datepayment == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $datepayment); print $form->selectDate($datepayment, '', '', '', 0, "add_paiement", 1, 1, 0, '', '', $facture->date); print '
 
'; //print "xx".$amounts[$invoice->id]."-".$amountsresttopay[$invoice->id]."
"; - if ($amounts[$invoice->id] && (abs($amounts[$invoice->id]) > abs($amountsresttopay[$invoice->id])) - || $multicurrency_amounts[$invoice->id] && (abs($multicurrency_amounts[$invoice->id]) > abs($multicurrency_amountsresttopay[$invoice->id]))) { + if (!empty($amounts[$invoice->id]) && (abs($amounts[$invoice->id]) > abs($amountsresttopay[$invoice->id])) + || !empty($multicurrency_amounts[$invoice->id]) && (abs($multicurrency_amounts[$invoice->id]) > abs($multicurrency_amountsresttopay[$invoice->id]))) { print ' '.img_warning($langs->trans("PaymentHigherThanReminderToPay")); } print '
'; print ''; if ($action == 'edittransportmode') { - $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_transport_mode, 'fk_transport_mode', 1); + $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->transport_mode_id, 'transport_mode_id', 1); } else { - $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->fk_transport_mode, 'none'); + $form->formSelectTransportMode($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->transport_mode_id, 'none'); } print ""; print ''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3f4b2dd9ee6..33cfa7c8b32 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2566,7 +2566,7 @@ abstract class CommonObject /** * Change the transport mode methods * - * @param int $id Id of new payment method + * @param int $id Id of transport mode * @return int >0 if OK, <0 if KO */ public function setTransportMode($id) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1f90b5f4fdc..dda350865af 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5289,9 +5289,9 @@ class Form global $langs; if ($htmlname != "none") { print '
'; - print ''; + print ''; print ''; - $this->selectTransportMode($selected, $htmlname, 2, $addempty, 0, 0, $active); + $this->selectTransportMode($selected, $htmlname, 0, $addempty, 0, 0, $active); print ''; print '
'; } else { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 637f29e87b8..81533dae324 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -214,6 +214,11 @@ class FactureFournisseur extends CommonInvoice public $mode_reglement_id; public $mode_reglement_code; + /** + * @var int transport mode id + */ + public $transport_mode_id; + public $extraparams = array(); /** @@ -670,6 +675,7 @@ class FactureFournisseur extends CommonInvoice $sql .= ' s.nom as socnom, s.rowid as socid,'; $sql .= ' t.fk_incoterms, t.location_incoterms,'; $sql .= " i.libelle as label_incoterms,"; + $sql .= ' t.fk_transport_mode,'; $sql .= ' t.fk_multicurrency, t.multicurrency_code, t.multicurrency_tx, t.multicurrency_total_ht, t.multicurrency_total_tva, t.multicurrency_total_ttc'; $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as t'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)"; @@ -742,14 +748,15 @@ class FactureFournisseur extends CommonInvoice $this->fk_incoterms = $obj->fk_incoterms; $this->location_incoterms = $obj->location_incoterms; $this->label_incoterms = $obj->label_incoterms; + $this->transport_mode_id = $obj->fk_transport_mode; // Multicurrency - $this->fk_multicurrency = $obj->fk_multicurrency; + $this->fk_multicurrency = $obj->fk_multicurrency; $this->multicurrency_code = $obj->multicurrency_code; - $this->multicurrency_tx = $obj->multicurrency_tx; + $this->multicurrency_tx = $obj->multicurrency_tx; $this->multicurrency_total_ht = $obj->multicurrency_total_ht; - $this->multicurrency_total_tva = $obj->multicurrency_total_tva; - $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; + $this->multicurrency_total_tva = $obj->multicurrency_total_tva; + $this->multicurrency_total_ttc = $obj->multicurrency_total_ttc; $this->extraparams = (array) json_decode($obj->extraparams, true); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 0bc26ea8f2b..a796ff81a0e 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1875,10 +1875,10 @@ if ($action == 'create') { $objectsrc->fetch_optionals(); $object->array_options = $objectsrc->array_options; } else { - $cond_reglement_id = $societe->cond_reglement_supplier_id; - $mode_reglement_id = $societe->mode_reglement_supplier_id; + $cond_reglement_id = $societe->cond_reglement_supplier_id; + $mode_reglement_id = $societe->mode_reglement_supplier_id; $transport_mode_id = $societe->transport_mode_supplier_id; - $fk_account = $societe->fk_account; + $fk_account = $societe->fk_account; $datetmp = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $dateinvoice = ($datetmp == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : '') : $datetmp); $datetmp = dol_mktime(12, 0, 0, $_POST['echmonth'], $_POST['echday'], $_POST['echyear']); @@ -2889,12 +2889,12 @@ if ($action == 'create') { // Intracomm report if (!empty($conf->intracommreport->enabled)) { $langs->loadLangs(array("intracommreport")); - print ''; - print ''; From 350a4215445077fcb747e793f418adb95189a729 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 08:41:26 +0200 Subject: [PATCH 146/174] Update card.php --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a796ff81a0e..a8a4cb63258 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2894,7 +2894,7 @@ if ($action == 'create') { print $langs->trans('IntracommReportTransportMode'); print ''; if ($action != 'editmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { - print ''; + print ''; } print '
'; + print '
'; + print ''; if ($action != 'editmode' && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) { - print ''; + print ''; } print '
'; print $langs->trans('IntracommReportTransportMode'); print 'id.'">'.img_edit($langs->trans('SetMode'), 1).'id.'">'.img_edit().'
'; print '
id.'">'.img_edit().'id.'">'.img_edit().'
'; print ''; From 3ae3137eaf9759d98a7422504496867984556f7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 08:57:48 +0200 Subject: [PATCH 147/174] Missing picto --- htdocs/fourn/commande/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index e7f19d0671a..c02a311f633 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -881,10 +881,10 @@ if ($resql) { 'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { - $arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisSupplier"); + $arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisSupplier"); } if ($user->rights->fournisseur->commande->supprimer) { - $arrayofmassactions['predelete'] = img_picto('', 'delete').$langs->trans("Delete"); + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete', 'createbills'))) { $arrayofmassactions = array(); From 621aa9e6f368118e42ca9dffe9daaeb607ea542b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 09:27:33 +0200 Subject: [PATCH 148/174] Fix typo --- htdocs/fourn/paiement/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 6a38ae2033d..4da69cfc0c1 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -254,10 +254,10 @@ if ($optioncss != '') { if ($search_ref) { $param .= '&search_ref='.urlencode($search_ref); } -if ($saerch_day) { +if ($search_day) { $param .= '&search_day='.urlencode($search_day); } -if ($saerch_month) { +if ($search_month) { $param .= '&search_month='.urlencode($search_month); } if ($search_year) { From 402d90554a8c421c048a941f493a787ff2e0d11d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 10:04:56 +0200 Subject: [PATCH 149/174] Clean code --- htdocs/accountancy/closure/index.php | 2 +- htdocs/accountancy/customer/index.php | 2 +- htdocs/accountancy/expensereport/index.php | 2 +- htdocs/accountancy/supplier/index.php | 2 +- htdocs/cashdesk/index_verif.php | 2 +- htdocs/public/agenda/agendaexport.php | 2 -- htdocs/public/project/index.php | 2 +- htdocs/public/project/new.php | 3 +-- 8 files changed, 7 insertions(+), 10 deletions(-) diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index 390c288b606..bcb3d7901f5 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy")); $socid = GETPOST('socid', 'int'); diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index d33f5e12312..9580e8bca37 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy")); // Security check if (empty($conf->accounting->enabled)) { diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index b4e85fd517a..baeefa1bbfb 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy")); $month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1); if (GETPOST("year", 'int')) { diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index a69debeb0c0..c1a3ffe23a6 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // Load translation files required by the page -$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy")); +$langs->loadLangs(array("compta", "bills", "other", "accountancy")); // Security check if (empty($conf->accounting->enabled)) { diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index 47a1d90b76c..94e0e7009cf 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php'; require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php'; // Load translation files required by the page -$langs->loadLangs(array("main", "admin", "cashdesk")); +$langs->loadLangs(array("admin", "cashdesk")); $username = GETPOST("txtUsername"); $password = GETPOST("pwdPassword"); diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index 2aaeb12de23..cc255b185ed 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -212,9 +212,7 @@ if ($format == 'ical') { if ($format == 'rss') { $shortfilename .= '.rss'; $filename .= '.rss'; } - if ($shortfilename == 'dolibarrcalendar') { - $langs->load("main"); $langs->load("errors"); llxHeaderVierge(); print '
'.$langs->trans("ErrorWrongValueForParameterX", 'format').'
'; diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index ce48db9e729..013f290dc6a 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -72,7 +72,7 @@ $hookmanager->initHooks(array('newpayment')); global $dolibarr_main_instance_unique_id; // Load translation files -$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data +$langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox", "paypal", "stripe")); // File with generic data // Security check // No check on module enabled. Done later according to $validpaymentmethod diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 048df9c41b3..e4a8b495d7c 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -60,13 +60,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; // Init vars $errmsg = ''; -$num = 0; $error = 0; $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'aZ09'); // Load translation files -$langs->loadLangs(array("main", "members", "companies", "install", "other")); +$langs->loadLangs(array("members", "companies", "install", "other")); // Security check if (empty($conf->projet->enabled)) { From 8c9bec3e3bdc7b62a02b987d10e814b375dc531a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 10:29:30 +0200 Subject: [PATCH 150/174] Code comment --- htdocs/expedition/class/expedition.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index f7c5a1d32a8..ea5bd17fdfb 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -468,11 +468,11 @@ class Expedition extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Create the detail (eat-by date) of the expedition line + * Create the detail of the expedition line. Create 1 record into expeditiondet for each warehouse and n record for each lot in this warehouse into expeditiondet_batch. * - * @param object $line_ext full line informations + * @param object $line_ext Objet with full information of line. $line_ext->detail_batch must be an array of ExpeditionLineBatch * @param array $array_options extrafields array - * @return int <0 if KO, >0 if OK + * @return int <0 if KO, >0 if OK */ public function create_line_batch($line_ext, $array_options = 0) { @@ -496,7 +496,7 @@ class Expedition extends CommonObject // create shipment batch lines for stockLocation foreach ($tab as $detbatch) { if ($detbatch->entrepot_id == $stockLocation) { - if (!($detbatch->create($line_id) > 0)) { // Create an expeditionlinebatch + if (!($detbatch->create($line_id) > 0)) { // Create an ExpeditionLineBatch $error++; } } From 174c6f8a455da035abceef8b7a31fefc59f9ba60 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 10:33:13 +0200 Subject: [PATCH 151/174] Update mouvementstock.class.php --- htdocs/product/stock/class/mouvementstock.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index ec2dfbc257e..ecdfdacbf44 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -355,7 +355,9 @@ class MouvementStock extends CommonObject $qtyisnotenough = 0; foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch) { - if ($batch !== $batchcursor) continue; // Do a strict comparison because $batchcursar can be an integer + if ((string) $batch != (string) $batchcursor) { // Lot '59' must be different than lot '59c' + continue; + } $foundforbatch = 1; if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty; break; From e73dad30bb9a238a46d31e07449343f23225ebec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 11:53:12 +0200 Subject: [PATCH 152/174] Warning --- htdocs/comm/mailing/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 86aff8a36e0..bbbebfad767 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -48,6 +48,7 @@ $confirm = GETPOST('confirm', 'alpha'); $urlfrom = GETPOST('urlfrom'); $object = new Mailing($db); + $result = $object->fetch($id); $extrafields = new ExtraFields($db); @@ -78,7 +79,7 @@ $listofmethods['mail'] = 'PHP mail function'; $listofmethods['smtps'] = 'SMTP/SMTPS socket library'; // Security check -if (!$user->rights->mailing->lire || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) { +if (empty($user->rights->mailing->lire) || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) { accessforbidden(); } From 1136e7dec537e58c0c4d6503b97465ae22e9750a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 11:57:59 +0200 Subject: [PATCH 153/174] Update inventory.php --- htdocs/product/inventory/inventory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 212f0404bd9..eee7217eef3 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -254,7 +254,7 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors'); } - if (GETPOST('qtytoadd') < 0) { + if (price2num(GETPOST('qtytoadd'), 'MS') < 0) { $error++; setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors'); } From e26f0f155fdcc5c51e2c9a2ad9bc45ef7f5ec1c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 12:00:54 +0200 Subject: [PATCH 154/174] Update inventory.php --- htdocs/product/inventory/inventory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index eee7217eef3..644e7ba2025 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -660,7 +660,7 @@ if ($object->id > 0) { // Real quantity print ''; if ($object->status == $object::STATUS_VALIDATED) { - $qty_view = GETPOST("id_".$obj->rowid) && GETPOST("id_".$obj->rowid) >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view; + $qty_view = GETPOST("id_".$obj->rowid) && price2num(GETPOST("id_".$obj->rowid), 'MS') >= 0 ? GETPOST("id_".$obj->rowid) : $obj->qty_view; $totalfound += price2num($qty_view, 'MS'); print ''; print ''; From c77dee0922b4b66225f08bd653acc7802f1e85ce Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Fri, 4 Jun 2021 12:27:50 +0200 Subject: [PATCH 155/174] changes to fetch after send --- htdocs/comm/mailing/card.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 73f31f34f01..0d321c08c09 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -408,7 +408,7 @@ if (empty($reshook)) { dol_syslog($db->error()); dol_print_error($db); } - + $object->fetch($id); $action = ''; } } @@ -677,7 +677,6 @@ if (empty($reshook)) { $form = new Form($db); $htmlother = new FormOther($db); -$object->fetch($id); $help_url = 'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing'; llxHeader( '', From e5ab721660ce528c5b53e76da76570d34f1b67a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 12:30:46 +0200 Subject: [PATCH 156/174] Fix sanitize --- htdocs/holiday/month_report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index eef3ca0dcbe..698d71e5dc7 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -154,7 +154,7 @@ if (!empty($search_employee) && $search_employee > 0) { $sql .= " AND cp.fk_user = ".((int) $search_employee); } if (!empty($search_type) && $search_type != '-1') { - $sql .= ' AND cp.fk_type IN ('.$db->escape($search_type).')'; + $sql .= ' AND cp.fk_type IN ('.$db->sanitize($search_type).')'; } if (!empty($search_description)) { $sql .= natural_search('cp.description', $search_description); From 34955b1cf9d9aab738b299850cd44a38ba5c40a5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 12:48:18 +0200 Subject: [PATCH 157/174] Fix sql --- htdocs/install/mysql/migration/13.0.0-14.0.0.sql | 2 +- htdocs/install/mysql/tables/llx_product.sql | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 25a6a6b09e8..3fb671fa9b2 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 @@ -418,7 +418,7 @@ UPDATE llx_propal SET fk_user_signature = fk_user_cloture WHERE fk_user_signatur UPDATE llx_propal SET date_signature = date_cloture WHERE date_signature IS NULL AND date_cloture IS NOT NULL; -ALTER TABLE llx_product ADD COLUMN batch_mask VARCHAR(32) NULL; +ALTER TABLE llx_product ADD COLUMN batch_mask VARCHAR(32) DEFAULT NULL; ALTER TABLE llx_product ADD COLUMN lifetime INTEGER NULL; ALTER TABLE llx_product ADD COLUMN qc_frequency INTEGER NULL; diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 73b4473a5a4..4aad3393137 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -59,7 +59,7 @@ create table llx_product tobuy tinyint DEFAULT 1, -- Product you buy onportal tinyint DEFAULT 0, -- If it is a product you sell and you want to sell it on portal (module website must be on) tobatch tinyint DEFAULT 0 NOT NULL, -- Is it a product that need a batch management (eat-by or lot management) - batch_mask varchar(32), -- If the product has batch feature, you may want to use a batch mask per product + batch_mask varchar(32) DEFAULT NULL, -- If the product has batch feature, you may want to use a batch mask per product fk_product_type integer DEFAULT 0, -- Type of product: 0 for regular product, 1 for service, 9 for other (used by external module) duration varchar(6), seuil_stock_alerte float DEFAULT NULL, @@ -95,7 +95,7 @@ create table llx_product canvas varchar(32) DEFAULT NULL, finished tinyint DEFAULT NULL, -- see dictionnary c_product_nature lifetime integer DEFAULT NULL, - qc_frequency integer DEFAULT NULL, + qc_frequency integer DEFAULT NULL, -- Quality control periodicity hidden tinyint DEFAULT 0, -- Not used. Deprecated. import_key varchar(14), -- Import key model_pdf varchar(255), -- model save dodument used From 292d5f6a154b97ae939be55b174ebc999e88d777 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 12:55:03 +0200 Subject: [PATCH 158/174] Update card.php --- htdocs/compta/facture/card.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 02fb8467e21..c3ba878cdbf 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2232,11 +2232,10 @@ if (empty($reshook)) { $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } else { - // Add batchinfo if the detailline has batchinfo - - if (!empty($lines[$i]->detail_batch) && ! empty($conf->global->INCUDE_BATCHINFO_ON_INVOICE)) { + // Add batchinfo if the detail_batch array is defined + if (!empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { foreach ($lines[$i]->detail_batch as $batchline) { - $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; + $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; } } From 43be7cf996e5c221264d3a6bcf1d1dc99ef01d10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 12:56:40 +0200 Subject: [PATCH 159/174] Update card.php --- htdocs/compta/facture/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index c3ba878cdbf..9f91c462a40 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -67,7 +67,7 @@ if (!empty($conf->accounting->enabled)) { } // Load translation files required by the page -$langs->loadLangs(array('bills', 'companies', 'compta', 'products', 'banks', 'main', 'withdrawals','productbatch')); +$langs->loadLangs(array('bills', 'companies', 'compta', 'products', 'banks', 'main', 'withdrawals')); if (!empty($conf->incoterm->enabled)) { $langs->load('incoterm'); } @@ -2234,6 +2234,7 @@ if (empty($reshook)) { } else { // Add batchinfo if the detail_batch array is defined if (!empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { + $langs->load('productbatch'); foreach ($lines[$i]->detail_batch as $batchline) { $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; } From 8b5922a0df094f64ec602610b0c66f9804aa8408 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 12:57:43 +0200 Subject: [PATCH 160/174] Update card.php --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 9f91c462a40..be9e23afecc 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2233,7 +2233,7 @@ if (empty($reshook)) { setEventMessages($mesg, null, 'errors'); } else { // Add batchinfo if the detail_batch array is defined - if (!empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { + if (!empty($conf->productbatch->enabled) && !empty($lines[$i]->detail_batch) && is_array($lines[$i]->detail_batch) && !empty($conf->global->INVOICE_INCUDE_DETAILS_OF_LOTS_SERIALS)) { $langs->load('productbatch'); foreach ($lines[$i]->detail_batch as $batchline) { $desc .= ' '.$langs->trans('Batch').' '.$batchline->batch.' '.$langs->trans('printQty', $batchline->qty).' '; From 2182e7fd54e299f7db7edd9bc5cecce82b6240c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 14:36:52 +0200 Subject: [PATCH 161/174] Look and feel v14 --- htdocs/compta/facture/invoicetemplate_list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 52dac1c462a..5f7e277076c 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -50,8 +50,7 @@ $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'invoicetemplatelist'; // To manage different context of search - -$socid = GETPOST('socid', 'int'); +$optioncss = GETPOST('optioncss', 'alpha'); $socid = GETPOST('socid', 'int'); @@ -394,7 +393,7 @@ if ($resql) { if ($search_payment_term != '') { $param .= '&search_payment_term='.urlencode($search_payment_term); } - if ($search_recurring != '' && $search_recurrning != '-1') { + if ($search_recurring != '' && $search_recurring != '-1') { $param .= '&search_recurring='.urlencode($search_recurring); } if ($search_frequency > 0) { @@ -570,7 +569,7 @@ if ($resql) { if (!empty($arrayfields['s.nom']['checked'])) { print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER['PHP_SELF'], "s.nom", "", $param, "", $sortfield, $sortorder); } - if (!empty($arrayfields['f.total_total']['checked'])) { + if (!empty($arrayfields['f.total_ht']['checked'])) { print_liste_field_titre($arrayfields['f.total_ht']['label'], $_SERVER['PHP_SELF'], "f.total_ht", "", $param, 'class="right"', $sortfield, $sortorder); } if (!empty($arrayfields['f.total_tva']['checked'])) { @@ -789,12 +788,13 @@ if ($resql) { } } // Action column - print ''; + print ''; if ($user->rights->facture->creer && empty($invoicerectmp->suspended)) { if ($invoicerectmp->isMaxNbGenReached()) { print $langs->trans("MaxNumberOfGenerationReached"); } elseif (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today) { print ''; + print img_picto($langs->trans("CreateBill"), 'add', 'class="paddingrightonly"'); print $langs->trans("CreateBill").''; } else { print $form->textwithpicto('', $langs->trans("DateIsNotEnough")); From 0147ffa737073733b603947ddd6aa2a7b15880f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 14:38:22 +0200 Subject: [PATCH 162/174] Fix css --- .../triggers/interface_50_modLdap_Ldapsynchro.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index 81054338b88..d4db5ebccfc 100644 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -138,8 +138,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers $container = $usergroup->_load_ldap_dn($oldinfo, 1); $search = "(".$usergroup->_load_ldap_dn($oldinfo, 2).")"; $records = $ldap->search($container, $search); - if (count($records) && $records['count'] == 0) - { + if (count($records) && $records['count'] == 0) { $olddn = ''; } @@ -157,12 +156,11 @@ class InterfaceLdapsynchro extends DolibarrTriggers $oldinfo = $usergroup->_load_ldap_info(); $olddn = $usergroup->_load_ldap_dn($oldinfo); - // Verify if entry exist + // Verify if an entry exists $container = $usergroup->_load_ldap_dn($oldinfo, 1); $search = "(".$usergroup->_load_ldap_dn($oldinfo, 2).")"; $records = $ldap->search($container, $search); - if (count($records) && $records['count'] == 0) - { + if (count($records) && $records['count'] == 0) { $olddn = ''; } From 3fb1fb63b471b3f6a639a4dab7d6ce74ef68d7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 4 Jun 2021 22:16:25 +0200 Subject: [PATCH 163/174] test zapier --- dev/examples/zapier/creates/thirdparty.js | 4 ++-- dev/examples/zapier/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/examples/zapier/creates/thirdparty.js b/dev/examples/zapier/creates/thirdparty.js index 3e20fd10e41..2abeef6ae4c 100644 --- a/dev/examples/zapier/creates/thirdparty.js +++ b/dev/examples/zapier/creates/thirdparty.js @@ -6,7 +6,7 @@ const createThirdparty = async (z, bundle) => { const response = await z.request({ method: 'POST', url: apiurl, - body: JSON.stringify({ + body: { name: bundle.inputData.name, name_alias: bundle.inputData.name_alias, ref_ext: bundle.inputData.ref_ext, @@ -24,7 +24,7 @@ const createThirdparty = async (z, bundle) => { code_client: bundle.inputData.code_client, code_fournisseur: bundle.inputData.code_fournisseur, sens: 'fromzapier' - }) + } }); const result = z.JSON.parse(response.content); // api returns an integer when ok, a json when ko diff --git a/dev/examples/zapier/package.json b/dev/examples/zapier/package.json index cc0768a27ef..4d5c5daa867 100644 --- a/dev/examples/zapier/package.json +++ b/dev/examples/zapier/package.json @@ -15,7 +15,7 @@ "npm": ">=5.6.0" }, "dependencies": { - "zapier-platform-core": "11.0.0" + "zapier-platform-core": "11.0.1" }, "devDependencies": { "mocha": "^5.2.0", From 3440024efebf877b219d66c55917d7ad4e0201f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 4 Jun 2021 22:35:05 +0200 Subject: [PATCH 164/174] test zapier --- dev/examples/zapier/triggers/thirdparty.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dev/examples/zapier/triggers/thirdparty.js b/dev/examples/zapier/triggers/thirdparty.js index 4656f836e74..0fecd4434ce 100644 --- a/dev/examples/zapier/triggers/thirdparty.js +++ b/dev/examples/zapier/triggers/thirdparty.js @@ -56,6 +56,12 @@ const getThirdparty = (z, bundle) => { fournisseur: bundle.cleanedRequest.fournisseur, code_client: bundle.cleanedRequest.code_client, code_fournisseur: bundle.cleanedRequest.code_fournisseur, + idprof1: bundle.cleanedRequest.idprof1, + idprof2: bundle.cleanedRequest.idprof2, + idprof3: bundle.cleanedRequest.idprof3, + idprof4: bundle.cleanedRequest.idprof4, + idprof5: bundle.cleanedRequest.idprof5, + idprof6: bundle.cleanedRequest.idprof6, authorId: bundle.cleanedRequest.authorId, createdAt: bundle.cleanedRequest.createdAt, action: bundle.cleanedRequest.action @@ -170,7 +176,13 @@ module.exports = { {key: 'client', label: 'Customer/Prospect 0/1/2/3'}, {key: 'fournisseur', label: 'Supplier 0/1'}, {key: 'code_client', label: 'Customer code'}, - {key: 'code_fournisseur', label: 'Supplier code'} + {key: 'code_fournisseur', label: 'Supplier code'}, + {key: 'idprof1', label: 'Id Prof 1'}, + {key: 'idprof2', label: 'Id Prof 2'}, + {key: 'idprof3', label: 'Id Prof 3'}, + {key: 'idprof4', label: 'Id Prof 4'}, + {key: 'idprof5', label: 'Id Prof 5'}, + {key: 'idprof6', label: 'Id Prof 6'} ] } }; From c94946b934758236a82f3668ffcf969912b823a8 Mon Sep 17 00:00:00 2001 From: daraelmin Date: Fri, 4 Jun 2021 23:14:31 +0200 Subject: [PATCH 165/174] Fix #17743 - token was hashed with membersubscription #Fix #17743 - token was hashed with membersubscription for retro-compatibility we must try to hash token wth both "membre" ans "membersubscription" to verify unique secure key d'or member --- htdocs/public/payment/newpayment.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 377077531ae..f19aef7f79c 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -281,6 +281,9 @@ if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { if ($tmpsource && $REF) { $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$tmpsource.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical + if ($SECUREKEY != $token) { + $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // for retro-compatibility (token may have been hashed with membersubscription in external module) + } } else { $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); } From d327de4e80b0e0bf60e9256bd5f186f7ee00e792 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jun 2021 23:39:52 +0200 Subject: [PATCH 166/174] Doc --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 531a19e0be9..34162fd5682 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ You can freely use, study, modify or distribute it according to its licence. You can use it as a standalone application or as a web application to access it from the Internet or a LAN. -Dolibarr has a large community ready to help you, free forums and [officially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org) +Dolibarr has a large community ready to help you, free forums and [preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org) ![ScreenShot](https://www.dolibarr.org/medias/dolibarr_screenshot1_1920x1080.jpg) @@ -122,7 +122,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Electronic Document Management (EDM) - Foundations members management - Point of Sale (POS) -- … (around 100 modules available by default, + 1000 on the addon market place) +- … (around 100 modules available by default, 1000+ on the addon market place) ### Other application/modules From 420bf440ef32c98f08a9b6c6f50284336edf93a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 00:53:07 +0200 Subject: [PATCH 167/174] Update newpayment.php --- htdocs/public/payment/newpayment.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index f19aef7f79c..a0e6a1854fd 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -278,11 +278,13 @@ if ($tmpsource == 'membersubscription') { } $valid = true; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { + $token = ''; + $tokenoldcompat = ''; if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) { if ($tmpsource && $REF) { $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$tmpsource.$REF, 2); // Use the source in the hash to avoid duplicates if the references are identical - if ($SECUREKEY != $token) { - $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // for retro-compatibility (token may have been hashed with membersubscription in external module) + if ($tmpsource != $source) { + $tokenoldcompat = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN.$source.$REF, 2); // for retro-compatibility (token may have been hashed with membersubscription in external module) } } else { $token = dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2); @@ -290,7 +292,7 @@ if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { } else { $token = $conf->global->PAYMENT_SECURITY_TOKEN; } - if ($SECUREKEY != $token) { + if ($SECUREKEY != $token && $SECUREKEY != $tokenoldcompat) { if (empty($conf->global->PAYMENT_SECURITY_ACCEPT_ANY_TOKEN)) { $valid = false; // PAYMENT_SECURITY_ACCEPT_ANY_TOKEN is for backward compatibility } else { From 246cb09ba58a02b8479d21a48f9a5916c256fa29 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 00:56:28 +0200 Subject: [PATCH 168/174] Update newpayment.php --- htdocs/public/payment/newpayment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index a0e6a1854fd..b71dd2df499 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -292,7 +292,7 @@ if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) { } else { $token = $conf->global->PAYMENT_SECURITY_TOKEN; } - if ($SECUREKEY != $token && $SECUREKEY != $tokenoldcompat) { + if ($SECUREKEY != $token && (empty($tokenoldcompat) || $SECUREKEY != $tokenoldcompat)) { if (empty($conf->global->PAYMENT_SECURITY_ACCEPT_ANY_TOKEN)) { $valid = false; // PAYMENT_SECURITY_ACCEPT_ANY_TOKEN is for backward compatibility } else { From 6ae4a75ac2405562adbda1a045f5571b6b19cae5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 01:04:09 +0200 Subject: [PATCH 169/174] Update fournisseur.commande.class.php --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 9b643ff1464..be13ad412aa 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -749,8 +749,8 @@ class CommandeFournisseur extends CommonOrder $statusLong = $langs->transnoentitiesnoconv($this->statuts[$status]).$billedtext; $statusShort = $langs->transnoentitiesnoconv($this->statutshort[$status]); - $parameters = array('status' => $status, 'mode' => $mode, 'billed' => $billed, 'obj'=>$this); - $reshook = $hookmanager->executeHooks('LibStatut', $parameters, $object); // Note that $action and $object may have been modified by hook + $parameters = array('status' => $status, 'mode' => $mode, 'billed' => $billed); + $reshook = $hookmanager->executeHooks('LibStatut', $parameters, $this); // Note that $action and $object may have been modified by hook if ($reshook > 0) { return $hookmanager->resPrint; } From f0118183c848cbf5443bc394fa8c0cdad20e4d0e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 01:11:05 +0200 Subject: [PATCH 170/174] Clean code --- .../class/fournisseur.commande.class.php | 2 + htdocs/public/payment/newpayment.php | 185 +++++++++--------- 2 files changed, 94 insertions(+), 93 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index d094916ef38..06f893026a5 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -156,6 +156,8 @@ class CommandeFournisseur extends CommonOrder public $user_approve_id; public $user_approve_id2; // Used when SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set + public $refuse_note; + public $extraparams = array(); /** diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 377077531ae..49093e0913e 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -907,7 +907,6 @@ print ''.$langs->trans("T $found = false; $error = 0; -$var = false; $object = null; @@ -923,17 +922,17 @@ if (!$source) { } // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { print ' ('.$langs->trans("ToComplete").')'; } - print ''; + print ''; if (empty($amount) || !is_numeric($amount)) { print ''; print ''; @@ -948,8 +947,8 @@ if (!$source) { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -995,14 +994,14 @@ if ($source == 'order') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); - print ''.$order->thirdparty->name.''; + print ''.$langs->trans("ThirdParty"); + print ''.$order->thirdparty->name.''; print ''."\n"; // Object @@ -1010,8 +1009,8 @@ if ($source == 'order') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''; @@ -1024,11 +1023,11 @@ if ($source == 'order') { print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { print ' ('.$langs->trans("ToComplete").')'; } - print ''; + print ''; if (empty($amount) || !is_numeric($amount)) { print ''; print ''; @@ -1043,8 +1042,8 @@ if ($source == 'order') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1119,14 +1118,14 @@ if ($source == 'invoice') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); - print ''.$invoice->thirdparty->name.''; + print ''.$langs->trans("ThirdParty"); + print ''.$invoice->thirdparty->name.''; print ''."\n"; // Object @@ -1134,8 +1133,8 @@ if ($source == 'invoice') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''; @@ -1148,11 +1147,11 @@ if ($source == 'invoice') { print ''."\n"; // Amount - print ''.$langs->trans("PaymentAmount"); + print ''.$langs->trans("PaymentAmount"); if (empty($amount) && empty($object->paye)) { print ' ('.$langs->trans("ToComplete").')'; } - print ''; + print ''; if ($object->type == $object::TYPE_CREDIT_NOTE) { print ''.$langs->trans("CreditNote").''; } elseif (empty($object->paye)) { @@ -1174,8 +1173,8 @@ if ($source == 'invoice') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1290,14 +1289,14 @@ if ($source == 'contractline') { } // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); - print ''.$contract->thirdparty->name.''; + print ''.$langs->trans("ThirdParty"); + print ''.$contract->thirdparty->name.''; print ''."\n"; // Object @@ -1319,8 +1318,8 @@ if ($source == 'contractline') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''; @@ -1349,17 +1348,17 @@ if ($source == 'contractline') { $duration = $contractline->product->duration_value.' '.$dur[$contractline->product->duration_unit]; } } - print ''.$label.''; - print ''.($duration ? $duration : $qty).''; + print ''.$label.''; + print ''.($duration ? $duration : $qty).''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { print ' ('.$langs->trans("ToComplete").')'; } - print ''; + print ''; if (empty($amount) || !is_numeric($amount)) { print ''; print ''; @@ -1374,8 +1373,8 @@ if ($source == 'contractline') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1451,14 +1450,14 @@ if ($source == 'member' || $source == 'membersubscription') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("Member"); - print ''; + print ''.$langs->trans("Member"); + print ''; if ($member->morphy == 'mor' && !empty($member->societe)) { print $member->societe; } else { @@ -1472,29 +1471,29 @@ if ($source == 'member' || $source == 'membersubscription') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''."\n"; if ($object->datefin > 0) { - print ''.$langs->trans("DateEndSubscription"); - print ''.dol_print_date($member->datefin, 'day'); + print ''.$langs->trans("DateEndSubscription"); + print ''.dol_print_date($member->datefin, 'day'); print ''."\n"; } if ($member->last_subscription_date || $member->last_subscription_amount) { // Last subscription date - print ''.$langs->trans("LastSubscriptionDate"); - print ''.dol_print_date($member->last_subscription_date, 'day'); + print ''.$langs->trans("LastSubscriptionDate"); + print ''.dol_print_date($member->last_subscription_date, 'day'); print ''."\n"; // Last subscription amount - print ''.$langs->trans("LastSubscriptionAmount"); - print ''.price($member->last_subscription_amount); + print ''.$langs->trans("LastSubscriptionAmount"); + print ''.price($member->last_subscription_amount); print ''."\n"; if (empty($amount) && !GETPOST('newamount', 'alpha')) { @@ -1513,8 +1512,8 @@ if ($source == 'member' || $source == 'membersubscription') { $amountbytype = $adht->amountByType(1); // Last member type - print ''.$langs->trans("LastMemberType"); - print ''.dol_escape_htmltag($member->type); + print ''.$langs->trans("LastMemberType"); + print ''.dol_escape_htmltag($member->type); print "\n"; // Set the new member type @@ -1526,25 +1525,25 @@ if ($source == 'member' || $source == 'membersubscription') { // Set amount for the subscription $amount = (!empty($amountbytype[$member->typeid])) ? $amountbytype[$member->typeid] : $member->last_subscription_amount; - print ''.$langs->trans("NewSubscription"); - print ''; + print ''.$langs->trans("NewSubscription"); + print ''; print $form->selectarray("typeid", $adht->liste_array(1), $member->typeid, 0, 0, 0, 'onchange="window.location.replace(\''.$urlwithroot.'/public/payment/newpayment.php?source='.urlencode($source).'&ref='.urlencode($ref).'&amount='.urlencode($amount).'&typeid=\' + this.value + \'&securekey='.urlencode($SECUREKEY).'\');"', 0, 0, 0, '', '', 1); print "\n"; } elseif ($action == dopayment) { - print ''.$langs->trans("NewMemberType"); - print ''.dol_escape_htmltag($member->type); + print ''.$langs->trans("NewMemberType"); + print ''.dol_escape_htmltag($member->type); print ''; print "\n"; } } else { - print ''.$langs->trans("MemberType"); - print ''.dol_escape_htmltag($member->type); + print ''.$langs->trans("MemberType"); + print ''.dol_escape_htmltag($member->type); print "\n"; } } // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { if (empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { print ' ('.$langs->trans("ToComplete"); @@ -1556,7 +1555,7 @@ if ($source == 'member' || $source == 'membersubscription') { print ')'; } } - print ''; + print ''; $valtoshow = ''; if (empty($amount) || !is_numeric($amount)) { $valtoshow = price2num(GETPOST("newamount", 'alpha'), 'MT'); @@ -1601,8 +1600,8 @@ if ($source == 'member' || $source == 'membersubscription') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1677,14 +1676,14 @@ if ($source == 'donation') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("ThirdParty"); - print ''; + print ''.$langs->trans("ThirdParty"); + print ''; if ($don->morphy == 'mor' && !empty($don->societe)) { print $don->societe; } else { @@ -1698,14 +1697,14 @@ if ($source == 'donation') { if (GETPOST('desc', 'alpha')) { $text = ''.$langs->trans(GETPOST('desc', 'alpha')).''; } - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("Amount"); if (empty($amount)) { if (empty($conf->global->MEMBER_NEWFORM_AMOUNT)) { print ' ('.$langs->trans("ToComplete"); @@ -1717,7 +1716,7 @@ if ($source == 'donation') { print ')'; } } - print ''; + print ''; $valtoshow = ''; if (empty($amount) || !is_numeric($amount)) { $valtoshow = price2num(GETPOST("newamount", 'alpha'), 'MT'); @@ -1757,8 +1756,8 @@ if ($source == 'donation') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1811,29 +1810,29 @@ if ($source == 'conferencesubscription') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("Attendee"); - print ''; + print ''.$langs->trans("Attendee"); + print ''; print $thirdparty->name; print ''; print ''."\n"; // Object $text = ''.$langs->trans("PaymentConferenceAttendee").''; - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); - print ''; + print ''.$langs->trans("Amount"); + print ''; $valtoshow = $amount; print ''.price($valtoshow).''; print ''; @@ -1845,8 +1844,8 @@ if ($source == 'conferencesubscription') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; @@ -1897,29 +1896,29 @@ if ($source == 'boothlocation') { $fulltag = dol_string_unaccent($fulltag); // Creditor - print ''.$langs->trans("Creditor"); - print ''.$creditor.''; + print ''.$langs->trans("Creditor"); + print ''.$creditor.''; print ''; print ''."\n"; // Debitor - print ''.$langs->trans("Attendee"); - print ''; + print ''.$langs->trans("Attendee"); + print ''; print $thirdparty->name; print ''; print ''."\n"; // Object $text = ''.$langs->trans("PaymentBoothLocation").''; - print ''.$langs->trans("Designation"); - print ''.$text; + print ''.$langs->trans("Designation"); + print ''.$text; print ''; print ''; print ''."\n"; // Amount - print ''.$langs->trans("Amount"); - print ''; + print ''.$langs->trans("Amount"); + print ''; $valtoshow = $amount; print ''.price($valtoshow).''; print ''; @@ -1931,8 +1930,8 @@ if ($source == 'boothlocation') { print ''."\n"; // Tag - print ''.$langs->trans("PaymentCode"); - print ''.$fulltag.''; + print ''.$langs->trans("PaymentCode"); + print ''.$fulltag.''; print ''; print ''; print ''."\n"; From 3e53ab5bfe13144ce3deee0e7fe345dac8fe31d2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 01:17:16 +0200 Subject: [PATCH 171/174] Fix scrutinizer --- htdocs/user/class/api_users.class.php | 6 ++---- htdocs/user/class/user.class.php | 5 +++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index e760997f3c8..9fa84042c3a 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -248,8 +248,8 @@ class Users extends DolibarrApi * * @url GET /info * - * @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) - * @return array|mixed Data without useless information + * @param int $includepermissions Set this to 1 to have the array of permissions loaded (not done by default for performance purpose) + * @return array|mixed Data without useless information * * @throws RestException 401 Insufficient rights * @throws RestException 404 User or group not found @@ -371,11 +371,9 @@ class Users extends DolibarrApi if ($field == 'pass') { if ($this->useraccount->id != DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->user->password)) { throw new RestException(401, 'You are not allowed to modify password of other users'); - continue; } if ($this->useraccount->id == DolibarrApiAccess::$user->id && empty(DolibarrApiAccess::$user->rights->user->self->password)) { throw new RestException(401, 'You are not allowed to modify your own password'); - continue; } } if (DolibarrApiAccess::$user->admin) { // If user for API is admin diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index b8e63ea8f19..910edce8c17 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -299,6 +299,11 @@ class User extends CommonObject */ public $nb_rights; + /** + * @var array To store list of groups of user (used by API /info for example) + */ + public $user_group_list; + /** * @var array Cache array of already loaded permissions */ From 39adaec7eb9616c543d709ab539461dec48a27af Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 01:29:24 +0200 Subject: [PATCH 172/174] Fix var not found --- htdocs/compta/bank/class/account.class.php | 8 +++++++- htdocs/compta/charges/index.php | 10 ++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 8c29a9ffc36..e629d7620f0 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -177,6 +177,10 @@ class Account extends CommonObject * @var int ID */ public $fk_accountancy_journal; + /** + * @var string Label of journal + */ + public $accountancy_journal; /** * Currency code @@ -281,6 +285,7 @@ class Account extends CommonObject 'rappro' =>array('type'=>'smallint(6)', 'label'=>'Rappro', 'enabled'=>1, 'visible'=>-1, 'position'=>120), 'url' =>array('type'=>'varchar(128)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>125), 'account_number' =>array('type'=>'varchar(32)', 'label'=>'Account number', 'enabled'=>1, 'visible'=>-1, 'position'=>130), + 'fk_accountancy_journal' =>array('type'=>'integer', 'label'=>'Accountancy journal ID', 'enabled'=>1, 'visible'=>-1, 'position'=>132), 'accountancy_journal' =>array('type'=>'varchar(20)', 'label'=>'Accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>135), 'currency_code' =>array('type'=>'varchar(3)', 'label'=>'Currency code', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>140), 'min_allowed' =>array('type'=>'integer', 'label'=>'Min allowed', 'enabled'=>1, 'visible'=>-1, 'position'=>145), @@ -294,7 +299,6 @@ class Account extends CommonObject 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>175), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>180), 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>185), - 'fk_accountancy_journal' =>array('type'=>'integer', 'label'=>'Fk accountancy journal', 'enabled'=>1, 'visible'=>-1, 'position'=>190), ); // END MODULEBUILDER PROPERTIES @@ -311,9 +315,11 @@ class Account extends CommonObject */ const TYPE_SAVINGS = 0; + const STATUS_OPEN = 0; const STATUS_CLOSED = 1; + /** * Constructor * diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index f171546f6c1..be7c88c0a1a 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -227,9 +227,10 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { $accountstatic->id = $obj->bid; $accountstatic->ref = $obj->bref; $accountstatic->number = $obj->bnumber; - $accountstatic->accountancy_number = $obj->account_number; - $accountstatic->accountancy_journal = $obj->accountancy_journal; + $accountstatic->account_number = $obj->account_number; + $accountstatic->fk_accountancy_journal = $obj->fk_accountancy_journal; $accountstatic->label = $obj->blabel; + print $accountstatic->getNomUrl(1); } else { print ' '; @@ -348,9 +349,10 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { $accountstatic->id = $obj->bid; $accountstatic->ref = $obj->bref; $accountstatic->number = $obj->bnumber; - $accountstatic->accountancy_number = $obj->account_number; - $accountstatic->accountancy_journal = $obj->accountancy_journal; + $accountstatic->account_number = $obj->account_number; + $accountstatic->fk_accountancy_journal = $obj->fk_accountancy_journal; $accountstatic->label = $obj->blabel; + print $accountstatic->getNomUrl(1); } else { print ' '; From b6ba1de3b39acb2835f9fa5e4fc9fbc760631e7c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 02:18:45 +0200 Subject: [PATCH 173/174] Fix remove use of captcha on backoffice for ticket creation --- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/ticket/card.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 23c220d43df..b10ac80416f 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -259,7 +259,7 @@ class FormTicket $doleditor->Create(); print ''; - if (!empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { + if ($public && !empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; print ''; print ''; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 5e2ef1e804b..96a5ad0c120 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -53,6 +53,7 @@ $ref = GETPOST('ref', 'alpha'); $projectid = GETPOST('projectid', 'int'); $cancel = GETPOST('cancel', 'alpha'); $action = GETPOST('action', 'aZ09'); +$backtopage = GETPOST('$backtopage', 'alpha'); $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); @@ -152,7 +153,7 @@ if (empty($reshook)) { } // Action to add an action (not a message) - if (GETPOST('add', 'alpha') && $user->rights->ticket->write) { + if (GETPOST('add', 'alpha') && !empty($user->rights->ticket->write)) { $error = 0; if (!GETPOST("subject", 'alphanohtml')) { From 865bf3b8493c4273f0e0f6e30fa05aa8ddc7c843 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Jun 2021 02:42:49 +0200 Subject: [PATCH 174/174] CSS --- htdocs/theme/eldy/global.inc.php | 4 ++-- htdocs/theme/md/style.css.php | 9 +++++++-- htdocs/ticket/class/actions_ticket.class.php | 8 +++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 4468c36a7da..70e5229ba28 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -348,7 +348,7 @@ a.butStatus { padding-right: 5px; background-color: transparent; color: var(--colortext) !important; - border: 2px solid var( --butactionbg); + border: 2px solid var( --butactionbg) !important; margin: 0 0.45em !important; } @@ -3894,7 +3894,7 @@ table.noborder.paymenttable { } .paymenttable tr td:first-child, .margintable tr td:first-child { - padding-left: 2px; + //padding-left: 2px; } .paymenttable, .margintable tr td { height: 22px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index f1fb649f4af..7dd19673b5e 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -3902,14 +3902,19 @@ tr.liste_sub_total, tr.liste_sub_total td { } .paymenttable, .margintable { + margin: 0px 0px 0px 0px !important; +} +.paymenttable, .margintable:not(.margintablenotop) { border-top-width: px !important; border-top-color: rgb() !important; border-top-style: solid !important; - margin: 0px 0px 0px 0px !important; +} +.margintable.margintablenotop { + border-top-width: 0; } .paymenttable tr td:first-child, .margintable tr td:first-child { - padding-left: 2px; + //padding-left: 2px; } .paymenttable, .margintable tr td { height: 22px; diff --git a/htdocs/ticket/class/actions_ticket.class.php b/htdocs/ticket/class/actions_ticket.class.php index eb6193d58f1..b787a437899 100644 --- a/htdocs/ticket/class/actions_ticket.class.php +++ b/htdocs/ticket/class/actions_ticket.class.php @@ -192,7 +192,7 @@ class ActionsTicket // Initial message print '
'; print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table - print ''; + print '
'; print '
'; print $langs->trans("InitialMessage"); print ''; @@ -391,7 +391,7 @@ class ActionsTicket { global $langs; - print '
'; + print '

'; + print ''; + print ''; + print '
'; } /**