Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/mymoneyschedule.cpp
Context not available. | |||||
80 | MyMoneyObject(*new MyMoneySchedulePrivate, node) | 80 | MyMoneyObject(*new MyMoneySchedulePrivate, node) | ||
---|---|---|---|---|---|
81 | { | 81 | { | ||
82 | if (nodeNames[nnScheduleTX] != node.tagName()) | 82 | if (nodeNames[nnScheduleTX] != node.tagName()) | ||
83 | throw MYMONEYEXCEPTION("Node was not SCHEDULED_TX"); | 83 | throw MYMONEYEXCEPTION_CSTRING("Node was not SCHEDULED_TX"); | ||
84 | 84 | | |||
85 | Q_D(MyMoneySchedule); | 85 | Q_D(MyMoneySchedule); | ||
86 | d->m_name = node.attribute(d->getAttrName(Schedule::Attribute::Name)); | 86 | d->m_name = node.attribute(d->getAttrName(Schedule::Attribute::Name)); | ||
Context not available. | |||||
102 | // read in the associated transaction | 102 | // read in the associated transaction | ||
103 | QDomNodeList nodeList = node.elementsByTagName(nodeNames[nnTransaction]); | 103 | QDomNodeList nodeList = node.elementsByTagName(nodeNames[nnTransaction]); | ||
104 | if (nodeList.count() == 0) | 104 | if (nodeList.count() == 0) | ||
105 | throw MYMONEYEXCEPTION("SCHEDULED_TX has no TRANSACTION node"); | 105 | throw MYMONEYEXCEPTION_CSTRING("SCHEDULED_TX has no TRANSACTION node"); | ||
106 | 106 | | |||
107 | setTransaction(MyMoneyTransaction(nodeList.item(0).toElement(), false), true); | 107 | setTransaction(MyMoneyTransaction(nodeList.item(0).toElement(), false), true); | ||
108 | 108 | | |||
Context not available. | |||||
447 | */ | 447 | */ | ||
448 | Q_D(const MyMoneySchedule); | 448 | Q_D(const MyMoneySchedule); | ||
449 | if (id_check && !d->m_id.isEmpty()) | 449 | if (id_check && !d->m_id.isEmpty()) | ||
450 | throw MYMONEYEXCEPTION("ID for schedule not empty when required"); | 450 | throw MYMONEYEXCEPTION_CSTRING("ID for schedule not empty when required"); | ||
451 | 451 | | |||
452 | if (d->m_occurrence == Schedule::Occurrence::Any) | 452 | if (d->m_occurrence == Schedule::Occurrence::Any) | ||
453 | throw MYMONEYEXCEPTION("Invalid occurrence type for schedule"); | 453 | throw MYMONEYEXCEPTION_CSTRING("Invalid occurrence type for schedule"); | ||
454 | 454 | | |||
455 | if (d->m_type == Schedule::Type::Any) | 455 | if (d->m_type == Schedule::Type::Any) | ||
456 | throw MYMONEYEXCEPTION("Invalid type for schedule"); | 456 | throw MYMONEYEXCEPTION_CSTRING("Invalid type for schedule"); | ||
457 | 457 | | |||
458 | if (!nextDueDate().isValid()) | 458 | if (!nextDueDate().isValid()) | ||
459 | throw MYMONEYEXCEPTION("Invalid next due date for schedule"); | 459 | throw MYMONEYEXCEPTION_CSTRING("Invalid next due date for schedule"); | ||
460 | 460 | | |||
461 | if (d->m_paymentType == Schedule::PaymentType::Any) | 461 | if (d->m_paymentType == Schedule::PaymentType::Any) | ||
462 | throw MYMONEYEXCEPTION("Invalid payment type for schedule"); | 462 | throw MYMONEYEXCEPTION_CSTRING("Invalid payment type for schedule"); | ||
463 | 463 | | |||
464 | if (d->m_transaction.splitCount() == 0) | 464 | if (d->m_transaction.splitCount() == 0) | ||
465 | throw MYMONEYEXCEPTION("Scheduled transaction does not contain splits"); | 465 | throw MYMONEYEXCEPTION_CSTRING("Scheduled transaction does not contain splits"); | ||
466 | 466 | | |||
467 | // Check the payment types | 467 | // Check the payment types | ||
468 | switch (d->m_type) { | 468 | switch (d->m_type) { | ||
469 | case Schedule::Type::Bill: | 469 | case Schedule::Type::Bill: | ||
470 | if (d->m_paymentType == Schedule::PaymentType::DirectDeposit || d->m_paymentType == Schedule::PaymentType::ManualDeposit) | 470 | if (d->m_paymentType == Schedule::PaymentType::DirectDeposit || d->m_paymentType == Schedule::PaymentType::ManualDeposit) | ||
471 | throw MYMONEYEXCEPTION("Invalid payment type for bills"); | 471 | throw MYMONEYEXCEPTION_CSTRING("Invalid payment type for bills"); | ||
472 | break; | 472 | break; | ||
473 | 473 | | |||
474 | case Schedule::Type::Deposit: | 474 | case Schedule::Type::Deposit: | ||
475 | if (d->m_paymentType == Schedule::PaymentType::DirectDebit || d->m_paymentType == Schedule::PaymentType::WriteChecque) | 475 | if (d->m_paymentType == Schedule::PaymentType::DirectDebit || d->m_paymentType == Schedule::PaymentType::WriteChecque) | ||
476 | throw MYMONEYEXCEPTION("Invalid payment type for deposits"); | 476 | throw MYMONEYEXCEPTION_CSTRING("Invalid payment type for deposits"); | ||
477 | break; | 477 | break; | ||
478 | 478 | | |||
479 | case Schedule::Type::Any: | 479 | case Schedule::Type::Any: | ||
480 | throw MYMONEYEXCEPTION("Invalid type ANY"); | 480 | throw MYMONEYEXCEPTION_CSTRING("Invalid type ANY"); | ||
481 | break; | 481 | break; | ||
482 | 482 | | |||
483 | case Schedule::Type::Transfer: | 483 | case Schedule::Type::Transfer: | ||
Context not available. |