Duplicating invoices not working anymore

kjmeijer
kjmeijer
Offline
0
Before updating Invoice Manager to v.2 a script was used to duplicate the invoices. I'm not 100 percent sure, but I think it was this one, this is a part of the whole php file:

$sql = "UPDATE #_virtuemart_orders SET order_status= 'U' ";

if ($conn->query($sql) === TRUE) {
echo "Vaste bestellingen op BEVESTIGD DOOR KLANT gezet \n";
} else {
echo "Error updating record: " . $conn->error;
}

echo "
";

$sql = "UPDATE #_virtuemart_order_items SET order_status= 'U' ";

if ($conn->query($sql) === TRUE) {
echo "Artikelen op bestelling op BEVESTIGD DOOR KLANT gezet \n";
} else {
echo "Error updating record: " . $conn->error;

------------------------------------

The invoices were only duplicated in Invoice Manager and not in Virtuemart. My questions are:

1: is it possible to make duplicates in Invoice Manager with this script?
2: since the orders in Virtuemart are not duplicated and also not in the table #_virtuemart_orders, where does Invoice Manager gets the info for making the invoices?

Accepted Answer

kjmeijer
kjmeijer
Offline
Tuesday, October 31 2017, 12:08 PM - #Permalink
0
Well, I've solved it myself. I still had the files from the previous version so I've compared the invoicemanager_virtuemart.php files and made sure the two were the same as possible.
The reply is currently minimized Show
Responses (9)
  • Accepted Answer

    Thursday, September 07 2017, 08:11 PM - #Permalink
    0
    hello

    this script you show me is definitely not from Invoice Manager.. it's not from our extension. I don't know where did you take it from.. but it's not ours...
    The reply is currently minimized Show
  • Accepted Answer

    kjmeijer
    kjmeijer
    Offline
    Thursday, September 07 2017, 08:20 PM - #Permalink
    0
    I know it's not yours, I haven't said that. What about my second question?
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, September 13 2017, 10:49 AM - #Permalink
    0
    hello,

    IM takes the info from the VM orders, when those are completed.
    but duplicating an invoice in IM does not mean duplicating the order in VM.. if that's what you're asking...
    The reply is currently minimized Show
  • Accepted Answer

    kjmeijer
    kjmeijer
    Offline
    Monday, September 18 2017, 01:11 PM - #Permalink
    0
    You say IM takes the info from VM when the order is completed. Just for my information, does IM "import" an invoice when an order in VM changes the status? If so, at which status an order will also be included in IM?
    The reply is currently minimized Show
  • Accepted Answer

    Monday, September 18 2017, 02:29 PM - #Permalink
    0
    hello,

    it does "import INVOICES", it only creates Invoice from ORDERS.

    it will do that (create or UPDATE an invoice) when the status changes to whatever state you have defined in the PLUGIN.

    in the plugin, you can define for which statuses you want the invoice to be created/updated.
    The reply is currently minimized Show
  • Accepted Answer

    kjmeijer
    kjmeijer
    Offline
    Tuesday, October 10 2017, 09:51 AM - #Permalink
    0
    Sorry for the late response.

    It's clear to me now how it's works. The plugin is set to 'Shipped' on Create invoices on order status. And it does create an invoice, except when I change the status of an order in Virtuemart back to 'Confirmed by customer' and change it again to Shipped it will not create a second invoice, what I want it to do. Why is this and how can it be solved?
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, October 31 2017, 08:36 AM - #Permalink
    0
    I don't have the code.. we would need to build it. basically you need to check (on the plugin) the order status and tell it to create a new one instead of updating the current one, if the status is specifically that one.
    The reply is currently minimized Show
  • Accepted Answer

    kjmeijer
    kjmeijer
    Offline
    Monday, October 30 2017, 03:20 PM - #Permalink
    0
    Could you tell me what needs to be changed/added to the plugin?
    The reply is currently minimized Show
  • Accepted Answer

    Monday, October 30 2017, 02:41 PM - #Permalink
    0
    hello

    sorry I missed this.

    it will not create a second invoice if the invoice is the same (but status is changed). this is how it is supposed to work..

    to generate new invoice on a particular order status, some coding needs to be done on the plugin
    The reply is currently minimized Show
Your Reply