This commit is contained in:
Hamza-Ayed
2024-06-25 15:08:56 +03:00
parent 9c73af74bb
commit 0407d37e9d
16 changed files with 513 additions and 493 deletions

View File

@@ -132,6 +132,10 @@ class LoginCaptinController extends GetxController {
box.write(BoxName.phoneVerified,
jsonDecoeded['data'][0]['is_verified'].toString());
box.write(BoxName.phoneDriver, jsonDecoeded['data'][0]['phone']);
box.write(
BoxName.bankCodeDriver, jsonDecoeded['data'][0]['bankCode']);
box.write(BoxName.accountBankNumberDriver,
jsonDecoeded['data'][0]['accountBank']);
box.write(
BoxName.nameDriver,
'${jsonDecoeded['data'][0]['first_name']}'

View File

@@ -1,8 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'dart:math' as math;
import 'dart:math' show cos;
import 'package:SEFER/constant/table_names.dart';
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
@@ -523,10 +520,8 @@ class MapDriverController extends GetxController {
}
double pointsSubtraction = 0;
pointsSubtraction = double.parse(paymentAmount) *
(-1) *
double.parse(kazan) /
100; // for Egypt /100
pointsSubtraction =
double.parse(paymentAmount) * (-1) * double.parse(kazan);
var paymentToken2 =
await generateTokenDriver((pointsSubtraction).toStringAsFixed(0));
var res = await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {

View File

@@ -14,6 +14,7 @@ import 'package:SEFER/main.dart';
class CaptainWalletController extends GetxController {
bool isLoading = false;
final formKeyTransfer = GlobalKey<FormState>();
final formKeyAccount = GlobalKey<FormState>();
Map walletDate = {};
Map walletDateVisa = {};
Map walletDriverPointsDate = {};
@@ -24,6 +25,8 @@ class CaptainWalletController extends GetxController {
final amountFromBudgetController = TextEditingController();
final newDriverPhoneController = TextEditingController();
final phoneWallet = TextEditingController();
final cardBank = TextEditingController();
final bankCode = TextEditingController();
payFromBudget() async {
if (formKey.currentState!.validate()) {
@@ -198,7 +201,10 @@ class CaptainWalletController extends GetxController {
await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
'driverID': amountToNewDriverMap[0]['id'].toString(),
'paymentID': paymentID.toString(),
'amount': (int.parse(amountFromBudgetController.text) - 5).toString(),
'amount': ((int.parse(amountFromBudgetController.text) - 5) / .08)
.toStringAsFixed(
0), // this will convert buddget to poitns by kazan .08
'token': paymentToken,
'paymentMethod': paymentMethod2.toString(),
});

View File

@@ -4,7 +4,18 @@ class MyTranslation extends Translations {
@override
Map<String, Map<String, String>> get keys => {
"ar": {
"You don't have enough money in your SEFER wallet":
"Please enter a valid card 16-digit number.":
"الرجاء إدخال رقم بطاقة صحيح مكون من 16 رقمًا.",
"Insert card number": "أدخل رقم البطاقة",
"Bank account added successfully": "تمت إضافة الحساب البنكي بنجاح",
"Updated successfully": "تم التحديث بنجاح",
"Create Wallet to receive your money": "أنشئ محفظة لاستقبال أموالك",
"Insert Account Bank": "أدخل رقم حسابك البنكي",
"Insert Card Bank Details to Receive Your Visa Money Weekly":
"أدخل تفاصيل بطاقتك البنكية لاستقبال راتبك عبر فيزا كل أسبوع",
"Select Name of Your Bank": "اختر اسم بنكك",
"Create Wallet to receive your money"
"You don't have enough money in your SEFER wallet":
"لا يوجد رصيد كافٍ في محفظة SEFER الخاصة بك ",
"You have transferred to your wallet from": "لقد حولت إلى محفظتك من",
'Transfer': "تحويل",
@@ -87,8 +98,8 @@ class MyTranslation extends Translations {
'This amount for all trip I get from Passengers and Collected For me in':
'هذا المبلغ لجميع الرحلات التي أحصل عليها من الركاب والمجموعة لي في',
'Total Budget from trips is ': 'إجمالي الميزانية من الرحلات هو ',
'You can buy Points to let you online\nby this list below':
'يمكنك سداد المديونية من هذه القائمة',
"You can purchase a budget to enable online access through the options listed below.":
'يمكنك ‏إضافة رصيد من هذه القائمة',
'You can buy points from your budget':
'يمكنك سداد المديونية من حسابك',
"expiration_date": "تاريخ الانتهاء",
@@ -648,11 +659,12 @@ class MyTranslation extends Translations {
"Please help! Contact me as soon as possible.":
"من فضلك ساعدني! تواصل معي في أقرب وقت ممكن.",
"Share Trip Details": "شارك تفاصيل الرحلة",
"Car Plate is": "لوحة السيارة",
"the 300 points equal 300 L.E for you":
"الـ 300 نقطة تعادل 300 جنيه مصري بالنسبة لك",
"Car Plate is": "لوحة السيارة", 'L.E': 'جنيه',
"the 3000 points equal 3000 L.E for you":
"الـ 3000 نقطة تعادل 3000 جنيه مصري بالنسبة لك",
"So go and gain your money": "انطلق واكسب مالك",
"the 300 points equal 300 L.E": "الـ 300 نقطة تساوي 300 جنيه مصري",
"the 3000 points equal 3000 L.E":
"الـ 3000 نقطة تساوي 3000 جنيه مصري",
"The payment was not approved. Please try again.":
"لم يتم الموافقة على الدفع. يرجى المحاولة مرة أخرى.",
"Payment Failed": "تعذرت عملية الدفع",
@@ -676,8 +688,8 @@ class MyTranslation extends Translations {
' is ON for this month': ' لهذا الشهر ',
"Origin": "الأصل",
"Destination": "مكان الوصول",
'the 300 points equal 300 L.E for you \nSo go and gain your money':
"ال300 نقطة تعادل 300 ج.م لك، فاذهب واكسب مالك.",
'the 3000 points equal 3000 L.E for you \nSo go and gain your money':
"ال3000 نقطة تعادل 3000 ج.م لك، فاذهب واكسب مالك.",
"Driver Name": "اسم السائق",
"Driver Car Plate": "لوحة سيارة السائق",
"Available for rides": "‏الرحلات المتوفرة",
@@ -1423,18 +1435,18 @@ class MyTranslation extends Translations {
"Konumum doğru. Navigasyon uygulamasını kullanarak beni arayabilirsiniz",
"Share Trip Details": "Seni bekliyorum",
"Car Plate is": "Merhaba, kararlaştırılan yerdeyim",
"the 300 points equal 300 L.E for you":
"the 3000 points equal 3000 L.E for you":
"Hızın 100 km/s'yi aştığını fark ettik. Lütfen güvenliğiniz için yavaşlayın. Kendinizi güvende hissetmiyorsanız yolculuk bilgilerinizi bir kişiyle paylaşabilir veya kırmızı sos düğmesini kullanarak polisi arayabilirsiniz.",
"So go and gain your money": "Uyarı: Hız algılandı!",
"the 300 points equal 300 L.E":
"the 3000 points equal 3000 L.E":
"Lütfen yardım edin! En kısa sürede benimle iletişime geçin.",
"The payment was not approved. Please try again.":
"Yolculuk bilgilerini paylaşın",
"Payment Failed": "Araç Plakası:",
"Error": "300 puan sizin için 300 L.E.' ye eşittir",
"Error": "3000 puan sizin için 3000 L.E.' ye eşittir",
"An error occurred during the payment process.":
"Öyleyse git ve paranı kazan",
"The payment was approved.": "300 puan 300 L.E.' ye eşittir.",
"The payment was approved.": "3000 puan 3000 L.E.' ye eşittir.",
"Payment Successful": "Ödeme onaylanmadı. Please try again later.",
"No ride found yet": "Ödeme Başarısız",
"Accept Order": "Error",
@@ -2220,10 +2232,10 @@ class MyTranslation extends Translations {
"Aide-moi s'il te plaît. Contactez-moi dès que possible.",
"Share Trip Details": "Partagez les détails de la",
"Car Plate is": "Le numéro d'immatriculation ?",
"the 300 points equal 300 L.E for you":
"300 points équivaut à 300 EGP pour vous",
"the 3000 points equal 3000 L.E for you":
"3000 points équivaut à 3000 EGP pour vous",
"So go and gain your money": "Gagnez de l'argent",
"the 300 points equal 300 L.E": "300 points équivaut à 300 EGP",
"the 3000 points equal 3000 L.E": "3000 points équivaut à 3000 EGP",
"The payment was not approved. Please try again.":
"Paiement non approuvé. Réessayer",
"Payment Failed": "Échec du paiement",
@@ -3020,10 +3032,10 @@ class MyTranslation extends Translations {
"Aide-moi s'il te plaît. Contactez-moi dès que possible.",
"Share Trip Details": "Partagez les détails de la",
"Car Plate is": "Le numéro d'immatriculation ?",
"the 300 points equal 300 L.E for you":
"300 points équivaut à 300 EGP pour vous",
"the 3000 points equal 3000 L.E for you":
"3000 points équivaut à 3000 EGP pour vous",
"So go and gain your money": "Gagnez de l'argent",
"the 300 points equal 300 L.E": "300 points équivaut à 300 EGP",
"the 3000 points equal 3000 L.E": "3000 points équivaut à 3000 EGP",
"The payment was not approved. Please try again.":
"Paiement non approuvé. Réessayer",
"Payment Failed": "Échec du paiement",
@@ -3817,10 +3829,10 @@ class MyTranslation extends Translations {
"Aide-moi s'il te plaît. Contactez-moi dès que possible.",
"Share Trip Details": "Partagez les détails de la",
"Car Plate is": "Le numéro d'immatriculation ?",
"the 300 points equal 300 L.E for you":
"300 points équivaut à 300 EGP pour vous",
"the 3000 points equal 3000 L.E for you":
"3000 points équivaut à 3000 EGP pour vous",
"So go and gain your money": "Gagnez de l'argent",
"the 300 points equal 300 L.E": "300 points équivaut à 300 EGP",
"the 3000 points equal 3000 L.E": "3000 points équivaut à 3000 EGP",
"The payment was not approved. Please try again.":
"Paiement non approuvé. Réessayer",
"Payment Failed": "Échec du paiement",
@@ -4615,10 +4627,10 @@ class MyTranslation extends Translations {
"Aide-moi s'il te plaît. Contactez-moi dès que possible.",
"Share Trip Details": "Partagez les détails de la",
"Car Plate is": "Le numéro d'immatriculation ?",
"the 300 points equal 300 L.E for you":
"300 points équivaut à 300 EGP pour vous",
"the 3000 points equal 3000 L.E for you":
"3000 points équivaut à 3000 EGP pour vous",
"So go and gain your money": "Gagnez de l'argent",
"the 300 points equal 300 L.E": "300 points équivaut à 300 EGP",
"the 3000 points equal 3000 L.E": "3000 points équivaut à 3000 EGP",
"The payment was not approved. Please try again.":
"Paiement non approuvé. Réessayer",
"Payment Failed": "Échec du paiement",
@@ -5418,10 +5430,10 @@ class MyTranslation extends Translations {
"Aide-moi s'il te plaît. Contactez-moi dès que possible.",
"Share Trip Details": "Partagez les détails de la",
"Car Plate is": "Le numéro d'immatriculation ?",
"the 300 points equal 300 L.E for you":
"300 points équivaut à 300 EGP pour vous",
"the 3000 points equal 3000 L.E for you":
"3000 points équivaut à 3000 EGP pour vous",
"So go and gain your money": "Gagnez de l'argent",
"the 300 points equal 300 L.E": "300 points équivaut à 300 EGP",
"the 3000 points equal 3000 L.E": "3000 points équivaut à 3000 EGP",
"The payment was not approved. Please try again.":
"Paiement non approuvé. Réessayer",
"Payment Failed": "Échec du paiement",
@@ -6204,10 +6216,10 @@ class MyTranslation extends Translations {
"कृपया मेरी मदद करें! जितनी जल्दी हो सके मुझसे संपर्क करें।",
"Share Trip Details": "ट्रिप का ब्यौरा दें",
"Car Plate is": "कार के चारों ओर ले आओ।",
"the 300 points equal 300 L.E for you":
"300 अंक आपके लिए 300 EGP के बराबर है",
"the 3000 points equal 3000 L.E for you":
"3000 अंक आपके लिए 3000 EGP के बराबर है",
"So go and gain your money": "अपने पैसे कमाने के लिए आगे बढ़ें",
"the 300 points equal 300 L.E": "300 points बराबर है: 300 EGP",
"the 3000 points equal 3000 L.E": "3000 points बराबर है: 3000 EGP",
"The payment was not approved. Please try again.":
"भुगतान मंज़ूर नहीं किया गया। फिर से कोशिश करें",
"Payment Failed": "भुगतान नहीं हो सका",
@@ -6983,10 +6995,11 @@ class MyTranslation extends Translations {
"لطفأ ، کمکم کن. در اسرع وقت با من تماس بگیرید.",
"Share Trip Details": "جزئیات سفر را به اشتراک بگذارید",
"Car Plate is": "پلاک اتومبیل",
"the 300 points equal 300 L.E for you":
"300 امتیاز برای شما معادل 300 پوند مصر است",
"the 3000 points equal 3000 L.E for you":
"3000 امتیاز برای شما معادل 3000 پوند مصر است",
"So go and gain your money": "برو جلو و پولت را در بیاور",
"the 300 points equal 300 L.E": "300 امتیاز معادل 300 پوند مصر است",
"the 3000 points equal 3000 L.E":
"3000 امتیاز معادل 3000 پوند مصر است",
"The payment was not approved. Please try again.":
"پرداخت تایید نشد سعی مجدد",
"Payment Failed": "پرداخت ناموفق",
@@ -7706,9 +7719,9 @@ class MyTranslation extends Translations {
"Please help! Contact me as soon as possible.": "請幫幫我!請盡快與我聯絡。",
"Share Trip Details": "提供行程詳細資訊",
"Car Plate is": "車牌號碼",
"the 300 points equal 300 L.E for you": "300分等於300 EGP",
"the 3000 points equal 3000 L.E for you": "3000分等於3000 EGP",
"So go and gain your money": "開始賺取收入",
"the 300 points equal 300 L.E": "300分等於300 EGP",
"the 3000 points equal 3000 L.E": "3000分等於3000 EGP",
"The payment was not approved. Please try again.": "付款未批準。請再試一次。",
"Payment Failed": "付款失敗",
"Error": "錯誤",

View File

@@ -1,45 +0,0 @@
import 'dart:convert';
import 'package:SEFER/constant/style.dart';
import 'package:SEFER/views/widgets/elevated_btn.dart';
import 'package:get/get.dart';
import 'package:SEFER/constant/box_name.dart';
import 'package:SEFER/constant/links.dart';
import 'package:SEFER/controller/functions/crud.dart';
import 'package:SEFER/main.dart';
class PassengerWalletHistoryController extends GetxController {
bool isLoading = false;
List archive = [];
getArchivePayment() async {
isLoading = true;
update();
var res = await CRUD().get(
link: AppLink.getPassengerWalletArchive,
payload: {'passenger_id': box.read(BoxName.passengerID)});
if (res != 'failure') {
archive = jsonDecode(res)['message'];
isLoading = false;
update();
} else {
Get.defaultDialog(
barrierDismissible: false,
title: 'No wallet record found'.tr,
titleStyle: AppStyle.title,
middleText: '',
confirm: MyElevatedButton(
title: 'OK'.tr,
onPressed: () {
Get.back();
Get.back();
}));
}
}
@override
void onInit() {
getArchivePayment();
super.onInit();
}
}