Overview
Comment:Fix: for credit payoff, no need to invert accounts order, as position is dynamic
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: 9513e0649ba4256c18526868c8d6f8871f353061
User & Date: bohwaz on 2020-12-06 13:58:27
Other Links: branch diff | manifest | tags
Context
2020-12-06
14:45
Try to get around Chrome and other password managers that fill new/edit forms check-in: ae81e37b04 user: bohwaz tags: dev
13:58
Fix: for credit payoff, no need to invert accounts order, as position is dynamic check-in: 9513e0649b user: bohwaz tags: dev
2020-12-05
23:47
Amélioration design pour mobile et tablettes check-in: 6084efe07c user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Entities/Accounting/Transaction.php from [7f6416e57a] to [fe4214ea5c].

674
675
676
677
678
679
680
681
682


683
684
685
686
687
688
689
674
675
676
677
678
679
680


681
682
683
684
685
686
687
688
689







-
-
+
+







		$this->label = ($this->_related->type == Transaction::TYPE_DEBT ? 'Règlement de dette : ' : 'Règlement de créance : ') . $this->_related->label;
		$this->type = $this->_related->type;

		$out = (object) [
			'id' => $this->_related->id,
			'sum' => $this->_related->sum(),
			'id_account' => null,
			'form_account_name' => sprintf('account_%d_%d', $this->type, $this->_related->type == self::TYPE_DEBT ? 1 : 0),
			'form_target_name' => sprintf('account_%d_%d', $this->type, $this->_related->type == self::TYPE_DEBT ? 0 : 1),
			'form_account_name' => sprintf('account_%d_%d', $this->type, 1),
			'form_target_name' => sprintf('account_%d_%d', $this->type, 0),
		];

		foreach ($this->_related->getLines() as $line) {
			if (($this->_related->type == self::TYPE_DEBT && $line->debit)
				|| ($this->_related->type == self::TYPE_CREDIT && $line->credit)) {
				// Skip the type of debt/credit, just keep the thirdparty account
				continue;