fix detail sale

dev
Aji Kamaludin 3 years ago
parent a3d2ff980e
commit 3c968a21a0
No known key found for this signature in database
GPG Key ID: 670E1F26AD5A8099

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

@ -69,7 +69,7 @@ export default function Create(props) {
return ( return (
<Flex direction="column"> <Flex direction="column">
<Breadcrumb main={["/sales", "penjualan", "detail"]}/> <Breadcrumb main={['/sales', 'penjualan', 'detail']} />
{error && ( {error && (
<Alert status="error" mb="5" rounded="md"> <Alert status="error" mb="5" rounded="md">
<AlertIcon /> <AlertIcon />
@ -78,14 +78,34 @@ export default function Create(props) {
)} )}
<Flex> <Flex>
<Card flex="1"> <Card flex="1">
<FormInput data={["kasir", casier, setCasier]} readOnly={true} bg="gray.200"/> <FormInput
<FormInput data={["tangal", formatDate(date), setDate]} readOnly={true} bg="gray.200"/> data={['kasir', casier, setCasier]}
<FormInput data={["pelanggan", customer.name]} readOnly={true} bg="gray.200"/> readOnly={true}
<FormInput data={["no. invoice", invoice, setInvoice]} readOnly={true} bg="gray.200"/> bg="gray.200"
<FormInputNumber data={["diskon", formatIDR(discount), setDiscount]} readOnly={true} bg="gray.200"/> />
<Textarea <FormInput
data={['tangal', formatDate(date), setDate]}
readOnly={true}
bg="gray.200"
/>
<FormInput
data={['pelanggan', customer.name]}
readOnly={true}
bg="gray.200"
/>
<FormInput
data={['no. invoice', invoice, setInvoice]}
readOnly={true}
bg="gray.200"
/>
<FormInputNumber
data={['diskon', formatIDR(discount), setDiscount]}
readOnly={true}
bg="gray.200"
/>
<Textarea
focusBorderColor="red.500" focusBorderColor="red.500"
placeholder="catatan" placeholder="catatan"
value={note} value={note}
readOnly={true} readOnly={true}
bg="gray.200" bg="gray.200"
@ -93,7 +113,13 @@ export default function Create(props) {
</Card> </Card>
<Card flex="3"> <Card flex="3">
<Table px="3" mt="2" minH="27rem"> <Table px="3" mt="2" minH="27rem">
<Thead style={{display: "table", width: "calc( 100% )", tableLayout: "fixed"}}> <Thead
style={{
display: 'table',
width: 'calc( 100% )',
tableLayout: 'fixed',
}}
>
<Tr> <Tr>
<Th>kode</Th> <Th>kode</Th>
<Th>nama</Th> <Th>nama</Th>
@ -102,19 +128,28 @@ export default function Create(props) {
<Th isNumeric>subtotal</Th> <Th isNumeric>subtotal</Th>
</Tr> </Tr>
</Thead> </Thead>
<Tbody style={{display: "block", maxHeight: "27rem", overflow: "auto", width: "100%"}}> <Tbody
{items.map(item => ( style={{
<Tr key={item.id} style={{display: "table", width: "100%", tableLayout: "fixed"}}> display: 'block',
maxHeight: '27rem',
overflow: 'auto',
width: '100%',
}}
>
{items.map((item) => (
<Tr
key={item.id}
style={{
display: 'table',
width: '100%',
tableLayout: 'fixed',
}}
>
<Td>{item.code}</Td> <Td>{item.code}</Td>
<Td>{item.name}</Td> <Td>{item.name}</Td>
<Td isNumeric>{formatIDR(item.price)}</Td> <Td isNumeric>{formatIDR(item.price)}</Td>
<Td isNumeric> <Td isNumeric>{item.quantity}</Td>
<Td isNumeric>{formatIDR(item.price * item.quantity)}</Td>
</Td>
<Td isNumeric>
{formatIDR(item.price * item.quantity)}
</Td>
</Tr> </Tr>
))} ))}
</Tbody> </Tbody>
@ -124,9 +159,7 @@ export default function Create(props) {
<Heading>Total</Heading> <Heading>Total</Heading>
</Box> </Box>
<Box> <Box>
<Heading> <Heading>{formatIDR(totalAmount)}</Heading>
{formatIDR(totalAmount)}
</Heading>
</Box> </Box>
</Flex> </Flex>
</Card> </Card>

Loading…
Cancel
Save