Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 42ed89f3

Von Philip Reetz vor mehr als 16 Jahren hinzugefügt

  • ID 42ed89f33e7f38dcf9bba8983a070e59b5b61a47
  • Vorgänger 1ed2662d
  • Nachfolger c9860c6f

Beim Bearbeiten von Konten die Funktion "als neu speichern" hinzugefuegt, um ein Konto mit allen Einstelungen zu klonen

Unterschiede anzeigen:

SL/AM.pm
230 230
    $form->{id} = "";
231 231
  }
232 232

  
233
  if (!$form->{id} || $form->{id} eq "") {
234
    $query = qq|SELECT nextval('id')|;
235
    ($form->{"id"}) = selectrow_query($form, $dbh, $query);
236
    $query = qq|INSERT INTO chart (id, accno) VALUES (?, ?)|;
237
    do_query($form, $dbh, $query, $form->{"id"}, $form->{"accno"});
238
  }
239

  
233 240
  my @values;
234 241

  
235 242
  if ($form->{id}) {
......
262 269
                $form->{id},
263 270
    );
264 271

  
265
  }
266
  elsif ($form->{id} && !$form->{new_chart_valid}) {
267

  
268
    $query = qq|
269
                  UPDATE chart
270
                  SET new_chart_id = ?,
271
                  valid_from = ?
272
                  WHERE id = ?
273
             |;
274

  
275
    @values = (
276
                  conv_i($form->{new_chart_id}),
277
                  conv_date($form->{valid_from}),
278
                  $form->{id}
279
              );
280
  }
281
  else {
282

  
283
    $query = qq|
284
                  INSERT INTO chart (
285
                      accno,
286
                      description,
287
                      charttype,
288
                      category,
289
                      link,
290
                      pos_bwa,
291
                      pos_bilanz,
292
                      pos_eur,
293
                      new_chart_id,
294
                      valid_from,
295
                      datevautomatik )
296
                  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
297
             |;
298

  
299
    @values = (
300
                      $form->{accno},
301
                      $form->{description},
302
                      $form->{charttype},
303
                      $form->{category}, $form->{link},
304
                      conv_i($form->{pos_bwa}),
305
                      conv_i($form->{pos_bilanz}), conv_i($form->{pos_eur}),
306
                      conv_i($form->{new_chart_id}),
307
                      conv_date($form->{valid_from}),
308
                      ($form->{datevautomatik} eq 'T') ? 'true':'false',
309
              );
310

  
311 272
  }
312 273

  
313 274
  do_query($form, $dbh, $query, @values);
......
325 286
    # Loop control
326 287

  
327 288
    # Check if the account already exists, else cancel
289

  
290
    print(STDERR "Keine Taxkeys weil ID =: $form->{id}\n");
291

  
328 292
    last READTAXKEYS if ( $form->{'id'} == 0);
329 293

  
330 294
    # check if there is a startdate
bin/mozilla/am.pl
55 55
sub save     { call_sub("save_$form->{type}"); }
56 56
sub edit     { call_sub("edit_$form->{type}"); }
57 57
sub continue { call_sub($form->{"nextsub"}); }
58
sub save_as_new { call_sub("save_as_new_$form->{type}"); }
58 59

  
59 60
sub add_account {
60 61
  $lxdebug->enter_sub();
......
373 374
      . $locale->text('Delete') . qq|">|;
374 375
  }
375 376

  
377
  if ($form->{id} && $form->{type} eq "account") {
378
    print qq|
379
    <input class=submit type=submit name=action value="|
380
      . $locale->text('Save as new') . qq|">|;
381
  }
382

  
376 383
  print qq|
377 384
</form>
378 385

  
......
402 409
  $lxdebug->leave_sub();
