my $datepaid = ($form->{invpaid} != 0) ? $form->{datepaid} : undef;
$query = qq|UPDATE ap SET
- invnumber = ?,
- transdate = ?,
- ordnumber = ?,
- vendor_id = ?,
- taxincluded = ?,
- amount = ?,
- duedate = ?,
- paid = ?,
- datepaid = ?,
- netamount = ?,
- curr = ?,
- notes = ?,
- department_id = ?
- WHERE id = ?|;
+ invnumber = ?, transdate = ?, ordnumber = ?, vendor_id = ?, taxincluded = ?,
+ amount = ?, duedate = ?, paid = ?, datepaid = ?, netamount = ?,
+ curr = ?, notes = ?, department_id = ?, storno = ?, storno_id = ?
+ WHERE id = ?|;
my @values = ($form->{invnumber}, conv_date($form->{transdate}),
$form->{ordnumber}, conv_i($form->{vendor_id}),
$form->{taxincluded} ? 't' : 'f', $form->{invtotal},
conv_date($form->{duedate}), $form->{invpaid},
conv_date($datepaid), $form->{netamount},
$form->{currency}, $form->{notes},
- conv_i($form->{department_id}), $form->{id});
+ conv_i($form->{department_id}), $form->{storno},
+ $form->{storno_id}, $form->{id});
do_query($form, $dbh, $query, @values);
# update exchangerate