Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c6867c46

Von Bernd Blessmann vor mehr als 14 Jahren hinzugefügt

  • ID c6867c462780a8747912dc0aab701f43e39ef1cb
  • Vorgänger f24968aa
  • Nachfolger 4c6a0cbb

Projektbeschreibung als Variable in Vorlagen
(globalprojectdescription und projectdescription)

Unterschiede anzeigen:

SL/DO.pm
740 740
  my %oid = ('Pg'     => 'oid',
741 741
             'Oracle' => 'rowid');
742 742

  
743
  my (@project_ids, %projectnumbers);
743
  my (@project_ids, %projectnumbers, %projectdescriptions);
744 744

  
745 745
  push(@project_ids, $form->{"globalproject_id"}) if ($form->{"globalproject_id"});
746 746

  
......
755 755
  }
756 756

  
757 757
  if (@project_ids) {
758
    $query = "SELECT id, projectnumber FROM project WHERE id IN (" .
758
    $query = "SELECT id, projectnumber, description FROM project WHERE id IN (" .
759 759
      join(", ", map("?", @project_ids)) . ")";
760 760
    $sth = prepare_execute_query($form, $dbh, $query, @project_ids);
761 761
    while (my $ref = $sth->fetchrow_hashref()) {
762 762
      $projectnumbers{$ref->{id}} = $ref->{projectnumber};
763
      $projectdescriptions{$ref->{id}} = $ref->{description};
763 764
    }
764 765
    $sth->finish();
765 766
  }
766 767

  
767 768
  $form->{"globalprojectnumber"} =
768 769
    $projectnumbers{$form->{"globalproject_id"}};
770
  $form->{"globalprojectdescription"} =
771
      $projectdescriptions{$form->{"globalproject_id"}};
769 772

  
770 773
  my $q_pg     = qq|SELECT p.partnumber, p.description, p.unit, a.qty, pg.partsgroup
771 774
                    FROM assembly a
......
790 793

  
791 794
  my @arrays =
792 795
    qw(runningnumber number description longdescription qty unit
793
       partnotes serialnumber reqdate projectnumber
796
       partnotes serialnumber reqdate projectnumber projectdescription
794 797
       si_runningnumber si_number si_description
795 798
       si_warehouse si_bin si_chargenumber si_bestbefore si_qty si_unit);
796 799

  
......
832 835
    push @{ $form->{TEMPLATE_ARRAYS}{serialnumber} },    $form->{"serialnumber_$i"};
833 836
    push @{ $form->{TEMPLATE_ARRAYS}{reqdate} },         $form->{"reqdate_$i"};
834 837
    push @{ $form->{TEMPLATE_ARRAYS}{projectnumber} },   $projectnumbers{$form->{"project_id_$i"}};
838
    push @{ $form->{TEMPLATE_ARRAYS}{projectdescription} },
839
      $projectdescriptions{$form->{"project_id_$i"}};
835 840

  
836 841
    if ($form->{"assembly_$i"}) {
837 842
      $sameitem = "";
SL/IS.pm
64 64
  my $query = qq|SELECT date | . conv_dateq($form->{duedate}) . qq| - date | . conv_dateq($form->{invdate}) . qq| AS terms|;
65 65
  ($form->{terms}) = selectrow_query($form, $dbh, $query);
66 66

  
67
  my (@project_ids, %projectnumbers);
67
  my (@project_ids, %projectnumbers, %projectdescriptions);
68 68
  $form->{TEMPLATE_ARRAYS} = {};
69 69

  
70 70
  push(@project_ids, $form->{"globalproject_id"}) if ($form->{"globalproject_id"});
......
89 89
  }
90 90

  
91 91
  if (@project_ids) {
92
    $query = "SELECT id, projectnumber FROM project WHERE id IN (" .
92
    $query = "SELECT id, projectnumber, description FROM project WHERE id IN (" .
93 93
      join(", ", map({ "?" } @project_ids)) . ")";
94 94
    $sth = $dbh->prepare($query);
95 95
    $sth->execute(@project_ids) ||
96 96
      $form->dberror($query . " (" . join(", ", @project_ids) . ")");
97 97
    while (my $ref = $sth->fetchrow_hashref()) {
98 98
      $projectnumbers{$ref->{id}} = $ref->{projectnumber};
99
      $projectdescriptions{$ref->{id}} = $ref->{description};
99 100
    }
100 101
    $sth->finish();
101 102
  }
102 103

  
103 104
  $form->{"globalprojectnumber"} =
104 105
    $projectnumbers{$form->{"globalproject_id"}};
106
  $form->{"globalprojectdescription"} =
107
    $projectdescriptions{$form->{"globalproject_id"}};
105 108

  
106 109
  my $tax = 0;
107 110
  my $item;
......
147 150
       deliverydate_oe ordnumber_oe transdate_oe licensenumber validuntil
148 151
       partnotes serialnumber reqdate sellprice listprice netprice
149 152
       discount p_discount discount_sub nodiscount_sub
150
       linetotal  nodiscount_linetotal tax_rate projectnumber
153
       linetotal  nodiscount_linetotal tax_rate projectnumber projectdescription
151 154
       price_factor price_factor_name partsgroup);
152 155

  
153 156
  push @arrays, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs };
......
274 277
      push @{ $form->{TEMPLATE_ARRAYS}->{nodiscount_linetotal} }, $form->format_amount($myconfig, $nodiscount_linetotal, 2);
275 278

  
276 279
      push(@{ $form->{TEMPLATE_ARRAYS}->{projectnumber} }, $projectnumbers{$form->{"project_id_$i"}});
280
      push(@{ $form->{TEMPLATE_ARRAYS}->{projectdescription} }, $projectdescriptions{$form->{"project_id_$i"}});
277 281

  
278 282
      @taxaccounts = split(/ /, $form->{"taxaccounts_$i"});
279 283
      $taxrate     = 0;
SL/OE.pm
1001 1001
  my %oid = ('Pg'     => 'oid',
1002 1002
             'Oracle' => 'rowid');
1003 1003

  
1004
  my (@project_ids, %projectnumbers);
1004
  my (@project_ids, %projectnumbers, %projectdescriptions);
1005 1005

  
1006 1006
  push(@project_ids, $form->{"globalproject_id"}) if ($form->{"globalproject_id"});
1007 1007

  
......
1033 1033
  }
1034 1034

  
1035 1035
  if (@project_ids) {
1036
    $query = "SELECT id, projectnumber FROM project WHERE id IN (" .
1036
    $query = "SELECT id, projectnumber, description FROM project WHERE id IN (" .
1037 1037
      join(", ", map("?", @project_ids)) . ")";
1038 1038
    $sth = prepare_execute_query($form, $dbh, $query, @project_ids);
1039 1039
    while (my $ref = $sth->fetchrow_hashref()) {
1040 1040
      $projectnumbers{$ref->{id}} = $ref->{projectnumber};
1041
      $projectdescriptions{$ref->{id}} = $ref->{description};
1041 1042
    }
1042 1043
    $sth->finish();
1043 1044
  }
1044 1045

  
1045 1046
  $form->{"globalprojectnumber"} = $projectnumbers{$form->{"globalproject_id"}};
1047
  $form->{"globalprojectdescription"} = $projectdescriptions{$form->{"globalproject_id"}};
1046 1048

  
1047 1049
  $form->{discount} = [];
1048 1050

  
......
1055 1057
    qw(runningnumber number description longdescription qty ship unit bin
1056 1058
       partnotes serialnumber reqdate sellprice listprice netprice
1057 1059
       discount p_discount discount_sub nodiscount_sub
1058
       linetotal  nodiscount_linetotal tax_rate projectnumber
1060
       linetotal  nodiscount_linetotal tax_rate projectnumber projectdescription
1059 1061
       price_factor price_factor_name partsgroup);
1060 1062

  
1061 1063
  push @arrays, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs };
......
1163 1165
      push @{ $form->{TEMPLATE_ARRAYS}->{nodiscount_linetotal} }, $form->format_amount($myconfig, $nodiscount_linetotal, 2);
1164 1166

  
1165 1167
      push(@{ $form->{TEMPLATE_ARRAYS}->{projectnumber} }, $projectnumbers{$form->{"project_id_$i"}});
1168
      push(@{ $form->{TEMPLATE_ARRAYS}->{projectdescription} }, $projectdescriptions{$form->{"project_id_$i"}});
1166 1169

  
1167 1170
      my ($taxamount, $taxbase);
1168 1171
      my $taxrate = 0;
doc/dokumentenvorlagen-und-variablen.html
678 678
    <td><code>globalprojectnumber</code></td>
679 679
    <td>Projektnummer des ganzen Beleges</td>
680 680
   </tr>
681
   <tr>
682
    <td><code>globalprojectdescription</code></td>
683
    <td>Projekbeschreibung des ganzen Beleges</td>
684
   </tr>
681 685
   <tr>
682 686
    <td><code>intnotes</code></td>
683 687
    <td>Interne Bemerkungen</td>
......
841 845
    <td><code>projectnumber</code></td>
842 846
    <td>Projektnummer</td>
843 847
   </tr>
848
   <tr>
849
    <td><code>projectdescription</code></td>
850
    <td>Projektbeschreibung</td>
851
   </tr>
844 852
   <tr>
845 853
    <td><code>qty</code></td>
846 854
    <td>Anzahl</td>

Auch abrufbar als: Unified diff