mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	fix new code to v7
This commit is contained in:
		@@ -41,7 +41,7 @@ export default function PartPricingPanel({ part }: { part: any }) {
 | 
				
			|||||||
  }, [user, part]);
 | 
					  }, [user, part]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <Stack spacing="xs">
 | 
					    <Stack gap="xs">
 | 
				
			||||||
      <LoadingOverlay visible={instanceQuery.isLoading} />
 | 
					      <LoadingOverlay visible={instanceQuery.isLoading} />
 | 
				
			||||||
      {!pricing && !instanceQuery.isLoading && (
 | 
					      {!pricing && !instanceQuery.isLoading && (
 | 
				
			||||||
        <Alert color="ref" title={t`Error`}>
 | 
					        <Alert color="ref" title={t`Error`}>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -166,7 +166,7 @@ export default function BomPricingPanel({
 | 
				
			|||||||
  const [chartType, setChartType] = useState<string>('pie');
 | 
					  const [chartType, setChartType] = useState<string>('pie');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <Stack spacing="xs">
 | 
					    <Stack gap="xs">
 | 
				
			||||||
      <SimpleGrid cols={2}>
 | 
					      <SimpleGrid cols={2}>
 | 
				
			||||||
        <InvenTreeTable
 | 
					        <InvenTreeTable
 | 
				
			||||||
          tableState={table}
 | 
					          tableState={table}
 | 
				
			||||||
@@ -182,7 +182,7 @@ export default function BomPricingPanel({
 | 
				
			|||||||
          }}
 | 
					          }}
 | 
				
			||||||
        />
 | 
					        />
 | 
				
			||||||
        {bomPricingData.length > 0 ? (
 | 
					        {bomPricingData.length > 0 ? (
 | 
				
			||||||
          <Stack spacing="xs">
 | 
					          <Stack gap="xs">
 | 
				
			||||||
            {chartType == 'bar' && <BomBarChart data={bomPricingData} />}
 | 
					            {chartType == 'bar' && <BomBarChart data={bomPricingData} />}
 | 
				
			||||||
            {chartType == 'pie' && <BomPieChart data={bomPricingData} />}
 | 
					            {chartType == 'pie' && <BomPieChart data={bomPricingData} />}
 | 
				
			||||||
            <SegmentedControl
 | 
					            <SegmentedControl
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -48,9 +48,9 @@ export default function PricingOverviewPanel({
 | 
				
			|||||||
        title: t`Pricing Category`,
 | 
					        title: t`Pricing Category`,
 | 
				
			||||||
        render: (record: PricingOverviewEntry) => {
 | 
					        render: (record: PricingOverviewEntry) => {
 | 
				
			||||||
          return (
 | 
					          return (
 | 
				
			||||||
            <Group position="left" spacing="xs">
 | 
					            <Group justify="left" gap="xs">
 | 
				
			||||||
              {record.icon}
 | 
					              {record.icon}
 | 
				
			||||||
              <Text weight={700}>{record.title}</Text>
 | 
					              <Text fw={700}>{record.title}</Text>
 | 
				
			||||||
            </Group>
 | 
					            </Group>
 | 
				
			||||||
          );
 | 
					          );
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@@ -143,9 +143,9 @@ export default function PricingOverviewPanel({
 | 
				
			|||||||
  // TODO: Add "update now" button
 | 
					  // TODO: Add "update now" button
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <Stack spacing="xs">
 | 
					    <Stack gap="xs">
 | 
				
			||||||
      <SimpleGrid cols={2}>
 | 
					      <SimpleGrid cols={2}>
 | 
				
			||||||
        <Stack spacing="xs">
 | 
					        <Stack gap="xs">
 | 
				
			||||||
          {pricing?.updated && (
 | 
					          {pricing?.updated && (
 | 
				
			||||||
            <Paper p="xs">
 | 
					            <Paper p="xs">
 | 
				
			||||||
              <Alert color="blue" title={t`Last Updated`}>
 | 
					              <Alert color="blue" title={t`Last Updated`}>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,7 +30,7 @@ export default function PricingPanel({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
export function NoPricingData() {
 | 
					export function NoPricingData() {
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <Stack spacing="xs">
 | 
					    <Stack gap="xs">
 | 
				
			||||||
      <Alert icon={<IconExclamationCircle />} color="blue" title={t`No Data`}>
 | 
					      <Alert icon={<IconExclamationCircle />} color="blue" title={t`No Data`}>
 | 
				
			||||||
        <Text>{t`No pricing data available`}</Text>
 | 
					        <Text>{t`No pricing data available`}</Text>
 | 
				
			||||||
      </Alert>
 | 
					      </Alert>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -64,7 +64,7 @@ export default function PurchaseHistoryPanel({
 | 
				
			|||||||
          let units = record.supplier_part_detail?.pack_quantity;
 | 
					          let units = record.supplier_part_detail?.pack_quantity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          return (
 | 
					          return (
 | 
				
			||||||
            <Group position="apart" spacing="xs">
 | 
					            <Group justify="apart" gap="xs">
 | 
				
			||||||
              <Text>{price}</Text>
 | 
					              <Text>{price}</Text>
 | 
				
			||||||
              {units && <Text size="xs">[{units}]</Text>}
 | 
					              {units && <Text size="xs">[{units}]</Text>}
 | 
				
			||||||
            </Group>
 | 
					            </Group>
 | 
				
			||||||
@@ -85,7 +85,7 @@ export default function PurchaseHistoryPanel({
 | 
				
			|||||||
          let units = record.part_detail?.units;
 | 
					          let units = record.part_detail?.units;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          return (
 | 
					          return (
 | 
				
			||||||
            <Group position="apart" spacing="xs">
 | 
					            <Group justify="apart" gap="xs">
 | 
				
			||||||
              <Text>{price}</Text>
 | 
					              <Text>{price}</Text>
 | 
				
			||||||
              {units && <Text size="xs">[{units}]</Text>}
 | 
					              {units && <Text size="xs">[{units}]</Text>}
 | 
				
			||||||
            </Group>
 | 
					            </Group>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -79,7 +79,7 @@ export default function VariantPricingPanel({
 | 
				
			|||||||
  }, [table.records]);
 | 
					  }, [table.records]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <Stack spacing="xs">
 | 
					    <Stack gap="xs">
 | 
				
			||||||
      <SimpleGrid cols={2}>
 | 
					      <SimpleGrid cols={2}>
 | 
				
			||||||
        <InvenTreeTable
 | 
					        <InvenTreeTable
 | 
				
			||||||
          tableState={table}
 | 
					          tableState={table}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -196,8 +196,8 @@ export function AttachmentTable({
 | 
				
			|||||||
                attachmentType: 'file',
 | 
					                attachmentType: 'file',
 | 
				
			||||||
                callback: table.refreshTable
 | 
					                callback: table.refreshTable
 | 
				
			||||||
              });
 | 
					              });
 | 
				
			||||||
              variant = 'default';
 | 
					 | 
				
			||||||
            }}
 | 
					            }}
 | 
				
			||||||
 | 
					            variant="default"
 | 
				
			||||||
          >
 | 
					          >
 | 
				
			||||||
            <IconFileUpload />
 | 
					            <IconFileUpload />
 | 
				
			||||||
          </ActionIcon>
 | 
					          </ActionIcon>
 | 
				
			||||||
@@ -216,8 +216,8 @@ export function AttachmentTable({
 | 
				
			|||||||
                attachmentType: 'link',
 | 
					                attachmentType: 'link',
 | 
				
			||||||
                callback: table.refreshTable
 | 
					                callback: table.refreshTable
 | 
				
			||||||
              });
 | 
					              });
 | 
				
			||||||
              variant = 'default';
 | 
					 | 
				
			||||||
            }}
 | 
					            }}
 | 
				
			||||||
 | 
					            variant="default"
 | 
				
			||||||
          >
 | 
					          >
 | 
				
			||||||
            <IconExternalLink />
 | 
					            <IconExternalLink />
 | 
				
			||||||
          </ActionIcon>
 | 
					          </ActionIcon>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,7 +38,7 @@ export function SupplierPriceBreakColumns(): TableColumn[] {
 | 
				
			|||||||
      switchable: true,
 | 
					      switchable: true,
 | 
				
			||||||
      render: (record: any) => {
 | 
					      render: (record: any) => {
 | 
				
			||||||
        return (
 | 
					        return (
 | 
				
			||||||
          <Group spacing="xs" noWrap>
 | 
					          <Group gap="xs" wrap="nowrap">
 | 
				
			||||||
            <Thumbnail
 | 
					            <Thumbnail
 | 
				
			||||||
              src={
 | 
					              src={
 | 
				
			||||||
                record?.supplier_detail?.thumbnail ??
 | 
					                record?.supplier_detail?.thumbnail ??
 | 
				
			||||||
@@ -96,7 +96,7 @@ export function SupplierPriceBreakColumns(): TableColumn[] {
 | 
				
			|||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return (
 | 
					        return (
 | 
				
			||||||
          <Group position="apart" spacing="xs" grow>
 | 
					          <Group justify="apart" gap="xs" grow>
 | 
				
			||||||
            <Text>{price}</Text>
 | 
					            <Text>{price}</Text>
 | 
				
			||||||
            {units && <Text size="xs">[{units}]</Text>}
 | 
					            {units && <Text size="xs">[{units}]</Text>}
 | 
				
			||||||
          </Group>
 | 
					          </Group>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user