From d0e9caab4d78ab7ac25ff54966c6f81b29f1ca67 Mon Sep 17 00:00:00 2001 From: PhyoThandar Date: Fri, 9 Oct 2020 20:49:25 +0630 Subject: [PATCH] modify invoice --- assets/local/localization_en.json | 2 +- assets/local/localization_mu.json | 5 +- lib/pages/invoice/invoice_editor.dart | 162 ++++++-------------------- 3 files changed, 40 insertions(+), 129 deletions(-) diff --git a/assets/local/localization_en.json b/assets/local/localization_en.json index cad7714..54cac09 100644 --- a/assets/local/localization_en.json +++ b/assets/local/localization_en.json @@ -338,7 +338,7 @@ "invoice.handling_fee":"Handling Fee", "invoice.custom_fee":"Custom Fee", "invoice.custom_fee_desc":"Custom Fee Description", - "invoice.discount":"Discounts", + "invoice.discount":"Discount Code", "invoice.payment_method":"Payment Method", "invoice.delivery_fee":"Delivery Fee : ", "invoice.payment_attachment":"Payment Attachment", diff --git a/assets/local/localization_mu.json b/assets/local/localization_mu.json index 0fd1a9d..bcb4709 100644 --- a/assets/local/localization_mu.json +++ b/assets/local/localization_mu.json @@ -338,7 +338,7 @@ "invoice.handling_fee":"ထိန်းသိမ်းခ", "invoice.custom_fee":"ကုန်သွယ်ခွန်", "invoice.custom_fee_desc":"ကုန်သွယ်ခွန်အကြောင်းအရာ", - "invoice.discount":"လျှော့စျေး : ", + "invoice.discount":"လျှော့စျေးကုဒ်", "invoice.payment_method":"ငွေပေးချေစနစ်", "invoice.delivery_fee":"ပို့ဆောင်ခ", "invoice.payment_attachment":"ပေးချေပြီးဖိုင်များ", @@ -347,7 +347,8 @@ "invoice.btn_create":"ငွေတောင်းခံလွှာ ပြုလုပ်ရန်", "invoice.btn_save":"ငွေတောင်းခံလွှာ သိမ်းရန်", "invoice.btn_payment_receipt":"ငွေလက်ခံဖြတ်ပိုင်း ထည့်ရန်", - "invoice.description": "အကြောင်းအရာ", + "invoice.desc": "အမျိုးအစား", + "invoice.description": "ငွေတောင်းခံလွှာအကြောင်းအရာ", "Invoices End ================================================================":"", "Discount Start ================================================================":"", diff --git a/lib/pages/invoice/invoice_editor.dart b/lib/pages/invoice/invoice_editor.dart index 63aa5dc..77a2217 100644 --- a/lib/pages/invoice/invoice_editor.dart +++ b/lib/pages/invoice/invoice_editor.dart @@ -247,6 +247,8 @@ class _InvoiceEditorState extends State { labelTextKey: 'invoice.status'), SizedBox(height: 15), + Divider(thickness: 1), + SizedBox(height: 15), LocalText(context, 'invoice.box_info', color: primaryColor, @@ -290,130 +292,53 @@ class _InvoiceEditorState extends State { SizedBox(height: 15), + Container( + padding: const EdgeInsets.only(bottom: 10), + child: LocalText(context, 'invoice.description', + color: primaryColor, + fontWeight: FontWeight.bold, + fontSize: 16.0), + ), Container( child: Column(children: getCargoTableByBox(context)), ), + SizedBox(height: 10), + Divider(thickness: 1), + SizedBox(height: 10), + // InputText( // controller: _handlingFeeController, // iconData: FontAwesomeIcons.moneyBill, // labelTextKey: 'invoice.handling_fee'), - + LocalText(context, 'invoice.payment_method', + fontSize: 16, + color: primaryColor, + fontWeight: FontWeight.bold), Container( padding: EdgeInsets.only(top: 5, left: 18), child: Row( children: [ Expanded( - child: LocalText(context, 'invoice.payment_method', - fontSize: 16, - color: primaryColor, - fontWeight: FontWeight.bold)), - Container( - width: 150.0, - child: DropdownButtonFormField( - items: paymentMethods - .map((e) => DropdownMenuItem( - child: Text(e.name), value: e.name)) - .toList(), - onChanged: (selected) => {}, + flex: 2, + child: Container( + width: 150.0, + child: DropdownButtonFormField( + hint: Text(getLocalString( + context, 'invoice.payment_method')), + items: paymentMethods + .map((e) => DropdownMenuItem( + child: Text(e.name), value: e.name)) + .toList(), + onChanged: (selected) => {}, + ), ), ), ], ), ), - // Container( - // padding: EdgeInsets.only(top: 5), - // child: Row( - // children: [ - // Expanded( - // child: Padding( - // padding: const EdgeInsets.only(left: 18.0), - // child: LocalText(context, 'invoice.delivery_fee', - // fontSize: 16, - // color: primaryColor, - // fontWeight: FontWeight.bold), - // )), - // Switch( - // value: isSwitched, - // onChanged: (value) { - // setState(() { - // isSwitched = value; - // if (value) { - // deliveryfee = 5; - // } else { - // deliveryfee = 0; - // } - // print(isSwitched); - // }); - // }, - // activeTrackColor: primaryColor.withOpacity(0.8), - // activeColor: primaryColor, - // ), - // Text( - // '(' + - // getLocalString(context, 'invoice.delivery_fee') + - // ' $deliveryfee)', - // style: TextStyle( - // color: primaryColor, - // fontWeight: FontWeight.bold, - // fontSize: 12), - // ), - // ], - // ), - // ), - // SizedBox( - // height: 10, - // ), - - // ExpansionTile( - // title: LocalText(context, 'invoice.payment_attachment', - // color: primaryColor, - // fontWeight: FontWeight.bold, - // fontSize: 16.0), - // children: [ - // widget.invoice != null - // ? Padding( - // padding: EdgeInsets.only(left: 20), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Container( - // padding: EdgeInsets.only(top: 10), - // 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: false, - // controller: multiImgController, - // title: "Receipt", - // )), - // ), - // Container( - // padding: EdgeInsets.only(top: 10, left: 10), - // child: Text( - // '\$${_invoice.receipts[0].amount} ', - // style: TextStyle( - // color: Colors.black, fontSize: 16), - // ), - // ), - // ], - // ), - // ) - // : Container(), - // SizedBox( - // height: 25, - // ), - // ], - // ), ]), )), widget.invoice == null @@ -474,7 +399,7 @@ class _InvoiceEditorState extends State { children: [ Expanded( flex: 2, - child: Text(getLocalString(context, 'invoice.description'), + child: Text(getLocalString(context, 'invoice.desc'), style: TextStyle( fontSize: 12, fontWeight: FontWeight.bold, @@ -503,17 +428,15 @@ class _InvoiceEditorState extends State { dataRow.insert( dataRow.length, Container( - padding: const EdgeInsets.only( - left: 5.0, right: 5.0, top: 10.0, bottom: 10.0), + padding: const EdgeInsets.only(left: 5.0, right: 5.0), child: Row( children: [ Expanded( - flex: 2, - child: Text(getLocalString(context, 'invoice.discount'))), - Expanded( + flex: 2, child: Container( - width: 80.0, child: DropdownButtonFormField( + hint: Text(getLocalString(context, 'invoice.discount'), + style: TextStyle(fontSize: 14)), items: discountModel.discounts .map((e) => DropdownMenuItem( child: Text(e.code, style: TextStyle(fontSize: 13)), @@ -545,23 +468,12 @@ class _InvoiceEditorState extends State { dataRow.length, Container( padding: const EdgeInsets.only( - left: 5.0, right: 5.0, top: 10.0, bottom: 10.0), + left: 5.0, right: 5.0, top: 10.0, bottom: 0.0), child: Row( children: [ Expanded( flex: 2, child: Text(getLocalString(context, 'invoice.custom_fee'))), - // Expanded( - // child: Text( - // '', - // )), - // Container( - // width: 100, - // child: InputText( - // controller: _customFeeController, - // iconData: null, - // labelTextKey: 'invoice.custom_fee'), - // ), Expanded( child: Text('\$ ${customFee}', textAlign: TextAlign.end, @@ -578,7 +490,7 @@ class _InvoiceEditorState extends State { dataRow.length, Container( padding: const EdgeInsets.only( - left: 5.0, right: 5.0, top: 10.0, bottom: 10.0), + left: 5.0, right: 5.0, top: 0.0, bottom: 10.0), child: Row( children: [ Expanded( @@ -630,7 +542,6 @@ class _InvoiceEditorState extends State { left: 5.0, right: 5.0, top: 10.0, bottom: 10.0), child: Row( children: [ - Expanded(flex: 1, child: Text('')), Expanded( flex: 2, child: LocalText( @@ -656,7 +567,6 @@ class _InvoiceEditorState extends State { left: 5.0, right: 5.0, top: 10.0, bottom: 10.0), child: Row( children: [ - Expanded(flex: 1, child: Text('')), Expanded( flex: 2, child: LocalText(