Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e309bf11

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

  • ID e309bf11488adf41abefed6a2833761e3d9ab3c9
  • Vorgänger f4338c0b
  • Nachfolger e5478aea

- form header auf templates ausgelagert,
- bugfixes.
- dead code aus pre buchungsgruppen entfernt.

Unterschiede anzeigen:

bin/mozilla/ic.pl
52 52

  
53 53
1;
54 54

  
55
# Parserhappy(R):
56
# type=submit $locale->text('Add Part')
57
# type=submit $locale->text('Add Service')
58
# type=submit $locale->text('Add Assembly')
59
# type=submit $locale->text('Edit Part')
60
# type=submit $locale->text('Edit Service')
61
# type=submit $locale->text('Edit Assembly')
62

  
55 63
# end of main
56 64

  
57 65
sub add {
......
164 172

  
165 173
  my ($partnumber, $description, $unit, $sellprice, $soldtotal);
166 174
  # if choice set data
167
  if ($form->{ndx}) {
168
    for (my $i = 0; $i < $form->{ndxs_counter}; $i++) {
169

  
170
      # prepeare data
171
      $partnumber  = $form->{"totop100_partnumber_$j"};
172
      $description = $form->{"totop100_description_$j"};
173
      $unit        = $form->{"totop100_unit_$j"};
174
      $sellprice   = $form->{"totop100_sellprice_$j"};
175
      $soldtotal   = $form->{"totop100_soldtotal_$j"};
176

  
177
      # insert data into top100
178
      push @{ $form->{parts} },
179
        { number      => "",
180
          partnumber  => "$partnumber",
181
          description => "$description",
182
          unit        => "$unit",
183
          sellprice   => "$sellprice",
184
          soldtotal   => "$soldtotal" };
185
    }    #rof
186
  }    #fi
175
#  if ($form->{ndx}) {
176
#    for my $i (0 .. $form->{ndxs_counter}) {
177
#
178
#      # insert data into top100
179
#      push @{ $form->{parts} },
180
#        { number      => "",
181
#          partnumber  => $form->{"totop100_partnumber_$j"},
182
#          description => $form->{"totop100_description_$j"},
183
#          unit        => $form->{"totop100_unit_$j"},
184
#          sellprice   => $form->{"totop100_sellprice_$j"},
185
#          soldtotal   => $form->{"totop100_soldtotal_$j"},
186
#        };
187
#    }    #rof
188
#  }    #fi
187 189

  
188 190
  $totop100 = "";
189 191

  
190 192
  # set data for next page
191
  if (($form->{ndxs_counter}) > 0) {
192
    for (my $i = 1; ($i < $form->{ndxs_counter} + 1); $i++) {
193
      $partnumber  = $form->{"totop100_partnumber_$i"};
194
      $description = $form->{"totop100_description_$i"};
195
      $unit        = $form->{"totop100_unit_$i"};
196
      $sellprice   = $form->{"totop100_sellprice_$i"};
197
      $soldtotal   = $form->{"totop100_soldtotal_$i"};
198

  
199
      $totop100 .= qq|
200
<input type=hidden name=totop100_partnumber_$i value=$form->{"totop100_partnumber_$i"}>
201
<input type=hidden name=totop100_description_$i value=$form->{"totop100_description_$i"}>
202
<input type=hidden name=totop100_unit_$i value=$form->{"totop100_unit_$i"}>
203
<input type=hidden name=totop100_sellprice_$i value=$form->{"totop100_sellprice_$i"}>
204
<input type=hidden name=totop100_soldtotal_$i value=$form->{"totop100_soldtotal_$i"}>
205
      |;
206
    }    #rof
207
  }    #fi
208

  
209
  print $form->parse_html_template('ic/choice', +{ HIDDENS => \@HIDDENS, totop100 => $totop100 });
193
  for my $i (1 .. $form->{ndxs_counter}) {
194
    $partnumber  = $form->{"totop100_partnumber_$i"};
195
    $description = $form->{"totop100_description_$i"};
196
    $unit        = $form->{"totop100_unit_$i"};
197
    $sellprice   = $form->{"totop100_sellprice_$i"};
198
    $soldtotal   = $form->{"totop100_soldtotal_$i"};
199

  
200
  push @PARTS, {
201
    totop100_partnumber  => $form->{"totop100_partnumber_$i"},
202
    totop100_description => $form->{"totop100_description_$i"},
203
    totop100_unit        => $form->{"totop100_unit_$i"},
204
    totop100_sellprice   => $form->{"totop100_sellprice_$i"},
205
    totop100_soldtotal   => $form->{"totop100_soldtotal_$i"},
206
  }
207

  
208
#    $totop100 .= qq|
209
#<input type=hidden name=totop100_partnumber_$i value=$form->{"totop100_partnumber_$i"}>
210
#<input type=hidden name=totop100_description_$i value=$form->{"totop100_description_$i"}>
211
#<input type=hidden name=totop100_unit_$i value=$form->{"totop100_unit_$i"}>
212
#<input type=hidden name=totop100_sellprice_$i value=$form->{"totop100_sellprice_$i"}>
213
#<input type=hidden name=totop100_soldtotal_$i value=$form->{"totop100_soldtotal_$i"}>
214
#    |;
215
  }    #rof
216

  
217
  print $form->parse_html_template('ic/choice', +{ HIDDENS => \@HIDDENS, PARTS => \@PARTS });
210 218

  
211 219
  $lxdebug->leave_sub();
212 220
}    #end choice
......
491 499
  }
492 500
  if ($form->{serialnumber}) {
493 501
    $callback .= "&serialnumber=$form->{serialnumber}";
494
    $option   .=
495
      $locale->text('Serial Number') . qq| : $form->{serialnumber}<br>|;
502
    $option   .= $locale->text('Serial Number') . qq| : $form->{serialnumber}<br>|;
496 503
  }
497 504
  if ($form->{description}) {
498
    $callback .= "&description=$form->{description}";
505
    $callback   .= "&description=$form->{description}";
499 506
    $description = $form->{description};
500
    $description =~ s/
501
/<br>/g;
502
    $option .=
503
      $locale->text('Part Description') . qq| : $form->{description}<br>|;
507
    $description =~ s/\n/<br>/g;
508
    $option     .= $locale->text('Part Description') . qq| : $form->{description}<br>|;
504 509
  }
505 510
  if ($form->{make}) {
506 511
    $callback .= "&make=$form->{make}";
......
756 761
      $onhand = 0 if ($form->{sold});
757 762
    }
758 763

  
759
    $ref->{description} =~ s/
760
/<br>/g;
764
    $ref->{description} =~ s/\n/<br>/g;
761 765

  
762 766
    $column_data{number} =
763 767
        "<td align=right>"
......
1405 1409

  
1406 1410
  if (@{ $form->{all_partsgroup} }) {
1407 1411
    $form->{selectpartsgroup} = qq|<option>\n|;
1408
    map {
1409
      $form->{selectpartsgroup} .=
1410
        qq|<option value="$_->{partsgroup}--$_->{id}">$_->{partsgroup}\n|
1411
    } @{ $form->{all_partsgroup} };
1412
    map { $form->{selectpartsgroup} .= qq|<option value="$_->{partsgroup}--$_->{id}">$_->{partsgroup}\n| } @{ $form->{all_partsgroup} };
1412 1413
  }
1413 1414

  
1414 1415
  if ($form->{item} eq 'assembly') {
......
1436 1437
sub form_header {
1437 1438
  $lxdebug->enter_sub();
1438 1439

  
1439
  my ($payment, $rows, $notes, $description, $ean, $buchungsgruppe, $partsgroup, $group, $tax, $lastcost, $eur, $linkaccounts, $weight, $n, $rop, $bin, $vegv);
1440
  my ($notdiscountableok, $notdiscountable);
1441
  my ($formula, $formula_label, $imagelinks, $obsolete, $shopok, $shop);
1440
  $form->{eur}              = $eur; # config dumps into namespace - yuck
1441
  $form->{pg_keys}          = sub { "$_[0]->{partsgroup}--$_[0]->{id}" };
1442
  $form->{description_area} = ($form->{rows} = $form->numtextrows($form->{description}, 40)) > 1;
1442 1443

  
1444
  map { $form->{"is_$_"}  = ($form->{item} eq $_) } qw(part service assembly);
1445
  map { $form->{$_}       =~ s/"/&quot;/g;        } qw(unit);
1446
 
1443 1447
  $form->get_lists('price_factors' => 'ALL_PRICE_FACTORS');
1444 1448

  
1445
  map({ $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, -2) }
1446
      qw(sellprice listprice lastcost gv));
1447

  
1448
  map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}) }
1449
    qw(weight rop stock);
1450

  
1451
  foreach my $item (qw(partnumber description unit notes)) {
1452
    $form->{$item} =~ s/\"/&quot;/g;
1453
  }
1454

  
1455
  $payment = qq|<option value=""></option>|;
1456
  foreach my $item (@{ $form->{payment_terms} }) {
1457
    if ($form->{payment_id} eq $item->{id}) {
1458
      $payment .= qq|<option value="$item->{id}" selected>$item->{description}</option>|;
1459
    } else {
1460
      $payment .= qq|<option value="$item->{id}">$item->{description}</option>|;
1461
    }
1462
  }
1463

  
1464

  
1465
  if (($rows = $form->numtextrows($form->{notes}, 40)) < 2) {
1466
    $rows = 4;
1467
  }
1468

  
1469
  $notes =
1470
    qq|<textarea name=notes rows=$rows cols=45 wrap=soft>$form->{notes}</textarea>|;
1471
  if (($rows = $form->numtextrows($form->{description}, 40)) > 1) {
1472
    $description =
1473
      qq|<textarea name="description" rows=$rows cols=40 wrap=soft>$form->{description}</textarea>|;
1474
  } else {
1475
    $description =
1476
      qq|<input name=description size=40 value="$form->{description}">|;
1477
  }
1478

  
1479
  $ean =  qq|<input name=ean size=40 value="$form->{ean}">|;
1480

  
1481
  foreach my $item (split / /, $form->{taxaccounts}) {
1482
    $form->{"IC_tax_$item"} = ($form->{"IC_tax_$item"}) ? "checked" : "";
1483
  }
1449
  $rows = 4 if $rows = $form->numtextrows($form->{notes}, 40) < 2;
1450
  $form->{notes_rows} = $rows;
1484 1451

  
1485 1452
  IC->retrieve_buchungsgruppen(\%myconfig, $form);
1486
  if (@{ $form->{BUCHUNGSGRUPPEN} }) {
1487
    foreach my $item (@{ $form->{BUCHUNGSGRUPPEN} }) {
1488
      if ($item->{id} == $form->{buchungsgruppen_id}) {
1489
        $form->{selectbuchungsgruppe} .=
1490
          "<option value=$item->{id} selected>$item->{description}\n";
1491
      } elsif (($form->{id} && $form->{orphaned}) || (!$form->{id})) {
1492
        $form->{selectbuchungsgruppe} .=
1493
          "<option value=$item->{id}>$item->{description}\n";
1494
      }
1495

  
1496
    }
1497
  }
1498

  
1499
  $buchungsgruppe = qq|
1500
	      <tr>
1501
		<th align=right>| . $locale->text('Buchungsgruppe') . qq|</th>
1502
		<td><select name=buchungsgruppen_id>$form->{selectbuchungsgruppe}</select></td>
1503
	      </tr>|;
1453
  @{ $form->{BUCHUNGSGRUPPEN} } = grep { $_->{id} eq $form->{buchungsgruppen_id} || ($form->{id} && $form->{orphaned}) || $form->{id} } @{ $form->{BUCHUNGSGRUPPEN} };
1504 1454

  
1505

  
1506
  # set option
