summaryrefslogtreecommitdiff
path: root/LedgerSMB/IC.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-09 23:09:45 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-09 23:09:45 +0000
commit8b040e5df9af9de3d01e3451b56ae37c90df1a4d (patch)
tree9e39ca28325ff4a195ad174585d61562169fcede /LedgerSMB/IC.pm
parent4de76bf567a88296a96401168516f6fc2e90996e (diff)
Fixing bug 1748255
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1361 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/IC.pm')
-rwxr-xr-xLedgerSMB/IC.pm15
1 files changed, 5 insertions, 10 deletions
diff --git a/LedgerSMB/IC.pm b/LedgerSMB/IC.pm
index 3132a8a7..749a94e3 100755
--- a/LedgerSMB/IC.pm
+++ b/LedgerSMB/IC.pm
@@ -204,6 +204,9 @@ sub get_part {
sub save {
my ( $self, $myconfig, $form ) = @_;
+ $form->{partnumber} =
+ $form->update_defaults( $myconfig, "partnumber", $dbh )
+ if !$form->{partnumber};
( $form->{inventory_accno} ) = split( /--/, $form->{IC_inventory} );
( $form->{expense_accno} ) = split( /--/, $form->{IC_expense} );
@@ -378,9 +381,6 @@ sub save {
( $null, $partsgroup_id ) = split /--/, $form->{partsgroup};
$partsgroup_id *= 1;
- $form->{partnumber} =
- $form->update_defaults( $myconfig, "partnumber", $dbh )
- if !$form->{partnumber};
if ( !$form->{priceupdate} ) {
$form->{priceupdate} = 'now';
@@ -1599,13 +1599,8 @@ sub include_assembly {
$form->{$id} = 1;
my @a = qw(partnumber description bin);
- if ( $form->{sort} eq 'partnumber' ) {
- $sortorder = "TRUE";
- }
- else {
- @a = grep !/$form->{sort}/, @a;
- $sortorder = "$form->{sort} $form->{direction}, " . join ',', @a;
- }
+ @a = grep !/$form->{sort}/, @a;
+ $sortorder = "$form->{sort} $form->{direction}, " . join ',', @a;
@a = ();
my $query = qq|