Fix method to delete a bookkeeping record
This commit is contained in:
parent
4c8945e460
commit
c15454e62b
@ -1224,18 +1224,17 @@ class BookKeeping extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Delete bookkepping by piece number
|
* Delete bookkepping by piece number
|
||||||
*
|
*
|
||||||
* @param int $piecenum peicenum to delete
|
* @param int $piecenum Piecenum to delete
|
||||||
* @param string $mode Mode
|
* @return int Result
|
||||||
* @return int Result
|
|
||||||
*/
|
*/
|
||||||
function deleteMvtNum($piecenum, $mode) {
|
function deleteMvtNum($piecenum) {
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// first check if line not yet in bookkeeping
|
// first check if line not yet in bookkeeping
|
||||||
$sql = "DELETE";
|
$sql = "DELETE";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element. $mode;
|
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
||||||
$sql .= " WHERE piece_num = " . $piecenum;
|
$sql .= " WHERE piece_num = " . $piecenum;
|
||||||
$sql .= " AND entity IN (" . getEntity('accountancy') . ")";
|
$sql .= " AND entity IN (" . getEntity('accountancy') . ")";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user