mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-19 13:54:25 +01:00
(bug) set settlement by cash by default for local payment mean
This commit is contained in:
parent
58e3097da2
commit
0e554d22ff
@ -2,6 +2,8 @@
|
||||
|
||||
## Next release
|
||||
|
||||
- Fix a bug: set settlement by cash by default for local payment mean
|
||||
|
||||
## v6.3.15 2024 February 29
|
||||
|
||||
- Fix a bug: unable to generate invoice for payment by check/transfer
|
||||
|
@ -13,7 +13,7 @@ import CheckoutAPI from '../../../api/checkout';
|
||||
import { SelectOption } from '../../../models/select';
|
||||
import { PaymentMethod } from '../../../models/payment';
|
||||
|
||||
const ALL_SCHEDULE_METHODS = ['card', 'check', 'transfer'] as const;
|
||||
const ALL_SCHEDULE_METHODS = ['card', 'check', 'transfer', 'cash'] as const;
|
||||
type scheduleMethod = typeof ALL_SCHEDULE_METHODS[number];
|
||||
|
||||
/**
|
||||
@ -24,13 +24,13 @@ type scheduleMethod = typeof ALL_SCHEDULE_METHODS[number];
|
||||
export const LocalPaymentForm: React.FC<GatewayFormProps> = ({ onSubmit, onSuccess, onError, children, className, paymentSchedule, cart, updateCart, customer, operator, formId, order }) => {
|
||||
const { t } = useTranslation('admin');
|
||||
|
||||
const [method, setMethod] = useState<scheduleMethod>('check');
|
||||
const [method, setMethod] = useState<scheduleMethod>('cash');
|
||||
const [onlinePaymentModal, setOnlinePaymentModal] = useState<boolean>(false);
|
||||
|
||||
useEffect(() => {
|
||||
setMethod(cart.payment_method || 'check');
|
||||
setMethod(cart.payment_method || 'cash');
|
||||
if (cart.payment_method === '') {
|
||||
cart.payment_method = PaymentMethod.Check;
|
||||
cart.payment_method = PaymentMethod.Cash;
|
||||
}
|
||||
}, [cart]);
|
||||
|
||||
|
@ -19,6 +19,7 @@ export enum PaymentMethod {
|
||||
Card = 'card',
|
||||
Check = 'check',
|
||||
Transfer = 'transfer',
|
||||
Cash = 'cash',
|
||||
Other = ''
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user