Commit de6359bc authored by Leon Tappe's avatar Leon Tappe 🔥
Browse files

add free information field for bill footer

parent 4a72b92c
...@@ -28,6 +28,9 @@ class Vendor { ...@@ -28,6 +28,9 @@ class Vendor {
'website', 'website',
'full_address', 'full_address',
'bill_prefix', 'bill_prefix',
'small_business',
'free_information',
'telephone',
]; ];
int id; int id;
...@@ -67,6 +70,8 @@ class Vendor { ...@@ -67,6 +70,8 @@ class Vendor {
bool smallBusiness; bool smallBusiness;
String freeInformation;
Vendor({ Vendor({
this.id, this.id,
@required this.name, @required this.name,
...@@ -101,6 +106,7 @@ class Vendor { ...@@ -101,6 +106,7 @@ class Vendor {
this.headerImageLeft, this.headerImageLeft,
this.userMessageLabel, this.userMessageLabel,
this.smallBusiness = false, this.smallBusiness = false,
this.freeInformation,
}); });
factory Vendor.empty() => Vendor( factory Vendor.empty() => Vendor(
...@@ -177,6 +183,8 @@ class Vendor { ...@@ -177,6 +183,8 @@ class Vendor {
userMessageLabel: userMessageLabel:
(map['user_message_label'] != null) ? map['user_message_label'].toString() : null, (map['user_message_label'] != null) ? map['user_message_label'].toString() : null,
smallBusiness: (map['small_business'] as int ?? 0) > 0 ? true : false, smallBusiness: (map['small_business'] as int ?? 0) > 0 ? true : false,
freeInformation:
map['free_information'] != null ? map['free_information'].toString() : null,
); );
@override @override
...@@ -224,6 +232,7 @@ class Vendor { ...@@ -224,6 +232,7 @@ class Vendor {
'reminder_titles': json.encode(reminderTitles.map<String, String>( 'reminder_titles': json.encode(reminderTitles.map<String, String>(
(ReminderIteration key, String value) => MapEntry(key.index.toString(), value))), (ReminderIteration key, String value) => MapEntry(key.index.toString(), value))),
'small_business': smallBusiness ? 1 : 0, 'small_business': smallBusiness ? 1 : 0,
'free_information': freeInformation,
}; };
@override @override
......
...@@ -316,6 +316,15 @@ class _VendorPageState extends State<VendorPage> { ...@@ -316,6 +316,15 @@ class _VendorPageState extends State<VendorPage> {
dirty = true; dirty = true;
}, },
), ),
TextFormField(
initialValue: newVendor.freeInformation,
maxLines: 3,
decoration: InputDecoration(labelText: 'Freitext für Fußzeile'),
onChanged: (String input) {
newVendor.freeInformation = input;
dirty = true;
},
),
TextFormField( TextFormField(
maxLines: 1, maxLines: 1,
initialValue: newVendor.reminderFees[ReminderIteration.first] != null initialValue: newVendor.reminderFees[ReminderIteration.first] != null
......
...@@ -132,13 +132,18 @@ Widget pageCountFooter(Context context, Vendor vendor, Font font) { ...@@ -132,13 +132,18 @@ Widget pageCountFooter(Context context, Vendor vendor, Font font) {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Paragraph( Paragraph(
text: 'Steuer-Nr.: ${vendor.taxNr}', text: vendor.taxNr.isNotEmpty && vendor.taxNr != ' '
? 'Steuer-Nr.: ${vendor.taxNr}'
: '',
style: TextStyle(fontSize: fontSize, font: font, color: color), style: TextStyle(fontSize: fontSize, font: font, color: color),
margin: EdgeInsets.only(top: 17.0)), margin: EdgeInsets.only(top: 17.0)),
Text(vendor.vatNr != null ? 'USt.-ID: ${vendor.vatNr}' : '', Text(vendor.vatNr.isNotEmpty && vendor.vatNr != ' ' ? 'USt.-ID: ${vendor.vatNr}' : '',
style: TextStyle(fontSize: fontSize, font: font, color: color)), style: TextStyle(fontSize: fontSize, font: font, color: color)),
Text(vendor.website ?? '', Text(vendor.website ?? '',
style: TextStyle(fontSize: fontSize, font: font, color: color)), style: TextStyle(fontSize: fontSize, font: font, color: color)),
if (vendor.freeInformation != null && vendor.freeInformation.isNotEmpty)
for (var line in vendor.freeInformation.split('\n'))
Text(line, style: TextStyle(fontSize: fontSize, font: font, color: color)),
], ],
), ),
], ],
......
...@@ -82,6 +82,7 @@ class VendorRepository<T extends DatabaseProvider> { ...@@ -82,6 +82,7 @@ class VendorRepository<T extends DatabaseProvider> {
'user_message_label', 'user_message_label',
'small_business', 'small_business',
'telephone', 'telephone',
'free_information',
], ],
[ [
'INTEGER', 'INTEGER',
...@@ -113,6 +114,7 @@ class VendorRepository<T extends DatabaseProvider> { ...@@ -113,6 +114,7 @@ class VendorRepository<T extends DatabaseProvider> {
'TEXT', 'TEXT',
'INTEGER', 'INTEGER',
'TEXT', 'TEXT',
'TEXT',
], ],
'id', 'id',
nullable: <bool>[ nullable: <bool>[
...@@ -145,6 +147,7 @@ class VendorRepository<T extends DatabaseProvider> { ...@@ -145,6 +147,7 @@ class VendorRepository<T extends DatabaseProvider> {
true, true,
false, false,
true, true,
true,
], ],
); );
} }
......
...@@ -69,6 +69,7 @@ class VendorCard extends StatelessWidget { ...@@ -69,6 +69,7 @@ class VendorCard extends StatelessWidget {
'Label für benutzerdefinierten Rechnungskommentar': 'Label für benutzerdefinierten Rechnungskommentar':
vendor.userMessageLabel ?? 'Keins', vendor.userMessageLabel ?? 'Keins',
'Kleingewerberegelung': vendor.smallBusiness ? 'Ja' : 'Nein', 'Kleingewerberegelung': vendor.smallBusiness ? 'Ja' : 'Nein',
'Freitext für Fußzeile': vendor.freeInformation ?? '',
}, },
), ),
], ],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment