Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d623e974

Von Moritz Bunkus vor fast 12 Jahren hinzugefügt

  • ID d623e974c5f456dab9a691df3fb57c6dba1e1865
  • Vorgänger f47c2cd1
  • Nachfolger fa2cbb11

Kreditorenbuchungen: Checkbox für "Lastschrifteinzug"; Vorbelegung aus Stammdaten

Unterschiede anzeigen:

SL/AP.pm
186 186
                invnumber = ?, transdate = ?, ordnumber = ?, vendor_id = ?, taxincluded = ?,
187 187
                amount = ?, duedate = ?, paid = ?, netamount = ?,
188 188
                curr = ?, notes = ?, department_id = ?, storno = ?, storno_id = ?,
189
                globalproject_id = ?
189
                globalproject_id = ?, direct_debit = ?
190 190
               WHERE id = ?|;
191 191
    @values = ($form->{invnumber}, conv_date($form->{transdate}),
192 192
                  $form->{ordnumber}, conv_i($form->{vendor_id}),
......
196 196
                  $form->{currency}, $form->{notes},
197 197
                  conv_i($form->{department_id}), $form->{storno},
198 198
                  $form->{storno_id}, conv_i($form->{globalproject_id}),
199
                  $form->{direct_debit} ? 't' : 'f',
199 200
                  $form->{id});
200 201
    do_query($form, $dbh, $query, @values);
201 202

  
SL/Form.pm
2529 2529
  # Hotfix f?r Bug 1837 - Besser w?re es alte Buchungsbelege
2530 2530
  # OHNE Auswahlliste (reines Textfeld) zu laden. Hilft aber auch
2531 2531
  # nicht f?r ver?nderbare Belege (oe, do, ...)
2532
  my $obsolete = "WHERE NOT obsolete" unless $self->{id};
2532
  my $obsolete = $self->{id} ? '' : "WHERE NOT obsolete";
2533 2533
  my $query = qq|SELECT count(*) FROM $table $obsolete|;
2534 2534
  my ($count) = selectrow_query($self, $dbh, $query);
2535 2535

  
......
2730 2730
  }
2731 2731

  
2732 2732
  my $extra_columns = '';
2733
  $extra_columns   .= 'a.direct_debit, ' if $module eq 'AR';
2733
  $extra_columns   .= 'a.direct_debit, ' if ($module eq 'AR') || ($module eq 'AP');
2734 2734

  
2735 2735
  if ($self->{id}) {
2736 2736
    $query =
bin/mozilla/ap.pl
97 97

  
98 98
  AP->get_transdate(\%myconfig, $form);
99 99
  $form->{initial_transdate} = $form->{transdate};
100
  &create_links;
100
  create_links(dont_save => 1);
101 101
  $form->{transdate} = $form->{initial_transdate};
102 102
  &display_form;
103 103

  
......
113 113

  
114 114
  $form->{title} = "Edit";
115 115

  
116
  &create_links;
116
  create_links();
117 117
  &display_form;
118 118

  
119 119
  $main::lxdebug->leave_sub();
......
135 135
sub create_links {
136 136
  $main::lxdebug->enter_sub();
137 137

  
138
  my %params   = @_;
139

  
138 140
  my $form     = $main::form;
139 141
  my %myconfig = %main::myconfig;
140 142

  
141 143
  $main::auth->assert('general_ledger');
142 144

  
143 145
  $form->create_links("AP", \%myconfig, "vendor");
144
  my $taxincluded = $form->{taxincluded};
145
  my $duedate     = $form->{duedate};
146
  my %saved;
147
  if (!$params{dont_save}) {
148
    %saved = map { ($_ => $form->{$_}) } qw(direct_debit taxincluded);
149
    $saved{duedate} = $form->{duedate} if $form->{duedate};
150
  }
146 151

  
147 152
  IR->get_vendor(\%myconfig, \%$form);
148
  $form->{taxincluded} = $taxincluded;
149
  $form->{duedate}   = $duedate if $duedate;
153

  
154
  $form->{$_}        = $saved{$_} for keys %saved;
150 155
  $form->{oldvendor} = "$form->{vendor}--$form->{vendor_id}";
151 156
  $form->{rowcount}  = 1;
152 157

  
templates/webpages/ap/form_header.html
139 139
                <td align="right"><input name="taxincluded" class="checkbox" type="checkbox" value="1" [% IF ( taxincluded ) %]checked[% END %]></td>
140 140
                <th align=left nowrap>[% 'Tax Included' | $T8 %]</th>
141 141
              </tr>
142
              <tr>
143
                <td align="right"><input name="direct_debit" class="checkbox" type="checkbox" value="1" [% IF direct_debit %]checked[% END %]></td>
144
                <th align="left" nowrap>[% 'direct debit' | $T8 %]</th>
145
              </tr>
142 146
            </table>
143 147
          </td>
144 148

  

Auch abrufbar als: Unified diff