Revision 6cdecee0
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
SL/OE.pm | ||
---|---|---|
215 | 215 |
do_query($form, $dbh, $query, $form->{id}, $form->{employee_id}); |
216 | 216 |
} |
217 | 217 |
|
218 |
my $amount; |
|
219 |
my $linetotal; |
|
220 |
my $discount; |
|
218 |
my $amount = 0;
|
|
219 |
my $linetotal = 0;
|
|
220 |
my $discount = 0;
|
|
221 | 221 |
my $project_id; |
222 | 222 |
my $reqdate; |
223 | 223 |
my $taxrate; |
224 |
my $taxamount; |
|
224 |
my $taxamount = 0;
|
|
225 | 225 |
my $fxsellprice; |
226 | 226 |
my %taxbase; |
227 | 227 |
my @taxaccounts; |
... | ... | |
330 | 330 |
# get pricegroup_id and save ist |
331 | 331 |
($null, my $pricegroup_id) = split(/--/, $form->{"sellprice_pg_$i"}); |
332 | 332 |
$pricegroup_id *= 1; |
333 |
$subtotal = $form->{"subtotal_$i"} * 1; |
|
334 | 333 |
|
335 | 334 |
# save detail record in orderitems table |
336 | 335 |
@values = (); |
... | ... | |
356 | 355 |
$form->{"unit_$i"}, conv_date($reqdate), conv_i($form->{"project_id_$i"}), |
357 | 356 |
$form->{"serialnumber_$i"}, $form->{"ship_$i"}, conv_i($pricegroup_id), |
358 | 357 |
$form->{"ordnumber_$i"}, conv_date($form->{"transdate_$i"}), |
359 |
$form->{"cusordnumber_$i"}, $subtotal,
|
|
358 |
$form->{"cusordnumber_$i"}, $form->{"subtotal_$i"} ? 't' : 'f',
|
|
360 | 359 |
$form->{"marge_percent_$i"}, $form->{"marge_absolut_$i"}, |
361 | 360 |
$form->{"lastcost_$i"}); |
362 | 361 |
do_query($form, $dbh, $query, @values); |
... | ... | |
394 | 393 |
|
395 | 394 |
# fill in subject if there is none |
396 | 395 |
if ($form->{type} =~ /_order$/) { |
397 |
$quotation = '0';
|
|
396 |
$quotation = 't';
|
|
398 | 397 |
$form->{subject} = qq|$form->{label} $form->{ordnumber}| |
399 | 398 |
unless $form->{subject}; |
400 | 399 |
} else { |
401 |
$quotation = '1';
|
|
400 |
$quotation = 'f';
|
|
402 | 401 |
$form->{subject} = qq|$form->{label} $form->{quonumber}| |
403 | 402 |
unless $form->{subject}; |
404 | 403 |
} |
... | ... | |
421 | 420 |
|
422 | 421 |
# save OE record |
423 | 422 |
$query = |
424 |
qq|UPDATE oe set | .
|
|
425 |
qq|ordnumber = ?, quonumber = ?, cusordnumber = ?, transdate = ?, vendor_id = ?, | .
|
|
426 |
qq|customer_id = ?, amount = ?, netamount = ?, reqdate = ?, taxincluded = ?, | .
|
|
427 |
qq|shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, curr = ?, closed = ?, | .
|
|
428 |
qq|delivered = ?, proforma = ?, quotation = ?, department_id = ?, language_id = ?, | .
|
|
429 |
qq|taxzone_id = ?, shipto_id = ?, payment_id = ?, delivery_vendor_id = ?, delivery_customer_id = ?, | .
|
|
430 |
qq|globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?, marge_total = ?, marge_percent = ?| .
|
|
431 |
qq|WHERE id = ?|;
|
|
423 |
qq|UPDATE oe SET
|
|
424 |
ordnumber = ?, quonumber = ?, cusordnumber = ?, transdate = ?, vendor_id = ?,
|
|
425 |
customer_id = ?, amount = ?, netamount = ?, reqdate = ?, taxincluded = ?,
|
|
426 |
shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, curr = ?, closed = ?,
|
|
427 |
delivered = ?, proforma = ?, quotation = ?, department_id = ?, language_id = ?,
|
|
428 |
taxzone_id = ?, shipto_id = ?, payment_id = ?, delivery_vendor_id = ?, delivery_customer_id = ?,
|
|
429 |
globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?, marge_total = ?, marge_percent = ?
|
|
430 |
WHERE id = ?|;
|
|
432 | 431 |
|
433 | 432 |
@values = ($form->{ordnumber}, $form->{quonumber}, |
434 | 433 |
$form->{cusordnumber}, conv_date($form->{transdate}), |
... | ... | |
436 | 435 |
$amount, $netamount, conv_date($reqdate), |
437 | 436 |
$form->{taxincluded} ? 't' : 'f', $form->{shippingpoint}, |
438 | 437 |
$form->{shipvia}, $form->{notes}, $form->{intnotes}, |
439 |
$form->{currency}, $form->{closed} ? 't' : 'f',
|
|
438 |
substr($form->{currency}, 0, 3), $form->{closed} ? 't' : 'f',
|
|
440 | 439 |
$form->{delivered} ? "t" : "f", $form->{proforma} ? 't' : 'f', |
441 | 440 |
$quotation, conv_i($form->{department_id}), |
442 | 441 |
conv_i($form->{language_id}), conv_i($form->{taxzone_id}), |
... | ... | |
446 | 445 |
conv_i($form->{globalproject_id}), conv_i($form->{employee_id}), |
447 | 446 |
conv_i($form->{salesman_id}), conv_i($form->{cp_id}), |
448 | 447 |
$form->{transaction_description}, |
449 |
$form->{marge_total}, $form->{marge_percent},
|
|
448 |
$form->{marge_total} * 1, $form->{marge_percent} * 1,
|
|
450 | 449 |
conv_i($form->{id})); |
451 | 450 |
do_query($form, $dbh, $query, @values); |
452 | 451 |
|
Auch abrufbar als: Unified diff
Bei boolean-Spalten lieber 't' und 'f' als 1 und 0 übergeben, weil wohl einige DBD::Pg-Versionen damit Probleme haben. Außerdem einige Integerwerte mit 0 initialisieren. Hoffentlich ein Bugfix für 703.