Commit 80268886 authored by Chanon.u's avatar Chanon.u
Browse files

Add validate declaration no for short message

parent 2f963e22
...@@ -294,7 +294,14 @@ class ManualResponse extends Component ...@@ -294,7 +294,14 @@ class ManualResponse extends Component
} }
//Validate profile production //Validate profile production
if(in_array($messageType, ['XCDA', 'XCDR']) && $declarationNo == ''){ if(in_array($messageType, ['XCDA', 'XCDR', 'SDCA', 'SDCR']) && $declarationNo == ''){
return [
"success" => false,
'message' => 'Cancel template is required "Declaration Number" field.'
];
}
if(str_starts_with($messageType, "XCDA_") && $declarationNo == ''){
return [ return [
"success" => false, "success" => false,
'message' => 'Cancel template is required "Declaration Number" field.' 'message' => 'Cancel template is required "Declaration Number" field.'
......
...@@ -283,7 +283,7 @@ return new class extends Migration ...@@ -283,7 +283,7 @@ return new class extends Migration
'type' => 'SDCA', 'type' => 'SDCA',
'name' => 'SHORT DECLARATION ACCEPTED', 'name' => 'SHORT DECLARATION ACCEPTED',
'description' => '', 'description' => '',
'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"IDCA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"ShortDeclarationAccept":{"DeclarationNumber":"","Message":"SHORT DECLARATION ACCEPTED"}}}}' 'template' => '{"root":"CustomsResponse","namespace":"http://ebxml.customs.go.th/XMLSchema/CustomsResponse_8_00","DocumentControl":{"MessageType":"SDCA","ReferenceNumber":"","RegistrationID":"TH0101075570001010000000001T0","DocumentDetail":{"ShortDeclarationAccept":{"DeclarationNumber":"","Message":"SHORT DECLARATION ACCEPTED"}}}}'
], ],
[ [
'mid' => 4, 'mid' => 4,
......
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