Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 89497ebe

Von Sven Schöling vor etwa 17 Jahren hinzugefügt

  • ID 89497ebec6afaffeeb61312f0ebe881ffa587f05
  • Vorgänger 33c46114
  • Nachfolger c2715187

Kosmetik

Unterschiede anzeigen:

bin/mozilla/ic.pl
1549 1549
  $form->{ledgerchecks} = 'Y' if (   $form->{bought} || $form->{sold} || $form->{onorder}
1550 1550
                                  || $form->{ordered} || $form->{rfq} || $form->{quoted});
1551 1551

  
1552
  # if something should be aktivated if something else is active, enter it here
1552
  # if something should be activated if something else is active, enter it here
1553 1553
  my %dependencies = (
1554 1554
    onhand       => [ qw(l_onhand) ],
1555 1555
    short        => [ qw(l_onhand) ],
......
1714 1714
                       'output_format'         => 'HTML',
1715 1715
                       'title'                 => $form->{title},
1716 1716
                       'attachment_basename'   => $attachment_basenames{$form->{searchitems}} . strftime('_%Y%m%d', localtime time),
1717
    );
1717
  );
1718 1718
  $report->set_options_from_form();
1719 1719

  
1720 1720
  $report->set_columns(%column_defs);
......
1728 1728
  my %subtotals = map { $_ => 0 } ('onhand', @subtotal_columns);
1729 1729
  my %totals    = map { $_ => 0 } @subtotal_columns;
1730 1730
  my $idx       = 0;
1731
  my $same_item = $form->{parts}->[0]->{ $form->{sort} } if (scalar @{ $form->{parts} });
1731
  my $same_item = $form->{parts}[0]{ $form->{sort} } if (scalar @{ $form->{parts} });
1732 1732

  
1733
  # postprocess parts
1733 1734
  foreach my $ref (@{ $form->{parts} }) {
1735

  
1736
    # fresh row, for inserting later
1734 1737
    my $row = { map { $_ => { 'data' => $ref->{$_} } } @columns };
1735 1738

  
1736 1739
    $ref->{exchangerate}  = 1 unless $ref->{exchangerate};
......
1742 1745
    my $onhand = $ref->{onhand};
1743 1746

  
1744 1747
    if ($ref->{assemblyitem}) {
1745
      $row->{partnumber}->{align} = 'right';
1746
      $row->{onhand}->{data}      = 0;
1748
      $row->{partnumber}{align}   = 'right';
1749
      $row->{onhand}{data}        = 0;
1747 1750
      $onhand                     = 0 if ($form->{sold});
1748 1751
    }
1749 1752

  
......
1752 1755
    $row->{description}->{link} = $edit_link;
1753 1756

  
1754 1757
    foreach (qw(sellprice listprice lastcost)) {
1755
      $row->{$_}->{data}            = $form->format_amount(\%myconfig, $ref->{$_}, -2);
1756
      $row->{"linetotal$_"}->{data} = $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{$_}, 2);
1758
      $row->{$_}{data}            = $form->format_amount(\%myconfig, $ref->{$_}, -2);
1759
      $row->{"linetotal$_"}{data} = $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{$_}, 2);
1757 1760
    }
1758 1761

  
1759
    map { $row->{$_}->{data} = $form->format_amount(\%myconfig, $ref->{$_}); } qw(onhand rop weight soldtotal);
1762
    map { $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{$_}); } qw(onhand rop weight soldtotal);
1760 1763

  
1761 1764
    if (!$ref->{assemblyitem}) {
1762 1765
      foreach my $col (@subtotal_columns) {
......
1767 1770
      $subtotals{onhand} += $onhand;
1768 1771
    }
1769 1772

  
1773
    # set module stuff
1770 1774
    if ($ref->{module} eq 'oe') {
1771 1775
      my $edit_oe_link = build_std_url("script=oe.pl", 'action=edit', 'type=' . E($ref->{type}), 'id=' . E($ref->{trans_id}), 'callback');
1772
      $row->{ordnumber}->{link} = $edit_oe_link;
1773
      $row->{quonumber}->{link} = $edit_oe_link if (!$ref->{ordnumber});
1776
      $row->{ordnumber}{link} = $edit_oe_link;
1777
      $row->{quonumber}{link} = $edit_oe_link if (!$ref->{ordnumber});
1774 1778

  
1775 1779
    } else {
1776
      $row->{invnumber}->{link} = build_std_url("script=$ref->{module}.pl", 'action=edit', 'type=invoice', 'id=' . E($ref->{trans_id}), 'callback');
1780
      $row->{invnumber}{link} = build_std_url("script=$ref->{module}.pl", 'action=edit', 'type=invoice', 'id=' . E($ref->{trans_id}), 'callback');
1777 1781
    }
1778 1782

  
1783
    # set properties of images
1779 1784
    if ($ref->{image} && (lc $report->{options}->{output_format} eq 'html')) {
1780
      $row->{image}->{data}     = '';
1781
      $row->{image}->{raw_data} = '<a href="' . H($ref->{image}) . '"><img src="' . H($ref->{image}) . '" height="32" border="0"></a>';
1785
      $row->{image}{data}     = '';
1786
      $row->{image}{raw_data} = '<a href="' . H($ref->{image}) . '"><img src="' . H($ref->{image}) . '" height="32" border="0"></a>';
1782 1787
    }
1783
    map { $row->{$_}->{link} = $ref->{$_} } qw(drawing microfiche);
1788
    map { $row->{$_}{link} = $ref->{$_} } qw(drawing microfiche);
1784 1789

  
1785 1790
    $report->add_data($row);
1786 1791

  
1787
    my $next_ref = $form->{parts}->[$idx + 1];
1792
    my $next_ref = $form->{parts}[$idx + 1];
1788 1793

  
1794
    # insert subtotal rows
1789 1795
    if (($form->{l_subtotal} eq 'Y') &&
1790 1796
        (!$next_ref ||
1791 1797
         (!$next_ref->{assemblyitem} && ($same_item ne $next_ref->{ $form->{sort} })))) {

Auch abrufbar als: Unified diff