|
@@ -217,8 +217,10 @@ $controller = new class($document_type, $document_number) {
|
|
|
$document = $this->requireDocument();
|
|
$document = $this->requireDocument();
|
|
|
|
|
|
|
|
$company_id = $this->request->int("company_id");
|
|
$company_id = $this->request->int("company_id");
|
|
|
- $company = $this->requireCompany($company_id);
|
|
|
|
|
- $document->company_id = $company->id;
|
|
|
|
|
|
|
+ if($company_id) {
|
|
|
|
|
+ $company = $this->requireCompany($company_id);
|
|
|
|
|
+ $document->company_id = $company->id;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if($document->isSalesOrder()) {
|
|
if($document->isSalesOrder()) {
|
|
|
$document->invoice_status = $this->request->int("invoice_status");
|
|
$document->invoice_status = $this->request->int("invoice_status");
|