Skip to content

Commit 8e4dcea

Browse files
committed
Fix the BDD tests to post AR/AP items using open_item_id-s
1 parent 50a0610 commit 8e4dcea

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

xt/lib/Pherkin/Extension/ledgersmb_steps/common_steps.pl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,13 @@
213213
WHERE entity.name = ?
214214
AND entity_credit_account.entity_class = 1
215215
LIMIT 1
216-
RETURNING ap.id
216+
RETURNING ap.id, ap.open_item_id
217217
");
218218

219219
my $acc_trans_query = $dbh->prepare("
220220
INSERT INTO acc_trans (trans_id, chart_id, amount_bc,
221-
curr, amount_tc, transdate)
222-
VALUES (?, ?, ?, 'USD', ?, ?)
221+
curr, amount_tc, transdate, open_item_id)
222+
VALUES (?, ?, ?, 'USD', ?, ?, ?)
223223
");
224224

225225
foreach my $data (@{C->data}) {
@@ -240,14 +240,15 @@
240240
$data->{'Amount'},
241241
$data->{'Vendor'},
242242
);
243-
my $ap_id = $ap_query->fetchrow_hashref->{id};
243+
my ($ap_id, $open_item_id) = $ap_query->fetchrow_array;
244244

245245
$acc_trans_query->execute(
246246
$ap_id,
247247
28, # 5700--Office Supplies
248248
$data->{'Amount'} * -1,
249249
$data->{'Amount'} * -1,
250250
$data->{'Date'},
251+
undef,
251252
);
252253

253254
$acc_trans_query->execute(
@@ -256,6 +257,7 @@
256257
$data->{'Amount'},
257258
$data->{'Amount'},
258259
$data->{'Date'},
260+
$open_item_id,
259261
);
260262
}
261263
};

0 commit comments

Comments
 (0)