- Posts: 6
- Thank you received: 0
no invoice number for such orders
8 years 3 months ago #294112
by urampa
no invoice number for such orders was created by urampa
-- HikaShop version -- : HikaShop Business: 3.4.0
-- Joomla version -- : 3.8.6
Is it possible to block the invoice number to be generated only for such orders? I need base it on a custom field to generate or not the invoice number.
-- Joomla version -- : 3.8.6
Is it possible to block the invoice number to be generated only for such orders? I need base it on a custom field to generate or not the invoice number.
Please Log in or Create an account to join the conversation.
8 years 3 months ago #294115
by nicolas
Replied by nicolas on topic no invoice number for such orders
Hi,
It's kind of possible.
I think you should be able to do that with a mass action:
www.hikashop.com/support/documentation/167-massaction-form.html
With a trigger "on after order updated", you could have a filter "order column" (for a custom order field) or "user column" (for a custom user field), and actions "update the values" on the columns "order_invoice_number", "order_invoice_id", "order_invoice_created" to empty their values.
That way the system would generate the invoice but it would be wiped out directly after being generated.
It's kind of possible.
I think you should be able to do that with a mass action:
www.hikashop.com/support/documentation/167-massaction-form.html
With a trigger "on after order updated", you could have a filter "order column" (for a custom order field) or "user column" (for a custom user field), and actions "update the values" on the columns "order_invoice_number", "order_invoice_id", "order_invoice_created" to empty their values.
That way the system would generate the invoice but it would be wiped out directly after being generated.
The following user(s) said Thank You: urampa
Please Log in or Create an account to join the conversation.
8 years 3 months ago #294185
by urampa
Replied by urampa on topic no invoice number for such orders
I've modified massaction_order plugin because the trigger onAfterOrderUpdate makes no result. I have copied part of onBeforeOrderUpdate settings:
$o = clone $order;
if(!empty($order->old)){
foreach($order->old as $key => $value) {
if(!isset($o->$key))
$o->$key = $value;
}
}
$orders = array($o);
instead of
$orders = array($order);
and now the massaction return correct value.
$o = clone $order;
if(!empty($order->old)){
foreach($order->old as $key => $value) {
if(!isset($o->$key))
$o->$key = $value;
}
}
$orders = array($o);
instead of
$orders = array($order);
and now the massaction return correct value.
Please Log in or Create an account to join the conversation.
8 years 3 months ago #294187
by nicolas
Replied by nicolas on topic no invoice number for such orders
Thank you for your feedback.
We'll add that on our end.
We'll add that on our end.
Please Log in or Create an account to join the conversation.
Time to create page: 0.197 seconds