step 15 : remove padding report

This commit is contained in:
sindhu
2024-01-16 09:03:44 +07:00
parent 088c18f536
commit a317946fc2
7 changed files with 234 additions and 147 deletions

View File

@@ -15,6 +15,9 @@ class Constant {
// static String baseUrl = "https://devregonline.pramita.co.id/one-api/xdoc/"; // static String baseUrl = "https://devregonline.pramita.co.id/one-api/xdoc/";
// tester devbandungraya // tester devbandungraya
static String baseUrlDevoneReport =
"devone.aplikasi.web.id";
static String baseUrlDevone = static String baseUrlDevone =
"http://devone.aplikasi.web.id/one-api-pettycash/pettycash/"; "http://devone.aplikasi.web.id/one-api-pettycash/pettycash/";

View File

@@ -25,8 +25,8 @@ class AuthDoctorModel {
late String M_UserID; late String M_UserID;
late String M_UserUsername; late String M_UserUsername;
late String M_UserEmail; late String M_UserEmail;
// late String M_UserM_DoctorCode; late String M_CompanyID;
// late String M_UserM_DoctorID; late String M_CompanyName;
// late String M_UserM_StaffID; // late String M_UserM_StaffID;
// late String M_UserM_MouID; // late String M_UserM_MouID;
late String ip; late String ip;
@@ -39,8 +39,8 @@ class AuthDoctorModel {
required this.M_UserID, required this.M_UserID,
required this.M_UserUsername, required this.M_UserUsername,
required this.M_UserEmail, required this.M_UserEmail,
// required this.M_UserM_DoctorCode, required this.M_CompanyID,
// required this.M_UserM_DoctorID, required this.M_CompanyName,
// this.M_UserM_StaffID = "", // this.M_UserM_StaffID = "",
// this.M_UserM_MouID = "", // this.M_UserM_MouID = "",
this.ip = "", this.ip = "",
@@ -51,8 +51,8 @@ class AuthDoctorModel {
M_UserID = json['M_UserID'].toString(); M_UserID = json['M_UserID'].toString();
M_UserUsername = json['M_UserUsername'].toString(); M_UserUsername = json['M_UserUsername'].toString();
M_UserEmail = json['M_UserEmail'].toString(); M_UserEmail = json['M_UserEmail'].toString();
// M_UserM_DoctorCode = json['M_UserM_DoctorCode'].toString(); M_CompanyID = json['M_CompanyID'].toString();
// M_UserM_DoctorID = json['M_UserM_DoctorID'].toString(); M_CompanyName = json['M_CompanyName'].toString();
// M_UserM_StaffID = json['M_UserM_StaffID'].toString(); // M_UserM_StaffID = json['M_UserM_StaffID'].toString();
// M_UserM_MouID = json['M_UserM_MouID'].toString(); // M_UserM_MouID = json['M_UserM_MouID'].toString();
ip = json['ip'].toString(); ip = json['ip'].toString();
@@ -64,8 +64,8 @@ class AuthDoctorModel {
data['M_UserID'] = M_UserID; data['M_UserID'] = M_UserID;
data['M_UserUsername'] = M_UserUsername; data['M_UserUsername'] = M_UserUsername;
data['M_UserEmail'] = M_UserEmail; data['M_UserEmail'] = M_UserEmail;
// data['M_UserM_DoctorCode'] = M_UserM_DoctorCode; data['M_CompanyID'] = M_CompanyID;
// data['M_UserM_DoctorID'] = M_UserM_DoctorID; data['M_CompanyName'] = M_CompanyName;
// data['M_UserM_StaffID'] = M_UserM_StaffID; // data['M_UserM_StaffID'] = M_UserM_StaffID;
// data['M_UserM_MouID'] = M_UserM_MouID; // data['M_UserM_MouID'] = M_UserM_MouID;
data['ip'] = ip; data['ip'] = ip;

View File

@@ -58,12 +58,12 @@ class TransaksiRepository extends BaseRepository {
String sender, String sender,
String url) async { String url) async {
String paramPostInUrl = ""; String paramPostInUrl = "";
if (tipe == "KREDIT") { if (tipe == "DEBIT") {
sender = ""; sender = "";
paramPostInUrl = paramPostInUrl =
"?tanggal=$tanggal&tipe=$tipe&kategoriid=$kategoriid&jumlah=$jumlah&catatan=$catatan&url=$url&userid=$userid&sender=$sender"; "?tanggal=$tanggal&tipe=$tipe&kategoriid=$kategoriid&jumlah=$jumlah&catatan=$catatan&url=$url&userid=$userid&sender=$sender";
} else { } else {
if (tipe == "DEBIT") { if (tipe == "KREDIT") {
kategoriid = "0"; kategoriid = "0";
paramPostInUrl = paramPostInUrl =
"?tanggal=$tanggal&tipe=$tipe&kategoriid=$kategoriid&jumlah=$jumlah&catatan=$catatan&url=$url&userid=$userid&sender=$sender"; "?tanggal=$tanggal&tipe=$tipe&kategoriid=$kategoriid&jumlah=$jumlah&catatan=$catatan&url=$url&userid=$userid&sender=$sender";

View File

@@ -0,0 +1,31 @@
import 'package:flutter/material.dart';
import '../../app/constant.dart';
import '../../widget/custom_drawer.dart';
class ChangeCompanyScreen extends StatelessWidget {
const ChangeCompanyScreen({super.key});
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.only(
top: Constant.getActualYPhone(context: context, y: 30),
),
child: Scaffold(
appBar: AppBar(
// centerTitle: true,
title: Text(
'Change Company',
style: TextStyle(color: Constant.textWhite),
),
backgroundColor: Constant.pcBtnBackgroundColor,
iconTheme: IconThemeData(
color: Constant.textWhite,
),
),
drawer: CustomDrawer(),
),
);
}
}

View File

@@ -29,7 +29,8 @@ class LoginScreen extends HookConsumerWidget {
final authModel = AuthModel( final authModel = AuthModel(
token: xmodel["token"], token: xmodel["token"],
model: AuthDoctorModel( model: AuthDoctorModel(
// M_UserM_DoctorID: xmodel["model"]["M_UserM_DoctorID"], M_CompanyID: xmodel["model"]["M_CompanyID"],
M_CompanyName: xmodel["model"]["M_CompanyName"],
M_UserEmail: xmodel["model"]["M_UserEmail"], M_UserEmail: xmodel["model"]["M_UserEmail"],
M_UserUsername: xmodel["model"]["M_UserUsername"], M_UserUsername: xmodel["model"]["M_UserUsername"],
// M_UserM_DoctorCode: xmodel["model"]["M_UserM_DoctorCode"], // M_UserM_DoctorCode: xmodel["model"]["M_UserM_DoctorCode"],

View File

@@ -254,150 +254,161 @@ class ReportScreen extends HookConsumerWidget {
), ),
), ),
), ),
bottomNavigationBar: Padding( bottomNavigationBar: Container(
padding: EdgeInsets.only( // height: 150,
// right: Constant.getActualXPhone(context: context, x: 27), child: Padding(
// left: Constant.getActualXPhone(context: context, x: 27), padding: EdgeInsets.only(
// bottom: Constant.getActualYPhone(context: context, y: 32), // right: Constant.getActualXPhone(context: context, x: 27),
top: Constant.getActualYPhone(context: context, y: 10), // left: Constant.getActualXPhone(context: context, x: 27),
), // bottom: Constant.getActualYPhone(context: context, y: 32),
child: BottomAppBar( top: Constant.getActualYPhone(context: context, y: 24),
child: Container( ),
height: 150, child: Column(
child: Padding( children: [
padding: EdgeInsets.only( // Excel
// right: Constant.getActualXPhone(context: context, x: 27), Container(
// left: Constant.getActualXPhone(context: context, x: 27), width: Constant.getActualXPhone(context: context, x: 336),
// bottom: Constant.getActualYPhone(context: context, y: 32), height: Constant.getActualYPhone(context: context, y: 42),
top: Constant.getActualYPhone(context: context, y: 24), child: ElevatedButton(
), style: ButtonStyle(
child: Column( backgroundColor: MaterialStateColor.resolveWith(
children: [ (states) => Colors.white),
// Excel // side: MaterialStateBorderSide.resolveWith(
Container( // (states) => BorderSide(color: Colors.green),
width: Constant.getActualXPhone(context: context, x: 336), // ),
height: Constant.getActualYPhone(context: context, y: 42),
child: ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateColor.resolveWith(
(states) => Colors.white),
// side: MaterialStateBorderSide.resolveWith(
// (states) => BorderSide(color: Colors.green),
// ),
// backgroundColor: MaterialStateColor.resolveWith( // backgroundColor: MaterialStateColor.resolveWith(
// (st) => Constant.pcBtnBackgroundColor), // (st) => Constant.pcBtnBackgroundColor),
shape: shape: MaterialStateProperty.all<RoundedRectangleBorder>(
MaterialStateProperty.all<RoundedRectangleBorder>( RoundedRectangleBorder(
RoundedRectangleBorder( borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), side: BorderSide(
side: BorderSide( color: Colors.green,
color: Colors.green,
),
),
), ),
shadowColor:
MaterialStateProperty.all(Color(0xffff48423d)),
elevation: MaterialStateProperty.all(4.0),
), ),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width: Constant.getActualXPhone(
context: context, x: 16),
height: Constant.getActualYPhone(
context: context, y: 16),
// decoration: BoxDecoration(color: Colors.grey),
child: Image.asset(
"images/logo_excel.png",
fit: BoxFit.fill,
// scale: 1,
),
),
SizedBox(
height: Constant.getActualXPhone(
context: context, x: 8),
),
Text(
'Download Report (xls) ',
style: Constant.body1(context: context).copyWith(
fontWeight: FontWeight.w600,
color: Colors.green,
),
),
],
),
onPressed: () {},
), ),
shadowColor:
MaterialStateProperty.all(Color(0xffff48423d)),
elevation: MaterialStateProperty.all(4.0),
), ),
child: Row(
SizedBox( mainAxisAlignment: MainAxisAlignment.center,
height: Constant.getActualYPhone(context: context, y: 20), children: [
), Container(
width:
// PDF Constant.getActualXPhone(context: context, x: 16),
Container( height:
width: Constant.getActualXPhone(context: context, x: 336), Constant.getActualYPhone(context: context, y: 16),
height: Constant.getActualYPhone(context: context, y: 42), // decoration: BoxDecoration(color: Colors.grey),
child: ElevatedButton( child: Image.asset(
style: ButtonStyle( "images/logo_excel.png",
backgroundColor: MaterialStateColor.resolveWith( fit: BoxFit.fill,
(st) => Constant.pcBtnBackgroundColor), // scale: 1,
shape:
MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(
color: Constant.pcBtnBackgroundColor,
),
),
), ),
shadowColor:
MaterialStateProperty.all(Color(0xffff48423d)),
elevation: MaterialStateProperty.all(4.0),
), ),
child: Row( SizedBox(
mainAxisAlignment: MainAxisAlignment.center, height:
children: [ Constant.getActualXPhone(context: context, x: 8),
Container(
width: Constant.getActualXPhone(
context: context, x: 16),
height: Constant.getActualYPhone(
context: context, y: 16),
// decoration: BoxDecoration(color: Colors.grey),
child: Image.asset(
"images/logo_pdf.png",
fit: BoxFit.fill,
// scale: 1,
),
),
SizedBox(
height: Constant.getActualXPhone(
context: context, x: 8),
),
Text(
'Download Report (PDF)',
style: Constant.body1(context: context).copyWith(
fontWeight: FontWeight.w600,
color: Constant.white),
),
],
), ),
onPressed: () async { Text(
String url = 'Download Report (xls) ',
"https://pub.dev/packages?q=url+launcher"; style: Constant.body1(context: context).copyWith(
if (!await launchUrl(Uri.parse(url))) { fontWeight: FontWeight.w600,
// throw Exception('Could not launch $url'); color: Colors.green,
SanckbarWidget(context, 'Could not launch $url', ),
snackbarType.error); ),
} ],
},
),
), ),
], onPressed: () async {
// Awal
DateTime parsedDateAwal = DateFormat('dd-MM-yyyy').parse(
ctrlTglAwal.value.text.toString(),
);
String formattedDateAwal =
DateFormat('yyyy-MM-dd').format(parsedDateAwal);
// Akhir
DateTime parsedDateAkhir = DateFormat('dd-MM-yyyy').parse(
ctrlTglAwal.value.text.toString(),
);
String formattedDateAkhir =
DateFormat('yyyy-MM-dd').format(parsedDateAkhir);
String url =
"https://${Constant.baseUrlDevoneReport}/birt/run?__report=report/one/pettycash/rpt_r_pt_001.rptdesign&__format=pdf&PStartDate=$formattedDateAwal&PEndDate=$formattedDateAkhir&PCompanyID=0&username=adminsas%20";
if (!await launchUrl(Uri.parse(url))) {
// throw Exception('Could not launch $url');
SanckbarWidget(context, 'Could not launch $url',
snackbarType.error);
}
// https://devone.aplikasi.web.id/birt/run?__report=report/one/pettycash/rpt_r_pt_001.rptdesign&__format=pdf&PStartDate=2023-11-01&PEndDate=2023-12-30&PCompanyID=0&username=adminsas%20&tm=1701327096267
},
),
), ),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 20),
),
// PDF
Container(
width: Constant.getActualXPhone(context: context, x: 336),
height: Constant.getActualYPhone(context: context, y: 42),
child: ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateColor.resolveWith(
(st) => Constant.pcBtnBackgroundColor),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
side: BorderSide(
color: Constant.pcBtnBackgroundColor,
),
),
),
shadowColor:
MaterialStateProperty.all(Color(0xffff48423d)),
elevation: MaterialStateProperty.all(4.0),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
width:
Constant.getActualXPhone(context: context, x: 16),
height:
Constant.getActualYPhone(context: context, y: 16),
// decoration: BoxDecoration(color: Colors.grey),
child: Image.asset(
"images/logo_pdf.png",
fit: BoxFit.fill,
// scale: 1,
),
),
SizedBox(
height:
Constant.getActualXPhone(context: context, x: 8),
),
Text(
'Download Report (PDF)',
style: Constant.body1(context: context).copyWith(
fontWeight: FontWeight.w600,
color: Constant.white),
),
],
),
onPressed: () async {
// String url =
// "https://pub.dev/packages?q=url+launcher";
// if (!await launchUrl(Uri.parse(url))) {
// // throw Exception('Could not launch $url');
// SanckbarWidget(context, 'Could not launch $url',
// snackbarType.error);
// }
},
),
),
],
), ),
), ),
), ),

