Git commit 08130b6aff91011ea883d37f36e60aa437a6c727 by Klaas Freitag. Committed on 29/10/2015 at 07:37. Pushed by freitag into branch 'mark_sent'. Add paymentExpected attribute to the DocType object. Bool value to mark that for a certainn DocType, a payment is expected. M +15 -1 src/doctype.cpp M +1 -0 src/doctype.h http://commits.kde.org/kraft/08130b6aff91011ea883d37f36e60aa437a6c727 diff --git a/src/doctype.cpp b/src/doctype.cpp index a6bc3df..2b036ba 100644 --- a/src/doctype.cpp +++ b/src/doctype.cpp @@ -40,6 +40,7 @@ = idMap DocType::mNameMap =3D idMap(); = +static const char paymentExpectedC[] =3D "paymentExpected"; = DocType::DocType() : mAttributes( QString::fromLatin1( "DocType" ) ), @@ -169,10 +170,23 @@ bool DocType::pricesVisible() return re; } = +void DocType::setPaymentExpected(bool pe) +{ + if(pe) { + Attribute att(paymentExpectedC); + att.setPersistant( true ); + att.setValue( pe ); + mAttributes[paymentExpectedC] =3D att; + } else { + mAttributes.markDelete(paymentExpectedC); + } + mDirty =3D true; +} + bool DocType::paymentExpected() { bool re =3D false; - if( mAttributes.contains("paymentExpected")) { + if( mAttributes.contains(paymentExpectedC)) { re =3D true; } return re; diff --git a/src/doctype.h b/src/doctype.h index 849170f..ab79fa0 100644 --- a/src/doctype.h +++ b/src/doctype.h @@ -60,6 +60,7 @@ class KRAFTCAT_EXPORT DocType * attribute, user should be able to set the payed sum on the docs. */ bool paymentExpected(); + void setPaymentExpected(bool pe); = QStringList follower(); =