Skip to content

Commit

Permalink
1.8: Fix #5115 - Salesperson/Employee cannot save
Browse files Browse the repository at this point in the history
$form->{employee} only contain Entity Name and Entity Id from entity table. not username from user table.
Since entity id is already in the $form we don't need to run sub query that take entity from user table.
  • Loading branch information
aungzwin10 committed Sep 23, 2020
1 parent 1cd18a1 commit d6bbf0f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions old/lib/LedgerSMB/AA.pm
Expand Up @@ -330,8 +330,7 @@ sub post_transaction {
person_id, entity_credit_account, approved,
setting_sequence
)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
(SELECT u.entity_id FROM users u WHERE u.username = ?), ?, ?, ?)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
RETURNING id
|;
}
Expand All @@ -343,8 +342,7 @@ sub post_transaction {
notes, intnotes, ponumber, crdate, reverse,
person_id, entity_credit_account, approved
)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
(SELECT u.entity_id FROM users u WHERE u.username = ?), ?, ?)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
RETURNING id
|;
}
Expand All @@ -363,7 +361,7 @@ sub post_transaction {
$form->{duedate},
$form->{notes}, $form->{intnotes},
$form->{ponumber}, $form->{crdate},
$form->{reverse}, $form->{employee_name},
$form->{reverse}, $form->{employee_id},
$form->{"$form->{vc}_id"}, $form->{approved}
);
if ($table eq 'ar') {
Expand Down

0 comments on commit d6bbf0f

Please sign in to comment.