diff options
-rw-r--r-- | catalog.cfg | 3 | ||||
-rw-r--r-- | config/pikul.tag | 20 | ||||
-rw-r--r-- | config/pikul_cost.tag | 6 | ||||
-rw-r--r-- | config/pikul_order.tag | 7 | ||||
-rw-r--r-- | products/ship/shipping.asc | 4 |
5 files changed, 39 insertions, 1 deletions
diff --git a/catalog.cfg b/catalog.cfg index 5f84b3f..e8668fa 100644 --- a/catalog.cfg +++ b/catalog.cfg @@ -759,4 +759,5 @@ Jobs base_directory etc/jobs Variable PIKUL 0 Variable PIKUL_ANTERAJA 1 -Variable PIKUL_END 2 +Variable PIKUL_SICEPAT 2 +Variable PIKUL_END 3 diff --git a/config/pikul.tag b/config/pikul.tag index db2d8ea..398cef0 100644 --- a/config/pikul.tag +++ b/config/pikul.tag @@ -43,6 +43,26 @@ sub { wantarray => 1})->[0]->[0] || ''; $code_prefixes[$company] = 'anteraja_'; $name_prefixes[$company] = 'Anteraja '; + } elsif ($company == $::Variable->{PIKUL_SICEPAT}) { + my $api_key = $::Variable->{SICEPAT_API_KEY} + || $Global::Variable->{SICEPAT_API_KEY}; + if (!$api_key) { + $origins[$company] = undef; + $destinations[$company] = undef; + $code_prefixes[$company] = undef; + $name_prefixes[$company] = undef; + next; + } + Pikul::init($company, [ + $api_key + ]); + $origins[$company] = $::Variable->{SICEPAT_ORIGIN} + || $Global::Variable->{SICEPAT_ORIGIN}; + $destinations[$company] = $Tag->query({sql => "SELECT code FROM sicepat_destination\ + WHERE district LIKE '%$district%'", + wantarray => 1})->[0]->[0] || ''; + $code_prefixes[$company] = 'sicepat_'; + $name_prefixes[$company] = 'SiCepat '; } } my $elements = Pikul::html( diff --git a/config/pikul_cost.tag b/config/pikul_cost.tag index 4b8aad0..199e503 100644 --- a/config/pikul_cost.tag +++ b/config/pikul_cost.tag @@ -11,6 +11,12 @@ sub { ); $origin = $::Variable->{ANTERAJA_ORIGIN}; $table = 'anteraja'; + } elsif ($company == $::Variable->{PIKUL_SICEPAT}) { + @provisions = ( + $Global::Variable->{SICEPAT_API_KEY} + ); + $origin = $::Variable->{SICEPAT_ORIGIN}; + $table = 'sicepat_destination'; } use Pikul; Pikul::init($company, \@provisions); diff --git a/config/pikul_order.tag b/config/pikul_order.tag index f8bf255..35845f6 100644 --- a/config/pikul_order.tag +++ b/config/pikul_order.tag @@ -21,6 +21,13 @@ sub { $Global::Variable->{ANTERAJA_PREFIX} ); $origin = $::Variable->{ANTERAJA_ORIGIN}; + } elsif (substr($table, 0, 7) eq 'sicepat') { + $company = $::Variable->{PIKUL_SICEPAT}; + @provisions = ( + $Global::Variable->{SICEPAT_API_KEY} + ); + $origin = $::Variable->{SICEPAT_ORIGIN}; + $table .= '_destination'; } my @items = @{$Tag->query({sql => "SELECT sku,quantity FROM orderline WHERE \ order_number='$order_number'", diff --git a/products/ship/shipping.asc b/products/ship/shipping.asc index 8c64631..21e2c54 100644 --- a/products/ship/shipping.asc +++ b/products/ship/shipping.asc @@ -9,3 +9,7 @@ anteraja_ND: Anteraja Next Day anteraja_SD: Anteraja Same Day crit weight cost f [pikul_cost company=__PIKUL_ANTERAJA__ service='SD' district='[evalue address2]' city='[evalue city]' province='[evalue state]' weight=@@TOTAL@@] + +sicepat_REG: SiCepat Regular + crit weight + cost f [pikul_cost company=__PIKUL_SICEPAT__ service='REG' district='[evalue address2]' city='[evalue city]' province='[evalue state]' weight=@@TOTAL@@] |