Commit bb2285ca by tdgiang

update codee

parent 8ab6c443
......@@ -12,6 +12,7 @@ import {
Typography,
MenuItem,
Tooltip,
Switch,
} from '@material-ui/core'
import { dropdownListSupplier } from 'app/apis/Functions/dropdown'
import { createMerchant } from 'app/apis/Functions/merchant'
......@@ -30,6 +31,8 @@ const SimpleForm = (props) => {
const [invoice, setInvoice] = useState(false)
const [payment, setPayment] = useState(false)
const [isAuto, setAuto] = useState(false)
const [isInvoiceAuto, setInvoiceAuto] = useState(false)
const [listDrop, setListDrop] = useState([])
const { t } = useTranslation()
const location = useLocation()
......@@ -91,6 +94,7 @@ const SimpleForm = (props) => {
is_connect_hddt: invoice,
is_connect_qr: payment,
is_hddt_nomal: isAuto,
is_invoice_auto: isInvoiceAuto,
})
props.hideLoading()
if (res.data.code == 200) {
......@@ -537,6 +541,37 @@ const SimpleForm = (props) => {
</Grid>
) : null}
{invoice ? (
<Grid
item
lg={12}
md={12}
sm={12}
xs={12}
style={{
paddingTop: 20,
}}
>
<Switch
onChange={(event) => {
setInvoiceAuto(event.target.checked)
}}
checked={isInvoiceAuto}
color="primary"
size="medium"
/>
<span
style={{
fontSize: 18,
marginLeft: 20,
marginTop: 5,
}}
>
Cho phép xut hóa đơn t động
</span>
</Grid>
) : null}
<Grid lg={12} md={12} sm={12} xs={12} item>
<FormControlLabel
className="min-w-288"
......
......@@ -12,6 +12,7 @@ import {
Typography,
MenuItem,
Tooltip,
Switch,
} from '@material-ui/core'
import { updateMerchant, detailMerchant } from 'app/apis/Functions/merchant'
......@@ -32,7 +33,7 @@ const SimpleForm = (props) => {
const [payment, setPayment] = useState(false)
const [isAuto, setAuto] = useState(false)
const [listDrop, setListDrop] = useState([])
const [isInvoiceAuto, setInvoiceAuto] = useState(false)
const { t } = useTranslation()
const location = useLocation()
useEffect(() => {
......@@ -99,7 +100,7 @@ const SimpleForm = (props) => {
setPayment(res.data.data?.is_connect_qr)
setIsStore(res.data.data?.is_admin_store)
setAuto(res.data.data?.is_hddt_nomal)
setInvoiceAuto(res.data.data?.is_invoice_auto)
} else if (res.data.code == 401) {
setTimeout(() => {
history.push('/')
......@@ -121,6 +122,7 @@ const SimpleForm = (props) => {
is_connect_hddt: invoice,
is_connect_qr: payment,
is_hddt_nomal: isAuto,
is_invoice_auto: isInvoiceAuto,
})
props.hideLoading()
if (res.data.code == 200) {
......@@ -547,6 +549,36 @@ const SimpleForm = (props) => {
/>
</Grid>
) : null}
{invoice ? (
<Grid
item
lg={12}
md={12}
sm={12}
xs={12}
style={{
paddingTop: 20,
}}
>
<Switch
onChange={(event) => {
setInvoiceAuto(event.target.checked)
}}
checked={isInvoiceAuto}
color="primary"
size="medium"
/>
<span
style={{
fontSize: 18,
marginLeft: 20,
marginTop: 5,
}}
>
Cho phép xuất hóa đơn tự động
</span>
</Grid>
) : null}
<Grid lg={12} md={12} sm={12} xs={12} item>
<FormControlLabel
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment