Skip to content

Commit

Permalink
[MIG] delivery_aras: Migration to 16.0 #78
Browse files Browse the repository at this point in the history
  • Loading branch information
milleniumkid committed Jan 6, 2025
1 parent d91a045 commit b8e4cf1
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 197 deletions.
4 changes: 4 additions & 0 deletions delivery_aras/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright 2024 Ahmet Yiğit Budak (https://github.com/yibudak)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

# Copyright 2024 Ismail Cagan Yilmaz (https://github.com/milleniumkid)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import models
10 changes: 7 additions & 3 deletions delivery_aras/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# Copyright 2024 Ahmet Yiğit Budak (https://github.com/yibudak)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

# Copyright 2024 Ismail Cagan Yilmaz (https://github.com/milleniumkid)
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
"name": "Delivery Aras",
"summary": "Delivery Carrier implementation for Aras Kargo API",
"version": "12.0.1.1.0",
"version": "16.0.1.1.0",
"category": "Stock",
"website": "https://github.com/odoo-turkey",
"author": "Yiğit Budak, Odoo Turkey Localization Group",
"license": "AGPL-3",
"license": "LGPL-3",
"application": False,
"installable": True,
"depends": ["delivery_integration_base"],
"external_dependencies": {"python": ["phonenumbers", "zeep"]},
"data": [
"views/delivery_aras_view.xml",
# 'report/aras_carrier_label.xml',
'report/aras_carrier_label.xml',
'report/aras_sms_template.xml',
# 'report/reports.xml',

Expand Down
194 changes: 97 additions & 97 deletions delivery_aras/docs/Sevkiyat Entegrasyonu/Örnek Php/aras .php
Original file line number Diff line number Diff line change
@@ -1,98 +1,98 @@
<?

/*****
Aras Class w/o barcode
Brandwolf
28.12.2016
*****/

class aras {
function order() {
$return = array(
"UserName" => $this->UserName,
"Password" => $this->Password,
"TradingWaybillNumber" => $this->TradingWaybillNumber,
"InvoiceNumber" => $this->InvoiceNumber,
"IntegrationCode" => $this->IntegrationCode,
"ReceiverName" => $this->ReceiverName,
"ReceiverAddress" => $this->ReceiverAddress,
"ReceiverCityName" => $this->ReceiverCityName,
"ReceiverTownName" => $this->ReceiverTownName,
"ReceiverDistrictName" => $this->ReceiverDistrictName,
"ReceiverQuarterName" => $this->ReceiverQuarterName,
"ReceiverAvenueName" => $this->ReceiverAvenueName,
"ReceiverStreetName" => $this->ReceiverStreetName,
"ReceiverPhone1" => $this->ReceiverPhone1,
"ReceiverPhone2" => $this->ReceiverPhone2,
"ReceiverPhone3" => $this->ReceiverPhone3,
"VolumetricWeight" => $this->VolumetricWeight,
"Weight" => $this->Weight,
"CityCode" => $this->CityCode,
"TownCode" => $this->TownCode,
"SpecialField1" => $this->SpecialField1,
"SpecialField2" => $this->SpecialField2,
"SpecialField3" => $this->SpecialField3,
"IsCod" => $this->IsCod,
"CodAmount" => $this->CodAmount,
"CodCollectionType" => $this->CodCollectionType,
"CodBillingType" => $this->CodBillingType,
"TaxNumber" => $this->TaxNumber,
"TaxOffice" => $this->TaxOffice,
"PayorTypeCode" => $this->PayorTypeCode,
"IsWorldWide" => $this->IsWorldWide,
"Description" => $this->Description,
);
if ($this->pieces) {
$return["PieceDetails"] = $this->PieceDetails();
$return["PieceCount"] = count($this->PieceDetails());
}
return $return;
}

function PieceDetails() {
foreach ($this->pieces as $piece) {
$return[] = array(
"VolumetricWeight" =>$piece->VolumetricWeight,
"Weight" =>$piece->Weight,
"BarcodeNumber" =>$piece->BarcodeNumber,
"ProductNumber" =>$piece->ProductNumber,
"Description" =>$piece->Description,
);
}
return $return;
}

function setOrder() {
try {
$client = new SoapClient($this->url, array("encoding"=>"UTF-8"));
$response=$client->SetOrder(array("orderInfo"=>array("Order"=>$this->order()),"userName"=>$this->UserName,"password"=>$this->Password));
$return = (array) $response->SetOrderResult->OrderResultInfo;

} catch (Exception $exc) {
$return = $exc->getMessage();
}

return $return;
}


function randStr($length = 10) {
$str = "";
$characters = array_merge(range('A','Z'), range('a','z'), range('0','9'));
$max = count($characters) - 1;
for ($i = 0; $i < $length; $i++) {
$rand = mt_rand(0, $max);
$str .= $characters[$rand];
}
return $str;
}

/* Debugging */
function debugger($array){
echo '<pre>';
print_r($array);
echo '</pre>';
}
}

<?

/*****
Aras Class w/o barcode
Brandwolf
28.12.2016
*****/

class aras {
function order() {
$return = array(
"UserName" => $this->UserName,
"Password" => $this->Password,
"TradingWaybillNumber" => $this->TradingWaybillNumber,
"InvoiceNumber" => $this->InvoiceNumber,
"IntegrationCode" => $this->IntegrationCode,
"ReceiverName" => $this->ReceiverName,
"ReceiverAddress" => $this->ReceiverAddress,
"ReceiverCityName" => $this->ReceiverCityName,
"ReceiverTownName" => $this->ReceiverTownName,
"ReceiverDistrictName" => $this->ReceiverDistrictName,
"ReceiverQuarterName" => $this->ReceiverQuarterName,
"ReceiverAvenueName" => $this->ReceiverAvenueName,
"ReceiverStreetName" => $this->ReceiverStreetName,
"ReceiverPhone1" => $this->ReceiverPhone1,
"ReceiverPhone2" => $this->ReceiverPhone2,
"ReceiverPhone3" => $this->ReceiverPhone3,
"VolumetricWeight" => $this->VolumetricWeight,
"Weight" => $this->Weight,
"CityCode" => $this->CityCode,
"TownCode" => $this->TownCode,
"SpecialField1" => $this->SpecialField1,
"SpecialField2" => $this->SpecialField2,
"SpecialField3" => $this->SpecialField3,
"IsCod" => $this->IsCod,
"CodAmount" => $this->CodAmount,
"CodCollectionType" => $this->CodCollectionType,
"CodBillingType" => $this->CodBillingType,
"TaxNumber" => $this->TaxNumber,
"TaxOffice" => $this->TaxOffice,
"PayorTypeCode" => $this->PayorTypeCode,
"IsWorldWide" => $this->IsWorldWide,
"Description" => $this->Description,
);
if ($this->pieces) {
$return["PieceDetails"] = $this->PieceDetails();
$return["PieceCount"] = count($this->PieceDetails());
}
return $return;
}

function PieceDetails() {
foreach ($this->pieces as $piece) {
$return[] = array(
"VolumetricWeight" =>$piece->VolumetricWeight,
"Weight" =>$piece->Weight,
"BarcodeNumber" =>$piece->BarcodeNumber,
"ProductNumber" =>$piece->ProductNumber,
"Description" =>$piece->Description,
);
}
return $return;
}

function setOrder() {
try {
$client = new SoapClient($this->url, array("encoding"=>"UTF-8"));
$response=$client->SetOrder(array("orderInfo"=>array("Order"=>$this->order()),"userName"=>$this->UserName,"password"=>$this->Password));
$return = (array) $response->SetOrderResult->OrderResultInfo;

} catch (Exception $exc) {
$return = $exc->getMessage();
}

return $return;
}


function randStr($length = 10) {
$str = "";
$characters = array_merge(range('A','Z'), range('a','z'), range('0','9'));
$max = count($characters) - 1;
for ($i = 0; $i < $length; $i++) {
$rand = mt_rand(0, $max);
$str .= $characters[$rand];
}
return $str;
}

/* Debugging */
function debugger($array){
echo '<pre>';
print_r($array);
echo '</pre>';
}
}

?>
Expand Down
Loading

0 comments on commit b8e4cf1

Please sign in to comment.