Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/eventorganization/class/conferenceorbooth.class.php
	htdocs/langs/en_US/eventorganization.lang
	htdocs/public/eventorganization/attendee_subscription.php
This commit is contained in:
Laurent Destailleur 2021-09-08 22:13:35 +02:00
commit 034c5651c8
26 changed files with 306 additions and 220 deletions

View File

@ -399,8 +399,8 @@ if (empty($reshook)) {
$object->cond_reglement_id = GETPOST('cond_reglement_id');
$object->mode_reglement_id = GETPOST('mode_reglement_id');
$object->fk_account = GETPOST('fk_account', 'int');
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
$object->socid = GETPOST('socid', 'int');
$object->contact_id = GETPOST('contactid', 'int');
$object->fk_project = GETPOST('projectid', 'int');
@ -841,8 +841,8 @@ if (empty($reshook)) {
$tva_tx = '';
}
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
$remise_percent = price2num(GETPOST('remise_percent'.$predef), 2);
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
$remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
if (empty($remise_percent)) {
$remise_percent = 0;
}
@ -1229,6 +1229,8 @@ if (empty($reshook)) {
$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
// Extrafields
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
@ -1241,7 +1243,7 @@ if (empty($reshook)) {
}
// Define special_code for special lines
$special_code = GETPOST('special_code');
$special_code = GETPOST('special_code', 'int');
if (!GETPOST('qty')) {
$special_code = 3;
}
@ -1260,7 +1262,7 @@ if (empty($reshook)) {
}
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) {
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error++;
}
@ -1290,7 +1292,7 @@ if (empty($reshook)) {
$qty = price2num(GETPOST('qty', 'alpha'), 'MS');
$result = $object->updateline(GETPOST('lineid', 'int'), $pu_ht, $qty, price2num(GETPOST('remise_percent'), 2), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise);
$result = $object->updateline(GETPOST('lineid', 'int'), $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise);
if ($result >= 0) {
$db->commit();
@ -1358,9 +1360,9 @@ if (empty($reshook)) {
// Terms of payment
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
} elseif ($action == 'setremisepercent' && $usercancreate) {
$result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent')));
$result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue')));
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
} elseif ($action == 'setmode' && $usercancreate) {
// Payment choice
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));

View File

@ -613,9 +613,9 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
}
} elseif ($action == 'setremisepercent' && $usercancreate) {
$result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), 2));
$result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2));
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU'));
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
} elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha') !== '') {
// Define vat_rate
$vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0);
@ -645,7 +645,7 @@ if (empty($reshook)) {
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0);
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
if (empty($remise_percent)) {
$remise_percent = 0;
}
@ -1035,6 +1035,8 @@ if (empty($reshook)) {
$special_code = 3;
}
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
// Check minimum price
$productid = GETPOST('productid', 'int');
if (!empty($productid)) {
@ -1050,7 +1052,7 @@ if (empty($reshook)) {
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) {
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error++;
}
@ -1075,7 +1077,7 @@ if (empty($reshook)) {
}
}
}
$result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu_ht, price2num(GETPOST('qty'), 'MS'), price2num(GETPOST('remise_percent'), 2), $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise);
$result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu_ht, price2num(GETPOST('qty'), 'MS'), $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise);
if ($result >= 0) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {

View File

@ -433,8 +433,8 @@ if (empty($reshook)) {
$tva_tx = '';
}
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
$remise_percent = price2num(GETPOST('remise_percent'.$predef), 2);
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
$remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
// Extrafields
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
@ -781,6 +781,8 @@ if (empty($reshook)) {
$result = -1;
}*/
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
// Check minimum price
$productid = GETPOST('productid', 'int');
if (!empty($productid)) {
@ -797,7 +799,7 @@ if (empty($reshook)) {
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent', 2)) / 100) < price2num($price_min)))) {
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error++;
}
@ -830,8 +832,8 @@ if (empty($reshook)) {
$vat_rate,
$localtax1_rate,
$localtax1_rate,
GETPOST('productid'),
price2num(GETPOST('remise_percent'), 2),
GETPOST('productid', 'int'),
$remise_percent,
'HT',
$info_bits,
0,

View File

@ -521,7 +521,7 @@ if (empty($reshook)) {
$result = $object->setBankAccount(GETPOST('fk_account', 'int'));
} elseif ($action == 'setremisepercent' && $usercancreate) {
$object->fetch($id);
$result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), 2));
$result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2));
} elseif ($action == "setabsolutediscount" && $usercancreate) {
// POST[remise_id] or POST[remise_id_for_payment]
@ -1037,8 +1037,8 @@ if (empty($reshook)) {
$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->fk_account = GETPOST('fk_account', 'int');
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@ -1094,7 +1094,7 @@ if (empty($reshook)) {
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->fk_account = GETPOST('fk_account', 'int');
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@ -1309,7 +1309,7 @@ if (empty($reshook)) {
$object->fk_account = GETPOST('fk_account', 'int');
$object->amount = price2num(GETPOST('amount'));
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@ -1390,7 +1390,7 @@ if (empty($reshook)) {
$object->fk_account = GETPOST('fk_account', 'int');
$object->amount = price2num(GETPOST('amount'));
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@ -1813,7 +1813,7 @@ if (empty($reshook)) {
$product->fetch(GETPOST('idprod'.$i, 'int'));
$startday = dol_mktime(12, 0, 0, GETPOST('date_start'.$i.'month'), GETPOST('date_start'.$i.'day'), GETPOST('date_start'.$i.'year'));
$endday = dol_mktime(12, 0, 0, GETPOST('date_end'.$i.'month'), GETPOST('date_end'.$i.'day'), GETPOST('date_end'.$i.'year'));
$result = $object->addline($product->description, $product->price, price2num(GETPOST('qty'.$i), 'MS'), $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, GETPOST('idprod'.$i, 'int'), price2num(GETPOST('remise_percent'.$i)), $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', $product->fk_unit);
$result = $object->addline($product->description, $product->price, price2num(GETPOST('qty'.$i), 'MS'), $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, GETPOST('idprod'.$i, 'int'), price2num(GETPOST('remise_percent'.$i), '', 2), $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', $product->fk_unit);
}
}
}
@ -1914,8 +1914,8 @@ if (empty($reshook)) {
$object->fk_project = GETPOST('projectid', 'int');
$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU');
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
$object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU', 2);
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
// Proprietes particulieres a facture de remplacement
@ -2001,8 +2001,8 @@ if (empty($reshook)) {
$tva_tx = '';
}
$qty = price2num(GETPOST('qty'.$predef), 'MS');
$remise_percent = price2num(GETPOST('remise_percent'.$predef), 2);
$qty = price2num(GETPOST('qty'.$predef), 'MS', 2);
$remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
// Extrafields
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
@ -2404,6 +2404,8 @@ if (empty($reshook)) {
}
}
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
// Check minimum price
$productid = GETPOST('productid', 'int');
if (!empty($productid)) {
@ -2420,7 +2422,7 @@ if (empty($reshook)) {
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
if ($usercanproductignorepricemin && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) {
if ($usercanproductignorepricemin && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error++;
}
@ -2473,7 +2475,7 @@ if (empty($reshook)) {
$description,
$pu_ht,
$qty,
price2num(GETPOST('remise_percent'), 2),
$remise_percent,
$date_start,
$date_end,
$vat_rate,

View File

@ -227,7 +227,7 @@ if (empty($reshook)) {
$object->note_private = GETPOST('note_private', 'alpha');
$object->note_public = GETPOST('note_public', 'alpha');
$object->fk_project = GETPOST('projectid', 'int');
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->ref = GETPOST('ref', 'alpha');
$object->ref_customer = GETPOST('ref_customer', 'alpha');
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');

View File

@ -717,6 +717,8 @@ class FormCompany extends Form
print ' onChange="'.$javaScript.'"';
}
print '>';
print '<option value="-1">&nbsp;</option>';
$num = $this->db->num_rows($resql);
$i = 0;
if ($num) {

View File

@ -207,7 +207,7 @@ function project_prepare_head(Project $project)
if ($conf->eventorganization->enabled && !empty($project->usage_organize_event)) {
$langs->load('eventorganization');
$head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_list.php?projectid=' . $project->id;
$head[$h][1] = $langs->trans("ConferenceOrBoothTab");
$head[$h][1] = $langs->trans("EventOrganization");
// Enable caching of conf or booth count
$nbConfOrBooth = 0;

View File

@ -89,7 +89,7 @@ if ($permission) {
?>
<form class="tagtr liste_titre">
<div class="tagtd liste_titre"><?php echo $langs->trans("ThirdParty"); ?></div>
<div class="tagtd liste_titre"><?php echo img_object('', 'company', 'class="optiongrey paddingright"').$langs->trans("ThirdParty"); ?></div>
<div class="tagtd liste_titre"><?php echo img_picto($langs->trans("Users"), 'user', 'class="optiongrey paddingright"').$langs->trans("Users").' | '.img_picto($langs->trans("Contacts"), 'contact', 'class="optiongrey paddingright"').$langs->trans("Contacts"); ?></div>
<div class="tagtd liste_titre"><?php echo $langs->trans("ContactType"); ?></div>
<div class="tagtd liste_titre">&nbsp;</div>
@ -140,11 +140,8 @@ if ($permission) {
} ?>
<div class="tagtd nowrap maxwidthonsmartphone noborderbottom">
<?php $selectedCompany = isset($_GET["newcompany"]) ? $_GET["newcompany"] : (empty($object->socid) ? 0 : $object->socid);
// add company icon before select list
if ($selectedCompany) {
echo img_object('', 'company', 'class="hideonsmartphone"');
}
<?php
$selectedCompany = GETPOSTISSET("newcompany") ? GETPOST("newcompany", 'int') : (empty($object->socid) ? 0 : $object->socid);
$selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); ?>
</div>
<!-- <div class="tagtd nowrap noborderbottom"><?php echo img_object('', 'contact').' '.$langs->trans("ThirdPartyContacts"); ?></div>-->

View File

@ -106,7 +106,7 @@ class ConferenceOrBooth extends ActionComm
'id' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'help'=>"Help text", 'showoncombobox'=>'1',),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company'),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'maxwidth500'),
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project'),
'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1),
'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'),
@ -246,7 +246,7 @@ class ConferenceOrBooth extends ActionComm
$result = parent::fetch($id, $ref, $ref_ext, $email_msgid);
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.urlencode($id).'&type=conf';
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.urlencode($id).'&type=conf';
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
@ -565,7 +565,7 @@ class ConferenceOrBooth extends ActionComm
$label .= '<br>';
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->id;
$url = dol_buildpath('/eventorganization/conferenceorbooth_card.php', 1).'?id='.$this->id;
$url = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not

View File

@ -63,6 +63,7 @@ class ConferenceOrBoothAttendee extends CommonObject
*/
public $picto = 'contact';
public $paid = 0;
const STATUS_DRAFT = 0;
const STATUS_VALIDATED = 1;
@ -102,12 +103,12 @@ class ConferenceOrBoothAttendee extends CommonObject
public $fields=array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'Attendee', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty",),
'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>53, 'notnull'=>0, 'visible'=>0, 'index'=>1,),
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>0, 'index'=>1,),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'Attendee', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'maxwidth500'),
'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>53, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'),
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project'),
'email' => array('type'=>'mail', 'label'=>'Email', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'index'=>1,),
'date_subscription' => array('type'=>'datetime', 'label'=>'DateSubscription', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',),
'amount' => array('type'=>'price', 'label'=>'AmountOfSubscriptionPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",),
'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',),
'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",),
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,),
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
@ -404,7 +405,7 @@ class ConferenceOrBoothAttendee extends CommonObject
$sql = 'SELECT ';
$sql .= $this->getFieldList('t');
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id=t.fk_actioncomm";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm as a on a.id = t.fk_actioncomm";
if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
$sql .= ' WHERE t.entity IN ('.getEntity($this->table_element).')';
} else {
@ -730,6 +731,8 @@ class ConferenceOrBoothAttendee extends CommonObject
}
$label .= '<br>';
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
$label .= '<br><b>'.$langs->trans('DateOfRegistration').':</b> '.dol_print_date($this->date_subscription, 'dayhour');
$label .= '<br><b>'.$langs->trans('AmountPaid').':</b> '.$this->amount;
$url = dol_buildpath('/eventorganization/conferenceorboothattendee_card.php', 1).'?id='.$this->id;
@ -744,15 +747,15 @@ class ConferenceOrBoothAttendee extends CommonObject
}
if ($option == 'conforboothid') {
$url .= '&conforboothid='.$this->fk_actioncomm;
$url .= '&conforboothid='.((int) $this->fk_actioncomm);
}
if ($option == 'projectid') {
$url .= '&fk_project='.$this->fk_project.'&withproject=1';
$url .= '&fk_project='.((int) $this->fk_project).'&withproject=1';
}
if ($option == 'conforboothidproject') {
$url .= '&conforboothid='.$this->fk_actioncomm.'&withproject=1' ;
$url .= '&conforboothid='.((int) $this->fk_actioncomm).'&withproject=1' ;
}
}
@ -853,14 +856,15 @@ class ConferenceOrBoothAttendee extends CommonObject
public function LibStatut($status, $mode = 0)
{
// phpcs:enable
global $langs;
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
global $langs;
//$langs->load("eventorganization@eventorganization");
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('Draft');
$this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled');
$this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated');
$this->labelStatus[self::STATUS_CANCELED] = $langs->trans('Disabled');
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Draft');
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled');
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Validated');
$this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans('Disabled');
}
@ -870,6 +874,11 @@ class ConferenceOrBoothAttendee extends CommonObject
$statusType = 'status6';
}
if ($status == self::STATUS_VALIDATED && $this->date_subscription && $this->amount) {
$statusType = 'status4';
$this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated').' - '.$langs->trans("Paid");
}
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
}

View File

@ -182,7 +182,7 @@ $object->project = clone $projectstatic;
if (!empty($withproject)) {
// Tabs for project
$tab = 'eventorganisation';
$withProjectUrl="&withproject=1";
$withProjectUrl = "&withproject=1";
$head = project_prepare_head($projectstatic);
print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');

View File

@ -101,7 +101,7 @@ if ($action == 'addcontact' && $permission) { // Add a new contact
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
if ($result >= 0) {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id.(!empty($withproject)?'&withproject=1':''));
header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject)?'&withproject=1':''));
exit;
} else {
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@ -119,7 +119,7 @@ if ($action == 'addcontact' && $permission) { // Add a new contact
$result = $object->delete_contact($lineid);
if ($result >= 0) {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id.(!empty($withproject)?'&withproject=1':''));
header("Location: ".$_SERVER['PHP_SELF']."?id=".((int) $object->id).(!empty($withproject)?'&withproject=1':''));
exit;
} else {
dol_print_error($db);
@ -161,7 +161,7 @@ $object->project = clone $projectstatic;
if (!empty($withproject)) {
// Tabs for project
$tab = 'eventorganisation';
$withProjectUrl="&withproject=1";
$withProjectUrl = "&withproject=1";
$head = project_prepare_head($projectstatic);
print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');

View File

@ -147,9 +147,11 @@ if ($user->socid > 0) { // Protection if external user
$result = restrictedArea($user, 'eventorganization');
if (!$permissiontoread) accessforbidden();
/*
* Actions
*/
if (preg_match('/^set/', $action) && $projectid > 0) {
$project = new Project($db);
//If "set" fields keys is in projects fields
@ -429,7 +431,7 @@ if ($projectid > 0) {
//print '</span>';
print '</td><td>';
$linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$project->id;
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 2);
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5');
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
//print '<div class="urllink">';
//print '<input type="text" value="'.$linksuggest.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
@ -445,8 +447,8 @@ if ($projectid > 0) {
print $langs->trans("PublicAttendeeSubscriptionGlobalPage");
//print '</span>';
print '</td><td>';
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$project->id.'&type=global';
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 2);
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.$project->id.'&type=global';
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$project->id, 'md5');
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
//print '<div class="urllink">';
//print '<input type="text" value="'.$linkregister.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';

View File

@ -200,7 +200,7 @@ $object->project = clone $projectstatic;
if (!empty($withproject)) {
// Tabs for project
$tab = 'eventorganisation';
$withProjectUrl="&withproject=1";
$withProjectUrl = "&withproject=1";
$head = project_prepare_head($projectstatic);
print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
@ -382,7 +382,7 @@ if (!empty($withproject)) {
print $langs->trans("PublicAttendeeSubscriptionGlobalPage");
//print '</span>';
print '</td><td>';
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$projectstatic->id.'&type=global';
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.$projectstatic->id.'&type=global';
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2);
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
//print '<div class="urllink">';
@ -418,6 +418,7 @@ if ($action == 'create') {
}
if ($projectstatic->id > 0) {
print '<input type="hidden" name="fk_project" value="'.$projectstatic->id.'">';
print '<input type="hidden" name="projectid" value="'.$projectstatic->id.'">';
}

View File

@ -57,8 +57,7 @@ $id = GETPOST('id', 'int');
$conf_or_booth_id = GETPOST('conforboothid', 'int');
$withproject = GETPOST('withproject', 'int');
$project_ref = GETPOST('project_ref', 'alpha');
$fk_project = GETPOST('fk_project', 'int');
$fk_project = GETPOST('fk_project', 'int') ? GETPOST('fk_project', 'int') : GETPOST('projectid', 'int');
$withProjectUrl='';
@ -372,8 +371,9 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
if (!empty($withproject)) {
// Tabs for project
$tab = 'eventorganisation';
$withProjectUrl="&withproject=1";
$withProjectUrl = "&withproject=1";
$head = project_prepare_head($projectstatic);
print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
$param = ($mode == 'mine' ? '&mode=mine' : '');
@ -467,7 +467,10 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
// Other attributes
$cols = 2;
//include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
$objectconf = $object;
$object = $projectstatic;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
$object = $objectconf;
print '</table>';
@ -554,7 +557,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
print $langs->trans("PublicAttendeeSubscriptionGlobalPage");
//print '</span>';
print '</td><td>';
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$projectstatic->id.'&type=global';
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_registration.php?id='.$projectstatic->id.'&type=global';
$encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2);
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
//print '<div class="urllink">';
@ -584,6 +587,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
if ($confOrBooth->id > 0) {
$head = conferenceorboothPrepareHead($confOrBooth, $withproject);
print dol_get_fiche_head($head, 'attendees', $langs->trans("ConferenceOrBooth"), -1, $object->picto);
$object_evt = $object;
@ -672,7 +676,7 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].(!empty($confOrBooth->id)?'?conforboothid='.$confOrBooth->id:'').$withProjectUrl), '', $permissiontoadd);
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);

View File

@ -39,20 +39,20 @@ function conferenceorboothPrepareHead($object, $with_project = 0)
$withProjectUrl='';
if ($with_project>0) {
$withProjectUrl="&withproject=1";
$withProjectUrl = "&withproject=1";
}
$head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_card.php", 1).'?id='.$object->id.$withProjectUrl;
$head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_card.ph?id='.$object->id.$withProjectUrl;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
$head[$h][0] = dol_buildpath("/eventorganization/conferenceorbooth_contact.php", 1).'?id='.$object->id.$withProjectUrl;
$head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorbooth_contact.php?id='.$object->id.$withProjectUrl;
$head[$h][1] = $langs->trans("ContactsAddresses");
$head[$h][2] = 'contact';
$h++;
$head[$h][0] = dol_buildpath("/eventorganization/conferenceorboothattendee_list.php", 1).'?conforboothid='.$object->id.$withProjectUrl;
$head[$h][0] = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?conforboothid='.$object->id.$withProjectUrl;
$head[$h][1] = $langs->trans("Attendees");
$head[$h][2] = 'attendees';
// Enable caching of conf or booth count attendees

View File

@ -759,7 +759,7 @@ if (empty($reshook)) {
GETPOST('product_desc', 'restricthtml'),
$ht,
price2num(GETPOST('qty'), 'MS'),
price2num(GETPOST('remise_percent'), 2),
price2num(GETPOST('remise_percent'), '', 2),
$vat_rate,
$localtax1_rate,
$localtax2_rate,

View File

@ -1287,8 +1287,8 @@ if (empty($reshook)) {
$localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty);
$localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty);
$remise_percent = price2num(GETPOST('remise_percent'), 2);
$pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), 'MU');
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), 'MU', 2);
// Extrafields Lines
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);

