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 ( return (
<MaterialDialog <MaterialDialog
title={I18n.t("SEARCH")} title={I18n.t("SEARCH")}
visible={this.state.dialogSearchUser} visible={this.state.dialogSearchUser}
onCancel={() => this.setState({dialogSearchUser: false})} onCancel={() => this.setState({ dialogSearchUser: false })}
onOk={result => { onOk={() => {
if(this.state.isPhoneAssureSearch) { console.log(
this.props.searchUserAction({ "On ok search user===>>",
dial_code: this.state.indicatif, this.state.userName,
phone: this.state.userName, this.state.indicatif,
this.state.isPhoneAssureSearch,
}, true); this.state.isNumeroAssureSearch
} else { );
this.props.searchUserAction({ // Prépare le payload
dial_code: this.state.indicatif, const payload = { dial_code: this.state.indicatif };
name: this.state.userName, if (this.state.isPhoneAssureSearch) {
}, true); payload.phone = this.state.userName;
} } else if (this.state.isNumeroAssureSearch) {
payload.identification_number = this.state.userName;
this.setState({dialogSearchUser: false}); } else {
payload.name = this.state.userName;
}} }
// Lance l'action
this.props.searchUserAction(payload, true);
this.setState({ dialogSearchUser: false });
}}
> >
<View> <View>
<TextInput <TextInput
style={{marginTop: 10, height: 46, borderRadius: 5, borderWidth: 1, borderColor: "#ccc"}} style={{
placeholder={this.state.isPhoneAssureSearch ? I18n.t('PHONE') : I18n.t('NAME')} marginTop: 10, height: 46, borderRadius: 5, borderWidth: 1, borderColor: "#ccc"
value={this.state.userName} }}
keyboardType={this.state.isPhoneAssureSearch ? 'numeric' : 'default'} placeholder={
onChangeText={(userName) => { this.state.isPhoneAssureSearch
this.setState({userName}); ? I18n.t("PHONE")
}} : this.state.isNumeroAssureSearch
icon={ ? I18n.t("IMMATRICULATION_DGI") // nouveau libellé à ajouter dans vos traductions
<FontAwesome : I18n.t("NAME")
style={{zIndex: 10}} }
name={this.state.isPhoneAssureSearch ? 'phone' : 'user'} value={this.state.userName}
size={20} 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={{ <View
flexDirection: 'row', style={{
position: 'absolute', flexDirection: "row",
top: 22, position: "absolute",
right: 50, top: 22,
justifyContent: 'space-between', right: 20,
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}
> >
</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() { renderDialogResultSearchUser() {

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -74,8 +74,8 @@ class NumeroQuitanceDetail extends Component {
return { return {
drawerLabel: () => null, drawerLabel: () => null,
title: navigation.getParam("isModify", false) ? I18n.t('QUITANCE') title: navigation.getParam("isModify", false) ? I18n.t('PAYMENT')
: I18n.t('QUITANCE'), : I18n.t('PAYMENT'),
headerTintColor: 'white', headerTintColor: 'white',
headerStyle: { headerStyle: {
backgroundColor: Color.primaryColor, backgroundColor: Color.primaryColor,
@ -119,15 +119,16 @@ class NumeroQuitanceDetail extends Component {
added_revenue_orders_items: [], added_revenue_orders_items: [],
displayAddOrdreRecette: false, displayAddOrdreRecette: false,
ordreRecetteId: this.props.navigation.getParam("isModify", false) ? this.props.navigation.getParam("item", "-").id_receipt : "", 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: [ paymentMethods: [
{ // {
title: I18n.t('WALLET'), // title: I18n.t('WALLET'),
value: 'wallet' // value: 'wallet'
}, // },
{ // {
title: I18n.t('CASH'), // title: I18n.t('CASH'),
value: 'cash' // value: 'cash'
}, // },
], ],
paymentMethod: 'wallet', paymentMethod: 'wallet',
paymentUrl: '', paymentUrl: '',
@ -285,15 +286,16 @@ class NumeroQuitanceDetail extends Component {
if (nextProps.paymentMethod !== null) { if (nextProps.paymentMethod !== null) {
if (nextProps.paymentMethod.result !== null) { if (nextProps.paymentMethod.result !== null) {
console.log("nextProps.paymentMethod", nextProps.paymentMethod); 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 = [ const paymentsMethods = [
{ // {
title: I18n.t('WALLET'), // title: I18n.t('WALLET'),
value: 'wallet' // value: 'wallet'
}, // },
{ // {
title: I18n.t('CASH'), // title: I18n.t('CASH'),
value: 'cash' // value: 'cash'
}, // },
] ]
this.setState({ this.setState({
paymentMethods: [...paymentsMethods, ...nextProps.paymentMethod.result.response.methods] paymentMethods: [...paymentsMethods, ...nextProps.paymentMethod.result.response.methods]
@ -947,7 +949,7 @@ class NumeroQuitanceDetail extends Component {
disabled={true} disabled={true}
textStyle={styles.textbtnstyle} textStyle={styles.textbtnstyle}
> >
{this.state.isModify ? I18n.t('MODIFY') : I18n.t('SAVE')} {this.state.isModify ? I18n.t('MODIFY') : I18n.t('PAY')}
</Button> </Button>
</View> </View>

View File

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

View File

@ -759,5 +759,6 @@
"TRADE_LICENSE": "Business License", "TRADE_LICENSE": "Business License",
"MERCURIAL_VALUE": "Mercurial Value ", "MERCURIAL_VALUE": "Mercurial Value ",
"CONSTRUCTION_VALUE": "Enter the Construction 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", "SUCCESS": "Succès",
"ETAT": "Etat", "ETAT": "Etat",
"MY_ACCOUNT": "Mon compte", "MY_ACCOUNT": "Mon compte",
"WALLET": "Wallet", "WALLET": "Portefeuille",
"DEPOSIT": "Dépôt", "DEPOSIT": "Dépôt",
"EN_ATTENTE_DE_VALIDATION": "En attente de validation", "EN_ATTENTE_DE_VALIDATION": "En attente de validation",
"REMBOURSE": "Remboursé", "REMBOURSE": "Remboursé",
@ -601,9 +601,9 @@
"ORDRE_RECETTE": "Ordre recette", "ORDRE_RECETTE": "Ordre recette",
"NO_ORDRE_RECETTE": "Aucun ordre de recette", "NO_ORDRE_RECETTE": "Aucun ordre de recette",
"MODIFICATION_ORDRE_RECETTE": "Modifier ordre 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", "MODIFICATION_NUMERO_QUITANCE": "Modifier numéro quittance",
"SAISIR_QUITANCE": "Saisir paiement ou quittance", "SAISIR_QUITANCE": "Gestion paiement ou quittance",
"CODE_AGENT": "Code agent ", "CODE_AGENT": "Code agent ",
"AVIS_IMPOSITION": "Déclaration", "AVIS_IMPOSITION": "Déclaration",
"AGENT_INFORMATION": "Informations sur l'agent", "AGENT_INFORMATION": "Informations sur l'agent",
@ -616,7 +616,7 @@
"SAVE": "Enregistrer", "SAVE": "Enregistrer",
"TEXT_SUPPRESS_CONFIRM_TAXE": "Voulez vous vraiment supprimer cette taxe?", "TEXT_SUPPRESS_CONFIRM_TAXE": "Voulez vous vraiment supprimer cette taxe?",
"NUMERO_QUITANCE": "Numéro quittance", "NUMERO_QUITANCE": "Numéro quittance",
"QUITANCE": "Quitance", "QUITANCE": "Quittance",
"ORDRE_DE_RECETTE": "Ordre de recette", "ORDRE_DE_RECETTE": "Ordre de recette",
"MODIFY_ORDRE_DE_RECETTE": "Modifier ordre de recette", "MODIFY_ORDRE_DE_RECETTE": "Modifier ordre de recette",
"ORDRE_DE_RECETTE_NUMBER": "Numéro d'ordre de recette", "ORDRE_DE_RECETTE_NUMBER": "Numéro d'ordre de recette",
@ -651,8 +651,8 @@
"ORDRE_RECETTE_RECEIPT": "Recette et quittance", "ORDRE_RECETTE_RECEIPT": "Recette et quittance",
"HISTORY_OF": "Historique des", "HISTORY_OF": "Historique des",
"AVIS_IMPOSITIONS": "déclarations", "AVIS_IMPOSITIONS": "déclarations",
"ORDRE_RECETTES_RECEIPTS": "recettes et quitances", "ORDRE_RECETTES_RECEIPTS": "recettes et quittances",
"QUITANCES": "quitances", "QUITANCES": "quittances",
"PRINCIPAL_AMOUNT": "Montant principal", "PRINCIPAL_AMOUNT": "Montant principal",
"DATE_AVIS_IMPOSITION": "Date avis imposition", "DATE_AVIS_IMPOSITION": "Date avis imposition",
"TEXT_NETWORK_UNABLE_CHOOSE_ANOTHER": "Ce réseau n'est pas actif, veuillez choisir un autre", "TEXT_NETWORK_UNABLE_CHOOSE_ANOTHER": "Ce réseau n'est pas actif, veuillez choisir un autre",
@ -759,5 +759,6 @@
"TRADE_LICENSE": "Patente", "TRADE_LICENSE": "Patente",
"MERCURIAL_VALUE": "Valeur mercuriale ", "MERCURIAL_VALUE": "Valeur mercuriale ",
"CONSTRUCTION_VALUE": "Saisir la valeur de la construction", "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) => { 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 auth = store.getState().authKeyReducer;
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : ''; const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';