summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-24 19:44:28 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-24 19:44:28 +0800
commit00d6b5d1c05e67ad894157812fb0213823a56ca2 (patch)
tree7074ea3eb949db4064742e1dd5e9b2aa44451228
parent3dd8b4fd7b317c78872a251fd1ed68d17b54d834 (diff)
parentc8b227b1508ceef861a7f3dc1225ba9bb07735d9 (diff)
Merge branch 'master' into sicepat
-rw-r--r--config/pikul.tag6
-rw-r--r--config/pikul_cost.tag3
2 files changed, 6 insertions, 3 deletions
diff --git a/config/pikul.tag b/config/pikul.tag
index 5f49ff0..398cef0 100644
--- a/config/pikul.tag
+++ b/config/pikul.tag
@@ -3,6 +3,8 @@ 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};
@@ -36,8 +38,8 @@ sub {
]);
$origins[$company] = $::Variable->{ANTERAJA_ORIGIN}
|| $Global::Variable->{ANTERAJA_ORIGIN};
- $destinations[$company] = $Tag->query({sql => "SELECT code FROM anteraja WHERE\
- district LIKE '%$district%'",
+ $destinations[$company] = $Tag->query({sql => "SELECT code FROM anteraja WHERE \
+ district='$district' AND city='$city' AND province='$province'",
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 24dd9a1..199e503 100644
--- a/config/pikul_cost.tag
+++ b/config/pikul_cost.tag
@@ -25,7 +25,8 @@ sub {
$service,
$origin,
$Tag->query({
- sql => "SELECT code FROM $table WHERE district LIKE '%$district%'",
+ sql => "SELECT code FROM $table WHERE district='$district' AND \
+ city='$city' AND province='$province'",
wantarray => 1
})->[0]->[0] || '',
$weight);