$query = qq|UPDATE ap SET invnumber = ?,
transdate = ?, ordnumber = ?, vendor_id = ?, taxincluded = ?,
- amount = ?, duedate = ?, paid = ?, netamount = ?,
+ amount = ?, duedate = ?, deliverydate = ?, paid = ?, netamount = ?,
currency_id = (SELECT id FROM currencies WHERE name = ?), notes = ?, department_id = ?, storno = ?, storno_id = ?,
globalproject_id = ?, direct_debit = ?
WHERE id = ?|;
@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},
- $form->{netamount},
+ conv_date($form->{duedate}), conv_date($form->{deliverydate}),
+ $form->{invpaid}, $form->{netamount},
$form->{currency}, $form->{notes},
conv_i($form->{department_id}), $form->{storno},
$form->{storno_id}, conv_i($form->{globalproject_id}),
$query =
qq|UPDATE ar set
invnumber = ?, ordnumber = ?, transdate = ?, customer_id = ?,
- taxincluded = ?, amount = ?, duedate = ?, paid = ?,
+ taxincluded = ?, amount = ?, duedate = ?, deliverydate = ?, paid = ?,
currency_id = (SELECT id FROM currencies WHERE name = ?),
netamount = ?, notes = ?, department_id = ?,
employee_id = ?, storno = ?, storno_id = ?, globalproject_id = ?,
direct_debit = ?
WHERE id = ?|;
my @values = ($form->{invnumber}, $form->{ordnumber}, conv_date($form->{transdate}), conv_i($form->{customer_id}), $form->{taxincluded} ? 't' : 'f', $form->{amount},
- conv_date($form->{duedate}), $form->{paid},
+ conv_date($form->{duedate}), conv_date($form->{deliverydate}), $form->{paid},
$form->{currency},
$form->{netamount}, $form->{notes}, conv_i($form->{department_id}),
conv_i($form->{employee_id}), $form->{storno} ? 't' : 'f', $form->{storno_id},
if ($self->{id}) {
$query =
qq|SELECT
- a.cp_id, a.invnumber, a.transdate, a.${table}_id, a.datepaid,
+ a.cp_id, a.invnumber, a.transdate, a.${table}_id, a.datepaid, a.deliverydate,
a.duedate, a.ordnumber, a.taxincluded, (SELECT cu.name FROM currencies cu WHERE cu.id=a.currency_id) AS currency, a.notes,
a.mtime, a.itime,
a.intnotes, a.department_id, a.amount AS oldinvtotal,
$::form->{transdate} = $today->to_kivitendo;
$::form->{duedate} = $today->to_kivitendo;
$::form->{duedate} = $order->payment_terms->calc_date(reference_date => $today)->to_kivitendo if $order->payment_terms;
+ $::form->{deliverydate} = $order->reqdate->to_kivitendo if $order->reqdate;
create_links();
my $config_po_ap_workflow_chart_id = $::instance_conf->get_workflow_po_ap_chart_id;
<th align="right" nowrap>[% 'Due Date' | $T8 %]</th>
<td>[% L.date_tag('duedate', duedate) %]</td>
</tr>
+ <tr>
+ <th align=right nowrap>[% 'Delivery Date' | $T8 %]</th>
+ <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
+ </tr>
<tr>
<th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
<td>
<th align=right nowrap>[% 'Due Date' | $T8 %]</th>
<td>[% L.date_tag('duedate', duedate) %]</td>
</tr>
+ <tr>
+ <th align=right nowrap>[% 'Delivery Date' | $T8 %]</th>
+ <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
+ </tr>
<tr>
<th align=right nowrap>[% 'Project Number' | $T8 %]</th>
<td>[% L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = 1, onChange = "document.getElementById('update_button').click();") %]</td>