Hi,
Line 840 refers to the lines you suggested me to add:
$app = JFactory::getApplication();
$app->enqueueMessage('Subsale '.(int)$order->order_id.' is being modified [' . $order->order_vendor_price . ' / ' . $order->old->order_vendor_price . ']');
They go into the beforeUpdateSubsale function as follows
$app = JFactory::getApplication();
$app->enqueueMessage('Subsale '.(int)$order->order_id.' is being modified [' . $order->order_vendor_price . ' / ' . $order->old->order_vendor_price . ']');
if(!empty($order->old->order_vendor_paid) && $order->old->order_vendor_paid > 0 && (!isset($order->hikamarket->internal_process) || $order->hikamarket->internal_process === false) ) {
if(isset($order->order_vendor_price) && $order->order_vendor_price !== $order->old->order_vendor_price) {
$do = false;
return;
}
}
The other tracing lines I have added in the administrator/components/com_hikamarket/classes/order.php are inside the generateOrderInvoiceNumber function as per my previous message.
I attach the full order.php file so you can see the line numbers - I attach it as .txt file because I'm not allowed to attach php files
What don't you understand? It looks pretty clear to me where the problem is. The key seems to be in the administrator/components/com_hikamarket/classes/order.php, inside the generateOrderInvoiceNumber() function.
As you can see in this function, there is an if condition to cancel the generation of the invoice:
if(!$force && (!empty($order->order_invoice_created) || !empty($order->old->order_invoice_created)))
{
return false;
}
When Stripe payment method is used, then when this function is called for the suborder
$force = false
$order->order_invoice_created = empty
$order->old->order_invoice_created = 0
Hence the if does NOT execute and the execution of the function continues and gives and invoice ID to the suborder
When Mangopay payment method is used, then when this function is called for the suborder
$force = false
$order->order_invoice_created = empty
$order->old->order_invoice_created = 1477304961
Since $order->old->order_invoice_created has a value, then the if gets executed and the return false stops the execution of the rest of the function. Hence the suborder does not get an invoice ID