Dolibarr ERP & CRM » Bugs » bug #1753 prevent validated invoice removalLatest modifications
Answer now
Snapshot Details |
Submitted by: | Bahfir Abbes (bafbes) | | Submitted on: | 2014-12-22 15:01 |
Last Modified On: | 2014-12-22 15:01 | |
Summary: | prevent validated invoice removal |
Description: | Keeping track of stock change of a product is not possible if a validated invoice which changed the number items in stock has been removed.
Presently validated invoices may be removed, which I consider as bug.
|
Step to reproduce bug: | Here is the diff of the correction in htdocs/compta/facture/class/facture.class.php :
@@ -2619,7 +2619,8 @@ class Facture extends CommonInvoice
if (! empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED)) return 1;
if (! empty($conf->global->INVOICE_CAN_NEVER_BE_REMOVED)) return 0;
-
+ // In order to keep track of stock values, invoices must be set to draft prior to be deleted
+ if (! empty($this->statut)) return 0;
// on verifie si la facture est en numerotation provisoire
$facref = substr($this->ref, 1, 4);
|
Detected in version: | 3.6.0 | | Category: | Other |
Severity: | 5 - Major | | OS Type/Version: | |
PHP version: | | | Database type and version: | |
Status |
Status: | Open | | Assigned to: | None |
Resolution: | None | |
Comments- Marcos GarcĂa 2014-12-23 16:11
- I am afraid this is a feature request, not a bug.
You can intercept the removal of invoices through triggers. |
|
You can intercept the removal of invoices through triggers.