qq|INSERT INTO acc_trans | .
qq| (trans_id, chart_id, amount, transdate, project_id, taxkey, tax_id)| .
qq|VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), | .
- qq| ?, ?, ?, ?, (SELECT tax_id FROM taxkeys WHERE taxkey_id= (SELECT taxkey_id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|;
+ qq| ?, ?, ?, ?, ?)|;
@values = ($form->{id}, $form->{AP_amounts}{"amount_$i"},
$form->{"amount_$i"}, conv_date($form->{transdate}),
- $project_id, $form->{"taxkey_$i"}, $form->{AP_amounts}{"amount_$i"}, conv_date($form->{transdate}));
+ $project_id, $form->{"taxkey_$i"}, conv_i($form->{"tax_id_$i"}));
do_query($form, $dbh, $query, @values);
if ($form->{"tax_$i"} != 0) {
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, | .
qq| project_id, taxkey, tax_id) | .
qq|VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), | .
- qq| ?, ?, ?, ?, (SELECT tax_id FROM taxkeys WHERE taxkey_id= (SELECT taxkey_id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|;
+ qq| ?, ?, ?, ?, ?)|;
@values = ($form->{id}, $form->{AP_amounts}{"tax_$i"},
$form->{"tax_$i"}, conv_date($form->{transdate}),
- $project_id, $form->{"taxkey_$i"}, $form->{AP_amounts}{"tax_$i"}, conv_date($form->{transdate}));
+ $project_id, $form->{"taxkey_$i"}, conv_i($form->{"tax_id_$i"}));
do_query($form, $dbh, $query, @values);
}