protected function generateFields()
    {
        $data = $this->data;
        $title = $this->title;
        $assignment = $title->assignment;
        $assignor_person = $title->assignment->assignor->person;

        $doc_number = BankInterchange\Utils::padNumber($title->doc_number, 10);
        $value = $this->formatMoney($data['value']);

        $demonstrative = $this->simpleTemplate($data['demonstrative'] ?? '');
        $instructions = $this->simpleTemplate($data['instructions'] ?? '');

        $guarantor = ($title->guarantor !== null)
            ? $title->guarantor->person->name . '     '
            . $title->guarantor->address->outputShort()
            : '';

        $fields = [
            'accept'        => $title->accept,
            'addition'      => $data['addition'] ?? '',
            'agency_code'   => $this->formatAgencyAccount(true),
            'amount'        => $data['amount'] ?? '',
            'assignor'      => $assignor_person->name,
            'bank_use'      => $data['bank_use'] ?? '',
            'charged'       => $data['charged'] ?? '',
            'client'        => $title->client->person->name,
            'cpf_cnpj'      => $assignor_person->getFormattedDocument(),
            'currency'      => $title->currency->symbol,
            'date_document' => self::formatDate($title->emission),
            'date_due'      => self::formatDate($title->due),
            'date_process'  => date('d/m/Y'),
            'deduction'     => $data['deduction'] ?? '',
            'demonstrative' => trim($demonstrative),
            'discount'      => $data['discount'] ?? '',
            'doc_number'    => $doc_number,
            'doc_number_sh' => $doc_number,
            'doc_value'     => $value,
            'doc_value='    => $value,
            'doc_valueU'    => $data['doc_valueU'] ?? '',
            'fine'          => $data['fine'] ?? '',
            'guarantor'     => $guarantor,
            'instructions'  => trim($instructions),
            'kind'          => $title->kind->symbol,
            'our_number'    => $this->formatOurNumber(true),
            'payment_place' => $data['payment_place'] ?? '',
            'wallet'        => $assignment->wallet->symbol,
        ];

        $result = [];
        foreach ($fields as $field_key => $field_value) {
            $result[$field_key] = [
                'text' => $this->dictionary[$field_key],
                'value' => utf8_decode($field_value),
            ];
        }
        return $result;
    }
protected function generateFields()
    {
        $data = $this->data;
        $title = $this->title;
        $assignment = $title->assignment;
        $assignor_person = $title->assignment->assignor->person;

        $doc_number = BankInterchange\Utils::padNumber($title->doc_number, 10);
        $value = $this->formatMoney($data['value']);

        $demonstrative = $this->simpleTemplate($data['demonstrative'] ?? '');
        $instructions = $this->simpleTemplate($data['instructions'] ?? '');

        $guarantor = ($title->guarantor !== null)
            ? $title->guarantor->person->name . '     '
            . $title->guarantor->address->outputShort()
            : '';

        $fields = [
            'accept'        => $title->accept,
            'addition'      => $data['addition'] ?? '',
            'agency_code'   => $this->formatAgencyAccount(true),
            'amount'        => $data['amount'] ?? '',
            'assignor'      => $assignor_person->name,
            'bank_use'      => $data['bank_use'] ?? '',
            'charged'       => $data['charged'] ?? '',
            'client'        => $title->client->person->name,
            'cpf_cnpj'      => $assignor_person->getFormattedDocument(),
            'currency'      => $title->currency->symbol,
            'date_document' => self::formatDate($title->emission),
            'date_due'      => self::formatDate($title->due),
            'date_process'  => date('d/m/Y'),
            'deduction'     => $data['deduction'] ?? '',
            'demonstrative' => trim($demonstrative),
            'discount'      => $data['discount'] ?? '',
            'doc_number'    => $doc_number,
            'doc_number_sh' => $doc_number,
            'doc_value'     => $value,
            'doc_value='    => $value,
            'doc_valueU'    => $data['doc_valueU'] ?? '',
            'fine'          => $data['fine'] ?? '',
            'guarantor'     => $guarantor,
            'instructions'  => trim($instructions),
            'kind'          => $title->kind->symbol,
            'our_number'    => $this->formatOurNumber(true),
            'payment_place' => $data['payment_place'] ?? '',
            'wallet'        => $assignment->wallet->symbol,
        ];

        $result = [];
        foreach ($fields as $field_key => $field_value) {
            $result[$field_key] = [
                'text' => $this->dictionary[$field_key],
                'value' => utf8_decode($field_value),
            ];
        }
        return $result;
    }
protected function generateFields ( ) { $ data = $ this -> data ; $ title = $ this -> title ; $ assignment = $ title -> assignment ; $ assignor_person = $ title -> assignment -> assignor -> person ; $ doc_number = BankInterchange \ Utils :: padNumber ( $ title -> doc_number , 10 ) ; $ value = $ this -> formatMoney ( $ data [ 'value' ] ) ; $ demonstrative = $ this -> simpleTemplate ( $ data [ 'demonstrative' ] ?? '' ) ; $ instructions = $ this -> simpleTemplate ( $ data [ 'instructions' ] ?? '' ) ; $ guarantor = ( $ title -> guarantor !== null ) ? $ title -> guarantor -> person -> name . '     ' . $ title -> guarantor -> address -> outputShort ( ) : '' ; $ fields = [ 'accept' => $ title -> accept , 'addition' => $ data [ 'addition' ] ?? '' , 'agency_code' => $ this -> formatAgencyAccount ( true ) , 'amount' => $ data [ 'amount' ] ?? '' , 'assignor' => $ assignor_person -> name , 'bank_use' => $ data [ 'bank_use' ] ?? '' , 'charged' => $ data [ 'charged' ] ?? '' , 'client' => $ title -> client -> person -> name , 'cpf_cnpj' => $ assignor_person -> getFormattedDocument ( ) , 'currency' => $ title -> currency -> symbol , 'date_document' => self :: formatDate ( $ title -> emission ) , 'date_due' => self :: formatDate ( $ title -> due ) , 'date_process' => date ( 'd/m/Y' ) , 'deduction' => $ data [ 'deduction' ] ?? '' , 'demonstrative' => trim ( $ demonstrative ) , 'discount' => $ data [ 'discount' ] ?? '' , 'doc_number' => $ doc_number , 'doc_number_sh' => $ doc_number , 'doc_value' => $ value , 'doc_value=' => $ value , 'doc_valueU' => $ data [ 'doc_valueU' ] ?? '' , 'fine' => $ data [ 'fine' ] ?? '' , 'guarantor' => $ guarantor , 'instructions' => trim ( $ instructions ) , 'kind' => $ title -> kind -> symbol , 'our_number' => $ this -> formatOurNumber ( true ) , 'payment_place' => $ data [ 'payment_place' ] ?? '' , 'wallet' => $ assignment -> wallet -> symbol , ] ; $ result = [ ] ; foreach ( $ fields as $ field_key => $ field_value ) { $ result [ $ field_key ] = [ 'text' => $ this -> dictionary [ $ field_key ] , 'value' => utf8_decode ( $ field_value ) , ] ; } return $ result ; }
Generates fields to be drawn in the billet

@return array[]
Generates fields to be drawn in the billet