Add support for handling economic invoice drafts/booked IDs

Added methods to check and retrieve economic invoice draft and booked IDs, improving invoice tracking functionality. Introduced a new method in the economic endpoint to fetch booked invoice details using external IDs. Additionally, updated the object property class to handle integer values during SQL updates.
This commit is contained in:
Jepp9350
2025-03-03 16:55:09 +01:00
parent 68b3fd2171
commit 9e46140373
3 changed files with 106 additions and 20 deletions
@@ -20,7 +20,7 @@ class object_property
$this->required = $required;
$this->default = $default;
}
public function __toString(): string
{
// Return the value of the field in the database table
@@ -54,7 +54,10 @@ class object_property
// If the value is null, set it to null
if ($value === null) {
$sql = "UPDATE $this->table SET $this->column = NULL WHERE id = $this->id";
} // If the value is a string, escape it
} // If the value is an integer, set it to the integer value
elseif (is_int($value)) {
$sql = "UPDATE $this->table SET $this->column = $value WHERE id = $this->id";
} // If the value is a string, escape it
else {
$value = $db->escape_string($value);
$sql = "UPDATE $this->table SET $this->column = '$value' WHERE id = $this->id";