fix: edit payment transaction

This commit is contained in:
Ahmed Bouhuolia
2025-10-29 12:54:12 +02:00
parent 98401b5a01
commit fc89cfb14a
13 changed files with 57 additions and 77 deletions

View File

@@ -102,13 +102,13 @@ export const StatusAccessor = (row) => {
return (
<Choose>
<Choose.When condition={!!row.is_published}>
<Tag minimal={true} round={true}>
<Tag round>
<T id={'published'} />
</Tag>
</Choose.When>
<Choose.Otherwise>
<Tag minimal={true} intent={Intent.WARNING} round={true}>
<Tag intent={Intent.WARNING} round>
<T id={'draft'} />
</Tag>
</Choose.Otherwise>

View File

@@ -42,7 +42,7 @@ export const handleDeleteErrors = (errors) => {
export const AccountCodeAccessor = (row) =>
!isBlank(row.code) ? (
<Tag minimal={true} round={true} intent={Intent.NONE}>
<Tag minimal round intent={Intent.NONE}>
{row.code}
</Tag>
) : null;

View File

@@ -15,7 +15,7 @@ const applyToTypeAccessor = (rule) => {
};
const conditionsAccessor = (rule) => (
<span style={{ fontSize: 12, color: '#5F6B7C' }}>
<span style={{ fontSize: 12 }}>
{rule.conditions_formatted}
</span>
);

View File

@@ -101,11 +101,11 @@ export function ActionsCell(props) {
*/
export function PublishAccessor(row) {
return row.is_published ? (
<Tag round={true} minimal={true}>
<Tag round>
<T id={'published'} />
</Tag>
) : (
<Tag round={true} minimal={true} intent={Intent.WARNING}>
<Tag round minimal intent={Intent.WARNING}>
<T id={'draft'} />
</Tag>
);

View File

@@ -72,7 +72,7 @@ export const SellPriceCell = ({ cell: { value } }) => {
export const ItemTypeAccessor = (row) => {
return row.type_formatted ? (
<Tag minimal={true} round={true} intent={Intent.NONE}>
<Tag round intent={Intent.NONE}>
{row.type_formatted}
</Tag>
) : null;

View File

@@ -46,12 +46,14 @@ function PaymentMadeFormProvider({ query, paymentMadeId, ...props }) {
// Handle fetch specific payment made details.
const {
data: { paymentMade: paymentMadeEditPage, entries: paymentEntriesEditPage },
data: paymentMadeEditData,
isFetching: isPaymentFetching,
isLoading: isPaymentLoading,
} = usePaymentMadeEditPage(paymentMadeId, {
enabled: !!paymentMadeId,
});
const paymentMadeEditPage = paymentMadeEditData?.bill_payment;
const paymentEntriesEditPage = paymentMadeEditData?.entries;
// Fetches the branches list.
const {

View File

@@ -22,27 +22,27 @@ import { safeCallback } from '@/utils';
export const statusAccessor = (row) => (
<Choose>
<Choose.When condition={row.is_approved}>
<Tag minimal={true} intent={Intent.SUCCESS} round={true}>
<Tag intent={Intent.SUCCESS} round>
<T id={'approved'} />
</Tag>
</Choose.When>
<Choose.When condition={row.is_rejected}>
<Tag minimal={true} intent={Intent.DANGER} round={true}>
<Tag intent={Intent.DANGER} round>
<T id={'rejected'} />
</Tag>
</Choose.When>
<Choose.When condition={row.is_expired}>
<Tag minimal={true} intent={Intent.WARNING} round={true}>
<Tag intent={Intent.WARNING} round>
<T id={'estimate.status.expired'} />
</Tag>
</Choose.When>
<Choose.When condition={row.is_delivered}>
<Tag minimal={true} intent={Intent.SUCCESS} round={true}>
<Tag intent={Intent.SUCCESS} round>
<T id={'delivered'} />
</Tag>
</Choose.When>
<Choose.Otherwise>
<Tag minimal={true} round={true}>
<Tag round>
<T id={'draft'} />
</Tag>
</Choose.Otherwise>

View File

@@ -42,15 +42,15 @@ function PaymentReceiveFormProvider({ query, paymentReceiveId, ...props }) {
// Fetches payment recevie details.
const {
data: {
paymentReceive: paymentReceiveEditPage,
entries: paymentEntriesEditPage,
},
data: paymentReceivedEditData,
isLoading: isPaymentLoading,
isFetching: isPaymentFetching,
} = usePaymentReceiveEditPage(paymentReceiveId, {
enabled: !!paymentReceiveId,
});
const paymentReceiveEditPage = paymentReceivedEditData?.data;
const paymentEntriesEditPage = paymentReceivedEditData?.entries
// Handle fetch accounts data.
const { data: accounts, isLoading: isAccountsLoading } = useAccounts();