Skip to content

Commit

Permalink
Some fields editable in COPARN
Browse files Browse the repository at this point in the history
  • Loading branch information
sabas committed Jan 30, 2020
1 parent 167f97e commit 4f50409
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/Generator/Coparn.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ public function setDTMMessageSendingTime($dtm)
* @param $sequence
* @return \EDI\Generator\Coparn
*/
public function setBooking($booking, $sequence)
public function setBooking($booking, $sequence = null)
{
$this->booking = self::rffSegment('BN', $booking);
$this->bookingSequence = self::rffSegment('SQ', $sequence);
if ($sequence !== null) {
$this->bookingSequence = self::rffSegment('SQ', $sequence);
}

return $this;
}
Expand Down Expand Up @@ -196,11 +198,13 @@ public function setFND($loc)
* $size = 22G1, 42G1, etc
* @param $number
* @param $size
* @return \EDI\Generator\Coparn
* @param $statusCode
* @param $fullEmptyIndicator
* @return \EDI\Generator\Codeco\Container
*/
public function setContainer($number, $size)
public function setContainer($number, $size, $statusCode = 2, $fullEmptyIndicator = 5)
{
$this->cntr = self::eqdSegment('CN', $number, [$size, '102', '5'], '', 2, 5);
$this->cntr = self::eqdSegment('CN', $number, [$size, '102', '5'], '', $statusCode, $fullEmptyIndicator);

return $this;
}
Expand Down Expand Up @@ -391,7 +395,9 @@ public function compose(?string $sMessageFunctionCode = "5", ?string $sDocumentN
$this->messageContent[] = $this->messageSender;
$this->messageContent[] = $this->messageCF;
$this->messageContent[] = $this->cntr;
$this->messageContent[] = $this->bookingSequence;
if ($this->bookingSequence !== null) {
$this->messageContent[] = $this->bookingSequence;
}

if ($this->cntr === '') {
$this->messageContent[] = $this->cntrAmount;
Expand Down

0 comments on commit 4f50409

Please sign in to comment.