- $query = qq|UPDATE oe set
- ordnumber = '$form->{ordnumber}',
- quonumber = '$form->{quonumber}',
- cusordnumber = '$form->{cusordnumber}',
- transdate = '$form->{transdate}',
- vendor_id = $form->{vendor_id},
- customer_id = $form->{customer_id},
- amount = $amount,
- netamount = $netamount,
- reqdate = $reqdate,
- taxincluded = '$form->{taxincluded}',
- shippingpoint = '$form->{shippingpoint}',
- shipvia = '$form->{shipvia}',
- notes = '$form->{notes}',
- intnotes = '$form->{intnotes}',
- curr = '$form->{currency}',
- closed = '$form->{closed}',
- quotation = '$quotation',
- department_id = $form->{department_id},
- employee_id = $form->{employee_id},
- cp_id = $form->{contact_id}
- WHERE id = $form->{id}|;
- $dbh->do($query) || $form->dberror($query);
+ $query =
+ qq|UPDATE oe SET
+ ordnumber = ?, quonumber = ?, cusordnumber = ?, transdate = ?, vendor_id = ?,
+ customer_id = ?, amount = ?, netamount = ?, reqdate = ?, taxincluded = ?,
+ shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, currency_id = (SELECT id FROM currencies WHERE name=?), closed = ?,
+ delivered = ?, proforma = ?, quotation = ?, department_id = ?, language_id = ?,
+ taxzone_id = ?, shipto_id = ?, payment_id = ?, delivery_vendor_id = ?, delivery_customer_id = ?,delivery_term_id = ?,
+ globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?, marge_total = ?, marge_percent = ?
+ , order_probability = ?, expected_billing_date = ?
+ WHERE id = ?|;
+
+ @values = ($form->{ordnumber} || '', $form->{quonumber},
+ $form->{cusordnumber}, conv_date($form->{transdate}),
+ conv_i($form->{vendor_id}), conv_i($form->{customer_id}),
+ $amount, $netamount, conv_date($reqdate),
+ $form->{taxincluded} ? 't' : 'f', $form->{shippingpoint},
+ $form->{shipvia}, $restricter->process($form->{notes}), $form->{intnotes},
+ $form->{currency}, $form->{closed} ? 't' : 'f',
+ $form->{delivered} ? "t" : "f", $form->{proforma} ? 't' : 'f',
+ $quotation, conv_i($form->{department_id}),
+ conv_i($form->{language_id}), conv_i($form->{taxzone_id}),
+ conv_i($form->{shipto_id}), conv_i($form->{payment_id}),
+ conv_i($form->{delivery_vendor_id}),
+ conv_i($form->{delivery_customer_id}),
+ conv_i($form->{delivery_term_id}),
+ conv_i($form->{globalproject_id}), conv_i($form->{employee_id}),
+ conv_i($form->{salesman_id}), conv_i($form->{cp_id}),
+ $form->{transaction_description},
+ $form->{marge_total} * 1, $form->{marge_percent} * 1,
+ $form->{order_probability} * 1, conv_date($form->{expected_billing_date}),
+ conv_i($form->{id}));
+ do_query($form, $dbh, $query, @values);
+
+ $form->new_lastmtime('oe');