it for gitweb.
summaryrefslogtreecommitdiff
path: root/bin/ic.pl
blob: 148b86d8569335ed4bb78acbf5e92692133baf42 (plain)
  1. #=====================================================================
  2. # LedgerSMB Small Medium Business Accounting
  3. # http://www.ledgersmb.org/
  4. #
  5. # Copyright (C) 2006
  6. # This work contains copyrighted information from a number of sources all used
  7. # with permission.
  8. #
  9. # This file contains source code included with or based on SQL-Ledger which
  10. # is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed
  11. # under the GNU General Public License version 2 or, at your option, any later
  12. # version. For a full list including contact information of contributors,
  13. # maintainers, and copyright holders, see the CONTRIBUTORS file.
  14. #
  15. # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork):
  16. # Copyright (c) 2001
  17. #
  18. # Author: DWS Systems Inc.
  19. # Web: http://www.sql-ledger.org
  20. #
  21. # Contributors:
  22. #
  23. #
  24. # This program is free software; you can redistribute it and/or modify
  25. # it under the terms of the GNU General Public License as published by
  26. # the Free Software Foundation; either version 2 of the License, or
  27. # (at your option) any later version.
  28. #
  29. # This program is distributed in the hope that it will be useful,
  30. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  31. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  32. # GNU General Public License for more details.
  33. # You should have received a copy of the GNU General Public License
  34. # along with this program; if not, write to the Free Software
  35. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  36. #======================================================================
  37. #
  38. # Inventory Control module
  39. #
  40. #======================================================================
  41. use LedgerSMB::IC;
  42. use LedgerSMB::Tax;
  43. require "bin/io.pl";
  44. 1;
  45. # end of main
  46. sub add {
  47. %label = ( part => 'Part',
  48. service => 'Service',
  49. assembly => 'Assembly',
  50. labor => 'Labor/Overhead', );
  51. # $locale->text('Add Part')
  52. # $locale->text('Add Service')
  53. # $locale->text('Add Assembly')
  54. # $locale->text('Add Labor/Overhead')
  55. $label = "Add $label{$form->{item}}";
  56. $form->{title} = $locale->text($label);
  57. $form->{callback} = "$form->{script}?action=add&item=$form->{item}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}" unless $form->{callback};
  58. $form->{orphaned} = 1;
  59. if ($form->{previousform}) {
  60. $form->{callback} = "";
  61. }
  62. &link_part;
  63. &display_form;
  64. }
  65. sub edit {
  66. %label = ( part => 'Part',
  67. service => 'Service',
  68. assembly => 'Assembly',
  69. labor => 'Labor/Overhead', );
  70. # $locale->text('Edit Part')
  71. # $locale->text('Edit Service')
  72. # $locale->text('Edit Assembly')
  73. # $locale->text('Edit Labor/Overhead')
  74. IC->get_part(\%myconfig, \%$form);
  75. $label = "Edit $label{$form->{item}}";
  76. $form->{title} = $locale->text($label);
  77. $form->{previousform} = $form->escape($form->{previousform}, 1) if $form->{previousform};
  78. &link_part;
  79. &display_form;
  80. }
  81. sub link_part {
  82. IC->create_links("IC", \%myconfig, \%$form);
  83. # currencies
  84. $form->{selectcurrency} = "";
  85. for (split /:/, $form->{currencies}) { $form->{selectcurrency} .= "<option>$_\n" }
  86. # readonly
  87. if ($form->{item} eq 'part') {
  88. $form->{readonly} = 1 if $myconfig{acs} =~ /Goods \& Services--Add Part/;
  89. $form->error($locale->text('Cannot create Part').";".$locale->text('Inventory account does not exist!')) if ! @{ $form->{IC_links}{IC} };
  90. $form->error($locale->text('Cannot create Part').";".$locale->text('Income account does not exist!')) if ! @{ $form->{IC_links}{IC_sale} };
  91. $form->error($locale->text('Cannot create Part').";".$locale->text('COGS account does not exist!')) if ! @{ $form->{IC_links}{IC_cogs} };
  92. }
  93. if ($form->{item} eq 'service') {
  94. $form->{readonly} = 1 if $myconfig{acs} =~ /Goods \& Services--Add Service/;
  95. $form->error($locale->text('Cannot create Service').";".$locale->text('Income account does not exist!')) if ! @{ $form->{IC_links}{IC_income} };
  96. $form->error($locale->text('Cannot create Service').";".$locale->text('Expense account does not exist!')) if ! @{ $form->{IC_links}{IC_expense} };
  97. }
  98. if ($form->{item} eq 'assembly') {
  99. $form->{readonly} = 1 if $myconfig{acs} =~ /Goods \& Services--Add Assembly/;
  100. $form->error($locale->text('Cannot create Assembly').";".$locale->text('Income account does not exist!')) if ! @{ $form->{IC_links}{IC_income} };
  101. }
  102. if ($form->{item} eq 'labor') {
  103. $form->{readonly} = 1 if $myconfig{acs} =~ /Goods \& Services--Add Labor\/Overhead/;
  104. $form->error($locale->text('Cannot create Labor').";".$locale->text('Inventory account does not exist!')) if ! @{ $form->{IC_links}{IC} };
  105. $form->error($locale->text('Cannot create Labor').";".$locale->text('COGS account does not exist!')) if ! @{ $form->{IC_links}{IC_cogs} };
  106. }
  107. # parts, assemblies , labor and overhead have the same links
  108. $taxpart = ($form->{item} eq 'service') ? "service" : "part";
  109. # build the popup menus
  110. $form->{taxaccounts} = "";
  111. foreach $key (keys %{ $form->{IC_links} }) {
  112. $form->{"select$key"} = "";
  113. foreach $ref (@{ $form->{IC_links}{$key} }) {
  114. # if this is a tax field
  115. if ($key =~ /IC_tax/) {
  116. if ($key =~ /$taxpart/) {
  117. $form->{taxaccounts} .= "$ref->{accno} ";
  118. $form->{"IC_tax_$ref->{accno}_description"} = "$ref->{accno}--$ref->{description}";
  119. if ($form->{id}) {
  120. if ($form->{amount}{$ref->{accno}}) {
  121. $form->{"IC_tax_$ref->{accno}"} = "checked";
  122. }
  123. } else {
  124. $form->{"IC_tax_$ref->{accno}"} = "checked";
  125. }
  126. }
  127. } else {
  128. $form->{"select$key"} .= "<option>$ref->{accno}--$ref->{description}\n";
  129. }
  130. }
  131. }
  132. chop $form->{taxaccounts};
  133. if ($form->{item} !~ /service/) {
  134. $form->{selectIC_inventory} = $form->{selectIC};
  135. $form->{selectIC_income} = $form->{selectIC_sale};
  136. $form->{selectIC_expense} = $form->{selectIC_cogs};
  137. $form->{IC_income} = $form->{IC_sale};
  138. $form->{IC_expense} = $form->{IC_cogs};
  139. }
  140. # set option
  141. for (qw(IC_inventory IC_income IC_expense)) { $form->{$_} = "$form->{amount}{$_}{accno}--$form->{amount}{$_}{description}" if $form->{amount}{$_}{accno} }
  142. delete $form->{IC_links};
  143. delete $form->{amount};
  144. $form->get_partsgroup(\%myconfig, {all => 1});
  145. if ($form->{partsgroup}) {
  146. $form->{partsgroup} = $form->quote($form->{partsgroup})."--$form->{partsgroup_id}";
  147. }
  148. if (@{ $form->{all_partsgroup} }) {
  149. $form->{selectpartsgroup} = qq|<option>\n|;
  150. for (@{ $form->{all_partsgroup} }) { $form->{selectpartsgroup} .= qq|<option value="|.$form->quote($_->{partsgroup}).qq|--$_->{id}">$_->{partsgroup}\n| }
  151. delete $form->{all_partsgroup};
  152. }
  153. if ($form->{item} eq 'assembly') {
  154. for (1 .. $form->{assembly_rows}) {
  155. if ($form->{"partsgroup_id_$_"}) {
  156. $form->{"partsgroup_$_"} = qq|$form->{"partsgroup_$_"}--$form->{"partsgroup_id_$_"}|;
  157. }
  158. }
  159. $form->get_partsgroup(\%myconfig);
  160. if (@{ $form->{all_partsgroup} }) {
  161. $form->{selectassemblypartsgroup} = qq|<option>\n|;
  162. for (@{ $form->{all_partsgroup} }) { $form->{selectassemblypartsgroup} .= qq|<option value="$_->{partsgroup}--$_->{id}">$_->{partsgroup}\n| }
  163. delete $form->{all_partsgroup};
  164. }
  165. }
  166. # setup make and models
  167. $i = 1;
  168. foreach $ref (@{ $form->{makemodels} }) {
  169. for (qw(make model)) { $form->{"${_}_$i"} = $ref->{$_} }
  170. $i++;
  171. }
  172. $form->{makemodel_rows} = $i - 1;
  173. delete $form->{makemodels};
  174. # setup vendors
  175. if (@{ $form->{all_vendor} }) {
  176. $form->{selectvendor} = "<option>\n";
  177. for (@{ $form->{all_vendor} }) { $form->{selectvendor} .= qq|<option value="$_->{name}--$_->{id}">$_->{name}\n| }
  178. delete $form->{all_vendor};
  179. }
  180. # vendor matrix
  181. $i = 1;
  182. foreach $ref (@{ $form->{vendormatrix} }) {
  183. $form->{"vendor_$i"} = qq|$ref->{name}--$ref->{id}|;
  184. for (qw(partnumber lastcost leadtime vendorcurr)) { $form->{"${_}_$i"} = $ref->{$_} }
  185. $i++;
  186. }
  187. $form->{vendor_rows} = $i - 1;
  188. delete $form->{vendormatrix};
  189. # setup customers and groups
  190. if (@{ $form->{all_customer} }) {
  191. $form->{selectcustomer} = "<option>\n";
  192. for (@{ $form->{all_customer} }) { $form->{selectcustomer} .= qq|<option value="$_->{name}--$_->{id}">$_->{name}\n| }
  193. delete $form->{all_customer};
  194. }
  195. if (@{ $form->{all_pricegroup} }) {
  196. $form->{selectpricegroup} = "<option>\n";
  197. for (@{ $form->{all_pricegroup} }) { $form->{selectpricegroup} .= qq|<option value="$_->{pricegroup}--$_->{id}">$_->{pricegroup}\n| }
  198. delete $form->{all_pricegroup};
  199. }
  200. $i = 1;
  201. # customer matrix
  202. foreach $ref (@{ $form->{customermatrix} }) {
  203. $form->{"customer_$i"} = "$ref->{name}--$ref->{cid}" if $ref->{cid};
  204. $form->{"pricegroup_$i"} = "$ref->{pricegroup}--$ref->{gid}" if $ref->{gid};
  205. for (qw(validfrom validto pricebreak customerprice customercurr)) { $form->{"${_}_$i"} = $ref->{$_} }
  206. $i++;
  207. }
  208. $form->{customer_rows} = $i - 1;
  209. delete $form->{customermatrix};
  210. }
  211. sub form_header {
  212. if ($form->{lastcost} > 0) {
  213. $markup = $form->round_amount((($form->{sellprice}/$form->{lastcost} - 1) * 100), 1);
  214. $form->{markup} = $form->format_amount(\%myconfig, $markup, 1);
  215. }
  216. ($dec) = ($form->{sellprice} =~ /\.(\d+)/);
  217. $dec = length $dec;
  218. $decimalplaces = ($dec > 2) ? $dec : 2;
  219. for (qw(listprice sellprice)) { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, $decimalplaces) }
  220. ($dec) = ($form->{lastcost} =~ /\.(\d+)/);
  221. $dec = length $dec;
  222. $decimalplaces = ($dec > 2) ? $dec : 2;
  223. for (qw(lastcost avgcost)) { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, $decimalplaces) }
  224. for (qw(weight rop stock)) { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}) }
  225. for (qw(partnumber description unit notes)) { $form->{$_} = $form->quote($form->{$_}) }
  226. if (($rows = $form->numtextrows($form->{notes}, 40)) < 2) {
  227. $rows = 2;
  228. }
  229. $notes = qq|<textarea name=notes rows=$rows cols=40 wrap=soft>$form->{notes}</textarea>|;
  230. if (($rows = $form->numtextrows($form->{description}, 40)) > 1) {
  231. $description = qq|<textarea name="description" rows=$rows cols=40 wrap=soft>$form->{description}</textarea>|;
  232. } else {
  233. $description = qq|<input name=description size=40 value="$form->{description}">|;
  234. }
  235. for (split / /, $form->{taxaccounts}) { $form->{"IC_tax_$_"} = ($form->{"IC_tax_$_"}) ? "checked" : "" }
  236. $form->{selectIC_inventory} = $form->{selectIC};
  237. # set option
  238. for (qw(IC_inventory IC_income IC_expense)) {
  239. if ($form->{$_}) {
  240. if ($form->{orphaned}) {
  241. $form->{"select$_"} =~ s/ selected//;
  242. $form->{"select$_"} =~ s/option>\Q$form->{$_}\E/option selected>$form->{$_}/;
  243. } else {
  244. $form->{"select$_"} = qq|<option selected>$form->{$_}|;
  245. }
  246. }
  247. }
  248. if ($form->{selectpartsgroup}) {
  249. $form->{selectpartsgroup} = $form->unescape($form->{selectpartsgroup});
  250. $partsgroup = qq|<input type=hidden name=selectpartsgroup value="|.$form->escape($form->{selectpartsgroup},1).qq|">|;
  251. $form->{partsgroup} = $form->quote($form->{partsgroup});
  252. $form->{selectpartsgroup} =~ s/(<option value="\Q$form->{partsgroup}\E")/$1 selected/;
  253. $partsgroup .= qq|\n<select name=partsgroup>$form->{selectpartsgroup}</select>|;
  254. $group = $locale->text('Group');
  255. }
  256. # tax fields
  257. foreach $item (split / /, $form->{taxaccounts}) {
  258. $tax .= qq|
  259. <input class=checkbox type=checkbox name="IC_tax_$item" value=1 $form->{"IC_tax_$item"}>&nbsp;<b>$form->{"IC_tax_${item}_description"}</b>
  260. <br><input type=hidden name=IC_tax_${item}_description value="$form->{"IC_tax_${item}_description"}">
  261. |;
  262. }
  263. $sellprice = qq|
  264. <tr>
  265. <th align="right" nowrap="true">|.$locale->text('Sell Price').qq|</th>
  266. <td><input name=sellprice size=11 value=$form->{sellprice}></td>
  267. </tr>
  268. <tr>
  269. <th align="right" nowrap="true">|.$locale->text('List Price').qq|</th>
  270. <td><input name=listprice size=11 value=$form->{listprice}></td>
  271. </tr>
  272. |;
  273. $avgcost = qq|
  274. <tr>
  275. <th align="right" nowrap="true">|.$locale->text('Average Cost').qq|</th>
  276. <td><input type=hidden name=avgcost value=$form->{avgcost}>$form->{avgcost}</td>
  277. </tr>
  278. |;
  279. $lastcost = qq|
  280. <tr>
  281. <th align="right" nowrap="true">|.$locale->text('Last Cost').qq|</th>
  282. <td><input name=lastcost size=11 value=$form->{lastcost}></td>
  283. </tr>
  284. <tr>
  285. <th align="right" nowrap="true">|.$locale->text('Markup').qq| %</th>
  286. <td><input name=markup size=5 value=$form->{markup}></td>
  287. <input type=hidden name=oldmarkup value=$markup>
  288. </tr>
  289. |;
  290. if ($form->{item} =~ /(part|assembly)/) {
  291. $n = ($form->{onhand} > 0) ? "1" : "0";
  292. $onhand = qq|
  293. <tr>
  294. <th align="right" nowrap>|.$locale->text('On Hand').qq|</th>
  295. <th align=left nowrap class="plus$n">&nbsp;|.$form->format_amount(\%myconfig, $form->{onhand}).qq|</th>
  296. </tr>
  297. |;
  298. $rop = qq|
  299. <tr>
  300. <th align="right" nowrap="true">|.$locale->text('ROP').qq|</th>
  301. <td><input name=rop size=10 value=$form->{rop}></td>
  302. </tr>
  303. |;
  304. $bin = qq|
  305. <tr>
  306. <th align="right" nowrap="true">|.$locale->text('Bin').qq|</th>
  307. <td><input name=bin size=10 value="$form->{bin}"></td>
  308. </tr>
  309. |;
  310. $imagelinks = qq|
  311. <tr>
  312. <td>
  313. <table width=100%>
  314. <tr>
  315. <th align=right nowrap>|.$locale->text('Image').qq|</th>
  316. <td><input name=image size=40 value="$form->{image}"></td>
  317. <th align=right nowrap>|.$locale->text('Microfiche').qq|</th>
  318. <td><input name=microfiche size=20 value="$form->{microfiche}"></td>
  319. </tr>
  320. <tr>
  321. <th align=right nowrap>|.$locale->text('Drawing').qq|</th>
  322. <td><input name=drawing size=40 value="$form->{drawing}"></td>
  323. </tr>
  324. </table>
  325. </td>
  326. </tr>
  327. |;
  328. }
  329. if ($form->{item} eq "part") {
  330. $linkaccounts = qq|
  331. <tr>
  332. <th align=right>|.$locale->text('Inventory').qq|</th>
  333. <td><select name=IC_inventory>$form->{selectIC_inventory}</select></td>
  334. <input name=selectIC type=hidden value="$form->{selectIC}">
  335. </tr>
  336. <tr>
  337. <th align=right>|.$locale->text('Income').qq|</th>
  338. <td><select name=IC_income>$form->{selectIC_income}</select></td>
  339. <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
  340. </tr>
  341. <tr>
  342. <th align=right>|.$locale->text('COGS').qq|</th>
  343. <td><select name=IC_expense>$form->{selectIC_expense}</select></td>
  344. <input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
  345. </tr>
  346. |;
  347. if ($tax) {
  348. $linkaccounts .= qq|
  349. <tr>
  350. <th align=right>|.$locale->text('Tax').qq|</th>
  351. <td>$tax</td>
  352. </tr>
  353. |;
  354. }
  355. $weight = qq|
  356. <tr>
  357. <th align="right" nowrap="true">|.$locale->text('Weight').qq|</th>
  358. <td>
  359. <table>
  360. <tr>
  361. <td>
  362. <input name=weight size=10 value=$form->{weight}>
  363. </td>
  364. <th>
  365. &nbsp;
  366. $form->{weightunit}
  367. <input type=hidden name=weightunit value=$form->{weightunit}>
  368. </th>
  369. </tr>
  370. </table>
  371. </td>
  372. </tr>
  373. |;
  374. }
  375. if ($form->{item} eq "assembly") {
  376. $avgcost = "";
  377. if ($form->{project_id}) {
  378. $weight = qq|
  379. <tr>
  380. <th align="right" nowrap="true">|.$locale->text('Weight').qq|</th>
  381. <td>
  382. <table>
  383. <tr>
  384. <td>
  385. <input name=weight size=10 value=$form->{weight}>
  386. </td>
  387. <th>
  388. &nbsp;
  389. $form->{weightunit}
  390. <input type=hidden name=weightunit value=$form->{weightunit}>
  391. </th>
  392. </tr>
  393. </table>
  394. </td>
  395. </tr>
  396. |;
  397. } else {
  398. $weight = qq|
  399. <tr>
  400. <th align="right" nowrap="true">|.$locale->text('Weight').qq|</th>
  401. <td>
  402. <table>
  403. <tr>
  404. <td>
  405. &nbsp;$form->{weight}
  406. <input type=hidden name=weight value=$form->{weight}>
  407. </td>
  408. <th>
  409. &nbsp;
  410. $form->{weightunit}
  411. <input type=hidden name=weightunit value=$form->{weightunit}>
  412. </th>
  413. </tr>
  414. </table>
  415. </td>
  416. </tr>
  417. |;
  418. }
  419. if ($form->{project_id}) {
  420. $lastcost = "";
  421. $avgcost = "";
  422. $onhand = "";
  423. $rop = "";
  424. $form->{isassemblyitem} = 1;
  425. } else {
  426. $stock = qq|
  427. <tr>
  428. <th align="right" nowrap>|.$locale->text('Stock').qq|</th>
  429. <td><input name=stock size=10 value=$form->{stock}></td>
  430. </tr>
  431. |;
  432. $lastcost = qq|
  433. <tr>
  434. <th align="right" nowrap="true">|.$locale->text('Last Cost').qq|</th>
  435. <td><input type=hidden name=lastcost value=$form->{lastcost}>$form->{lastcost}</td>
  436. </tr>
  437. <tr>
  438. <th align="right" nowrap="true">|.$locale->text('Markup').qq| %</th>
  439. <td><input name=markup size=5 value=$form->{markup}></td>
  440. <input type=hidden name=oldmarkup value=$markup>
  441. </tr>
  442. |;
  443. }
  444. $linkaccounts = qq|
  445. <tr>
  446. <th align=right>|.$locale->text('Income').qq|</th>
  447. <td><select name=IC_income>$form->{selectIC_income}</select></td>
  448. <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
  449. </tr>
  450. |;
  451. if ($tax) {
  452. $linkaccounts .= qq|
  453. <tr>
  454. <th align=right>|.$locale->text('Tax').qq|</th>
  455. <td>$tax</td>
  456. </tr>
  457. |;
  458. }
  459. }
  460. if ($form->{item} eq "service") {
  461. $avgcost = "";
  462. $linkaccounts = qq|
  463. <tr>
  464. <th align=right>|.$locale->text('Income').qq|</th>
  465. <td><select name=IC_income>$form->{selectIC_income}</select></td>
  466. <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
  467. </tr>
  468. <tr>
  469. <th align=right>|.$locale->text('Expense').qq|</th>
  470. <td><select name=IC_expense>$form->{selectIC_expense}</select></td>
  471. <input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
  472. </tr>
  473. |;
  474. if ($tax) {
  475. $linkaccounts .= qq|
  476. <tr>
  477. <th align=right>|.$locale->text('Tax').qq|</th>
  478. <td>$tax</td>
  479. </tr>
  480. |;
  481. }
  482. }
  483. if ($form->{item} eq 'labor') {
  484. $avgcost = "";
  485. $n = ($form->{onhand} > 0) ? "1" : "0";
  486. $onhand = qq|
  487. <tr>
  488. <th align="right" nowrap>|.$locale->text('On Hand').qq|</th>
  489. <th align=left nowrap class="plus$n">&nbsp;|.$form->format_amount(\%myconfig, $form->{onhand}).qq|</th>
  490. </tr>
  491. |;
  492. $linkaccounts = qq|
  493. <tr>
  494. <th align=right>|.$locale->text('Labor/Overhead').qq|</th>
  495. <td><select name=IC_inventory>$form->{selectIC_inventory}</select></td>
  496. <input name=selectIC type=hidden value="$form->{selectIC}">
  497. </tr>
  498. <tr>
  499. <th align=right>|.$locale->text('COGS').qq|</th>
  500. <td><select name=IC_expense>$form->{selectIC_expense}</select></td>
  501. <input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
  502. </tr>
  503. |;
  504. }
  505. if ($form->{id}) {
  506. $checked = ($form->{obsolete}) ? "checked" : "";
  507. $obsolete = qq|
  508. <tr>
  509. <th align="right" nowrap="true">|.$locale->text('Obsolete').qq|</th>
  510. <td><input name=obsolete type=checkbox class=checkbox value=1 $checked></td>
  511. </tr>
  512. |;
  513. $obsolete = "<input type=hidden name=obsolete value=$form->{obsolete}>" if $form->{project_id};
  514. }
  515. # type=submit $locale->text('Edit Part')
  516. # type=submit $locale->text('Edit Service')
  517. # type=submit $locale->text('Edit Assembly')
  518. $form->header;
  519. print qq|
  520. <body>
  521. <form method=post action="$form->{script}">
  522. |;
  523. $form->hide_form(qw(id item title makemodel alternate onhand orphaned taxaccounts rowcount baseassembly project_id));
  524. print qq|
  525. <table width="100%">
  526. <tr>
  527. <th class=listtop>$form->{title}</th>
  528. </tr>
  529. <tr height="5"></tr>
  530. <tr>
  531. <td>
  532. <table width="100%">
  533. <tr valign=top>
  534. <th align=left>|.$locale->text('Number').qq|</th>
  535. <th align=left>|.$locale->text('Description').qq|</th>
  536. <th align=left>$group</th>
  537. </tr>
  538. <tr valign=top>
  539. <td><input name=partnumber value="$form->{partnumber}" size=20></td>