X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fikano.pm;h=2d7688ddc26c21c2759f0432de10188c83819fdd;hb=7637f73d594307c314c844fde0b92f3d7ae282cc;hp=153b4a6062a58c2c54efdf25468f1a4ce3a8fb05;hpb=4fee4d1074c4a0844292c2204bc0a849f9bf119c;p=freeside.git diff --git a/FS/FS/part_export/ikano.pm b/FS/FS/part_export/ikano.pm index 153b4a606..2d7688ddc 100644 --- a/FS/FS/part_export/ikano.pm +++ b/FS/FS/part_export/ikano.pm @@ -51,12 +51,24 @@ sub location_types { 'LOT' => 'Lot', 'RM' => 'Room', 'SLIP' => 'Slip', + 'SUIT' => 'Suite', 'TRLR' => 'Trailer', 'UNIT' => 'Unit', 'WING' => 'Wing', ); } +sub location_types_parse { + my $class = shift; + my %t = $class->location_types; + delete $t{''}; + ( + (map { $_ => $_ } keys %t), + (reverse %t), + 'STE' => 'SUIT', #USPS + ); +} + sub dsl_pull { # we distinguish between invalid new data (return error) versus data that # has legitimately changed (may eventually execute hooks; now just update) @@ -344,21 +356,27 @@ sub qual_result { } my %pkglist = (); - my $result = { 'header' => 'Qualifying Packages', - 'pkglist' => \%pkglist, - }; - + my %found = (); my @part_pkgs = qsearch( 'part_pkg', { 'disabled' => '' } ); foreach my $part_pkg ( @part_pkgs ) { my %vendor_pkg_ids = $part_pkg->vendor_pkg_ids; my $externalid = $vendor_pkg_ids{$self->exportnum} if defined $vendor_pkg_ids{$self->exportnum}; - if ( $externalid && grep( $_ eq $externalid, @externalids )) { - $pkglist{$part_pkg->pkgpart} = $part_pkg->pkg." - ".$part_pkg->comment; + if ( $externalid && grep { $_ eq $externalid } @externalids ) { + $pkglist{$part_pkg->pkgpart} = $part_pkg->pkg_comment; + $found{$externalid}++; } } - $result; + my %not_avail = (); + foreach my $externalid ( grep !$found{$_}, @externalids ) { + $not_avail{$externalid} = $externalid; #a better label? + } + + { 'header' => 'Qualifying Packages', + 'pkglist' => \%pkglist, + 'not_avail' => \%not_avail, + }; } sub quals_by_cust_and_pkg {