View File

@ -19,19 +19,27 @@
#
ModuleEventOrganizationName = Event Organization
EventOrganizationDescription = Event Organization through Module Project
EventOrganizationDescriptionLong= Manage the organization of an events including conferences, speakers or attendees, with public submission and subscription page
EventOrganizationDescriptionLong= Manage the organization of an event (conferences, attendees, speakers, with public suggestion, vote or registration pages)
#
# Menu
#
EventOrganizationMenuLeft = Organized events
EventOrganizationConferenceOrBoothMenuLeft = Conference Or Booth
PaymentEvent=Payment of event
#
# Admin page
#
NewRegistration=Registration
<<<<<<< HEAD
EventOrganizationSetup = Event Organization setup
Settings = Settings
=======
EventOrganizationSetup=Event Organization setup
EventOrganization=Event organization
Settings=Settings
>>>>>>> branch '14.0' of git@github.com:Dolibarr/dolibarr.git
EventOrganizationSetupPage = Event Organization setup page
EVENTORGANIZATION_TASK_LABEL = Label of tasks to create automatically when project is validated
EVENTORGANIZATION_TASK_LABELTooltip = When you validate an organized event, some tasks can be automatically created in the project<br><br>For example: <br>Send Call for Conference<br>Send Call for Booth<br>Receive call for conferences<br>Receive call for Booth<br>Open subscriptions to events for attendees<br>Send remind of event to speakers<br>Send remind of event to Booth hoster<br>Send remind of event to attendees
@ -50,11 +58,11 @@ EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filter thirdpartie's select list in att
# Object
#
EventOrganizationConfOrBooth= Conference Or Booth
ManageOrganizeEvent = Manage event organisation
ManageOrganizeEvent = Manage the organization of an event
ConferenceOrBooth = Conference Or Booth
ConferenceOrBoothTab = Conference Or Booth
AmountOfSubscriptionPaid = Amount of subscription paid
DateSubscription = Date of subscription
AmountPaid = Amount paid
DateOfRegistration = Date of subscription
ConferenceOrBoothAttendee = Conference Or Booth Attendee
#