1507
  foreach my $item (qw(IC IC_income IC_expense)) {
1508
    if ($form->{$item}) {
1509
      if ($form->{id} && $form->{orphaned}) {
1510
        $form->{"select$item"} =~ s/ selected//;
1511
        $form->{"select$item"} =~
1512
          s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
1513
      } else {
1514
        $form->{"select$item"} = qq|<option selected>$form->{$item}|;
1515
      }
1516
    }
1517
  }
1518

  
1519
  if ($form->{selectpartsgroup}) {
1520
    $form->{selectpartsgroup} = $form->unescape($form->{selectpartsgroup});
1521
    $partsgroup =
1522
      qq|<input type=hidden name=selectpartsgroup value="|
1523
      . $form->escape($form->{selectpartsgroup}, 1) . qq|">|;
1524
    $form->{selectpartsgroup} =~
1525
      s/(<option value="\Q$form->{partsgroup}\E")/$1 selected/;
1526

  
1527
    $partsgroup .=
1528
      qq|<select name=partsgroup>$form->{selectpartsgroup}</select>|;
1529
    $group = $locale->text('Group');
1530
  }
1531

  
1532
  # tax fields
1533
  foreach my $item (split / /, $form->{taxaccounts}) {
1534
    $tax .= qq|
1535
      <input class=checkbox type=checkbox name="IC_tax_$item" value=1 $form->{"IC_tax_$item"}>&nbsp;<b>$form->{"IC_tax_${item}_description"}</b>
1536
      <br><input type=hidden name=IC_tax_${item}_description value="$form->{"IC_tax_${item}_description"}">
1537
|;
1538
  }
1539

  
1540
  $form->{obsolete} = "checked" if $form->{obsolete};
1541

  
1542
  $lastcost = qq|
1543
 	      <tr>
1544
                <th align="right" nowrap="true">|
1545
    . $locale->text('Last Cost') . qq|</th>
1546
                <td><input name=lastcost size=11 value=$form->{lastcost}></td>
1547
              </tr>
1548
|;
1549
  if (!$eur) {
1550
    $linkaccounts = qq|
1551
               <tr>
1552
		<th align=right>| . $locale->text('Inventory') . qq|</th>
1553
		<td><select name=IC>$form->{selectIC}</select></td>
1554
		<input name=selectIC type=hidden value="$form->{selectIC}">
1555
	      </tr>|;
1556
  }
1557

  
1558
  if ($form->{item} eq "part") {
1559

  
1560
    $linkaccounts .= qq|
1561
	      <tr>
1562
		<th align=right>| . $locale->text('Revenue') . qq|</th>
1563
		<td><select name=IC_income>$form->{selectIC_income}</select></td>
1564
		<input name=selectIC_income type=hidden value="$form->{selectIC_income}">
1565
	      </tr>
1566
	      <tr>
1567
		<th align=right>| . $locale->text('Expense') . qq|</th>
1568
		<td><select name=IC_expense>$form->{selectIC_expense}</select></td>
1569
		<input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
1570
	      </tr>
1571
|;
1572

  
1573
    $weight = qq|
1574
	      <tr>
1575
		<th align="right" nowrap="true">| . $locale->text('Weight') . qq|</th>
1576
		<td>
1577
		  <table>
1578
		    <tr>
1579
		      <td>
1580
			<input name=weight size=10 value=$form->{weight}>
1581
		      </td>
1582
		    </tr>
1583
		  </table>
1584
		</td>
1585
	      </tr>
1586
|;
1587

  
1588
  }
