This commit is contained in:
PhyoThandar
2020-10-13 11:49:35 +06:30
parent af568b8adf
commit fb2a3c8323
3 changed files with 112 additions and 106 deletions

View File

@@ -358,6 +358,7 @@
"invoice.btn_save":"Save Invoice", "invoice.btn_save":"Save Invoice",
"invoice.btn_payment_receipt":"Attachment Payment Receipt", "invoice.btn_payment_receipt":"Attachment Payment Receipt",
"invoice.description": "Description", "invoice.description": "Description",
"invoice.desc": "Types",
"Invoices End ================================================================":"", "Invoices End ================================================================":"",
"Discount Start ================================================================":"", "Discount Start ================================================================":"",

View File

@@ -83,6 +83,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
int customFee = 10; int customFee = 10;
double total = 0; double total = 0;
Discount _discount; Discount _discount;
bool isNew = false;
List<Box> selectedBoxes = []; List<Box> selectedBoxes = [];
@@ -122,6 +123,9 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
_customFeeController.text = '0'; _customFeeController.text = '0';
_descriptionController.text = ''; _descriptionController.text = '';
_balanceController.text = '0'; _balanceController.text = '0';
setState(() {
isNew = true;
});
} }
_boxes = [ _boxes = [
@@ -220,7 +224,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: DisplayText( child: DisplayText(
text: user != null ? user.name : "Myo Min", text: user != null ? user.name : "",
labelTextKey: "invoice.customer_name", labelTextKey: "invoice.customer_name",
iconData: Feather.user, iconData: Feather.user,
)), )),
@@ -255,6 +259,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16.0), fontSize: 16.0),
Container( Container(
padding: const EdgeInsets.only(top: 15),
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
child: MyDataTable( child: MyDataTable(
@@ -287,9 +292,7 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
), ),
SizedBox(height: 25), SizedBox(height: 25),
Divider(thickness: 1), Divider(thickness: 1),
SizedBox(height: 15), SizedBox(height: 15),
Container( Container(
@@ -300,13 +303,12 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
fontSize: 16.0), fontSize: 16.0),
), ),
Container( Container(
padding: const EdgeInsets.only(top: 15),
child: Column(children: getCargoTableByBox(context)), child: Column(children: getCargoTableByBox(context)),
), ),
SizedBox(height: 10), SizedBox(height: 10),
Divider(thickness: 1), Divider(thickness: 1),
SizedBox(height: 10), SizedBox(height: 10),
// InputText( // InputText(
@@ -339,6 +341,30 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
], ],
), ),
), ),
SizedBox(height: 10),
Divider(thickness: 1),
SizedBox(height: 10),
isNew
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
LocalText(context, 'invoice.payment_attachment',
fontSize: 16,
color: primaryColor,
fontWeight: FontWeight.bold),
Padding(
padding: EdgeInsets.only(left: 20, top: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[],
),
),
],
)
: Container()
]), ]),
)), )),
widget.invoice == null widget.invoice == null

View File

@@ -72,12 +72,10 @@ class _PaymentPageState extends State<PaymentPage> {
backgroundColor: primaryColor, backgroundColor: primaryColor,
title: Text(AppTranslations.of(context).text("pm_.title")), title: Text(AppTranslations.of(context).text("pm_.title")),
), ),
body: Card( body: ListView(
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Container( children: <Widget>[
Container(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
LocalText(context, 'pm.total.amount', LocalText(context, 'pm.total.amount',
@@ -91,10 +89,8 @@ class _PaymentPageState extends State<PaymentPage> {
) )
], ],
)), )),
), Container(
Padding( padding: const EdgeInsets.only(top: 15.0),
padding: const EdgeInsets.all(15.0),
child: Container(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
LocalText(context, 'pm.remaining_balance', LocalText(context, 'pm.remaining_balance',
@@ -108,16 +104,13 @@ class _PaymentPageState extends State<PaymentPage> {
) )
], ],
)), )),
), SizedBox(height: 10),
Expanded( Divider(),
child: ListView( SizedBox(height: 10),
children: [ LocalText(context, 'pm.attachment',
ExpansionTile( color: primaryColor, fontSize: 16, fontWeight: FontWeight.bold),
title: LocalText(context, 'pm.attachment',
color: Colors.black, fontSize: 16),
children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only(left: 20), padding: EdgeInsets.only(left: 20, top: 10),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -126,8 +119,7 @@ class _PaymentPageState extends State<PaymentPage> {
padding: EdgeInsets.only(top: 8), padding: EdgeInsets.only(top: 8),
child: Text( child: Text(
'${dateFormatter.format(_invoice.receipts[0].date)} ', '${dateFormatter.format(_invoice.receipts[0].date)} ',
style: TextStyle( style: TextStyle(color: Colors.black, fontSize: 16),
color: Colors.black, fontSize: 16),
), ),
), ),
Expanded( Expanded(
@@ -142,18 +134,12 @@ class _PaymentPageState extends State<PaymentPage> {
], ],
), ),
), ),
SizedBox( SizedBox(height: 25),
height: 25, Divider(),
), SizedBox(height: 10),
], LocalText(context, 'pm.receipt',
), color: primaryColor, fontSize: 16, fontWeight: FontWeight.bold),
ExpansionTile(
title: LocalText(context, 'pm.receipt',
color: Colors.black, fontSize: 16),
children: <Widget>[
Container( Container(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: MyDataTable( child: MyDataTable(
headingRowHeight: 40, headingRowHeight: 40,
columnSpacing: 20, columnSpacing: 20,
@@ -176,18 +162,11 @@ class _PaymentPageState extends State<PaymentPage> {
rows: getPackageRow(context), rows: getPackageRow(context),
), ),
), ),
),
SizedBox(height: 25), SizedBox(height: 25),
// saveBox,
// SizedBox(height: 10),
], ],
), ),
],
),
),
saveBox,
SizedBox(height: 10),
],
),
),
), ),
); );
} }