Pint
This commit is contained in:
@@ -210,13 +210,13 @@ class AcceptanceController extends Controller
|
||||
|
||||
// Add custom fields for asset (show_in_email = 1, field_encrypted = 0)
|
||||
$customFields = [];
|
||||
if ($item instanceof \App\Models\Asset && $item->model && $item->model->fieldset) {
|
||||
if ($item instanceof Asset && $item->model && $item->model->fieldset) {
|
||||
$fields = $item->model->fieldset->fields->where('show_in_email', true)->where('field_encrypted', false);
|
||||
foreach ($fields as $field) {
|
||||
$label = $field->name;
|
||||
$dbColumn = $field->db_column;
|
||||
$value = $item->$dbColumn;
|
||||
if (!is_null($value) && $value !== '') {
|
||||
if (! is_null($value) && $value !== '') {
|
||||
$customFields[] = [
|
||||
'label' => $label,
|
||||
'value' => $value,
|
||||
@@ -224,7 +224,7 @@ class AcceptanceController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($customFields)) {
|
||||
if (! empty($customFields)) {
|
||||
$data['custom_fields'] = $customFields;
|
||||
}
|
||||
|
||||
|
||||
@@ -244,12 +244,12 @@ class CheckoutAcceptance extends Model
|
||||
$pdf->writeHTML(trans('admin/hardware/form.serial').': '.e($data['item_serial']), true, 0, true, 0, '');
|
||||
}
|
||||
// Render custom fields if present
|
||||
if (!empty($data['custom_fields']) && is_array($data['custom_fields'])) {
|
||||
if (! empty($data['custom_fields']) && is_array($data['custom_fields'])) {
|
||||
foreach ($data['custom_fields'] as $customField) {
|
||||
$label = $customField['label'] ?? '';
|
||||
$value = $customField['value'] ?? '';
|
||||
if ($label !== '' && $value !== '') {
|
||||
$pdf->writeHTML(e($label) . ': ' . e($value), true, 0, true, 0, '');
|
||||
$pdf->writeHTML(e($label).': '.e($value), true, 0, true, 0, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -265,7 +265,6 @@ class CheckoutAcceptance extends Model
|
||||
$pdf->Ln();
|
||||
$pdf->writeHTML('<hr>', true, 0, true, 0, '');
|
||||
|
||||
|
||||
// Break the EULA into lines based on newlines, and check each line for RTL or CJK characters
|
||||
$eula_lines = preg_split("/\r\n|\n|\r/", $data['eula']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user