projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add latitude/longitude to prospects, customers and package locations, RT#15539
[freeside.git]
/
FS
/
FS
/
part_pkg_taxrate.pm
diff --git
a/FS/FS/part_pkg_taxrate.pm
b/FS/FS/part_pkg_taxrate.pm
index
fb1afce
..
e29c3d0
100644
(file)
--- a/
FS/FS/part_pkg_taxrate.pm
+++ b/
FS/FS/part_pkg_taxrate.pm
@@
-292,7
+292,9
@@
sub batch_import {
time_zone => 'floating',
);
my $dt = $parser->parse_datetime( $hash->{'effdate'} );
time_zone => 'floating',
);
my $dt = $parser->parse_datetime( $hash->{'effdate'} );
- $hash->{'effdate'} = $dt ? $dt->epoch : '';
+ return "Can't parse effdate ". $hash->{'effdate'}. ': '. $parser->errstr
+ unless $dt;
+ $hash->{'effdate'} = $dt->epoch;
$hash->{'country'} = 'US'; # CA is available
$hash->{'country'} = 'US'; # CA is available
@@
-301,6
+303,13
@@
sub batch_import {
if (exists($hash->{actionflag}) && $hash->{actionflag} eq 'D') {
delete($hash->{actionflag});
if (exists($hash->{actionflag}) && $hash->{actionflag} eq 'D') {
delete($hash->{actionflag});
+ foreach my $intfield (qw( taxproductnum taxclassnum effdate )) {
+ if ( $hash->{$intfield} eq '' ) {
+ return "$intfield is empty in search! -- ".
+ join(" ", map { "$_ => *". $hash->{$_}. '*' } keys(%$hash) );
+ }
+ }
+
my $part_pkg_taxrate = qsearchs('part_pkg_taxrate', $hash);
unless ( $part_pkg_taxrate ) {
if ( $hash->{taxproductnum} ) {
my $part_pkg_taxrate = qsearchs('part_pkg_taxrate', $hash);
unless ( $part_pkg_taxrate ) {
if ( $hash->{taxproductnum} ) {