Fixed rounding bug on invoice total calculation BOD-120. Added documents viewing to edit invoice BOD-75 BOD-63.

This commit is contained in:
Patrick Fic
2020-05-07 09:25:48 -07:00
parent 9d4b36aeec
commit 723f8da825
13 changed files with 65 additions and 30 deletions

View File

@@ -4,9 +4,15 @@ import DocumentsUploadContainer from "../documents-upload/documents-upload.conta
import JobsDocumentsDownloadButton from "./jobs-document-gallery.download.component";
import JobsDocumentsDeleteButton from "./jobs-documents-gallery.delete.component";
function JobsDocumentsComponent({ data, jobId, refetch }) {
function JobsDocumentsComponent({
data,
jobId,
refetch,
invoiceId,
invoicesCallback,
}) {
const [galleryImages, setgalleryImages] = useState([]);
console.log("Gallery Data", data);
useEffect(() => {
setgalleryImages(
data.reduce((acc, value) => {
@@ -28,17 +34,18 @@ function JobsDocumentsComponent({ data, jobId, refetch }) {
}, [data, setgalleryImages]);
return (
<div className='clearfix'>
<div className="clearfix">
<DocumentsUploadContainer
jobId={jobId}
callbackAfterUpload={refetch}
invoiceId={invoiceId}
callbackAfterUpload={invoicesCallback || refetch}
tagsArray={["test"]}
/>
<JobsDocumentsDownloadButton galleryImages={galleryImages} />
<JobsDocumentsDeleteButton
galleryImages={galleryImages}
deletionCallback={refetch}
deletionCallback={invoicesCallback || refetch}
/>
<Gallery