Added parts marking BOD-102

This commit is contained in:
Patrick Fic
2020-06-03 21:10:46 -07:00
parent 5244056e71
commit 7d4e73320d
8 changed files with 99 additions and 36 deletions

View File

@@ -1,4 +1,4 @@
<babeledit_project be_version="2.6.1" version="1.2"> <babeledit_project version="1.2" be_version="2.6.1">
<!-- <!--
BabelEdit project file BabelEdit project file
@@ -7563,6 +7563,27 @@
</translation> </translation>
</translations> </translations>
</concept_node> </concept_node>
<concept_node>
<name>mark</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node> <concept_node>
<name>postInvoices</name> <name>postInvoices</name>
<definition_loaded>false</definition_loaded> <definition_loaded>false</definition_loaded>
@@ -11347,6 +11368,27 @@
</translation> </translation>
</translations> </translations>
</concept_node> </concept_node>
<concept_node>
<name>partsfilter</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node> <concept_node>
<name>partssubletstotal</name> <name>partssubletstotal</name>
<definition_loaded>false</definition_loaded> <definition_loaded>false</definition_loaded>

View File

@@ -149,11 +149,7 @@ export default function InvoiceFormComponent({
form={form} form={form}
responsibilityCenters={responsibilityCenters} responsibilityCenters={responsibilityCenters}
/> />
{
// <Form.Item name="upload" label="Upload">
// <DocumentsUploadContainer jobId={form.getFieldValue("jobid")} />
// </Form.Item>
}
<Form.Item <Form.Item
name='upload' name='upload'
label='Upload' label='Upload'

View File

@@ -16,13 +16,13 @@ export default function InvoiceEnterModalLinesComponent({
const { setFieldsValue, getFieldsValue } = form; const { setFieldsValue, getFieldsValue } = form;
return ( return (
<Form.List name="invoicelines"> <Form.List name='invoicelines'>
{(fields, { add, remove }) => { {(fields, { add, remove }) => {
return ( return (
<div className="invoice-form-lines-wrapper"> <div className='invoice-form-lines-wrapper'>
{fields.map((field, index) => ( {fields.map((field, index) => (
<Form.Item required={false} key={field.key}> <Form.Item required={false} key={field.key}>
<div className="invoice-form-line"> <div className='invoice-form-line'>
<Form.Item <Form.Item
label={t("invoicelines.fields.jobline")} label={t("invoicelines.fields.jobline")}
key={`${index}joblinename`} key={`${index}joblinename`}
@@ -32,8 +32,7 @@ export default function InvoiceEnterModalLinesComponent({
required: true, required: true,
message: t("general.validation.required"), message: t("general.validation.required"),
}, },
]} ]}>
>
<InvoiceLineSearchSelect <InvoiceLineSearchSelect
options={lineData} options={lineData}
onBlur={null} onBlur={null}
@@ -48,7 +47,7 @@ export default function InvoiceEnterModalLinesComponent({
line_desc: opt.line_desc, line_desc: opt.line_desc,
actual_price: opt.cost, actual_price: opt.cost,
cost_center: opt.part_type cost_center: opt.part_type
? responsibilityCenters.defaults[ ? responsibilityCenters.defaults.costs[
opt.part_type opt.part_type
] || null ] || null
: null, : null,
@@ -69,8 +68,7 @@ export default function InvoiceEnterModalLinesComponent({
required: true, required: true,
message: t("general.validation.required"), message: t("general.validation.required"),
}, },
]} ]}>
>
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
@@ -82,8 +80,7 @@ export default function InvoiceEnterModalLinesComponent({
required: true, required: true,
message: t("general.validation.required"), message: t("general.validation.required"),
}, },
]} ]}>
>
<CurrencyInput <CurrencyInput
onBlur={(e) => { onBlur={(e) => {
setFieldsValue({ setFieldsValue({
@@ -113,8 +110,7 @@ export default function InvoiceEnterModalLinesComponent({
required: true, required: true,
message: t("general.validation.required"), message: t("general.validation.required"),
}, },
]} ]}>
>
<CurrencyInput /> <CurrencyInput />
</Form.Item> </Form.Item>
<Form.Item shouldUpdate> <Form.Item shouldUpdate>
@@ -143,11 +139,12 @@ export default function InvoiceEnterModalLinesComponent({
required: true, required: true,
message: t("general.validation.required"), message: t("general.validation.required"),
}, },
]} ]}>
>
<Select style={{ width: "150px" }}> <Select style={{ width: "150px" }}>
{responsibilityCenters.costs.map((item) => ( {responsibilityCenters.costs.map((item) => (
<Select.Option key={item.name}>{item.name}</Select.Option> <Select.Option key={item.name}>
{item.name}
</Select.Option>
))} ))}
</Select> </Select>
</Form.Item> </Form.Item>
@@ -155,25 +152,22 @@ export default function InvoiceEnterModalLinesComponent({
label={t("invoicelines.fields.federal_tax_applicable")} label={t("invoicelines.fields.federal_tax_applicable")}
key={`${index}fedtax`} key={`${index}fedtax`}
initialValue={true} initialValue={true}
valuePropName="checked" valuePropName='checked'
name={[field.name, "applicable_taxes", "federal"]} name={[field.name, "applicable_taxes", "federal"]}>
>
<Switch /> <Switch />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={t("invoicelines.fields.state_tax_applicable")} label={t("invoicelines.fields.state_tax_applicable")}
key={`${index}statetax`} key={`${index}statetax`}
valuePropName="checked" valuePropName='checked'
name={[field.name, "applicable_taxes", "state"]} name={[field.name, "applicable_taxes", "state"]}>
>
<Switch /> <Switch />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={t("invoicelines.fields.local_tax_applicable")} label={t("invoicelines.fields.local_tax_applicable")}
key={`${index}localtax`} key={`${index}localtax`}
valuePropName="checked" valuePropName='checked'
name={[field.name, "applicable_taxes", "local"]} name={[field.name, "applicable_taxes", "local"]}>
>
<Switch /> <Switch />
</Form.Item> </Form.Item>
<DeleteFilled <DeleteFilled
@@ -186,12 +180,11 @@ export default function InvoiceEnterModalLinesComponent({
))} ))}
<Form.Item> <Form.Item>
<Button <Button
type="dashed" type='dashed'
onClick={() => { onClick={() => {
add(); add();
}} }}
style={{ width: "50%" }} style={{ width: "50%" }}>
>
{t("invoicelines.actions.newline")} {t("invoicelines.actions.newline")}
</Button> </Button>
</Form.Item> </Form.Item>

View File

@@ -1,4 +1,4 @@
import { Button, Input, Table } from "antd"; import { Button, Input, Table, Dropdown, Menu } from "antd";
import React, { useState } from "react"; import React, { useState } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { connect } from "react-redux"; import { connect } from "react-redux";
@@ -96,6 +96,16 @@ export function JobLinesComponent({
sorter: (a, b) => alphaSort(a.part_type, b.part_type), sorter: (a, b) => alphaSort(a.part_type, b.part_type),
sortOrder: sortOrder:
state.sortedInfo.columnKey === "part_type" && state.sortedInfo.order, state.sortedInfo.columnKey === "part_type" && state.sortedInfo.order,
filters: [
{
text: t("jobs.labels.partsfilter"),
value: "parts",
},
],
// specify the condition of filtering result
// here is that finding the name started with `value`
onFilter: (value, record) =>
["PAN", "PAL", "PAA", "PAS", "PASL"].includes(record.part_type),
ellipsis: true, ellipsis: true,
editable: true, editable: true,
}, },
@@ -217,6 +227,18 @@ export function JobLinesComponent({
setState({ ...state, filteredInfo: filters, sortedInfo: sorter }); setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
}; };
const handleMark = (e) => {
setSelectedLines(jobLines.filter((item) => item.part_type === e.key));
};
const markMenu = (
<Menu onClick={handleMark}>
<Menu.Item key='PAA'>PAA</Menu.Item>
<Menu.Item key='PAN'>PAN</Menu.Item>
<Menu.Item key='PAL'>PAL</Menu.Item>
</Menu>
);
return ( return (
<div> <div>
<PartsOrderModalContainer /> <PartsOrderModalContainer />
@@ -244,6 +266,9 @@ export function JobLinesComponent({
}}> }}>
{t("parts.actions.order")} {t("parts.actions.order")}
</Button> </Button>
<Dropdown overlay={markMenu} trigger={["click"]}>
<Button>{t("jobs.actions.mark")}</Button>
</Dropdown>
<AllocationsBulkAssignmentContainer <AllocationsBulkAssignmentContainer
jobLines={selectedLines} jobLines={selectedLines}
refetch={refetch} refetch={refetch}
@@ -278,14 +303,14 @@ export function JobLinesComponent({
)} )}
pagination={{ position: "top", defaultPageSize: 25 }} pagination={{ position: "top", defaultPageSize: 25 }}
rowSelection={{ rowSelection={{
// selectedRowKeys: selectedLines, selectedRowKeys: selectedLines.map((item) => item.id),
onSelectAll: (selected, selectedRows, changeRows) => { onSelectAll: (selected, selectedRows, changeRows) => {
setSelectedLines(selectedRows); setSelectedLines(selectedRows);
}, },
onSelect: (record, selected, selectedRows, nativeEvent) => onSelect: (record, selected, selectedRows, nativeEvent) =>
setSelectedLines(selectedRows), setSelectedLines(selectedRows),
}} }}
columns={columns.map((item) => ({ ...item }))} columns={columns}
rowKey='id' rowKey='id'
dataSource={jobLines} dataSource={jobLines}
onChange={handleTableChange} onChange={handleTableChange}

View File

@@ -30,6 +30,7 @@ export const QUERY_BODYSHOP = gql`
invoice_tax_rates invoice_tax_rates
inhousevendorid inhousevendorid
accountingconfig accountingconfig
appt_length
employees { employees {
id id
first_name first_name

View File

@@ -509,6 +509,7 @@
"export": "Export", "export": "Export",
"gotojob": "Go to Job", "gotojob": "Go to Job",
"manualnew": "Create New Job Manually", "manualnew": "Create New Job Manually",
"mark": "Mark",
"postInvoices": "Post Invoices", "postInvoices": "Post Invoices",
"printCenter": "Print Center", "printCenter": "Print Center",
"reconcile": "Reconcile", "reconcile": "Reconcile",
@@ -698,6 +699,7 @@
"override_header": "Override estimate header on import?", "override_header": "Override estimate header on import?",
"paint_mat": "Paint Materials", "paint_mat": "Paint Materials",
"parts": "Parts", "parts": "Parts",
"partsfilter": "Parts Only",
"partssubletstotal": "Parts & Sublets Total", "partssubletstotal": "Parts & Sublets Total",
"partstotal": "Parts Total", "partstotal": "Parts Total",
"rates": "Rates", "rates": "Rates",

View File

@@ -509,6 +509,7 @@
"export": "", "export": "",
"gotojob": "", "gotojob": "",
"manualnew": "", "manualnew": "",
"mark": "",
"postInvoices": "Contabilizar facturas", "postInvoices": "Contabilizar facturas",
"printCenter": "Centro de impresión", "printCenter": "Centro de impresión",
"reconcile": "", "reconcile": "",
@@ -698,6 +699,7 @@
"override_header": "¿Anular encabezado estimado al importar?", "override_header": "¿Anular encabezado estimado al importar?",
"paint_mat": "", "paint_mat": "",
"parts": "Partes", "parts": "Partes",
"partsfilter": "",
"partssubletstotal": "", "partssubletstotal": "",
"partstotal": "", "partstotal": "",
"rates": "Tarifas", "rates": "Tarifas",

View File

@@ -509,6 +509,7 @@
"export": "", "export": "",
"gotojob": "", "gotojob": "",
"manualnew": "", "manualnew": "",
"mark": "",
"postInvoices": "Poster des factures", "postInvoices": "Poster des factures",
"printCenter": "Centre d'impression", "printCenter": "Centre d'impression",
"reconcile": "", "reconcile": "",
@@ -698,6 +699,7 @@
"override_header": "Remplacer l'en-tête d'estimation à l'importation?", "override_header": "Remplacer l'en-tête d'estimation à l'importation?",
"paint_mat": "", "paint_mat": "",
"parts": "les pièces", "parts": "les pièces",
"partsfilter": "",
"partssubletstotal": "", "partssubletstotal": "",
"partstotal": "", "partstotal": "",
"rates": "Les taux", "rates": "Les taux",