Update index.html
1 file changed+17−2
index.html+17−2View file
| @@ -2508,8 +2508,23 @@ | ||
| function commitActiveTimesheet(newStatus) { | ||
| activeEditorTimesheet.status = newStatus; | ||
| if (activeAttachedInvoice) { | ||
| - activeEditorTimesheet.invoiceFileName = activeAttachedInvoice.name; | ||
| - activeEditorTimesheet.invoiceFileData = activeAttachedInvoice.data; | ||
| + activeEditorTimesheet.invoiceFileName = activeAttachedInvoice.name || ''; | ||
| + activeEditorTimesheet.invoiceFileData = activeAttachedInvoice.data || ''; | ||
| + activeEditorTimesheet.invoiceFileSize = activeAttachedInvoice.sizeBytes || 0; | ||
| + activeEditorTimesheet.invoiceContentType = activeAttachedInvoice.type || 'application/pdf'; | ||
| + if (activeAttachedInvoice.fileUrl) { | ||
| + activeEditorTimesheet.invoiceFileUrl = activeAttachedInvoice.fileUrl; | ||
| + } | ||
| + if (activeAttachedInvoice.fileId) { | ||
| + activeEditorTimesheet.invoiceFile = activeAttachedInvoice.fileId; | ||
| + } | ||
| + } else { | ||
| + activeEditorTimesheet.invoiceFileName = ''; | ||
| + activeEditorTimesheet.invoiceFileData = ''; | ||
| + activeEditorTimesheet.invoiceFileSize = 0; | ||
| + activeEditorTimesheet.invoiceContentType = ''; | ||
| + activeEditorTimesheet.invoiceFileUrl = ''; | ||
| + activeEditorTimesheet.invoiceFile = null; | ||
| } | ||
| // Insert or update in state.timesheets | ||