1589

  
1590
  if ($form->{item} eq "assembly") {
1591

  
1592
    $lastcost = "";
1593

  
1594
    $linkaccounts = qq|
1595
	      <tr>
1596
		<th align=right>| . $locale->text('Revenue') . qq|</th>
1597
		<td><select name=IC_income>$form->{selectIC_income}</select></td>
1598
		<input name=selectIC_income type=hidden value="$form->{selectIC_income}">
1599
	      </tr>
1600
|;
1601

  
1602
    $weight = qq|
1603
	      <tr>
1604
		<th align="right" nowrap="true">| . $locale->text('Weight') . qq|</th>
1605
		<td>
1606
		  <table>
1607
		    <tr>
1608
		      <td>
1609
			&nbsp;$form->{weight}
1610
			<input type=hidden name=weight value=$form->{weight}>
1611
		      </td>
1612
		    </tr>
1613
		  </table>
1614
		</td>
1615
	      </tr>
1616
|;
1617

  
1618
  }
1619

  
1620
  if ($form->{item} eq "service") {
1621

  
1622
    $linkaccounts = qq|
1623
	      <tr>
1624
		<th align=right>| . $locale->text('Revenue') . qq|</th>
1625
		<td><select name=IC_income>$form->{selectIC_income}</select></td>
1626
		<input name=selectIC_income type=hidden value="$form->{selectIC_income}">
1627
	      </tr>
1628
	      <tr>
1629
		<th align=right>| . $locale->text('Expense') . qq|</th>
1630
		<td><select name=IC_expense>$form->{selectIC_expense}</select></td>
1631
		<input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
1632
	      </tr>
1633
|;
1634

  
1635
  }
1636
  $linkaccounts = qq|<input type=hidden name=IC_income value="$form->{IC_income_default}">|;
1637

  
1638
  if ($form->{IC_cogs_default}) {
1639
    $form->{IC_expense_default} = $form->{IC_cogs_default};
1640
  }
1641

  
1642
  if (($form->{item} eq "service") || ($form->{item} eq "part")) {
1643
    $linkaccounts .= qq|<input type=hidden name=IC_expense value="$form->{IC_expense_default}">|;
1644
  }
1645
  if ($form->{item} eq "part") {
1646
    $linkaccounts .= qq|<input type=hidden name=IC value="$form->{IC_default}">|;
1647
  }
1648

  
1649
  if ($form->{item} ne 'service') {
1650
    $n   = ($form->{onhand} > 0) ? "1" : "0";
1651
    $rop = qq|
1652
	      <tr>
1653
		<th align="right" nowrap>| . $locale->text('On Hand') . qq|</th>
1654
		<th align=left nowrap class="plus$n">&nbsp;|
1655
      . $form->format_amount(\%myconfig, $form->{onhand}) . qq|</th>
1656
	      </tr>
1657
|;
1658

  
1659
    if ($form->{item} eq 'assembly') {
1660
      $rop .= qq|
1661
              <tr>
1662
	        <th align="right" nowrap>| . $locale->text('Stock') . qq|</th>
1663
		<td><input name=stock size=10 value=$form->{stock}></td>
1664
	      </tr>
1665
|;
1666
    }
1667

  
1668
    $rop .= qq|
1669
	      <tr>
1670
		<th align="right" nowrap="true">| . $locale->text('ROP') . qq|</th>
1671
		<td><input name=rop size=10 value=$form->{rop}></td>
1672
	      </tr>
1673
|;
1674

  
1675
    $bin = qq|
1676
	      <tr>
1677
		<th align="right" nowrap="true">| . $locale->text('Bin') . qq|</th>
1678
		<td><input name=bin size=10 value=$form->{bin}></td>
1679
	      </tr>
1680
|;
1681
    $vegv = qq|
1682
 	      <tr>
1683
		<th align="right" nowrap="true">|
1684
      . $locale->text('Verrechnungseinheit') . qq|</th>
1685
		<td><input name=ve size=10 value=$form->{ve}></td>
1686
	      </tr>
1687
              <tr>
1688
		<th align="right" nowrap="true">|
1689
      . $locale->text('Business Volume') . qq|</th>
1690
		<td><input name=gv size=10 value=$form->{gv}></td>
1691
	      </tr>
1692
|;
1693
    $notdiscountableok = ($form->{not_discountable}) == 1 ? "checked" : "";
1694
    $notdiscountable .= qq|
1695
              <tr>
1696
                <th align=right nowrap>|
1697
    . $locale->text('Not Discountable') . qq|</th>
1698
                <td><input class=checkbox type=checkbox name=not_discountable value=1 $notdiscountableok></td>
1699
             </tr>
1700
|;
1701

  
1702
    $formula =
1703
      qq|<ilayer><layer  onmouseover="this.T_STICKY=true;this.T_STATIC=true;return escape('| . $locale->text('The formula needs the following syntax:<br>For regular article:<br>Variablename= Variable Unit;<br>Variablename2= Variable2 Unit2;<br>...<br>###<br>Variable + ( Variable2 / Variable )<br><b>Please be beware of the spaces in the formula</b><br>') . qq|')"><textarea name=formel rows=4 cols=30 wrap=soft>$form->{formel}</textarea></layer><ilayer>|;
1704

  
1705
    $formula_label = $locale->text('Formula');
1706

  
1707
    $imagelinks = qq|
1708
  <tr>
1709
    <td>
1710
      <table width=100%>
1711
        <tr>
1712
	  <th align=right nowrap>| . $locale->text('Image') . qq|</th>
1713
	  <td><input name=image size=40 value="$form->{image}"></td>
1714
	  <th align=right nowrap>| . $locale->text('Microfiche') . qq|</th>
1715
	  <td><input name=microfiche size=20 value="$form->{microfiche}"></td>
1716
	</tr>
1717
	<tr>
1718
	  <th align=right nowrap>| . $locale->text('Drawing') . qq|</th>
1719
	  <td><input name=drawing size=40 value="$form->{drawing}"></td>
1720
	</tr>
1721
      </table>
1722
    </td>
1723
  </tr>
1724
|;
1725

  
1726
  }
