Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9557707c

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 9557707c3a18daeb9371f2366b8637a7e1f0fa3c
  • Vorgänger c1a8c632
  • Nachfolger ae27679f

Revert "Nutzung der Tabelle currencies"

This reverts commit be776964b83340e69fa2f02eae59b703c0c95b88.

Unterschiede anzeigen:

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, curr) VALUES (?, '', ?, (SELECT curr FROM defaults))|;
314
    $query = qq|INSERT INTO oe (id, ordnumber, employee_id) VALUES (?, '', ?)|;
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 = (SELECT id FROM currencies WHERE curr=?), closed = ?,
497
         shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, 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
             $form->{currency}, $form->{closed} ? 't' : 'f',
509
             substr($form->{currency}, 0, 3), $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
762
                     (SELECT c.accno FROM chart c WHERE d.fxloss_accno_id    = c.id) AS fxloss_accno,
763
              d.curr AS currencies
763 764
              $query_add
764 765
              FROM defaults d|;
765 766
  my $ref = selectfirst_hashref_query($form, $dbh, $query);
766 767
  map { $form->{$_} = $ref->{$_} } keys %$ref;
767 768

  
768
  $form->{currency} = $form->get_default_currency($myconfig);
769
  ($form->{currency}) = split(/:/, $form->{currencies}) unless ($form->{currency});
769 770

  
770 771
  # set reqdate if this is an invoice->order conversion. If someone knows a better check to ensure
771 772
  # we come from invoices, feel free.
......
784 785
    $query =
785 786
      qq|SELECT o.cp_id, o.ordnumber, o.transdate, o.reqdate,
786 787
           o.taxincluded, o.shippingpoint, o.shipvia, o.notes, o.intnotes,
787
           (SELECT cu.curr FROM currencies cu WHERE cu.id=o.curr) AS currency, e.name AS employee, o.employee_id, o.salesman_id,
788
           o.curr AS currency, e.name AS employee, o.employee_id, o.salesman_id,
788 789
           o.${vc}_id, cv.name AS ${vc}, o.amount AS invtotal,
789 790
           o.closed, o.reqdate, o.quonumber, o.department_id, o.cusordnumber,
790 791
           d.description AS department, o.payment_id, o.language_id, o.taxzone_id,
......
806 807
    if ($ref) {
807 808
      map { $form->{$_} = $ref->{$_} } keys %$ref;
808 809

  
810
      # remove any trailing whitespace
811
      $form->{currency} =~ s/\s*$//;
812

  
809 813
      $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber"};
810 814

  
811 815
      # set all entries for multiple ids blank that yield different information

Auch abrufbar als: Unified diff