Commit 6377f0d0 authored by Chanon.u's avatar Chanon.u
Browse files

Update cancel matching for no gen declaration no.

parent e7a7151c
......@@ -132,6 +132,12 @@ class ManualResponse extends Component
$this->xmlContent = $xml['xmlContent'];
$this->xmlData = $xml['xmlWithData'];
//For response Export: 9904: Goods Transition Control Already Cancel Matching -> No auto-gen Declaration Number.
$messageCode = MasterResponseTemplates::where('id', $this->docType)->value('code') ?? '';
if($messageCode == '9904'){
$this->xmlData['DeclarationNumber'] = '';
}
if($this->lockData){
foreach($this->xmlData as $key => $val){
if(isset($tmp_xmlData[$key]) && !in_array($key, $this->listNonLockData)){
......@@ -228,7 +234,7 @@ class ManualResponse extends Component
'detail' => "Username: " . $userConnect->username . "\nLink: " . $userConnect->link,
'xml_content' => base64_encode($this->xmlContent),
'reference_number' => $this->xmlData['ReferenceNumber'] ?? $this->xmlData['ReferenceNo'] ?? '',
'declaration_number' => $this->xmlData['DeclarationNumber'] ?? '',
'declaration_number' => $this->xmlData['DeclarationNumber'] ?? $this->xmlData['DocumentNumber'] ?? '',
'link' => $userConnect->link
]);
......@@ -263,7 +269,7 @@ class ManualResponse extends Component
private function validateBeforeSend(){
$messageType = $this->xmlData['MessageType'] ?? '';
$referenceNo = $this->xmlData['ReferenceNumber'] ?? $this->xmlData['ReferenceNo'] ?? '';
$declarationNo = $this->xmlData['DeclarationNumber'] ?? '';
$declarationNo = $this->xmlData['DeclarationNumber'] ?? $this->xmlData['DocumentNumber'] ?? '';
$profileProds = ConfListProfile::where('type', 'PROD')->pluck('name')->toArray();
//Validate reference number format
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment