Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6216f7b5

Von Moritz Bunkus vor etwa 17 Jahren hinzugefügt

  • ID 6216f7b53a81a73641a2d98ea43f363b6a615b07
  • Vorgänger 1aa5ac26
  • Nachfolger f06a2509

Die Variable "ranking" für Zahlungsbedinungen konnte nirgends konfiguriert werden. Zusätzlich werden beim Wechsel des Kunden in einer Verkaufsmaske die beim Kunden hinterlegten Zahlungsbedingungen immer ausgewählt, nicht nur dann, wenn vorher keine ausgewählt waren.

Unterschiede anzeigen:

SL/AM.pm
1336 1336

  
1337 1337
  $query = qq|UPDATE payment_terms SET
1338 1338
              description = ?, description_long = ?,
1339
              ranking = ?,
1340 1339
              terms_netto = ?, terms_skonto = ?,
1341 1340
              percent_skonto = ?
1342 1341
              WHERE id = ?|;
1343 1342
  my @values = ($form->{description}, $form->{description_long},
1344
                $form->{ranking} * 1,
1345 1343
                $form->{terms_netto} * 1, $form->{terms_skonto} * 1,
1346 1344
                $form->{percent_skonto} * 1,
1347 1345
                $form->{id});
SL/IS.pm
1518 1518
  $query =
1519 1519
    qq|SELECT
1520 1520
         c.name AS customer, c.discount, c.creditlimit, c.terms,
1521
         c.email, c.cc, c.bcc, c.language_id, c.payment_id AS customer_payment_id,
1521
         c.email, c.cc, c.bcc, c.language_id, c.payment_id,
1522 1522
         c.street, c.zipcode, c.city, c.country,
1523 1523
         c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id,
1524 1524
         $duedate + COALESCE(pt.terms_netto, 0) AS duedate,
......
1550 1550
  $ref = selectfirst_hashref_query($form, $dbh, $query, $cid);
1551 1551
  map { $form->{$_} = $ref->{$_} } keys %$ref;
1552 1552

  
1553
  #check whether payment_terms are better than old payment_terms
1554
  if (($form->{payment_id} ne "") && ($form->{customer_payment_id} ne "")) {
1555
    $query =
1556
      qq|SELECT
1557
          (SELECT ranking FROM payment_terms WHERE id = ?),
1558
          (SELECT ranking FROM payment_terms WHERE id = ?)|;
1559
    my ($old_ranking, $new_ranking)
1560
      = selectrow_query($form, $dbh, $query, conv_i($form->{payment_id}), conv_i($form->{customer_payment_id}));
1561
    if ($new_ranking > $old_ranking) {
1562
      $form->{payment_id} = $form->{customer_payment_id};
1563
    }
1564
  }
1565

  
1566
  if ($form->{payment_id} eq "") {
1567
    $form->{payment_id} = $form->{customer_payment_id};
1568
  }
1569

  
1570 1553
  $form->{creditremaining} = $form->{creditlimit};
1571 1554
  $query = qq|SELECT SUM(amount - paid) FROM ar WHERE customer_id = ?|;
1572 1555
  my ($value) = selectrow_query($form, $dbh, $query, $cid);
......
1755 1738
      }
1756 1739
    }
1757 1740

  
1758
    #check whether payment_terms are better than old payment_terms
1759
    if (($form->{payment_id} ne "") && ($form->{part_payment_id} ne "")) {
1760
      $query =
1761
        qq|SELECT
1762
            (SELECT ranking FROM payment_terms WHERE id = ?),
1763
            (SELECT ranking FROM payment_terms WHERE id = ?)|;
1764
      my ($old_ranking, $new_ranking)
1765
        = selectrow_query($form, $dbh, $query, conv_i($form->{payment_id}), conv_i($form->{part_payment_id}));
1766
      if ($new_ranking > $old_ranking) {
1767
        $form->{payment_id} = $form->{customer_payment_id};
1768
      }
1769
    }
1770

  
1771 1741
    if ($form->{payment_id} eq "") {
1772 1742
      $form->{payment_id} = $form->{part_payment_id};
1773 1743
    }

Auch abrufbar als: Unified diff