summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-24 18:13:56 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-24 18:13:56 +0800
commitf6204deab03d98ff78a999463879a0f9063ff61d (patch)
treeb7039f1bb106f36afbe1942b6f9bd2e6822c68d8 /config
parent02ff6591ba83e1b8a934ec8017f8af7a45657fa8 (diff)
Destination code relies on district only
Diffstat (limited to 'config')
-rw-r--r--config/pikul.tag6
-rw-r--r--config/pikul_cost.tag3
2 files changed, 3 insertions, 6 deletions
diff --git a/config/pikul.tag b/config/pikul.tag
index db2d8ea..7a447e7 100644
--- a/config/pikul.tag
+++ b/config/pikul.tag
@@ -3,8 +3,6 @@ UserTag pikul Routine <<EOR
sub {
my ($widget, $extra) = @_;
my $district = $Tag->value('address2');
- my $city = $Tag->value('city');
- my $province = $Tag->value('state');
my $weight = 0.0;
for my $item (@{$Carts->{main}}) {
$weight += $Tag->data('products', 'weight', $item->{code}) * $item->{quantity};
@@ -38,8 +36,8 @@ sub {
]);
$origins[$company] = $::Variable->{ANTERAJA_ORIGIN}
|| $Global::Variable->{ANTERAJA_ORIGIN};
- $destinations[$company] = $Tag->query({sql => "SELECT code FROM anteraja WHERE \
- district='$district' AND city='$city' AND province='$province'",
+ $destinations[$company] = $Tag->query({sql => "SELECT code FROM anteraja WHERE\
+ district LIKE '%$district%'",
wantarray => 1})->[0]->[0] || '';
$code_prefixes[$company] = 'anteraja_';
$name_prefixes[$company] = 'Anteraja ';
diff --git a/config/pikul_cost.tag b/config/pikul_cost.tag
index 4b8aad0..2b2e5e1 100644
--- a/config/pikul_cost.tag
+++ b/config/pikul_cost.tag
@@ -19,8 +19,7 @@ sub {
$service,
$origin,
$Tag->query({
- sql => "SELECT code FROM $table WHERE district='$district' AND \
- city='$city' AND province='$province'",
+ sql => "SELECT code FROM $table WHERE district LIKE '%$district%'",
wantarray => 1
})->[0]->[0] || '',
$weight);