Refactor payment terminology and remove unused payment methods

- Updated header titles from 'QUITANCE' to 'PAYMENT' in NumeroQuitance and NumeroQuitanceDetail components.
- Removed references to 'WALLET' and 'CASH' payment methods in NumeroQuitanceDetail, leaving only 'Tresor pay'.
- Changed the title in optionNumeroQuitanceScreen from 'QUITANCE' to 'NUMERO_QUITANCE'.
- Added new translation key 'PAY' in both English and French language files.
- Updated French translations for 'QUITANCE' and 'SAISIE_NUMERO_QUITANCE' to reflect payment context.
- Added console logs for debugging in searchUserAction function.
This commit is contained in:
Don Wilfried 2025-07-09 06:01:04 +01:00
parent 1ce94928b6
commit 6f146eb712
8 changed files with 3191 additions and 2782 deletions

View File

@ -2433,109 +2433,130 @@ class Home extends BaseScreen {
)
}
renderSearchUser() {
renderSearchUser() {
return (
<MaterialDialog
title={I18n.t("SEARCH")}
visible={this.state.dialogSearchUser}
onCancel={() => this.setState({dialogSearchUser: false})}
onOk={result => {
if(this.state.isPhoneAssureSearch) {
this.props.searchUserAction({
dial_code: this.state.indicatif,
phone: this.state.userName,
}, true);
} else {
this.props.searchUserAction({
dial_code: this.state.indicatif,
name: this.state.userName,
}, true);
}
this.setState({dialogSearchUser: false});
}}
title={I18n.t("SEARCH")}
visible={this.state.dialogSearchUser}
onCancel={() => this.setState({ dialogSearchUser: false })}
onOk={() => {
console.log(
"On ok search user===>>",
this.state.userName,
this.state.indicatif,
this.state.isPhoneAssureSearch,
this.state.isNumeroAssureSearch
);
// Prépare le payload
const payload = { dial_code: this.state.indicatif };
if (this.state.isPhoneAssureSearch) {
payload.phone = this.state.userName;
} else if (this.state.isNumeroAssureSearch) {
payload.identification_number = this.state.userName;
} else {
payload.name = this.state.userName;
}
// Lance l'action
this.props.searchUserAction(payload, true);
this.setState({ dialogSearchUser: false });
}}
>
<View>
<TextInput
style={{marginTop: 10, height: 46, borderRadius: 5, borderWidth: 1, borderColor: "#ccc"}}
placeholder={this.state.isPhoneAssureSearch ? I18n.t('PHONE') : I18n.t('NAME')}
value={this.state.userName}
keyboardType={this.state.isPhoneAssureSearch ? 'numeric' : 'default'}
onChangeText={(userName) => {
this.setState({userName});
}}
icon={
<FontAwesome
style={{zIndex: 10}}
name={this.state.isPhoneAssureSearch ? 'phone' : 'user'}
size={20}
/>
}
/>
<View>
<TextInput
style={{
marginTop: 10, height: 46, borderRadius: 5, borderWidth: 1, borderColor: "#ccc"
}}
placeholder={
this.state.isPhoneAssureSearch
? I18n.t("PHONE")
: this.state.isNumeroAssureSearch
? I18n.t("IMMATRICULATION_DGI") // nouveau libellé à ajouter dans vos traductions
: I18n.t("NAME")
}
value={this.state.userName}
keyboardType={this.state.isPhoneAssureSearch ? "numeric" : "default"}
onChangeText={userName => this.setState({ userName })}
icon={
<FontAwesome
style={{ zIndex: 10 }}
name={
this.state.isPhoneAssureSearch
? "phone"
: this.state.isNumeroAssureSearch
? "id-card" // icône FontAwesome5 pour le NIU
: "user"
}
size={20}
/>
}
/>
<View style={{
flexDirection: 'row',
position: 'absolute',
top: 22,
right: 50,
justifyContent: 'space-between',
width: 50
}}>
<FontAwesomeIcon
style={{paddingRight: 5}}
name='phone'
size={20}
color={Color.primaryColor}
onPress={() => {
this.setState({
isNumeroAssureSearch: false,
isPhoneAssureSearch: true
});
}}
/>
<FontAwesomeIcon
style={{paddingRight: 5}}
name='user'
size={20}
color={Color.primaryColor}
onPress={() => {
this.setState({
isNumeroAssureSearch: false,
isPhoneAssureSearch: false
});
}}
/>
<FontAwesomeIcon
style={{paddingRight: 5}}
name="qrcode"
size={20}
color={Color.primaryColor}
onPress={() => {
this.setState({
showQRCodeScanner: true
});
}}
/>
</View>
</View>
{/* <Fumi iconClass={FontAwesomeIcon}
label={I18n.t('NAME')}
iconColor={'#f95a25'}
iconSize={20}
iconName={"user"}
value={this.state.userName}
onChangeText={(userName) => {
this.setState({userName});
}}
style={styles.input}
<View
style={{
flexDirection: "row",
position: "absolute",
top: 22,
right: 20,
}}
>
</Fumi>*/}
{/* Mode téléphone */}
<FontAwesomeIcon
name="phone"
size={20}
color={this.state.isPhoneAssureSearch ? Color.primaryColor : "#888"}
onPress={() =>
this.setState({
isPhoneAssureSearch: true,
isNumeroAssureSearch: false
})
}
style={{ marginHorizontal: 5 }}
/>
</MaterialDialog>)
{/* Mode nom */}
<FontAwesomeIcon
name="user"
size={20}
color={
!this.state.isPhoneAssureSearch && !this.state.isNumeroAssureSearch
? Color.primaryColor
: "#888"
}
onPress={() =>
this.setState({
isPhoneAssureSearch: false,
isNumeroAssureSearch: false
})
}
style={{ marginHorizontal: 5 }}
/>
{/* Mode NIU */}
<FontAwesomeIcon
name="id-card"
size={20}
color={this.state.isNumeroAssureSearch ? Color.primaryColor : "#888"}
onPress={() =>
this.setState({
isPhoneAssureSearch: false,
isNumeroAssureSearch: true
})
}
style={{ marginHorizontal: 5 }}
/>
{/* Scanner QR */}
<FontAwesomeIcon
name="qrcode"
size={20}
color={Color.primaryColor}
onPress={() => this.setState({ showQRCodeScanner: true })}
style={{ marginHorizontal: 5 }}
/>
</View>
</View>
</MaterialDialog>
);
}
renderDialogResultSearchUser() {

File diff suppressed because it is too large Load Diff

View File

@ -62,7 +62,7 @@ class NumeroQuitance extends Component {
static navigationOptions = () => {
return {
drawerLabel: () => null,
headerTitle: I18n.t('QUITANCE'),
headerTitle: I18n.t('PAYMENT'),
headerTintColor: 'white',
headerStyle: {
backgroundColor: Color.primaryColor,

View File

@ -74,8 +74,8 @@ class NumeroQuitanceDetail extends Component {
return {
drawerLabel: () => null,
title: navigation.getParam("isModify", false) ? I18n.t('QUITANCE')
: I18n.t('QUITANCE'),
title: navigation.getParam("isModify", false) ? I18n.t('PAYMENT')
: I18n.t('PAYMENT'),
headerTintColor: 'white',
headerStyle: {
backgroundColor: Color.primaryColor,
@ -119,15 +119,16 @@ class NumeroQuitanceDetail extends Component {
added_revenue_orders_items: [],
displayAddOrdreRecette: false,
ordreRecetteId: this.props.navigation.getParam("isModify", false) ? this.props.navigation.getParam("item", "-").id_receipt : "",
// Suppression de ces 2 moyens de paiement Wallet et Cash pour laissser uniquement Tresor pay qui lui vient plutot de l'API
paymentMethods: [
{
title: I18n.t('WALLET'),
value: 'wallet'
},
{
title: I18n.t('CASH'),
value: 'cash'
},
// {
// title: I18n.t('WALLET'),
// value: 'wallet'
// },
// {
// title: I18n.t('CASH'),
// value: 'cash'
// },
],
paymentMethod: 'wallet',
paymentUrl: '',
@ -285,15 +286,16 @@ class NumeroQuitanceDetail extends Component {
if (nextProps.paymentMethod !== null) {
if (nextProps.paymentMethod.result !== null) {
console.log("nextProps.paymentMethod", nextProps.paymentMethod);
// Suppression de ces 2 moyens de paiement Wallet et Cash pour laissser uniquement Tresor pay qui lui vient plutot de l'API
const paymentsMethods = [
{
title: I18n.t('WALLET'),
value: 'wallet'
},
{
title: I18n.t('CASH'),
value: 'cash'
},
// {
// title: I18n.t('WALLET'),
// value: 'wallet'
// },
// {
// title: I18n.t('CASH'),
// value: 'cash'
// },
]
this.setState({
paymentMethods: [...paymentsMethods, ...nextProps.paymentMethod.result.response.methods]
@ -947,7 +949,7 @@ class NumeroQuitanceDetail extends Component {
disabled={true}
textStyle={styles.textbtnstyle}
>
{this.state.isModify ? I18n.t('MODIFY') : I18n.t('SAVE')}
{this.state.isModify ? I18n.t('MODIFY') : I18n.t('PAY')}
</Button>
</View>

View File

@ -491,7 +491,7 @@ export const optionOrdreRecetteScreen = {
export const optionNumeroQuitanceScreen = {
type: 'QUITANCE',
title: 'QUITANCE',
title: 'NUMERO_QUITANCE',
subTitle: 'CHOOSE_OPTION',
options: [
{

View File

@ -759,5 +759,6 @@
"TRADE_LICENSE": "Business License",
"MERCURIAL_VALUE": "Mercurial Value ",
"CONSTRUCTION_VALUE": "Enter the Construction Value",
"BUILDING_CONSTRUCTED": "Building Constructed"
"BUILDING_CONSTRUCTED": "Building Constructed",
"PAY": "Pay"
}

View File

@ -45,7 +45,7 @@
"SUCCESS": "Succès",
"ETAT": "Etat",
"MY_ACCOUNT": "Mon compte",
"WALLET": "Wallet",
"WALLET": "Portefeuille",
"DEPOSIT": "Dépôt",
"EN_ATTENTE_DE_VALIDATION": "En attente de validation",
"REMBOURSE": "Remboursé",
@ -601,9 +601,9 @@
"ORDRE_RECETTE": "Ordre recette",
"NO_ORDRE_RECETTE": "Aucun ordre de recette",
"MODIFICATION_ORDRE_RECETTE": "Modifier ordre recette",
"SAISIE_NUMERO_QUITANCE": "Saisir numéro quittance",
"SAISIE_NUMERO_QUITANCE": "Effectuer un paiement",
"MODIFICATION_NUMERO_QUITANCE": "Modifier numéro quittance",
"SAISIR_QUITANCE": "Saisir paiement ou quittance",
"SAISIR_QUITANCE": "Gestion paiement ou quittance",
"CODE_AGENT": "Code agent ",
"AVIS_IMPOSITION": "Déclaration",
"AGENT_INFORMATION": "Informations sur l'agent",
@ -616,7 +616,7 @@
"SAVE": "Enregistrer",
"TEXT_SUPPRESS_CONFIRM_TAXE": "Voulez vous vraiment supprimer cette taxe?",
"NUMERO_QUITANCE": "Numéro quittance",
"QUITANCE": "Quitance",
"QUITANCE": "Quittance",
"ORDRE_DE_RECETTE": "Ordre de recette",
"MODIFY_ORDRE_DE_RECETTE": "Modifier ordre de recette",
"ORDRE_DE_RECETTE_NUMBER": "Numéro d'ordre de recette",
@ -651,8 +651,8 @@
"ORDRE_RECETTE_RECEIPT": "Recette et quittance",
"HISTORY_OF": "Historique des",
"AVIS_IMPOSITIONS": "déclarations",
"ORDRE_RECETTES_RECEIPTS": "recettes et quitances",
"QUITANCES": "quitances",
"ORDRE_RECETTES_RECEIPTS": "recettes et quittances",
"QUITANCES": "quittances",
"PRINCIPAL_AMOUNT": "Montant principal",
"DATE_AVIS_IMPOSITION": "Date avis imposition",
"TEXT_NETWORK_UNABLE_CHOOSE_ANOTHER": "Ce réseau n'est pas actif, veuillez choisir un autre",
@ -759,5 +759,6 @@
"TRADE_LICENSE": "Patente",
"MERCURIAL_VALUE": "Valeur mercuriale ",
"CONSTRUCTION_VALUE": "Saisir la valeur de la construction",
"BUILDING_CONSTRUCTED": "Immeuble bâti"
"BUILDING_CONSTRUCTED": "Immeuble bâti",
"PAY": "Payer"
}

View File

@ -604,6 +604,8 @@ export const savePenalityReset = () => {
};
export const searchUserAction = (data, searchFromMap = false) => {
console.log("searchUserAction===>>", data, searchFromMap);
console.log("searchUserActionUrl===>>", searchFromMap ? searchUserHomeUrl : `${searchUserUrl}?name=${data}`);
const auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';