1. jure
  2. RO CSVI
  3. Thursday, 13 February 2020
  4.  Subscribe via email
Hi,

I have a question about my setup which sometime produces duplicate ordeline items in orders that were set to produce 2 pdf documents, proforma invoice + final invoice.
If the order has 1 invoice generated it exports the 4 items as intended. But if the invoice has a generated proforma invoice + invoice all the exported items get duplicated.

I tried to use group by but was not successful.

Any help would be appreciated, best regards
Attachments (1)
Accepted Answer
Accepted Answer Pending Moderation
Hi Tharuna

I'm writing here what seems to work now, if someone will have the same issue.
What I had to do is group by the field order_item_sku and then Sort by order_number

This seems to work in my setup,

Thank you for all the help, regards
Jure
  1. more than a month ago
  2. RO CSVI
  3. # Permalink
Accepted Answer Pending Moderation
Hello,
Can you post the export debug log to check? To get the debug log check How to get debug information? document.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 1
Accepted Answer Pending Moderation
Hi Tharuna,

I have uploaded the log file to the original post,

Thank you
  1. more than a month ago
  2. RO CSVI
  3. # 2
Accepted Answer Pending Moderation
Hello,
Thank you for the debug log. From what i know in VirtueMart, proforma invoice is one of the order status where invoice is generated and sent to user before a product has been shipped. As you said an order has two invoices, a proforma invoice and final invoice which also means two entries in #__virtuemart_invoices table. That should be the cause for duplicate orders in export. What i really don't know is that if the invoice_number is same for both of these invoices or different. If they are same, you can try group by invoice_number in your export. See if that helps.

I also see that you have added few columns in export fields but it has not been used in the export XML file. What is the use of having the export fields which are not used in export XML?
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 3
Accepted Answer Pending Moderation
Hi,

I've tried the group by invoice_number but it only exports the first item in the order.
Looking at the VM table the only common thing for both is the virtuemart_order_id, but using that in group by shows only 1st item in orderlines.

.log.275 is withought group by
.log.277 is with group by virtuemart_order_id

I've added the image of the table, I've exported only the virtuemart_order_id 45 record, which has 2 entries, Q is for proforma and S is for Invoice.

Best Regards,
Jure
Attachments (3)
  1. more than a month ago
  2. RO CSVI
  3. # 4
Accepted Answer Pending Moderation
Hello Jure,
I tried to replicate your duplicate issue with two invoices for an order and can see orderline items getting duplicated. Is that what you see in your export? If so can you group by order_item_name field and check the export. If that does not solve your issue, can you post a sample of your export file which has duplicates?
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. RO CSVI
  3. # 5
Accepted Answer Pending Moderation
Hi Tharuna,

Yes I see duplicated order items in xml export. I've tried order_item_name, but it's an issue because 2 items can have the same name, so it then shows just the 1st one.
I've tried with order_item_sku which is unique, but then the order in the xml get exported 2 times, each with different orderlines.

I've attached the 2 xml files, one with group by order_item_sku (03.xml)
One without group by in this one you can see that if the order has only 1 invoice generated it show as expected (10.xml)
Attachments (2)
  1. more than a month ago
  2. RO CSVI
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!