import 'dart:async'; import 'package:fikoyt_mesaici/apps/mesaici/model/ayarlar/model_ayarlar.dart'; import 'package:fikoyt_mesaici/apps/mesaici/model/model_hareketler.dart'; import 'package:fikoyt_mesaici/core/Extensions/fiko_double_ext.dart'; import 'package:fikoyt_mesaici/core/Extensions/fiko_tarih.dart'; import 'package:fikoyt_mesaici/core/fikoyt.service.dart'; import 'package:fikoyt_ui/ui/ui.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:isar/isar.dart'; class OzetAylikHesaplamalarLogic extends GetxController { // late FikoYTMesaiciService FikoYTService.servisMesaici; Rx hesap = Rx(OzetAylikHesaplamalar()); RxBool hesaplaniyor = false.obs; StreamSubscription? $aktifIntentListen; /** */ /** */ @override void onInit() { // FikoYTService.servisMesaici = Get.put(FikoYTMesaiciService()); $aktifIntentListen = FikoYTService.servisMesaici.aktifIntent.listen( (data) async { if (data?.extra?["komut"] == "com.fikoyt.mesaici.komut.ozetAylik.hesapla" || data?.extra?["actionId"] == "com.fikoyt.mesaici.komut.aktifKart.giris.yap.saatinde") { try { if (hesaplaniyor.value == true) return; hesaplaniyor.value = true; hesaplaniyor.refresh(); try { await Future.delayed(const Duration(milliseconds: 300)); OzetAylikHesaplamalar ozt = OzetAylikHesaplamalar(maasAyarlari: FikoYTService.servisMesaici.ayarlarModel?.value.maasParametreleri.toListe()[FikoYTService.servisMesaici.aktifAy.value.month - 1], brutUcret: FikoYTService.servisMesaici.aylikOzet?.odenecekUcret ?? 0.0); await ozt.hesapla(); hesap.value = ozt; hesap.refresh(); hesaplaniyor.value = false; hesaplaniyor.refresh(); hesaplaniyor.refresh(); } catch (e) { // print(e); hesaplaniyor.value = false; hesaplaniyor.refresh(); } finally { hesaplaniyor.value = false; hesaplaniyor.refresh(); } } catch (e) {} } }, ); super.onInit(); } @override // ignore: unnecessary_overrides void onClose() { $aktifIntentListen?.cancel(); super.onClose(); } } class OzetAylikHesaplamalarWidget extends StatefulWidget { const OzetAylikHesaplamalarWidget({super.key}); @override State createState() => _OzetAylikHesaplamalarWidgetState(); } class _OzetAylikHesaplamalarWidgetState extends State with WidgetsBindingObserver { late OzetAylikHesaplamalarLogic logic; @override void initState() { logic = Get.put(OzetAylikHesaplamalarLogic()); super.initState(); WidgetsBinding.instance.addObserver(this); } @override void dispose() { Get.delete(); WidgetsBinding.instance.removeObserver(this); super.dispose(); } @override void didChangePlatformBrightness() { super.didChangePlatformBrightness(); setState(() {}); } @override Widget build(BuildContext context) { return Obx( () { FikoYTService.servisMesaici.aktifAy.value; // logic.FikoYTService.servisMesaici.aktifCalisma?.value; logic.update(); return FutureBuilder( future: FikoYTService.servisMesaici.aylikOzet?.aktifAyhesapla(), builder: (context, snapshot) => Container( padding: const EdgeInsets.all(2), margin: const EdgeInsets.all(5), decoration: BoxDecoration( color: Theme.of(context).extension()?.cardBackgroundColor, borderRadius: const BorderRadius.all( Radius.circular(5), ), boxShadow: const [ BoxShadow(color: Colors.black12, offset: Offset(0, 0), spreadRadius: 1, blurRadius: 0.0, blurStyle: BlurStyle.outer), ]), child: Column( children: [ FikoYTButton( text: "Aylık Hesaplamalar", tema: Theme.of(context).extension()?.copyWith( fontSize: 12, textStrokeColor: Colors.black, textColor: Colors.white, ), ), const Divider( height: 2, ), /** */ Row( children: [ Expanded( child: Container( alignment: Alignment.center, decoration: BoxDecoration( color: Colors.blue.shade400, ), child: const Text( "Hesaplama İsmi", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), ), ), Expanded( child: Container( alignment: Alignment.center, decoration: BoxDecoration( color: Colors.blue.shade400, ), child: const Text( "Değer", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), ), ), ], ), Obx( () => Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoYTButton1( text: "Brüt Maaş", tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.grey.shade100, ), // onPressed: () {}, ), ), Expanded( child: AnimatedNumberFikoYTButton1( text: logic.hesap.value.brutUcret, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: EdgeInsets.zero, textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.grey.shade100, ), // onPressed: () {}, ), ), ], ), /** */ ...logic.hesap.value.ekOdemeler.map( (ekOdeme) => Container( color: Colors.orange.shade100, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoYTButton1( text: "${ekOdeme.turu.simge} ${ekOdeme.ismi}", tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.grey.shade100.withAlpha(100), ), // onPressed: () {}, ), ), Expanded( child: AnimatedNumberFikoYTButton1( text: ekOdeme.miktar, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.grey.shade100.withAlpha(100), ), // onPressed: () {}, ), ), ], ), ), ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoYTButton1( text: "Σ Ek Ödemeler Toplam", tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.blue.shade100.withAlpha(100), ), // onPressed: () {}, ), ), Expanded( child: AnimatedNumberFikoYTButton1( text: logic.hesap.value.ekOdemelerToplam, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.blue.shade100.withAlpha(100), ), // onPressed: () {}, ), ), ], ), /** */ Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoYTButton1( text: "Kesinti Matrahı", tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.grey.shade100.withAlpha(100), ), // onPressed: () {}, ), ), Expanded( child: AnimatedNumberFikoYTButton1( text: logic.hesap.value.kesintiMatrahi, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.grey.shade100.withAlpha(100), ), // onPressed: () {}, ), ), ], ), /** */ ...logic.hesap.value.kesintilerPrimler.map( (kesinti) => Container( color: Colors.orange.shade100, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoYTButton1( text: "${kesinti.turu.simge} ${kesinti.ismi}", tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.orange.shade100.withAlpha(100), ), // onPressed: () {}, ), ), Expanded( child: AnimatedNumberFikoYTButton1( text: kesinti.hesaplanan, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.orange.shade100.withAlpha(100), ), // onPressed: () {}, ), ), ], ), ), ), /** */ Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoYTButton1( text: "Σ Kesintiler / Primler", tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.blue.shade100.withAlpha(100), ), // onPressed: () {}, ), ), Expanded( child: AnimatedNumberFikoYTButton1( text: logic.hesap.value.kesintilerToplam, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.blue.shade100.withAlpha(100), ), // onPressed: () {}, ), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoYTButton1( text: "Vergi Matrahı", tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.grey.shade100.withAlpha(100), ), // onPressed: () {}, ), ), Expanded( child: AnimatedNumberFikoYTButton1( text: logic.hesap.value.vergiMatrahi, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.grey.shade100.withAlpha(100), ), // onPressed: () {}, ), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoYTButton1( text: "Kümülatif Matrah", tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.grey.shade100.withAlpha(100), ), // onPressed: () { // print(logic.hesap.value.kumulatifVergiMatrahi); // }, ), ), Expanded( child: AnimatedNumberFikoYTButton1( text: logic.hesap.value.kumulatifVergiMatrahi, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.grey.shade100.withAlpha(100), ), // onPressed: () {}, ), ), ], ), /** */ ...logic.hesap.value.vergiler.map( (vergi) => Visibility( visible: ((vergi.hesaplanan ?? 0.0) > 0), child: Container( color: Colors.orange.shade100, child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoYTButton1( text: "${vergi.turu.simge} ${vergi.ismi}", tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.orange.shade100.withAlpha(100), ), // onPressed: () {}, ), ), Expanded( child: AnimatedNumberFikoYTButton1( text: vergi.hesaplanan, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.orange.shade100.withAlpha(100), ), // onPressed: () {}, ), ), ], ), ), ), ), /** */ Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoYTButton1( text: "Σ Vergiler Toplam", tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.blue.shade100.withAlpha(100), ), // onPressed: () {}, ), ), Expanded( child: AnimatedNumberFikoYTButton1( text: logic.hesap.value.vergilerToplam, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.blue.shade100.withAlpha(100), ), // onPressed: () {}, ), ), ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ Expanded( child: AnimatedFikoYTButton1( text: "Net Ücret", tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.grey.shade100.withAlpha(100), ), // onPressed: () {}, ), ), Expanded( child: AnimatedNumberFikoYTButton1( text: logic.hesap.value.netUcret, textBuilder: (tweenValue) => tweenValue.toParaBirimi(), tema: Theme.of(context).extension()?.copyWith( fontSize: 12, edgePadding: const EdgeInsets.symmetric(vertical: 2.0), textColor: Colors.black, textStrokeColor: Colors.transparent, fontWeight: FontWeight.normal, radius: 0, backgroundColor: Colors.grey.shade100.withAlpha(100), ), // onPressed: () {}, ), ), ], ), ], ), ), /** */ // TextButton( // onPressed: () async { // if (logic.hesaplaniyor.value == true) return; // logic.hesaplaniyor.value = true; // logic.hesaplaniyor.refresh(); // try { // await Future.delayed(const Duration(milliseconds: 1000)); // OzetAylikHesaplamalar ozt = OzetAylikHesaplamalar(maasAyarlari: logic.FikoYTService.servisMesaici.ayarlarModel?.value.maasParametreleri.toListe()[logic.FikoYTService.servisMesaici.aktifAy.value.month - 1], brutUcret: logic.FikoYTService.servisMesaici.aylikOzet?.odenecekUcret ?? 0.0); // await ozt.hesapla(); // logic.hesap.value = ozt; // logic.hesap.refresh(); // logic.hesaplaniyor.value = false; // logic.hesaplaniyor.refresh(); // logic.hesaplaniyor.refresh(); // } catch (e) { // // print(e); // logic.hesaplaniyor.value = false; // logic.hesaplaniyor.refresh(); // } finally { // logic.hesaplaniyor.value = false; // logic.hesaplaniyor.refresh(); // } // }, // style: TextButton.styleFrom( // alignment: Alignment.center, // fixedSize: const Size.fromHeight(16), // backgroundColor: Colors.blue.shade400, // shape: const RoundedRectangleBorder( // borderRadius: BorderRadius.horizontal( // left: Radius.circular(50), // right: Radius.circular(50), // ), // ), // textStyle: const TextStyle( // fontSize: 10, // color: Colors.white, // ), // ), // child: Padding( // padding: const EdgeInsets.symmetric(horizontal: 10), // child: Obx( // () => AnimatedCrossFade( // firstChild: const Text( // "🧮 Hesapla", // style: TextStyle( // color: Colors.white, // ), // ), // secondChild: Row( // crossAxisAlignment: CrossAxisAlignment.center, // mainAxisAlignment: MainAxisAlignment.center, // children: [ // Container( // width: 16, // height: 16, // padding: const EdgeInsets.all(2.0), // child: const CircularProgressIndicator( // color: Colors.white, // strokeWidth: 3, // ), // ), // ], // ), // crossFadeState: logic.hesaplaniyor.value ? CrossFadeState.showSecond : CrossFadeState.showFirst, // duration: const Duration(milliseconds: 500), // ), // ), // ), // ), FikoYTButton( text: Obx( () => AnimatedCrossFade( firstChild: const Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ Text( "🧮 Hesapla", style: TextStyle(fontSize: 11), ), ], ), secondChild: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ Container( width: 16, height: 16, padding: const EdgeInsets.all(2.0), child: const CircularProgressIndicator( // color: Colors.white, strokeWidth: 3, ), ), ], ), crossFadeState: logic.hesaplaniyor.value ? CrossFadeState.showSecond : CrossFadeState.showFirst, duration: const Duration(milliseconds: 500), ), ), tema: Theme.of(context).extension()?.copyWith( fontSize: 10, edgePadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 1), // backColor: Colors.white, // textColor: Colors.black, textStrokeColor: Colors.transparent, borderColor: Colors.transparent, ), onPressed: () async { if (logic.hesaplaniyor.value == true) return; logic.hesaplaniyor.value = true; logic.hesaplaniyor.refresh(); try { await Future.delayed(const Duration(milliseconds: 300)); OzetAylikHesaplamalar ozt = OzetAylikHesaplamalar(maasAyarlari: FikoYTService.servisMesaici.ayarlarModel?.value.maasParametreleri.toListe()[FikoYTService.servisMesaici.aktifAy.value.month - 1], brutUcret: FikoYTService.servisMesaici.aylikOzet?.odenecekUcret ?? 0.0); await ozt.hesapla(); logic.hesap.value = ozt; logic.hesap.refresh(); logic.hesaplaniyor.value = false; logic.hesaplaniyor.refresh(); logic.hesaplaniyor.refresh(); } catch (e) { // print(e); logic.hesaplaniyor.value = false; logic.hesaplaniyor.refresh(); } finally { logic.hesaplaniyor.value = false; logic.hesaplaniyor.refresh(); } }, ) ], ), ), ); }, ); } } class OzetAylikHesaplamalar { OzetAylikHesaplamalar({this.maasAyarlari, this.brutUcret}); Maas? maasAyarlari; /** */ double? brutUcret; // double brutMaas = 0.0; double kesintiMatrahi = 0.0; List ekOdemeler = []; double ekOdemelerToplam = 0.0; List kesintilerPrimler = []; double kesintilerToplam = 0.0; double vergiMatrahi = 0.0; double kumulatifVergiMatrahi = 0.0; List vergiler = []; double vergilerToplam = 0.0; double netUcret = 0.0; hesapla() async { ekOdemeler = maasAyarlari!.ekOdemeler!.copy(); ekOdemelerToplam = ekOdemeler.toplam(); kesintiMatrahi = (brutUcret ?? 0.0) + ekOdemelerToplam; kesintilerPrimler = maasAyarlari!.kesintiler!.copy(); kesintilerToplam = kesintilerPrimler.hesapla(ucret: kesintiMatrahi, guncelBrutMaas: kesintiMatrahi, guncelBrut: 0); vergiMatrahi = kesintiMatrahi - kesintilerToplam; kumulatifVergiMatrahi = await kumulatifMatrahGuncelleSync(); vergiler = maasAyarlari!.vergiler!.copy(); vergilerToplam = vergiler.hesapla(ucret: vergiMatrahi, kumulatifMatrah: kumulatifVergiMatrahi, guncelBrutMaas: vergiMatrahi, guncelBrut: kesintiMatrahi); netUcret = kesintiMatrahi - kesintilerToplam - vergilerToplam; // print(vergiMatrahi); } Future kumulatifMatrahGuncelleSync() async { // final FikoYTMesaiciService FikoYTService.servisMesaici = Get.put(FikoYTMesaiciService()); /** */ // List liste = await FikoYTService.servisMesaici.isar?.modelHareketlers.where().filter().turuEqualTo(KartTuru.CALISMA_KARTI).calismaKarti((q) => q.tarihBetween(FikoYTService.servisMesaici.aktifAy.value.yilinIlkGunu().ilkSaatler(), FikoYTService.servisMesaici.aktifAy.value.ayinSonGunu().sonSaatler())).calismaKartiProperty().findAll(); /** */ double sonucGelirVergisiMatrahi = 0; for (var i = 1; i <= FikoYTService.servisMesaici.aktifAy.value.month; i++) { Maas mevcutAyAyarlari = FikoYTService.servisMesaici.ayarlarModel!.value.maasParametreleri.toListe()[i - 1]; /** */ double brutUcret1 = 0.0; List listeMevcutAy = await FikoYTService.servisMesaici.isar!.modelHareketlers.where().filter().turuEqualTo(KartTuru.CALISMA_KARTI).calismaKarti((q) => q.tarihBetween(DateTime(FikoYTService.servisMesaici.aktifAy.value.year, i).ayinIlkGunu().ilkSaatler(), DateTime(FikoYTService.servisMesaici.aktifAy.value.year, i).ayinSonGunu().sonSaatler())).calismaKartiProperty().findAll(); for (var k = 0; k < listeMevcutAy.length; k++) { CalismaKayitEmbedded itemGun = listeMevcutAy[k]!; brutUcret1 += itemGun.odenecekUcret; } /** */ double kesintiMatrahi1 = brutUcret1 + (mevcutAyAyarlari.ekOdemeler?.toplam() ?? 0.0); double kesintilerToplam1 = mevcutAyAyarlari.kesintiler?.hesapla(ucret: kesintiMatrahi1, guncelBrutMaas: kesintiMatrahi1, guncelBrut: 0) ?? 0.0; double vergiMatrahi1 = kesintiMatrahi1 - kesintilerToplam1; sonucGelirVergisiMatrahi += vergiMatrahi1; } // guncelBrutMaas = 0; // for (var i = 0; i < liste.length; i++) { // CalismaKayitEmbedded? item = liste[i]; // if (item != null) { // // await item.hesaplamalar.hesapla(); // sonucGelirVergisiMatrahi += item.gelirVergisiMatrahi; // // if (tarih!.ayinIlkGunu().ilkSaatler().isBefore(item.tarih!)) { // // if (item.tarih!.isBefore(tarih!.sonSaatler())) { // // guncelBrutMaas += item.gelirVergisiMatrahi; // // } // // } // } // } // guncelMaas += odenecekUcret; // kumulatifVergiMatrahi = sonucGelirVergisiMatrahi; return sonucGelirVergisiMatrahi; } }