qq|ORDER BY c.accno|;
$sth = $dbh->prepare($query);
$sth->execute($form->{"tax_id_$i"}) || $form->dberror($query . " (" . $form->{"tax_id_$i"} . ")");
- ($form->{AP_amounts}{"tax_$i"}, $form->{"taxkey_$i"}, $form->{"taxrate_$i"}) =
- $sth->fetchrow_array;
- $form->{AP_amounts}{"tax_$i"}{taxkey} = $form->{"taxkey_$i"};
- $form->{AP_amounts}{"amount_$i"}{taxkey} = $form->{"taxkey_$i"};
+ ($form->{AP_amounts}{"tax_$i"}, $form->{"taxkey_$i"}, $form->{"taxrate_$i"}) = $sth->fetchrow_array();
$sth->finish;
if ($form->{taxincluded} *= 1) {
if ($form->{"amount_$i"} != 0) {
my $project_id;
$project_id = conv_i($form->{"project_id_$i"});
- $taxkey = $form->{AP_amounts}{"amount_$i"}{taxkey};
# insert detail records in acc_trans
$query =
qq| ?, ?, ?, ?)|;
@values = ($form->{id}, $form->{AP_amounts}{"amount_$i"},
$form->{"amount_$i"}, conv_date($form->{transdate}),
- $project_id, $taxkey);
+ $project_id, $form->{"taxkey_$i"});
do_query($form, $dbh, $query, @values);
if ($form->{"tax_$i"} != 0) {
qq| ?, ?, ?, ?)|;
@values = ($form->{id}, $form->{AP_amounts}{"tax_$i"},
$form->{"tax_$i"}, conv_date($form->{transdate}),
- $project_id, $taxkey);
+ $project_id, $form->{"taxkey_$i"});
do_query($form, $dbh, $query, @values);
}
$query = qq|SELECT c.accno, t.taxkey, t.rate FROM tax t LEFT JOIN chart c ON (c.id = t.chart_id) WHERE t.id = ? ORDER BY c.accno|;
($form->{AR_amounts}{"tax_$i"}, $form->{"taxkey_$i"}, $form->{"taxrate_$i"}) = selectrow_query($form, $dbh, $query, $form->{"tax_id_$i"});
- $form->{AR_amounts}{"tax_$i"}{taxkey} = $form->{"taxkey_$i"};
- $form->{AR_amounts}{"amounts_$i"}{taxkey} = $form->{"taxkey_$i"};
-
if ($form->{taxincluded} *= 1) {
$tax = $form->{"korrektur_$i"}
? $form->{"tax_$i"}
for $i (1 .. $form->{rowcount}) {
if ($form->{"amount_$i"} != 0) {
my $project_id = conv_i($form->{"project_id_$i"});
- $taxkey = $form->{AR_amounts}{"amounts_$i"}{taxkey};
# insert detail records in acc_trans
$query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey)
VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), ?, ?, ?, ?)|;
- @values = (conv_i($form->{id}), conv_i($form->{AR_amounts}{"amount_$i"}), conv_i($form->{"amount_$i"}), conv_date($form->{transdate}), $project_id, conv_i($taxkey));
+ @values = (conv_i($form->{id}), conv_i($form->{AR_amounts}{"amount_$i"}), conv_i($form->{"amount_$i"}), conv_date($form->{transdate}), $project_id,
+ conv_i($form->{"taxkey_$i"}));
do_query($form, $dbh, $query, @values);
if ($form->{"tax_$i"} != 0) {
# insert detail records in acc_trans
$query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey)
VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), ?, ?, ?, ?)|;
- @values = (conv_i($form->{id}), conv_i($form->{AR_amounts}{"tax_$i"}), conv_i($form->{"tax_$i"}), conv_date($form->{transdate}), $project_id, conv_i($taxkey));
+ @values = (conv_i($form->{id}), conv_i($form->{AR_amounts}{"tax_$i"}), conv_i($form->{"tax_$i"}), conv_date($form->{transdate}), $project_id,
+ conv_i($form->{"taxkey_$i"}));
do_query($form, $dbh, $query, @values);
}
}