1727

  
1728
  if ($form->{id}) {
1729
    $obsolete = qq|
1730
	      <tr>
1731
		<th align="right" nowrap="true">| . $locale->text('Obsolete') . qq|</th>
1732
		<td><input name=obsolete type=checkbox class=checkbox value=1 $form->{obsolete}></td>
1733
	      </tr>
1734
|;
1735
  }
1736
  $shopok = $form->{shop} == 1 ? "checked" : "";
1737
  $shop .= qq|
1738
              <tr>
1739
                <th align=right nowrap>|
1740
    . $locale->text('Shopartikel') . qq|</th>
1741
                <td><input class=checkbox type=checkbox name=shop value=1 $shopok></td>
1742
             </tr>
1743
|;
1744

  
1745

  
1746
  # type=submit $locale->text('Add Part')
1747
  # type=submit $locale->text('Add Service')
1748
  # type=submit $locale->text('Add Assembly')
1749

  
1750
  # type=submit $locale->text('Edit Part')
1751
  # type=submit $locale->text('Edit Service')
1752
  # type=submit $locale->text('Edit Assembly')
1753
  # use JavaScript Calendar or not
1754
  my ($jsscript, $button1);
1455
  # use JavaScript Calendar or not (yes!)
1755 1456
  $form->{jsscript} = 1;
1756
  $jsscript = "";
1757
  if ($form->{jsscript}) {
1758

  
1759
    # with JavaScript Calendar
1760
    $button1 = qq|
1761
       <td width="13"><input name=priceupdate id=priceupdate size=11  title="$myconfig{dateformat}" value="$form->{priceupdate}"></td>
1762
       <td width="4" align="left"><input type=button name=priceupdate id="trigger1" value=|
1763
      . $locale->text('button') . qq|></td>
1764
      |;
1765 1457

  
1766
    #write Trigger
1767
    $jsscript =
1768
      Form->write_trigger(\%myconfig, "1", "priceupdate", "BL", "trigger1");
1769
  } else {
1770

  
1771
    # without JavaScript Calendar
1772
    $button1 = qq|
1773
                              <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>|;
1774
  }
1775

  
1776
  my $unit_select = '<input type="hidden" name="unit_changeable" value="' . $form->{"unit_changeable"} . '">';
