Recommend this page to a friend! |
Download |
Info | Documentation | Screenshots | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 54 | All time: 10,612 This week: 455 |
Version | License | PHP version | Categories | |||
d3edi 1.0.0 | Freeware | 7.2 | PHP 5, Databases, Content management |
Description | Author | |||||||||||||||||||||||
This package can process information exchanged electronically. Innovation Award |
|
- Collect EDI messages in DB - Other processes process collected messages and registries * status processed and ref records * status error and error message
The preferred way to install this extension is through composer.
Either run
$ composer require d3yii2/d3edi "*"
or add
"d3yii2/d3edi": "*"
to the require
section of your composer.json
file.
class DepoEdiBooking extends BaseDepoEdiBooking
{
public function loadEdi($ediMessage): void
{
$r = $ediMessage->readEdiMessage();
$this->booking_ref_number = $r->readEdiDataValue(['RFF',['1'=>'BN']],1,0);
$this->carier = $r->readEdiDataValue(['NAD',['1'=>'CA']],2,0);
$this->containerType = $r->readEdiDataValue(['EQD',['1'=>'CN']],3,0);
if(!$this->cont_type_id = CargoContTypeDictionary::getIdByEdiCode($containerType)){
$this->cont_type_id = null;
$this->addError('cont_type_id','Undefined container type: ' . $containerType);
}
}
}
$cnt = 0;
foreach(EdiMessage::find()->allNews() as $ediMessage){
if(!$transaction = $this->module->db->begintransaction()){
throw new \yii\db\Exception('can not start Begin transaction');
}
try {
$ediBooking = new DepoEdiBooking();
$ediBooking->loadEdi($ediMessage);
if ($ediBooking->hasErrors() || !$ediBooking->validate()) {
$ediMessage->saveError($ediBooking->getErrors());
continue;
}
if (!$ediBooking->save()) {
throw new D3ActiveRecordException($ediBooking);
}
$ediMessage->saveProcessed($ediBooking);
$transaction->commit();
$cnt ++;
continue;
}catch (Exception $e){
$transaction->rollBack();
Yii::error($e->getMessage());
Yii::error($e->getTraceAsString());
$ediMessage->saveError($e->getMessage());
}
}
return $cnt;
}
For showing unprocessed messages can use panel solution Yii2Panel
echo \unyii2\yii2panel\PanelWidget::widget([
'name' => 'MyAllerts',
]);
class MyModule extends Module
{
/
* @var array panels for PanelWidgets
*/
public $panels;
'mymodule' => [
'class' => 'MyModule',
'panels' => [
'MyAllerts' =>
[
[
'route' => 'edi/panel/message',
]
]
],
],
'edi' => [
'class' => 'd3yii2\d3edi\Module',
'accessRulesMessageRoles' => ['Depo3EdiFull']
],
Screenshots (1) | ||
Files (36) |
File | Role | Description | ||
---|---|---|---|---|
components (1 file) | ||||
controllers (3 files) | ||||
dictionaries (2 files) | ||||
doc (2 files) | ||||
gii (5 files) | ||||
logic (1 file) | ||||
messages (1 directory) | ||||
migrations (3 files) | ||||
models (8 files, 1 directory) | ||||
views (1 directory) | ||||
composer.json | Data | Auxiliary data | ||
LeftMenu.php | Aux. | Auxiliary script | ||
Module.php | Class | Class source | ||
README.md | Doc. | Documentation |
Files (36) | / | controllers |
File | Role | Description |
---|---|---|
PanelController.php | Class | Class source |
ProcessIncomingEdiController.php | Class | Class source |
TestController.php | Class | Class source |
Files (36) | / | dictionaries |
File | Role | Description |
---|---|---|
EdiCompanyDictionary.php | Class | Class source |
EdiMessageTypeDictionary.php | Class | Class source |
Files (36) | / | doc |
File | Role | Description |
---|---|---|
DbSchema.png | Data | Auxiliary data |
DbSchema.schemaxml | Data | Auxiliary data |
Files (36) | / | gii |
File | Role | Description |
---|---|---|
ediGiiantNModule.json | Data | Auxiliary data |
edi_companyGiiantModel.json | Data | Auxiliary data |
edi_messageGiiantModel.json | Data | Auxiliary data |
edi_message_refGiiantModel.json | Data | Auxiliary data |
edi_message_typeGiiantModel.json | Data | Auxiliary data |
Files (36) | / | migrations |
File | Role | Description |
---|---|---|
m200814_220707_init.php | Class | Class source |
m201130_200707_messages_add_filename.php | Class | Class source |
m210404_080707_message_add_compnent.php | Class | Class source |
Files (36) | / | models |
File | Role | Description | ||
---|---|---|---|---|
base (4 files) | ||||
EdiCompany.php | Class | Class source | ||
EdiMessage.php | Class | Class source | ||
EdiMessageQuery.php | Class | Class source | ||
EdiMessageRef.php | Class | Class source | ||
EdiMessageRefQuery.php | Class | Class source | ||
EdiMessageType.php | Class | Class source | ||
EdiMessageTypeQuery.php | Class | Class source | ||
SysModels.php | Class | Class source |
Files (36) | / | models | / | base |
File | Role | Description |
---|---|---|
EdiCompany.php | Class | Class source |
EdiMessage.php | Class | Class source |
EdiMessageRef.php | Class | Class source |
EdiMessageType.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
97% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.