View File

@ -868,7 +868,7 @@ if (empty($reshook)) {
if (GETPOST('propalid') > 0) {
// Define cost price for margin calculation
$buyprice = 0;
if (($result = $propal->defineBuyPrice($pu_ht, price2num(GETPOST('remise_percent'), 2), $object->id)) < 0) {
if (($result = $propal->defineBuyPrice($pu_ht, price2num(GETPOST('remise_percent'), '', 2), $object->id)) < 0) {
dol_syslog($langs->trans('FailedToGetCostPrice'));
setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors');
} else {
@ -883,7 +883,7 @@ if (empty($reshook)) {
$localtax1_tx, // localtax1
$localtax2_tx, // localtax2
$object->id,
price2num(GETPOST('remise_percent'), 2),
price2num(GETPOST('remise_percent'), '', 2),
$price_base_type,
$pu_ttc,
0,
@ -908,7 +908,7 @@ if (empty($reshook)) {
} elseif (GETPOST('commandeid') > 0) {
// Define cost price for margin calculation
$buyprice = 0;
if (($result = $commande->defineBuyPrice($pu_ht, GETPOST('remise_percent', 2), $object->id)) < 0) {
if (($result = $commande->defineBuyPrice($pu_ht, price2num(GETPOST('remise_percent'), '', 2), $object->id)) < 0) {
dol_syslog($langs->trans('FailedToGetCostPrice'));
setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors');
} else {
@ -923,7 +923,7 @@ if (empty($reshook)) {
$localtax1_tx, // localtax1
$localtax2_tx, // localtax2
$object->id,
price2num(GETPOST('remise_percent'), 2),
price2num(GETPOST('remise_percent'), '', 2),
'',
'',
$price_base_type,
@ -942,13 +942,13 @@ if (empty($reshook)) {
);
if ($result > 0) {
header("Location: ".DOL_URL_ROOT."/commande/card.php?id=".$commande->id);
header("Location: ".DOL_URL_ROOT."/commande/card.php?id=".urlencode($commande->id));
exit;
}
} elseif (GETPOST('factureid') > 0) {
// Define cost price for margin calculation
$buyprice = 0;
if (($result = $facture->defineBuyPrice($pu_ht, GETPOST('remise_percent', 2), $object->id)) < 0) {
if (($result = $facture->defineBuyPrice($pu_ht, price2num(GETPOST('remise_percent'), '', 2), $object->id)) < 0) {
dol_syslog($langs->trans('FailedToGetCostPrice'));
setEventMessages($langs->trans('FailedToGetCostPrice'), null, 'errors');
} else {
@ -963,7 +963,7 @@ if (empty($reshook)) {
$localtax1_tx,
$localtax2_tx,
$object->id,
price2num(GETPOST('remise_percent'), 2),
price2num(GETPOST('remise_percent'), '', 2),
'',
'',
'',

View File

@ -715,7 +715,7 @@ END;
// Discount qty min
print '<tr><td>'.$langs->trans("DiscountQtyMin").'</td>';
print '<td><input class="flat" name="remise_percent" size="4" value="'.(GETPOSTISSET('remise_percent') ? vatrate(price2num(GETPOST('remise_percent'), 2)) : (isset($object->fourn_remise_percent) ?vatrate($object->fourn_remise_percent) : '')).'"> %';
print '<td><input class="flat" name="remise_percent" size="4" value="'.(GETPOSTISSET('remise_percent') ? vatrate(price2num(GETPOST('remise_percent'), '', 2)) : (isset($object->fourn_remise_percent) ?vatrate($object->fourn_remise_percent) : '')).'"> %';
print '</td>';
print '</tr>';

View File

@ -412,10 +412,10 @@ if (empty($reshook)) {
// Récupération des variables
$rowid = GETPOST('rowid', 'int');
$priceid = GETPOST('priceid', 'int');
$newprice = price2num(GETPOST("price"), 'MU');
$newprice = price2num(GETPOST("price"), 'MU', 2);
// $newminprice=price2num(GETPOST("price_min"),'MU'); // TODO : Add min price management
$quantity = price2num(GETPOST('quantity'), 'MS');
$remise_percent = price2num(GETPOST('remise_percent'), 2);
$quantity = price2num(GETPOST('quantity'), 'MS', 2);
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$remise = 0; // TODO : allow discount by amount when available on documents
if (empty($quantity)) {

View File

@ -16,7 +16,7 @@
*/
/**
* \file htdocs/public/eventorganization/attendee_subscription.php
* \file htdocs/public/eventorganization/attendee_registration.php
* \ingroup project
* \brief Example of form to subscribe to an event
*
@ -79,13 +79,17 @@ $email = GETPOST("email");
$societe = GETPOST("societe");
// Getting id from Post and decoding it
$id = GETPOST('id', 'int');
$type = GETPOST('type', 'alpha');
$type = GETPOST('type', 'aZ09');
if ($type == 'conf') {
$id = GETPOST('id', 'int');
} else {
$id = GETPOST('fk_project', 'int') ? GETPOST('fk_project', 'int') : GETPOST('id', 'int');
}
$conference = new ConferenceOrBooth($db);
$project = new Project($db);
if ($type=='conf') {
if ($type == 'conf') {
$resultconf = $conference->fetch($id);
if ($resultconf < 0) {
print 'Bad value for parameter id';
@ -97,11 +101,7 @@ if ($type=='conf') {
$errmsg .= $project->error;
}
}
if ($type=='global') {
$project = new Project($db);
if (empty($id)) {
$id = GETPOST('fk_project', 'int');
}
if ($type == 'global') {
$resultproject = $project->fetch($id);
if ($resultproject < 0) {
$error++;
@ -110,10 +110,9 @@ if ($type=='global') {
}
// Security check
$securekeyreceived = GETPOST('securekey', 'alpha');
$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5');
// We check if the securekey collected is OK
if ($securekeytocompare != $securekeyreceived) {
@ -221,7 +220,7 @@ if ($reshook < 0) {
}
// Action called when page is submitted
if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status!=2 || !empty($project->id) && $project->status==Project::STATUS_VALIDATED)) {
if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conference->status!=2 || !empty($project->id) && $project->status == Project::STATUS_VALIDATED)) {
$error = 0;
$urlback = '';
@ -251,20 +250,22 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
// Check if attendee already exists (by email and for this event)
$confattendee = new ConferenceOrBoothAttendee($db);
if ($type=='global') {
if ($type == 'global') {
$filter = array('t.fk_project'=>$id, 'customsql'=>'t.email="'.$email.'"');
}
if ($action='conf') {
if ($action == 'conf') {
$filter = array('t.fk_actioncomm'=>$id, 'customsql'=>'t.email="'.$email.'"');
}
// Check if there is already an attendee into table eventorganization_conferenceorboothattendee for same event (or conference/booth)
$resultfetchconfattendee = $confattendee->fetchAll('', '', 0, 0, $filter);
if ($resultfetchconfattendee > 0 && count($resultfetchconfattendee)>0) {
if (is_array($resultfetchconfattendee) && count($resultfetchconfattendee) > 0) {
// Found confattendee
$confattendee = array_shift($resultfetchconfattendee);
} else {
// Need to create a confattendee
$confattendee->date_subscription = dol_now();
$confattendee->date_creation = dol_now();
$confattendee->email = $email;
$confattendee->fk_project = $project->id;
$confattendee->fk_actioncomm = $id;
@ -274,42 +275,50 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$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) {
// At this point, we have an existing $confattendee. It may not be linked to a thirdparty.
//var_dump($confattendee);
// If the attendee has already been paid
if (!empty($confattendee->date_subscription)) {
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl;
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl);
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)) {
// Fetch using fk_soc if the attendee was already found
if (!empty($confattendee->fk_soc) && $confattendee->fk_soc > 0) {
$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;
if (empty($conf->global->EVENTORGANIZATION_DISABLE_RETREIVE_THIRDPARTY_FROM_NAME)) {
// Fetch using the input field by user if we just created the attendee
if (!empty($societe)) {
$resultfetchthirdparty = $thirdparty->fetch('', $societe, '', '', '', '', '', '', '', '', $email);
if ($resultfetchthirdparty <= 0) {
// Need to create a new one (not found or multiple with the same name/email)
$resultfetchthirdparty = 0;
} else {
// We found an unique result with that name/email, so we set the fk_soc of attendee
$confattendee->fk_soc = $thirdparty->id;
$confattendee->update($user);
}
} 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);
// Need to create a thirdparty (put number>0 if we do not want to create a thirdparty for free-conferences)
$resultfetchthirdparty = 0;
}
} 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) {
if ($resultfetchthirdparty < 0) {
$error++;
$errmsg .= $thirdparty->error;
} elseif ($resultfetchthirdparty==0) {
// creation of a new thirdparty
} elseif ($resultfetchthirdparty == 0) {
// Creation of a new thirdparty
if (!empty($societe)) {
$thirdparty->name = $societe;
} else {
@ -318,7 +327,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$thirdparty->address = GETPOST("address");
$thirdparty->zip = GETPOST("zipcode");
$thirdparty->town = GETPOST("town");
$thirdparty->client = 2;
$thirdparty->client = $thirdparty::PROSPECT;
$thirdparty->fournisseur = 0;
$thirdparty->country_id = GETPOST("country_id", 'int');
$thirdparty->state_id = GETPOST("state_id", 'int');
@ -343,12 +352,13 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
}
$thirdparty->code_client = $tmpcode;
$readythirdparty = $thirdparty->create($user);
if ($readythirdparty <0) {
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);
}
@ -356,10 +366,18 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
}
if (!$error) {
$db->commit();
if (!empty(floatval($project->price_registration))) {
$outputlangs = $langs;
// TODO Use default language of $thirdparty->default_lang to build $outputlang
$productforinvoicerow = new Product($db);
$resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION);
$productforinvoicerow->id = 0;
$resultprod = 0;
if ($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION > 0) {
$resultprod = $productforinvoicerow->fetch($conf->global->SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION);
}
if ($resultprod < 0) {
$error++;
$errmsg .= $productforinvoicerow->error;
@ -371,6 +389,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$facture->date = dol_now();
$facture->cond_reglement_id = $confattendee->cond_reglement_id;
$facture->fk_project = $project->id;
if (empty($facture->cond_reglement_id)) {
$paymenttermstatic = new PaymentTerm($confattendee->db);
$facture->cond_reglement_id = $paymenttermstatic->getDefaultId();
@ -393,29 +412,44 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
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);
$labelforproduct = $outputlangs->trans("EventFee", $project->title);
$date_start = $project->date_start;
$date_end = $project->date_end;
$result = $facture->addline($labelforproduct, floatval($project->price_registration), 1, $vattouse, 0, 0, $productforinvoicerow->id, 0, $date_start, $date_end, 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;
}
}
if (!$error) {
$db->commit();
// Registration was recorded and invoice was generated, so we send an email
// TODO
// Now we redirect to the payment page
$sourcetouse = 'organizedeventregistration';
$reftouse = $facture->id;
$redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.urlencode($sourcetouse).'&ref='.urlencode($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='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
}
Header("Location: ".$redirection);
exit;
}
Header("Location: ".$redirection);
exit;
} else {
$db->rollback();
}
} else {
$db->commit();
// No price has been set
// Validating the subscription
$confattendee->setStatut(1);
@ -464,7 +498,8 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
}
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl;
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl);
Header("Location: ".$redirection);
exit;
}
@ -524,8 +559,8 @@ if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CO
print '<input type="hidden" name="token" value="' . newToken() . '" / >';
print '<input type="hidden" name="entity" value="' . $entity . '" />';
print '<input type="hidden" name="action" value="add" />';
print '<input type="hidden" name="id" value="' . $conference->id . '" />';
print '<input type="hidden" name="type" value="' . $type . '" />';
print '<input type="hidden" name="id" value="' . $conference->id . '" />';
print '<input type="hidden" name="fk_project" value="' . $project->id . '" />';
print '<input type="hidden" name="securekey" value="' . $securekeyreceived . '" />';

View File

@ -113,11 +113,13 @@ if (!$action) {
}
}
if ($source == 'conferencesubscription') {
if ($source == 'organizedeventregistration') {
// Finding the Attendee
$invoiceid = GETPOST('ref');
$invoiceid = GETPOST('ref', 'int');
$invoice = new Facture($db);
$resultinvoice = $invoice->fetch($invoiceid);
if ($resultinvoice <= 0) {
setEventMessages(null, $invoice->errors, "errors");
} else {
@ -129,9 +131,12 @@ if ($source == 'conferencesubscription') {
$attendee = new ConferenceOrBoothAttendee($db);
$resultattendee = $attendee->fetch($linkedAttendees[0]);
if ($resultattendee <= 0) {
setEventMessages(null, $attendee->errors, "errors");
} else {
$attendee->fetch_projet();
$amount = price2num($invoice->total_ttc);
// Finding the associated thirdparty
$thirdparty = new Societe($db);
@ -1806,9 +1811,9 @@ if ($source == 'donation') {
print '<input type="hidden" name="desc" value="'.dol_escape_htmltag($labeldesc).'">'."\n";
}
if ($source == 'conferencesubscription') {
if ($source == 'organizedeventregistration') {
$found = true;
$langs->load("members");
$langs->loadLangs(array("members", "eventorganization"));
if (GETPOST('fulltag', 'alpha')) {
$fulltag = GETPOST('fulltag', 'alpha');
@ -1833,10 +1838,15 @@ if ($source == 'conferencesubscription') {
print '</b>';
print '</td></tr>'."\n";
if (! is_object($attendee->project)) {
$text = 'ErrorProjectotFound';
} else {
$text = $langs->trans("PaymentEvent").' - '.$attendee->project->title;
}
// Object
$text = '<b>'.$langs->trans("PaymentConferenceAttendee").'</b>';
print '<tr class="CTableRow2"><td class="CTableRow2">'.$langs->trans("Designation");
print '</td><td class="CTableRow2">'.$text;
print '</td><td class="CTableRow2"><b>'.$text.'</b>';
print '<input type="hidden" name="source" value="'.dol_escape_htmltag($source).'">';
print '<input type="hidden" name="ref" value="'.dol_escape_htmltag($invoice->id).'">';
print '</td></tr>'."\n";

View File

@ -23,9 +23,10 @@
/**
* \file htdocs/public/payment/paymentok.php
* \ingroup core
* \brief File to show page after a successful payment
* \brief File to show page after a successful payment on a payment line system.
* The payment was already really recorded. So an error here must send warning to admin but must still infor user that payment is ok.
* This page is called by payment system with url provided to it completed with parameter TOKEN=xxx
* This token can be used to get more informations.
* This token and session can be used to get more informations.
*/
if (!defined('NOLOGIN')) {
@ -804,7 +805,7 @@ if ($ispaymentok) {
$ispostactionok = 1;
}
} else {
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Your payment was really executed but we failed to record it. Please contact us.';
$ispostactionok = -1;
$error++;
}
@ -1015,7 +1016,7 @@ if ($ispaymentok) {
$ispostactionok = 1;
}
} else {
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Your payment was really executed but we failed to record it. Please contact us.';
$ispostactionok = -1;
$error++;
}
@ -1038,7 +1039,7 @@ if ($ispaymentok) {
// TODO send email with acknowledgment for the donation
// (need that the donation module can gen a pdf document for the cerfa with pre filled content)
} elseif (array_key_exists('ATT', $tmptag) && $tmptag['ATT'] > 0) {
// Record payment for attendee
// Record payment for registration to an event for an attendee
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$object = new Facture($db);
$result = $object->fetch($ref);
@ -1090,7 +1091,7 @@ if ($ispaymentok) {
}
$paiement->paiementid = $paymentTypeId;
$paiement->num_payment = '';
$paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
$paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress.' for event registration';
$paiement->ext_payment_id = $TRANSACTIONID;
$paiement->ext_payment_site = $service;
@ -1131,77 +1132,86 @@ if ($ispaymentok) {
$ispostactionok = 1;
}
} else {
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Your payment was really executed but we failed to record it. Please contact us.';
$ispostactionok = -1;
$error++;
}
}
if (!$error) {
$db->commit();
// Validating the attendee
$attendeetovalidate = new ConferenceOrBoothAttendee($db);
$resultattendee = $attendeetovalidate->fetch($tmptag['ATT']);
if ($resultattendee < 0) {
$error++;
setEventMessages(null, $attendeetovalidate->errors, "errors");
} else {
$attendeetovalidate->amount=$FinalPaymentAmt;
$attendeetovalidate->update($user);
$attendeetovalidate->validate($user);
// Sending mail
$thirdparty = new Societe($db);
$resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc);
if ($resultthirdparty < 0) {
setEventMessages(null, $attendeetovalidate->errors, "errors");
$attendeetovalidate->amount = $FinalPaymentAmt;
$attendeetovalidate->date_subscription = dol_now();
$attendeetovalidate->update($user);
}
}
if (!$error) {
$db->commit();
} else {
setEventMessages(null, $postactionmessages, 'warnings');
$db->rollback();
}
if (! $error) {
// Sending mail
$thirdparty = new Societe($db);
$resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc);
if ($resultthirdparty < 0) {
setEventMessages(null, $attendeetovalidate->errors, "errors");
} else {
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, 'conferenceorbooth', $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 = $attendeetovalidate->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 {
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, 'conferenceorbooth', $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 = $attendeetovalidate->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');
}
}
} else {
$db->rollback();
}
}
} else {
@ -1306,7 +1316,7 @@ if ($ispaymentok) {
$ispostactionok = 1;
}
} else {
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
$postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Your payment was really executed but we failed to record it. Please contact us.';
$ispostactionok = -1;
$error++;
}

View File

@ -274,8 +274,8 @@ if (empty($reshook)) {
$object->cond_reglement_id = GETPOST('cond_reglement_id');
$object->mode_reglement_id = GETPOST('mode_reglement_id');
$object->fk_account = GETPOST('fk_account', 'int');
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
$object->socid = GETPOST('socid');
$object->fk_project = GETPOST('projectid', 'int');
$object->model_pdf = GETPOST('model');
@ -931,8 +931,8 @@ if (empty($reshook)) {
$result = $object->updateline(
GETPOST('lineid', 'int'),
$ht,
price2num(GETPOST('qty'), 'MS'),
price2num(GETPOST('remise_percent'), 2),
price2num(GETPOST('qty'), 'MS', 2),
price2num(GETPOST('remise_percent'), '', 2),
$vat_rate,
$localtax1_rate,
$localtax2_rate,
@ -1012,9 +1012,9 @@ if (empty($reshook)) {
// Terms of payments
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
} elseif ($action == 'setremisepercent' && $usercancreate) {
$result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), 2));
$result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU'));
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
} elseif ($action == 'setmode' && $usercancreate) {
// Payment mode
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));