Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a9a6bc13

Von Holger Lindemann vor fast 14 Jahren hinzugefügt

  • ID a9a6bc1311e57d4e902ecbf5df40174870c97c99
  • Vorgänger 60c0c579
  • Nachfolger 79398e65

Neuer MakeModel Satz mit Datum initialisieren

Unterschiede anzeigen:

SL/IC.pm
504 504
        $value = $form->parse_amount($myconfig, $form->{"lastcost_$i"});
505 505
        if ($value == $form->{"old_lastcost_$i"}) 
506 506
        {
507
            $lastupdate = $dbh->quote($form->{"lastupdate_$i"});
507
            if ($form->{"lastupdate_$i"} eq "") { 
508
                $lastupdate = 'now()';
509
            } else {
510
                $lastupdate = $dbh->quote($form->{"lastupdate_$i"});
511
            }
508 512
        } else {
509 513
            $lastupdate = 'now()';
510 514
        }
......
1467 1471

  
1468 1472
  $form->{ACCOUNT_CHAIN_BY_ID} ||= {
1469 1473
    map { $_->{id} => $_ }
1470
      selectall_hashref_query($form, $dbh, <<SQL) };
1471
    SELECT c.id, c.new_chart_id, ${transdate} >= c.valid_from AS is_valid, cnew.accno
1474
      selectall_hashref_query($form, $dbh, <<SQL, $transdate) };
1475
    SELECT c.id, c.new_chart_id, date(?) >= c.valid_from AS is_valid, cnew.accno
1472 1476
    FROM chart c
1473 1477
    LEFT JOIN chart cnew ON c.new_chart_id = cnew.id
1474 1478
    WHERE NOT c.new_chart_id IS NULL AND (c.new_chart_id > 0)
......
1518 1522
  if ($transdate eq "") {
1519 1523
    $transdate = "current_date";
1520 1524
  } else {
1521
    $transdate = 'date(' . $dbh->quote($transdate) . ')';
1525
    $transdate = $dbh->quote($transdate);
1522 1526
  }
1523 1527
  #/transdate
1524 1528
  my $inc_exp = $form->{"vc"} eq "customer" ? "income_accno_id" : "expense_accno_id";
......
1551 1555
    WHERE t.id IN
1552 1556
      (SELECT tk.tax_id
1553 1557
       FROM taxkeys tk
1554
       WHERE tk.chart_id = ? AND startdate <= ${transdate}
1558
       WHERE tk.chart_id = ? AND startdate <= ?
1555 1559
       ORDER BY startdate DESC LIMIT 1)
1556 1560
SQL
1557 1561

  
......
1569 1573

  
1570 1574
    $form->{"${_}_accno_$index"} = $accounts{"${_}_accno"} for qw(inventory income expense);
1571 1575

  
1572
    $sth_tax->execute($accounts{$inc_exp});
1576
    $sth_tax->execute($accounts{$inc_exp}, quote_db_date($transdate));
1573 1577
    $ref = $sth_tax->fetchrow_hashref or next;
1574 1578

  
1575 1579
    $form->{"taxaccounts_$index"} = $ref->{"accno"};

Auch abrufbar als: Unified diff