u
This commit is contained in:
@@ -19,7 +19,7 @@ import DeleteForeverIcon from '@mui/icons-material/DeleteForever';
|
||||
import DeleteIcon from '@mui/icons-material/Delete';
|
||||
import GoogleIcon from '@mui/icons-material/Google';
|
||||
import WebIcon from '@mui/icons-material/Web';
|
||||
import EscalatorWarningIcon from '@mui/icons-material/EscalatorWarning';
|
||||
import EngineeringIcon from '@mui/icons-material/Engineering';
|
||||
import PictureAsPdfIcon from '@mui/icons-material/PictureAsPdf';
|
||||
import ManageSearchIcon from '@mui/icons-material/ManageSearch';
|
||||
import LensBlurIcon from '@mui/icons-material/LensBlur';
|
||||
@@ -91,7 +91,9 @@ const TOOL_ICON_MAP = {
|
||||
rm: DeleteIcon,
|
||||
web_search: GoogleFaviconIcon,
|
||||
url_get: WebIcon,
|
||||
sub_agent: EscalatorWarningIcon,
|
||||
subagent: EngineeringIcon,
|
||||
sub_agent: EngineeringIcon,
|
||||
'sub-agent': EngineeringIcon,
|
||||
pdf_read: PictureAsPdfIcon,
|
||||
search_articles: ManageSearchIcon,
|
||||
edit_image: LensBlurIcon,
|
||||
|
||||
@@ -454,7 +454,7 @@ export function collectFilesForUpload(attachments = [], { onlyNew = false } = {}
|
||||
*/
|
||||
export async function buildManifestBody(
|
||||
form,
|
||||
{ partyField, requireAtLeastOne, externalNumber: useExternalNumber, kind, isUpdate, mode },
|
||||
{ partyField, requireAtLeastOne, externalNumber: useExternalNumber, kind, isUpdate, mode, omitLines },
|
||||
) {
|
||||
const date = form.date;
|
||||
if (!date) throw new Error('Datum fehlt.');
|
||||
@@ -462,6 +462,7 @@ export async function buildManifestBody(
|
||||
const externalNumber = String(form.externalNumber ?? '').trim();
|
||||
const isEdit = isUpdate != null ? Boolean(isUpdate) : (mode === 'edit' || !requireAtLeastOne);
|
||||
const shouldRequireLine = requireAtLeastOne !== false;
|
||||
const shouldIncludeLines = !omitLines && form.lines !== undefined && form.lines !== null;
|
||||
|
||||
let body;
|
||||
if (kind === 'delivery') {
|
||||
@@ -470,8 +471,10 @@ export async function buildManifestBody(
|
||||
body = {
|
||||
externalNumber: externalNumber || null,
|
||||
date,
|
||||
lines: buildLines(form.lines, { requireAtLeastOne: shouldRequireLine }),
|
||||
};
|
||||
if (shouldIncludeLines) {
|
||||
body.lines = buildLines(form.lines, { requireAtLeastOne: shouldRequireLine });
|
||||
}
|
||||
} else {
|
||||
let number = String(form.number ?? '').trim();
|
||||
if (!number) {
|
||||
@@ -481,8 +484,10 @@ export async function buildManifestBody(
|
||||
body = {
|
||||
number,
|
||||
date,
|
||||
lines: buildLines(form.lines, { requireAtLeastOne: shouldRequireLine }),
|
||||
};
|
||||
if (shouldIncludeLines) {
|
||||
body.lines = buildLines(form.lines, { requireAtLeastOne: shouldRequireLine });
|
||||
}
|
||||
if (useExternalNumber || form.externalNumber != null) {
|
||||
body.externalNumber = externalNumber || null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user