Author Topic: VM [3.2.14] I can't delete orders  (Read 2046 times)

hazael

  • Beginner
  • *
  • Posts: 35
    • Biżuteria etniczna i orientalna
  • VirtueMart Version: 3.2.14
VM [3.2.14] I can't delete orders
« on: April 16, 2018, 16:51:52 pm »
in
Quote
administrator/index.php?option=com_virtuemart&view=orders
I have canceled orders in the list and I want to delete them.
After I try to delete, I get a error message: "An invoice has been issue, you are not allowed to delete this order QWERTY"
How to solve this problem?

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3378
  • using Matomo instead of Google Analytics
Re: VM [3.2.14] I can't delete orders
« Reply #1 on: April 16, 2018, 21:44:59 pm »
At present, after a (pdf) invoice has been generated, you can't delete the order from the VirtueMart administration anymore in VM 3.2.14+. This was recently implemented due to a new french law, but probably isn't the final solution to comply with that law yet. You should be able to delete the invoice in the xxxxx_virtuemart_invoices table with for example phpmyadmin and afterwards delete the order from the VM orders view.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2821
  • VirtueMart Version: 3.4
Re: VM [3.2.14] I can't delete orders
« Reply #2 on: April 17, 2018, 15:05:06 pm »
Accidental order deletion and invoice removal has been a problem for some time.  It is not just an issue with French businesses.

If VirtueMart is producing invoices (it does not have to) then records of these invoices should be maintained.

The changes in the latest release help to prevent the removal of records that have resulted in an invoice being produced through normal administrator operations.

This will help maintain a sequential record of invoice data which is a legal requirement in many countries.
regards
A

Joomla 3.8.13
php 7.1

hazael

  • Beginner
  • *
  • Posts: 35
    • Biżuteria etniczna i orientalna
  • VirtueMart Version: 3.2.14
Re: VM [3.2.14] I can't delete orders
« Reply #3 on: April 17, 2018, 18:47:58 pm »
This is understandable but this solution is troublesome. it would be useful to have a temporary option for administrator for testing - similar to the sandbox option in paypal. :-)
I removed tested orders from the database using the older version of Virtuemart [3.2.12]

lausianne

  • Jr. Member
  • **
  • Posts: 50
Re: VM [3.2.14] I can't delete orders
« Reply #4 on: April 20, 2018, 09:35:56 am »
I see the legal requirement, and I had this trouble with other shop software as well. The "solution" is really useless, though - if anyone actually wants to mess with the data, he can easily do that in the database. No fraud protection here. You'd need a blockchain for that, or similar. Maybe every transaction transferred directly to a state controlled safe location. Not that I propose this, just thoughts.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2821
  • VirtueMart Version: 3.4
Re: VM [3.2.14] I can't delete orders
« Reply #5 on: April 20, 2018, 13:59:23 pm »
Quote
The "solution" is really useless, though - if anyone actually wants to mess with the data, he can easily do that in the database. No fraud protection here.

This is designed for the average user who does not want to commit fraud - if you want to - you will find a way.

You could just delete the whole database and yes be done with it, in the same way that you could destroy paper invoices or delete all your other accounting records by formatting your hard disk.





regards
A

Joomla 3.8.13
php 7.1

lausianne

  • Jr. Member
  • **
  • Posts: 50
Re: VM [3.2.14] I can't delete orders
« Reply #6 on: April 20, 2018, 17:43:16 pm »
So it's just to protect users from accidental deletion, right? Then why not just have an extra warning, "Are you sure you want to delete this???"

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27109
  • Always on vacation
    • Jenkin Hill Internet
Re: VM [3.2.14] I can't delete orders
« Reply #7 on: April 21, 2018, 10:47:46 am »
It is also to prevent malicious deletion by a member of staff with admin access.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.3.9989 on Joomla 3.9.1 PHP 7.0.32
Testing VM 3.4.3.9993 on Joomla 3.9.1

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2821
  • VirtueMart Version: 3.4
Re: VM [3.2.14] I can't delete orders
« Reply #8 on: April 21, 2018, 10:50:45 am »
Quote
So it's just to protect users from accidental deletion, right?

No - that is not what I said.

The average user will not know how to manipulate a database

Quote
Then why not just have an extra warning, "Are you sure you want to delete this???

Because that will still allow deletion and that is not what the developers wanted to achieve.
regards
A

Joomla 3.8.13
php 7.1

Moskito

  • Beginner
  • *
  • Posts: 1
  • A beginner
Re: VM [3.2.14] I can't delete orders
« Reply #9 on: June 18, 2018, 11:14:13 am »
I understand, but we did not use this to issue the bill. Anyone who is doing this is the solution here:
administrator / components / com_virtuemart / models / order.php

Search this line(2268-2271. line):
Code: [Select]
if ($invoice) {
$removedOrderMsgs [$order['details']['BT']->order_number]= 'COM_VIRTUEMART_ORDER_NOT_ALLOWED_TO_DELETE';
continue;
}

Replace:
Code: [Select]
/*if ($invoice) {
$removedOrderMsgs [$order['details']['BT']->order_number]= 'COM_VIRTUEMART_ORDER_NOT_ALLOWED_TO_DELETE';
continue;
}*/

Sorry my bad english!

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2821
  • VirtueMart Version: 3.4
Re: VM [3.2.14] I can't delete orders
« Reply #10 on: June 18, 2018, 11:40:42 am »
Why are you suggestion changing code??

Quote
I understand, but we did not use this to issue the bill. Anyone who is doing this is the solution here:
administrator / components / com_virtuemart / models / order.php

There has been some misunderstanding somewhere along the way.

Just configure the system correctly - so that it does not think it is "issuing invoices"

"but we did not use this to issue the bill. "

If you do not issue invoices from VM you can delete the orders.

Ensure that NO order status is set to generate an invoice

Then you can delete whatever you want.

admin/configuration/order statuses

Create Invoice - set to No
regards
A

Joomla 3.8.13
php 7.1

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3543
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: VM [3.2.14] I can't delete orders
« Reply #11 on: September 10, 2018, 16:59:08 pm »
@AH
The restriction is not the only problem, Virtuemart is bugged because task value is set 2 times !
I'm wondered that all other function work in this form ?
Here why
Code: [Select]
<?php echo $this->addStandardHiddenToForm (); ?>
<input type="hidden" name="task" value="<?php echo vRequest::getCmd('task'); ?>">
addStandardHiddenToForm already add the task and the second line add the task a second time
Bug found in  3.2.14, but i dont checked if this is the case for other release.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2821
  • VirtueMart Version: 3.4
Re: VM [3.2.14] I can't delete orders
« Reply #12 on: September 10, 2018, 18:05:22 pm »
@studio42 

Cannot see this in 3.2.15

Things seem to be working fine.
regards
A

Joomla 3.8.13
php 7.1