Overview
Comment:Renommer payment_reference en reference, et ajout libellé par ligne pour les saisies avancées
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: d6206cc5c27c8d14fc62f27f23117804fdceffac
User & Date: bohwaz on 2020-09-03 16:19:21
Other Links: branch diff | manifest | tags
Context
2020-09-03
16:19
Compatibilité avec AbstractEntity check-in: 749ef24654 user: bohwaz tags: dev
16:19
Renommer payment_reference en reference, et ajout libellé par ligne pour les saisies avancées check-in: d6206cc5c2 user: bohwaz tags: dev
2020-06-23
00:32
Merge avec trunk check-in: eea005f855 user: bohwaz tags: dev
Changes

Modified src/include/data/1.0.0_schema.sql from [2862cb96ce] to [37d671a7d2].

252
253
254
255
256
257
258
259



260
261
262
263
264
265
266
267
268
    id INTEGER PRIMARY KEY NOT NULL,

    id_transaction INTEGER NOT NULL REFERENCES acc_transactions (id) ON DELETE CASCADE,
    id_account INTEGER NOT NULL REFERENCES acc_accounts (id), -- N° du compte dans le plan comptable

    credit INTEGER NOT NULL,
    debit INTEGER NOT NULL,




    reconcilied INTEGER NOT NULL DEFAULT 0,
    payment_reference TEXT NULL, -- Référence de paiement, eg. numéro de chèque

    CONSTRAINT line_check1 CHECK ((credit * debit) = 0),
    CONSTRAINT line_check2 CHECK ((credit + debit) > 0)
);

CREATE INDEX IF NOT EXISTS acc_transactions_lines_account ON acc_transactions_lines (id_account);









>
>
>

<







252
253
254
255
256
257
258
259
260
261
262
263

264
265
266
267
268
269
270
    id INTEGER PRIMARY KEY NOT NULL,

    id_transaction INTEGER NOT NULL REFERENCES acc_transactions (id) ON DELETE CASCADE,
    id_account INTEGER NOT NULL REFERENCES acc_accounts (id), -- N° du compte dans le plan comptable

    credit INTEGER NOT NULL,
    debit INTEGER NOT NULL,

    reference TEXT NULL, -- Référence de paiement, eg. numéro de chèque
    label TEXT NULL,

    reconcilied INTEGER NOT NULL DEFAULT 0,


    CONSTRAINT line_check1 CHECK ((credit * debit) = 0),
    CONSTRAINT line_check2 CHECK ((credit + debit) > 0)
);

CREATE INDEX IF NOT EXISTS acc_transactions_lines_account ON acc_transactions_lines (id_account);

Modified src/include/lib/Garradin/Entities/Accounting/Line.php from [90430b6221] to [3dc76458ae].

14
15
16
17
18
19
20
21
22
23
24
25

26
27
28
29
30
31
32
33
34

35
36
37
38
39
40
41
42
	protected $id_account;
	protected $credit = 0;
	protected $debit = 0;
	protected $payment_reference;
	protected $reconciled;

	protected $_types = [
		'id_transaction'    => 'int',
		'id_account'        => 'int',
		'credit'            => 'int',
		'debit'             => 'int',
		'payment_reference' => '?string',

		'reconcilied'       => 'int',
	];

	protected $_validation_rules = [
		'id_transaction'    => 'required|integer|in_table:acc_transactions,id',
		'id_account'        => 'required|integer|in_table:acc_accounts,id',
		'credit'            => 'required|integer|min:0',
		'debit'             => 'required|integer|min:0',
		'payment_reference' => 'string|max:200',

		'reconcilied'       => 'int|min:0|max:1',
	];

	public function filterUserValue(string $key, $value, array $source)
	{
		$value = parent::filterUserValue($key, $value);

		if ($key == 'credit' || $key == 'debit')







|
|
|
|
|
>
|



|
|
|
|
|
>
|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	protected $id_account;
	protected $credit = 0;
	protected $debit = 0;
	protected $payment_reference;
	protected $reconciled;

	protected $_types = [
		'id_transaction' => 'int',
		'id_account'     => 'int',
		'credit'         => 'int',
		'debit'          => 'int',
		'reference'      => '?string',
		'label'          => '?string',
		'reconcilied'    => 'int',
	];

	protected $_validation_rules = [
		'id_transaction' => 'required|integer|in_table:acc_transactions,id',
		'id_account'     => 'required|integer|in_table:acc_accounts,id',
		'credit'         => 'required|integer|min:0',
		'debit'          => 'required|integer|min:0',
		'reference'      => 'string|max:200',
		'label'          => 'string|max:200',
		'reconcilied'    => 'int|min:0|max:1',
	];

	public function filterUserValue(string $key, $value, array $source)
	{
		$value = parent::filterUserValue($key, $value);

		if ($key == 'credit' || $key == 'debit')