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 {
'website',
'full_address',
'bill_prefix',
'small_business',
'free_information',
'telephone',
];
int id;
......@@ -67,6 +70,8 @@ class Vendor {
bool smallBusiness;
String freeInformation;
Vendor({
this.id,
@required this.name,
......@@ -101,6 +106,7 @@ class Vendor {
this.headerImageLeft,
this.userMessageLabel,
this.smallBusiness = false,
this.freeInformation,
});
factory Vendor.empty() => Vendor(
......@@ -177,6 +183,8 @@ class Vendor {
userMessageLabel:
(map['user_message_label'] != null) ? map['user_message_label'].toString() : null,
smallBusiness: (map['small_business'] as int ?? 0) > 0 ? true : false,
freeInformation:
map['free_information'] != null ? map['free_information'].toString() : null,
);
@override
......@@ -224,6 +232,7 @@ class Vendor {
'reminder_titles': json.encode(reminderTitles.map<String, String>(
(ReminderIteration key, String value) => MapEntry(key.index.toString(), value))),
'small_business': smallBusiness ? 1 : 0,
'free_information': freeInformation,
};
@override
......
......@@ -316,6 +316,15 @@ class _VendorPageState extends State<VendorPage> {
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(
maxLines: 1,
initialValue: newVendor.reminderFees[ReminderIteration.first] != null
......
......@@ -132,13 +132,18 @@ Widget pageCountFooter(Context context, Vendor vendor, Font font) {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Paragraph(
text: 'Steuer-Nr.: ${vendor.taxNr}',
text: vendor.taxNr.isNotEmpty && vendor.taxNr != ' '
? 'Steuer-Nr.: ${vendor.taxNr}'
: '',
style: TextStyle(fontSize: fontSize, font: font, color: color),
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)),
Text(vendor.website ?? '',
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> {
'user_message_label',
'small_business',
'telephone',
'free_information',
],
[
'INTEGER',
......@@ -113,6 +114,7 @@ class VendorRepository<T extends DatabaseProvider> {
'TEXT',
'INTEGER',
'TEXT',
'TEXT',
],
'id',
nullable: <bool>[
......@@ -145,6 +147,7 @@ class VendorRepository<T extends DatabaseProvider> {
true,
false,
true,
true,
],
);
}
......
......@@ -69,6 +69,7 @@ class VendorCard extends StatelessWidget {
'Label für benutzerdefinierten Rechnungskommentar':
vendor.userMessageLabel ?? 'Keins',
'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