use SL::IO;
use SL::MoreCommon;
-use Data::Dumper;
-
use strict;
sub post_transaction {
(split(/--/, $form->{"AP_amount_$i"}))[0];
}
($form->{AP_amounts}{payables}) = split(/--/, $form->{APselected});
- ($form->{AP_payables}) = split(/--/, $form->{APselected});
+ ($form->{AP}{payables}) = split(/--/, $form->{APselected});
# reverse and parse amounts
for my $i (1 .. $form->{rowcount}) {
# get paid account
- ($form->{"AP_paid_account_$i"}) = split(/--/, $form->{"AP_paid_$i"});
+ ($form->{AP}{"paid_$i"}) = split(/--/, $form->{"AP_paid_$i"});
$form->{"datepaid_$i"} = $form->{transdate}
unless ($form->{"datepaid_$i"});
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey) | .
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, | .
qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|;
- @values = ($form->{id}, $form->{AP_payables}, $amount,
+ @values = ($form->{id}, $form->{AP}{payables}, $amount,
conv_date($form->{"datepaid_$i"}), $project_id,
- $form->{AP_payables});
+ $form->{AP}{payables});
do_query($form, $dbh, $query, @values);
}
$form->{payables} = $amount;
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, memo, project_id, taxkey) | .
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, | .
qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|;
- @values = ($form->{id}, $form->{"AP_paid_account_$i"}, $form->{"paid_$i"},
+ @values = ($form->{id}, $form->{AP}{"paid_$i"}, $form->{"paid_$i"},
conv_date($form->{"datepaid_$i"}), $form->{"source_$i"},
- $form->{"memo_$i"}, $project_id, $form->{"AP_paid_account_$i"});
+ $form->{"memo_$i"}, $project_id, $form->{AP}{"paid_$i"});
do_query($form, $dbh, $query, @values);
# add exchange rate difference
qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey) | .
qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, | .
qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|;
- @values = ($form->{id}, $form->{"AP_paid_account_$i"}, $amount,
+ @values = ($form->{id}, $form->{AP}{"paid_$i"}, $amount,
conv_date($form->{"datepaid_$i"}), $project_id,
- $form->{"AP_paid_account_$i"});
+ $form->{AP}{"paid_$i"});
do_query($form, $dbh, $query, @values);
}