1777
  if (!$form->{"unit_changeable"}) {
1778
    $unit_select .= '<input type="hidden" name="unit" value="' . $form->{"unit"} . '">' . $form->{"unit"};
1779
  } else {
1780
    my $units = AM->retrieve_units(\%myconfig, $form, $form->{"item"} eq "service" ? "service" : "dimension");
1781
    $unit_select .= AM->unit_select_html($units, "unit", $form->{"unit"});
1782
  }
1783

  
1784
  my $price_factor;
1785
  if (0 < scalar @{ $form->{ALL_PRICE_FACTORS} }) {
1786
    my @values = ('', map { $_->{id}                      } @{ $form->{ALL_PRICE_FACTORS} });
1787
    my %labels =      map { $_->{id} => $_->{description} } @{ $form->{ALL_PRICE_FACTORS} };
1788

  
1789
    $price_factor =
1790
        qq|<tr><th align="right">|
1791
      . $locale->text('Price Factor')
1792
      . qq|</th><td>|
1793
      . NTI($cgi->popup_menu('-name'    => 'price_factor_id',
1794
                             '-default' => $form->{price_factor_id},
1795
                             '-values'  => \@values,
1796
                             '-labels'  => \%labels))
1797
      . qq|</td></tr>|;
1798
  }
1458
  $units = AM->retrieve_units(\%myconfig, $form, $form->{"item"} eq "service" ? "service" : "dimension");
1459
  $form->{ALL_UNITS} = [ map +{ name => $_ }, sort { $units->{$a}{sortkey} <=> $units->{$b}{sortkey} } keys %$units ];
1799 1460

  
1800 1461
  $form->{fokus} = "ic.partnumber";
1801
  $form->header;
1802

  
1803
  print qq|
1804
  <body onLoad="fokus()">
1805
 <script type="text/javascript" src="js/common.js"></script>
1806
 <script type="text/javascript" src="js/parts_language_selection.js"></script>
1807

  
1808
<form method=post name="ic" action=$form->{script}>
1809

  
1810
<input name=id type=hidden value=$form->{id}>
1811
<input name=item type=hidden value=$form->{item}>
1812
<input name=title type=hidden value="$form->{title}">
1813
<input name=makemodel type=hidden value="$form->{makemodel}">
1814
<input name=alternate type=hidden value="$form->{alternate}">
1815
<input name=onhand type=hidden value=$form->{onhand}>
1816
<input name=orphaned type=hidden value=$form->{orphaned}>
1817
<input name=taxaccounts type=hidden value="$form->{taxaccounts}">
1818
<input name=rowcount type=hidden value=$form->{rowcount}>
1819
<input name=eur type=hidden value=$eur>
1820
<input name=language_values type=hidden value="$form->{language_values}">
1821
<input name="original_partnumber" type="hidden" value="| . $form->quote($form->{"original_partnumber"}) . qq|">
1822

  
1823
<table width="100%">
1824
  <tr>
1825
    <th class=listtop>$form->{title}</th>
1826
  </tr>
1827
  <tr height="5"></tr>
1828
  <tr>
1829
    <td>
1830
      <table width="100%">
1831
        <tr valign=top>
1832
          <th align=left>| . $locale->text('Part Number') . qq|</th>
1833
          <th align=left>| . $locale->text('Part Description') . qq|</th>
1834
          <th align=left>$group</th>
1835
        </tr>
1836
	<tr valign=top>
1837
          <td><input name=partnumber value="$form->{partnumber}" size=20></td>
1838
          <td>$description</td>
1839
          <td>$partsgroup</td>
1840
	  <input type=hidden name=oldpartsgroup value="$form->{oldpartsgroup}">
1841
	</tr>
1842
      </table>
1843
    </td>
1844
  </tr>
1845
  <tr>
1846
    <td>
1847
      <table width="100%" height="100%">
1848
        <tr valign=top>
1849
          <td width=70%>
1850
            <table width="100%" height="100%">
1851
              <tr>
