- $query = qq|UPDATE customer SET
- customernumber = '$form->{customernumber}',
- name = '$form->{name}',
- greeting = '$form->{greeting}',
- department_1 = '$form->{department_1}',
- department_2 = '$form->{department_2}',
- street = '$form->{street}',
- zipcode = '$form->{zipcode}',
- city = '$form->{city}',
- country = '$form->{country}',
- homepage = '$form->{homepage}',
- contact = '$form->{contact}',
- phone = '$form->{phone}',
- fax = '$form->{fax}',
- email = '$form->{email}',
- cc = '$form->{cc}',
- bcc = '$form->{bcc}',
- notes = '$form->{notes}',
- discount = $form->{discount},
- creditlimit = $form->{creditlimit},
- terms = $form->{terms},
- taxincluded = '$form->{taxincluded}',
- business_id = $form->{business},
- taxnumber = '$form->{taxnumber}',
- sic_code = '$form->{sic}',
- language = '$form->{language}',
- account_number = '$form->{account_number}',
- bank_code = '$form->{bank_code}',
- bank = '$form->{bank}',
- obsolete = '$form->{obsolete}',
- ustid = '$form->{ustid}',
- username = '$form->{username}',
- salesman_id = '$form->{salesman_id}',
- language_id = '$form->{language_id}',
- payment_id = '$form->{payment_id}',
- taxzone_id = '$form->{taxzone_id}',
- user_password = | . $dbh->quote($form->{user_password}) . qq|,
- c_vendor_id = '$form->{c_vendor_id}',
- klass = '$form->{klass}'
- WHERE id = $form->{id}|;
- $dbh->do($query) || $form->dberror($query);
-
- if ($form->{cp_id}) {
- $query = qq|UPDATE contacts SET
- cp_greeting = '$form->{cp_greeting}',
- cp_title = '$form->{cp_title}',
- cp_givenname = '$form->{cp_givenname}',
- cp_name = '$form->{cp_name}',
- cp_email = '$form->{cp_email}',
- cp_phone1 = '$form->{cp_phone1}',
- cp_phone2 = '$form->{cp_phone2}',
- cp_abteilung = | . $dbh->quote($form->{cp_abteilung}) . qq|,
- cp_fax = | . $dbh->quote($form->{cp_fax}) . qq|,
- cp_mobile1 = | . $dbh->quote($form->{cp_mobile1}) . qq|,
- cp_mobile2 = | . $dbh->quote($form->{cp_mobile2}) . qq|,
- cp_satphone = | . $dbh->quote($form->{cp_satphone}) . qq|,
- cp_satfax = | . $dbh->quote($form->{cp_satfax}) . qq|,
- cp_project = | . $dbh->quote($form->{cp_project}) . qq|,
- cp_privatphone = | . $dbh->quote($form->{cp_privatphone}) . qq|,
- cp_privatemail = | . $dbh->quote($form->{cp_privatemail}) . qq|,
- cp_birthday = | . $dbh->quote($form->{cp_birthday}) . qq|
- WHERE cp_id = $form->{cp_id}|;
- } elsif ($form->{cp_name} || $form->{cp_givenname}) {
+ $query = qq|UPDATE customer SET | .
+ qq|customernumber = ?, | .
+ qq|name = ?, | .
+ qq|greeting = ?, | .
+ qq|department_1 = ?, | .
+ qq|department_2 = ?, | .
+ qq|street = ?, | .
+ qq|zipcode = ?, | .
+ qq|city = ?, | .
+ qq|country = ?, | .
+ qq|homepage = ?, | .
+ qq|contact = ?, | .
+ qq|phone = ?, | .
+ qq|fax = ?, | .
+ qq|email = ?, | .
+ qq|cc = ?, | .
+ qq|bcc = ?, | .
+ qq|notes = ?, | .
+ qq|discount = ?, | .
+ qq|creditlimit = ?, | .
+ qq|terms = ?, | .
+ qq|business_id = ?, | .
+ qq|taxnumber = ?, | .
+ qq|language = ?, | .
+ qq|account_number = ?, | .
+ qq|bank_code = ?, | .
+ qq|bank = ?, | .
+ qq|iban = ?, | .
+ qq|bic = ?, | .
+ qq|obsolete = ?, | .
+ qq|direct_debit = ?, | .
+ qq|ustid = ?, | .
+ qq|username = ?, | .
+ qq|salesman_id = ?, | .
+ qq|language_id = ?, | .
+ qq|payment_id = ?, | .
+ qq|taxzone_id = ?, | .
+ qq|user_password = ?, | .
+ qq|c_vendor_id = ?, | .
+ qq|klass = ? | .
+ qq|WHERE id = ?|;
+ my @values = (
+ $form->{customernumber},
+ $form->{name},
+ $form->{greeting},
+ $form->{department_1},
+ $form->{department_2},
+ $form->{street},
+ $form->{zipcode},
+ $form->{city},
+ $form->{country},
+ $form->{homepage},
+ $form->{contact},
+ $form->{phone},
+ $form->{fax},
+ $form->{email},
+ $form->{cc},
+ $form->{bcc},
+ $form->{notes},
+ $form->{discount},
+ $form->{creditlimit},
+ conv_i($form->{terms}),
+ conv_i($form->{business}),
+ $form->{taxnumber},
+ $form->{language},
+ $form->{account_number},
+ $form->{bank_code},
+ $form->{bank},
+ $form->{iban},
+ $form->{bic},
+ $form->{obsolete} ? 't' : 'f',
+ $form->{direct_debit} ? 't' : 'f',
+ $form->{ustid},
+ $form->{username},
+ conv_i($form->{salesman_id}),
+ conv_i($form->{language_id}),
+ conv_i($form->{payment_id}),
+ conv_i($form->{taxzone_id}, 0),
+ $form->{user_password},
+ $form->{c_vendor_id},
+ conv_i($form->{klass}),
+ $form->{id}
+ );
+ do_query( $form, $dbh, $query, @values );
+
+ $query = undef;
+ if ( $form->{cp_id} ) {
+ $query = qq|UPDATE contacts SET | .
+ qq|cp_greeting = ?, | .
+ qq|cp_title = ?, | .
+ qq|cp_givenname = ?, | .
+ qq|cp_name = ?, | .
+ qq|cp_email = ?, | .
+ qq|cp_phone1 = ?, | .
+ qq|cp_phone2 = ?, | .
+ qq|cp_abteilung = ?, | .
+ qq|cp_fax = ?, | .
+ qq|cp_mobile1 = ?, | .
+ qq|cp_mobile2 = ?, | .
+ qq|cp_satphone = ?, | .
+ qq|cp_satfax = ?, | .
+ qq|cp_project = ?, | .
+ qq|cp_privatphone = ?, | .
+ qq|cp_privatemail = ?, | .
+ qq|cp_birthday = ? | .
+ qq|WHERE cp_id = ?|;
+ @values = (
+ $form->{cp_greeting},
+ $form->{cp_title},
+ $form->{cp_givenname},
+ $form->{cp_name},
+ $form->{cp_email},
+ $form->{cp_phone1},
+ $form->{cp_phone2},
+ $form->{cp_abteilung},
+ $form->{cp_fax},
+ $form->{cp_mobile1},
+ $form->{cp_mobile2},
+ $form->{cp_satphone},
+ $form->{cp_satfax},
+ $form->{cp_project},
+ $form->{cp_privatphone},
+ $form->{cp_privatemail},
+ $form->{cp_birthday},
+ $form->{cp_id}
+ );
+ } elsif ( $form->{cp_name} || $form->{cp_givenname} ) {