diff --git a/assets/local/localization_en.json b/assets/local/localization_en.json index 0f32319..82f2223 100644 --- a/assets/local/localization_en.json +++ b/assets/local/localization_en.json @@ -358,6 +358,7 @@ "invoice.btn_save":"Save Invoice", "invoice.btn_payment_receipt":"Attachment Payment Receipt", "invoice.description": "Description", + "invoice.desc": "Types", "Invoices End ================================================================":"", "Discount Start ================================================================":"", diff --git a/lib/pages/invoice/invoice_editor.dart b/lib/pages/invoice/invoice_editor.dart index 77a2217..724a2bc 100644 --- a/lib/pages/invoice/invoice_editor.dart +++ b/lib/pages/invoice/invoice_editor.dart @@ -83,6 +83,7 @@ class _InvoiceEditorState extends State { int customFee = 10; double total = 0; Discount _discount; + bool isNew = false; List selectedBoxes = []; @@ -122,6 +123,9 @@ class _InvoiceEditorState extends State { _customFeeController.text = '0'; _descriptionController.text = ''; _balanceController.text = '0'; + setState(() { + isNew = true; + }); } _boxes = [ @@ -220,7 +224,7 @@ class _InvoiceEditorState extends State { children: [ Expanded( child: DisplayText( - text: user != null ? user.name : "Myo Min", + text: user != null ? user.name : "", labelTextKey: "invoice.customer_name", iconData: Feather.user, )), @@ -255,6 +259,7 @@ class _InvoiceEditorState extends State { fontWeight: FontWeight.bold, fontSize: 16.0), Container( + padding: const EdgeInsets.only(top: 15), child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: MyDataTable( @@ -287,9 +292,7 @@ class _InvoiceEditorState extends State { ), SizedBox(height: 25), - Divider(thickness: 1), - SizedBox(height: 15), Container( @@ -300,13 +303,12 @@ class _InvoiceEditorState extends State { fontSize: 16.0), ), Container( + padding: const EdgeInsets.only(top: 15), child: Column(children: getCargoTableByBox(context)), ), SizedBox(height: 10), - Divider(thickness: 1), - SizedBox(height: 10), // InputText( @@ -339,6 +341,30 @@ class _InvoiceEditorState extends State { ], ), ), + + 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: [], + ), + ), + ], + ) + : Container() ]), )), widget.invoice == null diff --git a/lib/pages/invoice/payment_page.dart b/lib/pages/invoice/payment_page.dart index 89f3867..78c8adc 100644 --- a/lib/pages/invoice/payment_page.dart +++ b/lib/pages/invoice/payment_page.dart @@ -72,30 +72,26 @@ class _PaymentPageState extends State { backgroundColor: primaryColor, title: Text(AppTranslations.of(context).text("pm_.title")), ), - body: Card( - child: Column( - children: [ - Padding( - padding: const EdgeInsets.all(15.0), - child: Container( - child: Row( - children: [ - LocalText(context, 'pm.total.amount', - color: Colors.black, fontSize: 16), - Text( - ' \$ ${_invoice.amount}', - style: TextStyle( - color: primaryColor, - fontSize: 16, - fontWeight: FontWeight.bold), - ) - ], - )), - ), - Padding( - padding: const EdgeInsets.all(15.0), - child: Container( - child: Row( + body: ListView( + padding: const EdgeInsets.all(15.0), + children: [ + Container( + child: Row( + children: [ + LocalText(context, 'pm.total.amount', + color: Colors.black, fontSize: 16), + Text( + ' \$ ${_invoice.amount}', + style: TextStyle( + color: primaryColor, + fontSize: 16, + fontWeight: FontWeight.bold), + ) + ], + )), + Container( + padding: const EdgeInsets.only(top: 15.0), + child: Row( children: [ LocalText(context, 'pm.remaining_balance', color: Colors.black, fontSize: 16), @@ -108,85 +104,68 @@ class _PaymentPageState extends State { ) ], )), - ), - Expanded( - child: ListView( - children: [ - ExpansionTile( - title: LocalText(context, 'pm.attachment', - color: Colors.black, fontSize: 16), - children: [ - Padding( - padding: EdgeInsets.only(left: 20), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.only(top: 8), - child: Text( - '${dateFormatter.format(_invoice.receipts[0].date)} ', - style: TextStyle( - color: Colors.black, fontSize: 16), - ), - ), - Expanded( - child: Container( - padding: EdgeInsets.only(left: 10), - child: MultiImageFile( - enabled: true, - controller: multiImgController, - title: "Receipt File", - )), - ), - ], - ), - ), - SizedBox( - height: 25, - ), - ], + SizedBox(height: 10), + Divider(), + SizedBox(height: 10), + LocalText(context, 'pm.attachment', + color: primaryColor, fontSize: 16, fontWeight: FontWeight.bold), + Padding( + padding: EdgeInsets.only(left: 20, top: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(top: 8), + child: Text( + '${dateFormatter.format(_invoice.receipts[0].date)} ', + style: TextStyle(color: Colors.black, fontSize: 16), ), - ExpansionTile( - title: LocalText(context, 'pm.receipt', - color: Colors.black, fontSize: 16), - children: [ - Container( - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: MyDataTable( - headingRowHeight: 40, - columnSpacing: 20, - columns: [ - MyDataColumn( - label: LocalText( - context, - "pm.date", - color: Colors.grey, - ), - ), - MyDataColumn( - label: LocalText( - context, - "pm.amount", - color: Colors.grey, - ), - ), - ], - rows: getPackageRow(context), - ), - ), - ), - SizedBox(height: 25), - ], - ), - ], - ), + ), + Expanded( + child: Container( + padding: EdgeInsets.only(left: 10), + child: MultiImageFile( + enabled: true, + controller: multiImgController, + title: "Receipt File", + )), + ), + ], ), - saveBox, - SizedBox(height: 10), - ], - ), + ), + SizedBox(height: 25), + Divider(), + SizedBox(height: 10), + LocalText(context, 'pm.receipt', + color: primaryColor, fontSize: 16, fontWeight: FontWeight.bold), + Container( + child: MyDataTable( + headingRowHeight: 40, + columnSpacing: 20, + columns: [ + MyDataColumn( + label: LocalText( + context, + "pm.date", + color: Colors.grey, + ), + ), + MyDataColumn( + label: LocalText( + context, + "pm.amount", + color: Colors.grey, + ), + ), + ], + rows: getPackageRow(context), + ), + ), + SizedBox(height: 25), + // saveBox, + // SizedBox(height: 10), + ], ), ), );