Revision d331a3d7
Von Niclas Zimmermann vor mehr als 11 Jahren hinzugefügt
SL/OE.pm | ||
---|---|---|
311 | 311 |
$query = qq|SELECT nextval('id')|; |
312 | 312 |
($form->{id}) = selectrow_query($form, $dbh, $query); |
313 | 313 |
|
314 |
$query = qq|INSERT INTO oe (id, ordnumber, employee_id) VALUES (?, '', ?)|;
|
|
314 |
$query = qq|INSERT INTO oe (id, ordnumber, employee_id, curr) VALUES (?, '', ?, (SELECT curr FROM defaults))|;
|
|
315 | 315 |
do_query($form, $dbh, $query, $form->{id}, $form->{employee_id}); |
316 | 316 |
} |
317 | 317 |
|
... | ... | |
494 | 494 |
qq|UPDATE oe SET |
495 | 495 |
ordnumber = ?, quonumber = ?, cusordnumber = ?, transdate = ?, vendor_id = ?, |
496 | 496 |
customer_id = ?, amount = ?, netamount = ?, reqdate = ?, taxincluded = ?, |
497 |
shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, curr = ?, closed = ?,
|
|
497 |
shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, curr = (SELECT id FROM currencies WHERE curr=?), closed = ?,
|
|
498 | 498 |
delivered = ?, proforma = ?, quotation = ?, department_id = ?, language_id = ?, |
499 | 499 |
taxzone_id = ?, shipto_id = ?, payment_id = ?, delivery_vendor_id = ?, delivery_customer_id = ?, |
500 | 500 |
globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?, marge_total = ?, marge_percent = ? |
... | ... | |
506 | 506 |
$amount, $netamount, conv_date($reqdate), |
507 | 507 |
$form->{taxincluded} ? 't' : 'f', $form->{shippingpoint}, |
508 | 508 |
$form->{shipvia}, $form->{notes}, $form->{intnotes}, |
509 |
substr($form->{currency}, 0, 3), $form->{closed} ? 't' : 'f',
|
|
509 |
$form->{currency}, $form->{closed} ? 't' : 'f',
|
|
510 | 510 |
$form->{delivered} ? "t" : "f", $form->{proforma} ? 't' : 'f', |
511 | 511 |
$quotation, conv_i($form->{department_id}), |
512 | 512 |
conv_i($form->{language_id}), conv_i($form->{taxzone_id}), |
... | ... | |
759 | 759 |
(SELECT c.accno FROM chart c WHERE d.income_accno_id = c.id) AS income_accno, |
760 | 760 |
(SELECT c.accno FROM chart c WHERE d.expense_accno_id = c.id) AS expense_accno, |
761 | 761 |
(SELECT c.accno FROM chart c WHERE d.fxgain_accno_id = c.id) AS fxgain_accno, |
762 |
(SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id) AS fxloss_accno, |
|
763 |
d.curr AS currencies |
|
762 |
(SELECT c.accno FROM chart c WHERE d.fxloss_accno_id = c.id) AS fxloss_accno |
|
764 | 763 |
$query_add |
765 | 764 |
FROM defaults d|; |
766 | 765 |
my $ref = selectfirst_hashref_query($form, $dbh, $query); |
767 | 766 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
768 | 767 |
|
769 |
($form->{currency}) = split(/:/, $form->{currencies}) unless ($form->{currency});
|
|
768 |
$form->{currency} = $form->get_default_currency($myconfig);
|
|
770 | 769 |
|
771 | 770 |
# set reqdate if this is an invoice->order conversion. If someone knows a better check to ensure |
772 | 771 |
# we come from invoices, feel free. |
... | ... | |
785 | 784 |
$query = |
786 | 785 |
qq|SELECT o.cp_id, o.ordnumber, o.transdate, o.reqdate, |
787 | 786 |
o.taxincluded, o.shippingpoint, o.shipvia, o.notes, o.intnotes, |
788 |
o.curr AS currency, e.name AS employee, o.employee_id, o.salesman_id,
|
|
787 |
(SELECT cu.curr FROM currencies cu WHERE cu.id=o.curr) AS currency, e.name AS employee, o.employee_id, o.salesman_id,
|
|
789 | 788 |
o.${vc}_id, cv.name AS ${vc}, o.amount AS invtotal, |
790 | 789 |
o.closed, o.reqdate, o.quonumber, o.department_id, o.cusordnumber, |
791 | 790 |
d.description AS department, o.payment_id, o.language_id, o.taxzone_id, |
... | ... | |
807 | 806 |
if ($ref) { |
808 | 807 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
809 | 808 |
|
810 |
# remove any trailing whitespace |
|
811 |
$form->{currency} =~ s/\s*$//; |
|
812 |
|
|
813 | 809 |
$form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber"}; |
814 | 810 |
|
815 | 811 |
# set all entries for multiple ids blank that yield different information |
Auch abrufbar als: Unified diff
Nutzung der Tabelle currencies
Dieser Commmit passt den Code an, um die Tabelle currencies zu nutzen.