Skip to content

Commit

Permalink
FIX add display of an error when attempting to delete a committed tra…
Browse files Browse the repository at this point in the history
…nsaction (#26573)

* add display of an error when attempting to delete a committed transaction

* update
  • Loading branch information
samifilali authored Nov 14, 2023
1 parent 201ad75 commit 966e26e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion htdocs/accountancy/bookkeeping/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,11 @@
setEventMessages($object->error, $object->errors, 'errors');
$error++;
break;
}
} elseif (isset($object->date_validation) || $object->date_validation != '') {
setEventMessages($langs->trans("ValidatedRecordWhereFound"), null, 'errors');
$error++;
break;
}
}
}

Expand Down
6 changes: 5 additions & 1 deletion htdocs/accountancy/bookkeeping/listbyaccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,11 @@
setEventMessages($object->error, $object->errors, 'errors');
$error++;
break;
}
} elseif (isset($object->date_validation) || $object->date_validation != '') {
setEventMessages($langs->trans("ValidatedRecordWhereFound"), null, 'errors');
$error++;
break;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion htdocs/accountancy/class/bookkeeping.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ public function fetch($id, $ref = null, $mode = '')
$this->piece_num = $obj->piece_num;
$this->date_creation = $this->db->jdate($obj->date_creation);
$this->date_export = $this->db->jdate($obj->date_export);
$this->date_validation = isset($obj->date_validated) ? $this->db->jdate($obj->date_validated) : '';
$this->date_validation = isset($obj->date_validation) ? $this->db->jdate($obj->date_validation) : '';
}
$this->db->free($resql);

Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/en_US/main.lang
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ RecordModifiedSuccessfully=Record modified successfully
RecordsModified=%s record(s) modified
RecordsDeleted=%s record(s) deleted
RecordsGenerated=%s record(s) generated
ValidatedRecordWhereFound = Some of the selected records have already been validated. No records have been deleted.
AutomaticCode=Automatic code
FeatureDisabled=Feature disabled
MoveBox=Move widget
Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/fr_FR/main.lang
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ RecordModifiedSuccessfully=Enregistrement modifié avec succès
RecordsModified=%s enregistrements modifiés
RecordsDeleted=%s enregistrement(s) supprimé(s)
RecordsGenerated=%s enregistrement(s) généré(s)
ValidatedRecordWhereFound = Certains des enregistrements sélectionnés ont déjà été validés. Aucun enregistrement n'a été supprimé.
AutomaticCode=Création automatique du code
FeatureDisabled=Fonction désactivée
MoveBox=Déplacer le widget
Expand Down

0 comments on commit 966e26e

Please sign in to comment.