Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d7ee4bed

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID d7ee4bed6eb13c63bc359df124c11ee8e38f76a3
  • Vorgänger 27e3ec0d
  • Nachfolger 98b16fdb

Rechnungsbericht: Lieferadresse anzeigen und filtern

Unterschiede anzeigen:

SL/AR.pm
526 526
    qq|  tz.description AS taxzone, | .
527 527
    qq|  pt.description AS payment_terms, | .
528 528
    qq|  d.description AS department, | .
529
    qq|  s.shiptoname, s.shiptodepartment_1, s.shiptodepartment_2, | .
530
    qq|  s.shiptostreet, s.shiptozipcode, s.shiptocity, s.shiptocountry, | .
529 531
    qq{  ( SELECT ch.accno || ' -- ' || ch.description
530 532
           FROM acc_trans at
531 533
           LEFT JOIN chart ch ON ch.id = at.chart_id
......
543 545
    qq|LEFT JOIN tax_zones tz ON (tz.id = a.taxzone_id)| .
544 546
    qq|LEFT JOIN payment_terms pt ON (pt.id = a.payment_id)| .
545 547
    qq|LEFT JOIN business b ON (b.id = c.business_id)| .
548
    qq|LEFT JOIN shipto s ON (
549
        (a.shipto_id = s.shipto_id) or
550
        (a.id = s.trans_id and s.module = 'AR')
551
       )| .
546 552
    qq|LEFT JOIN department d ON (d.id = a.department_id)|;
547 553

  
548 554
  my $where = "1 = 1";
......
711 717
    $where .= ' AND COALESCE(paid_difference.amount, 0) + a.paid != 0';
712 718
  }
713 719

  
720
  if ($form->{shiptoname}) {
721
    $where .= " AND s.shiptoname ILIKE ?";
722
    push(@values, like($form->{shiptoname}));
723
  }
724
  if ($form->{shiptodepartment_1}) {
725
    $where .= " AND s.shiptodepartment_1 ILIKE ?";
726
    push(@values, like($form->{shiptodepartment_1}));
727
  }
728
  if ($form->{shiptodepartment_2}) {
729
    $where .= " AND s.shiptodepartment_2 ILIKE ?";
730
    push(@values, like($form->{shiptodepartment_2}));
731
  }
732
  if ($form->{shiptostreet}) {
733
    $where .= " AND s.shiptostreet ILIKE ?";
734
    push(@values, like($form->{shiptostreet}));
735
  }
736
  if ($form->{shiptozipcode}) {
737
    $where .= " AND s.shiptozipcode ILIKE ?";
738
    push(@values, like($form->{shiptozipcode}));
739
  }
740
  if ($form->{shiptocity}) {
741
    $where .= " AND s.shiptocity ILIKE ?";
742
    push(@values, like($form->{shiptocity}));
743
  }
744
  if ($form->{shiptocountry}) {
745
    $where .= " AND s.shiptocountry ILIKE ?";
746
    push(@values, like($form->{shiptocountry}));
747
  }
748

  
714 749
  my ($cvar_where, @cvar_values) = CVar->build_filter_query('module'         => 'CT',
715 750
                                                            'trans_id_field' => 'c.id',
716 751
                                                            'filter'         => $form,

Auch abrufbar als: Unified diff