Document form missing value controller add..
This commit is contained in:
parent
2c673f9ed6
commit
db0d424de2
@ -67,9 +67,17 @@ abstract class DocumentForm extends Component
|
|||||||
/** Metadata Component Start */
|
/** Metadata Component Start */
|
||||||
public $contacts;
|
public $contacts;
|
||||||
|
|
||||||
|
public $contact;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
public $contactType;
|
public $contactType;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
public $contactSearchRoute;
|
||||||
|
|
||||||
|
/** @var string */
|
||||||
|
public $contactCreateRoute;
|
||||||
|
|
||||||
/** @var bool */
|
/** @var bool */
|
||||||
public $hideContact;
|
public $hideContact;
|
||||||
|
|
||||||
@ -166,7 +174,7 @@ abstract class DocumentForm extends Component
|
|||||||
bool $hideCompany = false, bool $hideAdvanced = false, bool $hideFooter = false, bool $hideButtons = false,
|
bool $hideCompany = false, bool $hideAdvanced = false, bool $hideFooter = false, bool $hideButtons = false,
|
||||||
/** Content Component End */
|
/** Content Component End */
|
||||||
/** Metadata Component Start */
|
/** Metadata Component Start */
|
||||||
$contacts = [], string $contactType = '',
|
$contacts = [], $contact = false, string $contactType = '', string $contactSearchRoute = '', string $contactCreateRoute = '',
|
||||||
bool $hideContact = false, bool $hideIssuedAt = false, bool $hideDocumentNumber = false, bool $hideDueAt = false, bool $hideOrderNumber = false,
|
bool $hideContact = false, bool $hideIssuedAt = false, bool $hideDocumentNumber = false, bool $hideDueAt = false, bool $hideOrderNumber = false,
|
||||||
string $textDocumentNumber = '', string $textOrderNumber = '', string $textIssuedAt = '', string $textDueAt = '',
|
string $textDocumentNumber = '', string $textOrderNumber = '', string $textIssuedAt = '', string $textDueAt = '',
|
||||||
string $issuedAt = '', string $documentNumber = '', string $dueAt = '', string $orderNumber = '',
|
string $issuedAt = '', string $documentNumber = '', string $dueAt = '', string $orderNumber = '',
|
||||||
@ -207,6 +215,7 @@ abstract class DocumentForm extends Component
|
|||||||
|
|
||||||
/** Metadata Component Start */
|
/** Metadata Component Start */
|
||||||
$this->contacts = $this->getContacts($type, $contacts);
|
$this->contacts = $this->getContacts($type, $contacts);
|
||||||
|
$this->contact = $this->getContact($contact, $document);
|
||||||
$this->contactType = $this->getContactType($type, $contactType);
|
$this->contactType = $this->getContactType($type, $contactType);
|
||||||
|
|
||||||
$this->hideContact = $hideContact;
|
$this->hideContact = $hideContact;
|
||||||
@ -283,6 +292,21 @@ abstract class DocumentForm extends Component
|
|||||||
return $contacts;
|
return $contacts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function getContact($contact, $document)
|
||||||
|
{
|
||||||
|
if (!empty($contact)) {
|
||||||
|
return $contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
$contact = new \stdClass();
|
||||||
|
|
||||||
|
if (!empty($document) && !empty($document->contact)) {
|
||||||
|
$contact = $document->contact;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $contact;
|
||||||
|
}
|
||||||
|
|
||||||
protected function getContactType($type, $contact_type)
|
protected function getContactType($type, $contact_type)
|
||||||
{
|
{
|
||||||
if (!empty($contact_type)) {
|
if (!empty($contact_type)) {
|
||||||
|
@ -37,16 +37,26 @@
|
|||||||
:document="$document"
|
:document="$document"
|
||||||
hide-contact="{{ $hideContact }}"
|
hide-contact="{{ $hideContact }}"
|
||||||
contact-type="{{ $contactType }}"
|
contact-type="{{ $contactType }}"
|
||||||
|
:contact="$contact"
|
||||||
|
:contacts="$contacts"
|
||||||
|
:search_route="$contactSearchRoute"
|
||||||
|
:create_route="$contactCreateRoute"
|
||||||
hide-issue-at="{{ $hideIssuedAt }}"
|
hide-issue-at="{{ $hideIssuedAt }}"
|
||||||
text-issue-at="{{ $textIssuedAt }}"
|
text-issue-at="{{ $textIssuedAt }}"
|
||||||
|
issue-at="{{ $issuedAt }}"
|
||||||
hide-document-number="{{ $hideDocumentNumber }}"
|
hide-document-number="{{ $hideDocumentNumber }}"
|
||||||
text-document-number="{{ $textDocumentNumber }}"
|
text-document-number="{{ $textDocumentNumber }}"
|
||||||
|
document-number="{{ $documentNumber }}"
|
||||||
hide-due-at="{{ $hideDueAt }}"
|
hide-due-at="{{ $hideDueAt }}"
|
||||||
text-due-at="{{ $textDueAt }}"
|
text-due-at="{{ $textDueAt }}"
|
||||||
|
due-at="{{ $dueAt }}"
|
||||||
hide-order-number="{{ $hideOrderNumber }}"
|
hide-order-number="{{ $hideOrderNumber }}"
|
||||||
text-order-number="{{ $textOrderNumber }}"
|
text-order-number="{{ $textOrderNumber }}"
|
||||||
|
order-number="{{ $orderNumber }}"
|
||||||
hide-edit-item-columns="{{ $hideEditItemColumns }}"
|
hide-edit-item-columns="{{ $hideEditItemColumns }}"
|
||||||
hide-items="{{ $hideItems }}"
|
hide-items="{{ $hideItems }}"
|
||||||
|
hide-name="{{ $hideName }}"
|
||||||
|
hide-description="{{ $hideDescription }}"
|
||||||
text-items="{{ $textItems }}"
|
text-items="{{ $textItems }}"
|
||||||
hide-quantity="{{ $hideQuantity }}"
|
hide-quantity="{{ $hideQuantity }}"
|
||||||
text-quantity="{{ $textQuantity }}"
|
text-quantity="{{ $textQuantity }}"
|
||||||
@ -58,7 +68,10 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
@if (!$hideFooter)
|
@if (!$hideFooter)
|
||||||
<x-documents.form.footer type="{{ $type }}" :document="$document" />
|
<x-documents.form.footer
|
||||||
|
type="{{ $type }}"
|
||||||
|
:document="$document"
|
||||||
|
/>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if (!$hideAdvanced)
|
@if (!$hideAdvanced)
|
||||||
|
@ -5,14 +5,22 @@
|
|||||||
:document="$document"
|
:document="$document"
|
||||||
hide-contact="{{ $hideContact }}"
|
hide-contact="{{ $hideContact }}"
|
||||||
contact-type="{{ $contactType }}"
|
contact-type="{{ $contactType }}"
|
||||||
|
:contact="$contact"
|
||||||
|
:contacts="$contacts"
|
||||||
|
:search_route="$contactSearchRoute"
|
||||||
|
:create_route="$contactCreateRoute"
|
||||||
hide-issue-at="{{ $hideIssuedAt }}"
|
hide-issue-at="{{ $hideIssuedAt }}"
|
||||||
text-issue-at="{{ $textIssuedAt }}"
|
text-issue-at="{{ $textIssuedAt }}"
|
||||||
|
issue-at="{{ $issuedAt }}"
|
||||||
hide-document-number="{{ $hideDocumentNumber }}"
|
hide-document-number="{{ $hideDocumentNumber }}"
|
||||||
text-document-number="{{ $textDocumentNumber }}"
|
text-document-number="{{ $textDocumentNumber }}"
|
||||||
|
document-number="{{ $documentNumber }}"
|
||||||
hide-due-at="{{ $hideDueAt }}"
|
hide-due-at="{{ $hideDueAt }}"
|
||||||
text-due-at="{{ $textDueAt }}"
|
text-due-at="{{ $textDueAt }}"
|
||||||
|
due-at="{{ $dueAt }}"
|
||||||
hide-order-number="{{ $hideOrderNumber }}"
|
hide-order-number="{{ $hideOrderNumber }}"
|
||||||
text-order-number="{{ $textOrderNumber }}"
|
text-order-number="{{ $textOrderNumber }}"
|
||||||
|
order-number="{{ $orderNumber }}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<x-documents.form.items
|
<x-documents.form.items
|
||||||
@ -20,6 +28,8 @@
|
|||||||
:document="$document"
|
:document="$document"
|
||||||
hide-edit-item-columns="{{ $hideEditItemColumns }}"
|
hide-edit-item-columns="{{ $hideEditItemColumns }}"
|
||||||
hide-items="{{ $hideItems }}"
|
hide-items="{{ $hideItems }}"
|
||||||
|
hide-name="{{ $hideName }}"
|
||||||
|
hide-description="{{ $hideDescription }}"
|
||||||
text-items="{{ $textItems }}"
|
text-items="{{ $textItems }}"
|
||||||
hide-quantity="{{ $hideQuantity }}"
|
hide-quantity="{{ $hideQuantity }}"
|
||||||
text-quantity="{{ $textQuantity }}"
|
text-quantity="{{ $textQuantity }}"
|
||||||
|
@ -2,7 +2,13 @@
|
|||||||
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
<div class="col-sm-6 col-md-6 col-lg-6 col-xl-6">
|
||||||
@if (!$hideContact)
|
@if (!$hideContact)
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<x-select-contact-card type="{{ $contactType }}" :contact="($document) ? $document->contact : new stdClass()"/>
|
<x-select-contact-card
|
||||||
|
type="{{ $contactType }}"
|
||||||
|
:contact="$contact"
|
||||||
|
:contacts="$contacts"
|
||||||
|
:search_route="$contactSearchRoute"
|
||||||
|
:create_route="$contactCreateRoute"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user