- nuke visible from the face of the earth with fire.

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-01-12 17:25:25 -05:00
parent 7d6e61043e
commit ba32a71786
58 changed files with 227 additions and 229 deletions

View File

@@ -21,29 +21,29 @@ export default connect(
export function DmsCustomerSelector({ bodyshop }) {
const { t } = useTranslation();
const [customerList, setcustomerList] = useState([]);
const [visible, setVisible] = useState(false);
const [open, setOpen] = useState(false);
const [selectedCustomer, setSelectedCustomer] = useState(null);
const [dmsType, setDmsType] = useState("cdk");
socket.on("cdk-select-customer", (customerList, callback) => {
setVisible(true);
setOpen(true);
setDmsType("cdk");
setcustomerList(customerList);
});
socket.on("pbs-select-customer", (customerList, callback) => {
setVisible(true);
setOpen(true);
setDmsType("pbs");
setcustomerList(customerList);
});
const onUseSelected = () => {
setVisible(false);
setOpen(false);
socket.emit(`${dmsType}-selected-customer`, selectedCustomer);
setSelectedCustomer(null);
};
const onUseGeneric = () => {
setVisible(false);
setOpen(false);
socket.emit(
`${dmsType}-selected-customer`,
bodyshop.cdk_configuration.generic_customer_number
@@ -52,7 +52,7 @@ export function DmsCustomerSelector({ bodyshop }) {
};
const onCreateNew = () => {
setVisible(false);
setOpen(false);
socket.emit(`${dmsType}-selected-customer`, null);
setSelectedCustomer(null);
};
@@ -114,7 +114,7 @@ export function DmsCustomerSelector({ bodyshop }) {
},
];
if (!visible) return null;
if (!open) return null;
return (
<Col span={24}>
<Table