403 410
}
404 411

  
412
sub save_as_new_account {
413
  $lxdebug->enter_sub();
414

  
415
  $auth->assert('config');
416

  
417
  $form->isblank("accno",       $locale->text('Account Number missing!'));
418
  $form->isblank("description", $locale->text('Account Description missing!'));
419
  
420
  if ($form->{charttype} eq 'A'){
421
    $form->isblank("category",  $locale->text('Account Type missing!'));
422
  }
423

  
424
  for my $taxkey (0 .. 9) {
425
    if ($form->{"taxkey_id_$taxkey"}) {
426
      $form->{"taxkey_id_$taxkey"} = "NEW";
427
    }
428
  }
429

  
430
  $form->{id} = 0;
431
  if ($form->{"original_accno"} &&
432
      ($form->{"accno"} eq $form->{"original_accno"})) {
433
    $form->error($locale->text('Account Number already used!'));
434
  }
435
  $form->redirect($locale->text('Account saved!'))
436
    if (AM->save_account(\%myconfig, \%$form));
437
  $form->error($locale->text('Cannot save account!'));
438

  
439
  $lxdebug->leave_sub();
440
}
441

  
405 442
sub list_account {
406 443
  $lxdebug->enter_sub();
407 444

  
locale/de/all
76 76
  'Account Link IC_taxpart'     => 'Warenliste Steuer',
77 77
  'Account Link IC_taxservice'  => 'Dienstleistungen Steuer',
78 78
  'Account Number'              => 'Kontonummer',
79
  'Account Number already used!' => 'Kontonummer ist bereits in Benutzung!',
79 80
  'Account Number missing!'     => 'Kontonummer fehlt!',
80 81
  'Account Nummer'              => 'Kontonummer',
81 82
  'Account Type'                => 'Kontoart',
locale/de/am
42 42
  'Account Link IC_sale'        => 'Warenliste Erl?skonto',
43 43
  'Account Link IC_taxpart'     => 'Warenliste Steuer',
44 44
  'Account Link IC_taxservice'  => 'Dienstleistungen Steuer',
45
  'Account Number already used!' => 'Kontonummer ist bereits in Benutzung!',
45 46
  'Account Number missing!'     => 'Kontonummer fehlt!',
46 47
  'Account Type missing!'       => 'Kontoart fehlt!',
47 48
  'Account deleted!'            => 'Konto gel?scht!',
......
236 237
  'SAVED FOR DUNNING'           => 'Gespeichert',
237 238
  'SCREENED'                    => 'Angezeigt',
238 239
  'Save'                        => 'Speichern',
240
  'Save as new'                 => 'als neu speichern',
239 241
  'Screen'                      => 'Bildschirm',
240 242
  'Select a Customer'           => 'Endkunde ausw?hlen',
241 243
  'Select a customer'           => 'Einen Kunden ausw&auml;hlen',
......
409 411
  'retrieve_partunits'          => 'retrieve_partunits',
410 412
  'save'                        => 'save',
411 413
  'save_account'                => 'save_account',
414
  'save_as_new'                 => 'save_as_new',
415
  'save_as_new_account'         => 'save_as_new_account',
412 416
  'save_bin'                    => 'save_bin',
413 417
  'save_buchungsgruppe'         => 'save_buchungsgruppe',
414 418
  'save_business'               => 'save_business',
......
444 448
  'kontodaten_bearbeiten'       => 'edit_account',
445 449
  'neue_ware'                   => 'new_part',
446 450
  'speichern'                   => 'save',
451
  'als_neu_speichern'           => 'save_as_new',
447 452
};
448 453

  
449 454
1;
templates/webpages/am/edit_accounts_de.html
18 18
<input type="hidden" name="type"               value="account">
19 19
<input type="hidden" name="orphaned"           value="[% HTML.escape(orphaned) %]">
20 20
<input type="hidden" name="new_chart_valid"    value="[% HTML.escape(new_chart_valid) %]">
21
<input type="hidden" name="original_accno"    value="[% HTML.escape(accno) %]">
21 22
<input type="hidden" name="inventory_accno_id" value="[% HTML.escape(inventory_accno_id) %]">
22 23
<input type="hidden" name="income_accno_id"    value="[% HTML.escape(income_accno_id) %]">
23 24
<input type="hidden" name="expense_accno_id"   value="[% HTML.escape(expense_accno_id) %]">
templates/webpages/am/edit_accounts_master.html
18 18
<input type="hidden" name="type"               value="account">
19 19
<input type="hidden" name="orphaned"           value="[% HTML.escape(orphaned) %]">
20 20
<input type="hidden" name="new_chart_valid"    value="[% HTML.escape(new_chart_valid) %]">
21
<input type="hidden" name="original_accno"    value="[% HTML.escape(accno) %]">
21 22
<input type="hidden" name="inventory_accno_id" value="[% HTML.escape(inventory_accno_id) %]">
22 23
<input type="hidden" name="income_accno_id"    value="[% HTML.escape(income_accno_id) %]">
23 24
<input type="hidden" name="expense_accno_id"   value="[% HTML.escape(expense_accno_id) %]">

Auch abrufbar als: Unified diff