IO-789 Adjust main job query to pull bill data.

This commit is contained in:
Patrick Fic
2021-03-19 15:36:18 -07:00
parent 4fec7cf186
commit 613ab4c540
4 changed files with 38 additions and 71 deletions

View File

@@ -1,26 +1,10 @@
import { Spin } from "antd";
import React from "react";
import AlertComponent from "../alert/alert.component";
export default function JobLinesBillRefernece({
jobline,
loading,
error,
billLinesObject,
}) {
if (loading)
return (
<div>
<Spin size="small" className="loading-spinner" />
</div>
);
if (!billLinesObject) return null;
export default function JobLinesBillRefernece({ jobline }) {
const billLine = jobline.billlines && jobline.billlines[0];
const billLine = billLinesObject[jobline.id];
if (!billLine) return null;
if (error) return <AlertComponent message={error.message} type="error" />;
return (
<div>{`${(billLine.actual_price * billLine.quantity).toFixed(2)} (${
billLine.bill.vendor.name