Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6e08e454

Von Thomas Heck vor mehr als 11 Jahren hinzugefügt

taxincluded von Rose laden lassen

Unterschiede anzeigen:

bin/mozilla/is.pl
35 35
use SL::IS;
36 36
use SL::PE;
37 37
use SL::OE;
38
use SL::DB::Default;
39 38
use Data::Dumper;
40
use SL::DBUtils;
41 39
use List::Util qw(max sum);
42 40

  
41
use SL::DB::Default;
42
use SL::DB::Customer;
43

  
43 44
require "bin/mozilla/io.pl";
44 45
require "bin/mozilla/invoice_io.pl";
45 46
require "bin/mozilla/arap.pl";
......
410 411
  my ($tax, $subtotal);
411 412
  $form->{taxaccounts_array} = [ split(/ /, $form->{taxaccounts}) ];
412 413

  
413
  if ( $form->{type} =~ /sales_(order|quotation)/ && $form->{vc} eq 'customer' && !$form->{taxincluded_changed_by_user} ) {
414
    my $query = '
415
      SELECT
416
        taxincluded_checked
417
      FROM
418
        customer
419
      WHERE
420
        id = ?';
421
    my $res = selectfirst_hashref_query($::form, $::form->get_standard_dbh(), $query, conv_i($::form->{customer_id}));
422

  
423
    $form->{taxincluded} = ($res && defined($res->{taxincluded_checked})) ? $res->{taxincluded_checked} : $myconfig{taxincluded_checked};
414
  if ($form->{customer_id}) {
415
    my $customer = SL::DB::Customer->new(id => $form->{customer_id})->load();
416
    $form->{taxincluded} = defined($customer->taxincluded_checked) ? $customer->taxincluded_checked : $myconfig{taxincluded_checked};
424 417
  }
425 418

  
426 419
  foreach my $item (@{ $form->{taxaccounts_array} }) {
bin/mozilla/oe.pl
45 45
use SL::ReportGenerator;
46 46
use List::MoreUtils qw(any none);
47 47
use List::Util qw(min max reduce sum);
48
use SL::DBUtils;
49 48
use Data::Dumper;
50 49

  
50
use SL::DB::Customer;
51

  
51 52
require "bin/mozilla/io.pl";
52 53
require "bin/mozilla/arap.pl";
53 54
require "bin/mozilla/reportgenerator.pl";
......
482 483
  $TMPL_VAR{notes}    = qq|<textarea name=notes rows="$rows" cols="25">| . H($form->{notes}) . qq|</textarea>|;
483 484
  $TMPL_VAR{intnotes} = qq|<textarea name=intnotes rows="$introws" cols="35">| . H($form->{intnotes}) . qq|</textarea>|;
484 485

  
485
  if ( $form->{type} =~ /sales_(order|quotation)/ && $form->{vc} eq 'customer' && !$form->{taxincluded_changed_by_user} ) {
486
    my $query = '
487
      SELECT
488
        taxincluded_checked
489
      FROM
490
        customer
491
      WHERE
492
        id = ?';
493
    my $res = selectfirst_hashref_query($::form, $::form->get_standard_dbh(), $query, conv_i($::form->{customer_id}));
494

  
495
    $form->{taxincluded} = ($res && defined($res->{taxincluded_checked})) ? $res->{taxincluded_checked} : $myconfig{taxincluded_checked};
486
  if ($form->{customer_id}) {
487
    my $customer = SL::DB::Customer->new(id => $form->{customer_id})->load();
488
    $form->{taxincluded} = defined($customer->taxincluded_checked) ? $customer->taxincluded_checked : $myconfig{taxincluded_checked};
496 489
  }
497 490

  
498 491
  if (!$form->{taxincluded}) {

Auch abrufbar als: Unified diff