View File

@@ -43,6 +43,7 @@ class TransaksiScreen extends HookConsumerWidget {
final ctrlJumlah = useTextEditingController(text: ""); final ctrlJumlah = useTextEditingController(text: "");
final ctrlCatatan = useTextEditingController(text: ""); final ctrlCatatan = useTextEditingController(text: "");
final ctrlNamaPengirim = useTextEditingController(text: ""); final ctrlNamaPengirim = useTextEditingController(text: "");
final ctrlCompanyName = useTextEditingController(text: "");
String formattedDate = DateFormat('dd-MM-yyyy').format(DateTime.now()); String formattedDate = DateFormat('dd-MM-yyyy').format(DateTime.now());
@@ -202,6 +203,46 @@ class TransaksiScreen extends HookConsumerWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// Company Name
Text(
'Company Name',
style: Constant.body1(context: context).copyWith(
fontWeight: FontWeight.w600, color: Constant.textBlack),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 10),
),
TextField(
controller: ctrlCompanyName,
readOnly: true,
decoration: InputDecoration(
hintStyle:
Constant.body2_400(context: context).copyWith(
color: Constant.textGreyv2,
),
labelStyle:
Constant.body2_400(context: context).copyWith(
color: Constant.textGreyv2,
),
border: OutlineInputBorder(
borderSide: BorderSide(
color: Colors.orange,
width: 1,
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Constant.textGreyv2,
width: 1,
),
),
labelText: "Company Name",
hintText: 'Company Name',
),
),
SizedBox(
height: Constant.getActualYPhone(context: context, y: 20),
),
Text( Text(
'Tanggal Transaksi', 'Tanggal Transaksi',
style: Constant.body1(context: context).copyWith( style: Constant.body1(context: context).copyWith(
@@ -714,12 +755,12 @@ class TransaksiScreen extends HookConsumerWidget {
), ),
onPressed: () { onPressed: () {
if (selectedListTypeData.value.typeid.toString() == if (selectedListTypeData.value.typeid.toString() ==
"KREDIT") { "DEBIT") {
ctrlNamaPengirim.text = ""; ctrlNamaPengirim.text = "";
// validasi form // validasi form
} else { } else {
if (selectedListTypeData.value.typeid.toString() == if (selectedListTypeData.value.typeid.toString() ==
"DEBIT") { "KREDIT") {
selectedListCategory.value.categoryid = "0"; selectedListCategory.value.categoryid = "0";
// validasi form // validasi form
} }