1852
                <td colspan=2>
1853
                  <table>
1854
                    $buchungsgruppe
1855
                    $linkaccounts
1856
                  </table>
1857
                </td>
1858
              </tr>
1859
              <tr>
1860
                <th align="left">| . $locale->text('Notes') . qq|</th>
1861
                <th align="left">$formula_label</th>
1862
              </tr>
1863
              <tr>
1864
                <td>
1865
                  $notes
1866
                </td>
1867
                <td>
1868
                  $formula
1869
                </td>
1870
              </tr>
1871
              <tr>
1872
                <th align="left"></th>
1873
                <th align="left">| . $locale->text('EAN-Code') . qq|</th>
1874
              </tr>
1875
              <tr>
1876
                <td>
1877
                  <button type="button" onclick="parts_language_selection_window('language_values')">| . $locale->text('Set Language Values') . qq|</button>
1878
                </td>
1879
		<td>
1880
	 	  $ean	
1881
		</td>
1882
              </tr>
1883
              <tr>
1884
              <td colspan=2>
1885
                <table>
1886
                <tr>
1887
	       <th align=right>| . $locale->text('Payment Terms') . qq|</th>
1888
	         <td><select name=payment_id>$payment</select></td>
1889
                </tr>
1890
               </table>
1891
              </td>
1892
              </tr>
1893
            </table>
1894
          </td>
1895
	  <td width="30%">
1896
	    <table width="100%">
1897
	      <tr>
1898
                <th align="right" nowrap="true">|
1899
    . $locale->text('Updated') . qq|</th>
1900
                $button1
1901
              </tr>
1902
	      <tr>
1903
		<th align="right" nowrap="true">| . $locale->text('List Price') . qq|</th>
1904
		<td><input name=listprice size=11 value=$form->{listprice}></td>
1905
	      </tr>
1906
	      <tr>
1907
		<th align="right" nowrap="true">| . $locale->text('Sell Price') . qq|</th>
1908
		<td><input name=sellprice size=11 value=$form->{sellprice}></td>
1909
	      </tr>
1910
	      $lastcost
1911
	      $price_factor
1912
	      <tr>
1913
		<th align="right" nowrap="true">| . $locale->text('Unit') . qq|</th>
1914
		<td>$unit_select</td>
1915
	      </tr>
1916
	      $weight
1917
	      $rop
1918
	      $bin
1919
              $notdiscountable
1920
              $vegv
1921
              $shop
1922
	      $obsolete
1923
	    </table>
1924
	  </td>
1925
	</tr>
1926
      </table>
1927
    </td>
1928
  </tr>
1929
  $imagelinks
1930 1462

  
1931
$jsscript
1932
|;
1463
  $form->header;
1464
  print $form->parse_html_template('ic/form_header', { ALL_PRICE_FACTORS => $form->{ALL_PRICE_FACTORS}, 
1465
                                                       ALL_UNITS         => $form->{ALL_UNITS},
1466
                                                       BUCHUNGSGRUPPEN   => $form->{BUCHUNGSGRUPPEN},
1467
                                                       payment_terms     => $form->{payment_terms},
1468
                                                       all_partsgroup    => $form->{all_partsgroup}});
1933 1469
  $lxdebug->leave_sub();
1934 1470
}
1935 1471

  
......
1943 1479
	  <td>
1944 1480
            <table width="100%">
1945 1481
              <tr>
1946
                <th colspan=2 align=right>|
1947
      . $locale->text('Total') . qq|&nbsp;</th>
1948
                <th align=right>|
1949
      . $form->format_amount(\%myconfig, $form->{assemblytotal}, 2) . qq|</th>
1482
                <th colspan=2 align=right>| . $locale->text('Total') . qq|&nbsp;</th>
1483
                <th align=right>| . $form->format_amount(\%myconfig, $form->{assemblytotal}, 2) . qq|</th>
1950 1484
              </tr>
1951 1485
            </table>
1952 1486
          </td>

Auch abrufbar als: Unified diff