fix: the ref passed in url is now attendee s one, not invoice s
This commit is contained in:
parent
f059cbe89c
commit
4d20079c49
@ -343,7 +343,7 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
$valid = true;
|
$valid = true;
|
||||||
$sourcetouse = 'conferencesubscription';
|
$sourcetouse = 'conferencesubscription';
|
||||||
$reftouse = $facture->id;
|
$reftouse = $confattendee->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)) {
|
||||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||||
|
|||||||
@ -59,6 +59,7 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.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/payments.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.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.'/societe/class/societeaccount.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
@ -113,30 +114,31 @@ if (!$action) {
|
|||||||
|
|
||||||
if ($source == 'conferencesubscription') {
|
if ($source == 'conferencesubscription') {
|
||||||
// Finding the Attendee
|
// Finding the Attendee
|
||||||
$invoiceid = GETPOST('ref');
|
$attendeeid = GETPOST('ref');
|
||||||
$invoice = new Facture($db);
|
$attendee = new ConferenceOrBoothAttendee($db);
|
||||||
$resultinvoice = $invoice->fetch($invoiceid);
|
$resultattendee = $attendee->fetch($attendeeid);
|
||||||
if ($resultinvoice <= 0) {
|
if ($resultattendee <= 0) {
|
||||||
setEventMessages(null, $invoice->errors, "errors");
|
setEventMessages(null, $attendee->errors, "errors");
|
||||||
} else {
|
} else {
|
||||||
$invoice->fetchObjectLinked();
|
|
||||||
// Finding the thirdparty associated to the Attendee
|
|
||||||
$thirdparty = new Societe($db);
|
|
||||||
$resultthirdparty = $thirdparty->fetch($invoice->socid);
|
|
||||||
if ($resultthirdparty <= 0) {
|
|
||||||
setEventMessages(null, $thirdparty->errors, "errors");
|
|
||||||
}
|
|
||||||
$object = $thirdparty;
|
|
||||||
|
|
||||||
$linkedAttendees = $invoice->linkedObjectsIds['conferenceorboothattendee'];
|
$attendee->fetchObjectLinked();
|
||||||
|
$linkedInvoices = $attendee->linkedObjectsIds['facture'];
|
||||||
|
|
||||||
if (is_array($linkedAttendees)) {
|
if (is_array($linkedInvoices)) {
|
||||||
$linkedAttendees = array_values($linkedAttendees);
|
$linkedInvoices = array_values($linkedInvoices);
|
||||||
|
|
||||||
$attendee = new ConferenceOrBoothAttendee($db);
|
$invoice = new Facture($db);
|
||||||
$resultattendee = $attendee->fetch($linkedAttendees[0]);
|
$resultinvoice = $invoice->fetch($linkedInvoices[0]);
|
||||||
if ($resultattendee <= 0) {
|
if ($resultinvoice <= 0) {
|
||||||
setEventMessages(null, $attendee->errors, "errors");
|
setEventMessages(null, $invoice->errors, "errors");
|
||||||
|
} else {
|
||||||
|
// Finding the associated thirdparty
|
||||||
|
$thirdparty = new Societe($db);
|
||||||
|
$resultthirdparty = $thirdparty->fetch($invoice->socid);
|
||||||
|
if ($resultthirdparty <= 0) {
|
||||||
|
setEventMessages(null, $thirdparty->errors, "errors");
|
||||||
|
}
|
||||||
|
$object = $thirdparty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1808,7 +1810,7 @@ if ($source == 'conferencesubscription') {
|
|||||||
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("Designation");
|
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("Designation");
|
||||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'">'.$text;
|
print '</td><td class="CTableRow'.($var ? '1' : '2').'">'.$text;
|
||||||
print '<input type="hidden" name="source" value="'.dol_escape_htmltag($source).'">';
|
print '<input type="hidden" name="source" value="'.dol_escape_htmltag($source).'">';
|
||||||
print '<input type="hidden" name="ref" value="'.dol_escape_htmltag($invoice->id).'">';
|
print '<input type="hidden" name="ref" value="'.dol_escape_htmltag($attendee->id).'">';
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
// Amount
|
// Amount
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user