Garradin Plugins

Check-in [7705097317]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:total manquant
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7705097317426b1e9991cf9d21bcc1eead006063
User & Date: bohwaz 2020-05-22 01:00:01
Context
2020-05-22
01:04
Ajout cat├ęgorie check-in: 1038686ea1 user: bohwaz tags: trunk
01:00
total manquant check-in: 7705097317 user: bohwaz tags: trunk
00:56
Fixes check-in: 83819e8692 user: bohwaz tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to caisse/lib/Tab.php.

9
10
11
12
13
14
15


16


17
18
19
20
21
22
23
{
	public $id;

	public function __construct(int $id)
	{
		$this->id = $id;



		foreach (DB::getInstance()->first(POS::sql('SELECT * FROM @PREFIX_tabs WHERE id = ?;'), $id) as $key => $value) {


			$this->$key = $value;
		}
	}

	public function getRemainder(): int
	{
		return (int) DB::getInstance()->firstColumn(POS::sql('SELECT







>
>
|
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
	public $id;

	public function __construct(int $id)
	{
		$this->id = $id;

		$sql = POS::sql('SELECT *,
			COALESCE((SELECT SUM(qty*price) FROM @PREFIX_tabs_items WHERE tab = @PREFIX_tabs.id), 0) AS total
			FROM @PREFIX_tabs WHERE id = ?;');

		foreach (DB::getInstance()->first($sql, $id) as $key => $value) {
			$this->$key = $value;
		}
	}

	public function getRemainder(): int
	{
		return (int) DB::getInstance()->firstColumn(POS::sql('SELECT