IO-794 Add vendor active field

This commit is contained in:
Patrick Fic
2021-03-22 17:48:24 -07:00
parent 43a266c463
commit aced67f835
15 changed files with 309 additions and 4 deletions

View File

@@ -6,6 +6,7 @@ import {
InputNumber,
Select,
Space,
Switch,
Typography,
} from "antd";
import React from "react";
@@ -49,6 +50,14 @@ export default function VendorsFormComponent({
>
<Input />
</Form.Item>
<Form.Item
label={t("vendors.fields.active")}
name="active"
initialValue={true}
valuePropName="checked"
>
<Switch />
</Form.Item>
<Form.Item
label={t("vendors.fields.email")}
rules={[

View File

@@ -16,6 +16,7 @@ export const QUERY_VENDOR_BY_ID = gql`
cost_center
city
street1
active
phone
}
}
@@ -39,6 +40,7 @@ export const QUERY_ALL_VENDORS = gql`
cost_center
city
phone
active
}
}
`;
@@ -65,13 +67,14 @@ export const DELETE_VENDOR = gql`
export const QUERY_ALL_VENDORS_FOR_ORDER = gql`
query QUERY_ALL_VENDORS_FOR_ORDER($jobId: uuid) {
vendors(order_by: { name: asc }) {
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
name
cost_center
id
favorite
discount
email
active
}
jobs(where: { id: { _eq: $jobId } }) {
v_make_desc
@@ -81,18 +84,19 @@ export const QUERY_ALL_VENDORS_FOR_ORDER = gql`
export const SEARCH_VENDOR_AUTOCOMPLETE = gql`
query SEARCH_VENDOR_AUTOCOMPLETE {
vendors(order_by: { name: asc }) {
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
name
discount
id
cost_center
active
}
}
`;
export const SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR = gql`
query SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR {
vendors(order_by: { name: asc }) {
vendors(order_by: { name: asc }, where: { active: { _eq: true } }) {
name
discount
id
@@ -104,6 +108,7 @@ export const SEARCH_VENDOR_AUTOCOMPLETE_WITH_ADDR = gql`
city
email
state
active
}
}
`;

View File

@@ -1933,6 +1933,7 @@
"saving": "Error encountered while saving vendor. "
},
"fields": {
"active": "Active",
"am": "Aftermarket",
"city": "City",
"cost_center": "Cost Center",

View File

@@ -1933,6 +1933,7 @@
"saving": "Se encontró un error al guardar el proveedor."
},
"fields": {
"active": "",
"am": "",
"city": "ciudad",
"cost_center": "Centro de costos",

View File

@@ -1933,6 +1933,7 @@
"saving": "Erreur rencontrée lors de l'enregistrement du fournisseur."
},
"fields": {
"active": "",
"am": "",
"city": "Ville",
"cost_center": "Centre de coûts",