| @@ -5,6 +5,10 @@ | |||||
| <label for="name" class="form-label">{{ 'common.name' | translate }}*:</label> | <label for="name" class="form-label">{{ 'common.name' | translate }}*:</label> | ||||
| <input type="text" class="form-control" id="name" formControlName="name" required/> | <input type="text" class="form-control" id="name" formControlName="name" required/> | ||||
| </div> | </div> | ||||
| <div class="mb-3"> | |||||
| <label for="code" class="form-label">{{ 'common.code' | translate }}*:</label> | |||||
| <input type="text" class="form-control" id="code" formControlName="code" required/> | |||||
| </div> | |||||
| <button type="submit" class="btn btn-primary" [disabled]="form.invalid">{{ 'basic.send' | translate }} | <button type="submit" class="btn btn-primary" [disabled]="form.invalid">{{ 'basic.send' | translate }} | ||||
| </button> | </button> | ||||
| </form> | </form> | ||||
| @@ -6,7 +6,11 @@ | |||||
| <input type="text" class="form-control" id="name" formControlName="name" required/> | <input type="text" class="form-control" id="name" formControlName="name" required/> | ||||
| </div> | </div> | ||||
| <div class="mb-3"> | <div class="mb-3"> | ||||
| <label for="zone" class="form-label">{{ 'model.shipping_company' | translate }}:</label> | |||||
| <label for="code" class="form-label">{{ 'common.code' | translate }}*:</label> | |||||
| <input type="text" class="form-control" id="code" formControlName="code" required/> | |||||
| </div> | |||||
| <div class="mb-3"> | |||||
| <label for="company" class="form-label">{{ 'model.shipping_company' | translate }}:</label> | |||||
| <app-search-select #shippingCompanySearchSelect | <app-search-select #shippingCompanySearchSelect | ||||
| [formId]="'company'" | [formId]="'company'" | ||||
| [formLabelLangKey]="'model.shipping_company'" | [formLabelLangKey]="'model.shipping_company'" | ||||
| @@ -21,7 +21,7 @@ class ShippingCompanyApiToEntityMapper implements MapperInterface | |||||
| $dto = $from; | $dto = $from; | ||||
| assert($dto instanceof ShippingCompanyApi); | assert($dto instanceof ShippingCompanyApi); | ||||
| $entity = $dto->id ? $this->repository->find($dto->id) : new ShippingCompany($dto->name); | |||||
| $entity = $dto->id ? $this->repository->find($dto->id) : new ShippingCompany($dto->name, $dto->code); | |||||
| if ($dto->id && !$entity) { | if ($dto->id && !$entity) { | ||||
| throw new \Exception('ShippingCompany not found'); | throw new \Exception('ShippingCompany not found'); | ||||
| } | } | ||||