1#line 2 "src/Gui/BillPay/PaymentWidget.cpp"
3#include <Wt/WVBoxLayout.h>
5#include "../../Eng/TransactionManager.h"
6#include "../../Glb/Core.h"
11:
Wt::WContainerWidget(),
19 auto lw =
setLayout( std::make_unique< Wt::WVBoxLayout >() );
27 addWidget( std::make_unique< Wt::WTemplate >(
TR(
"gcw_gui.billpay.paymentwidget.form.main") ) );
46#ifdef INCLUDE_TABLE_WITH_MULTIPLE_INPUT_ROWS
84 for(
int row=1; row<= 3; row++ )
107 m_date -> setPlaceholderText(
TR(
"gcw.billPay.pht.date" ) );
108 m_num -> setPlaceholderText(
TR(
"gcw.billPay.pht.num" ) );
109 m_desc -> setPlaceholderText(
TR(
"gcw.billPay.pht.desc" ) );
110 m_acct -> setPlaceholderText(
TR(
"gcw.billPay.pht.acct" ) );
111 m_recon -> setPlaceholderText(
TR(
"gcw.billPay.pht.recon" ) );
113 m_credit -> setPlaceholderText(
TR(
"gcw.billPay.pht.credit") );
121 m_confirm-> setPlaceholderText(
TR(
"gcw.billPay.pht.confirm") );
143 GCW_NUMERIC cVal( m_credit-> valueText().toUTF8() );
156 for(
auto si = splitItems.rbegin(); si != splitItems.rend(); si++ )
158 auto splitItem = *si;
161 if( txItem-> num() ==
"bp" )
176 if(
auto txItem = lastTx() )
180 if( splitItem-> account_guid() !=
bpItem.accountGuid() )
203 auto desc =
bpItem.nickname();
204 if(
bpItem.last4() !=
"" )
205 desc +=
" (" +
bpItem.last4() +
")";
208 m_recon -> setValueText(
"n" );
209 m_num -> setValueText(
"bp" );
210 m_desc -> setValueText( desc );
212 if(
auto splitItem = lastSplit() )
224 if( m_acct-> valueText() ==
"" )
246 std::cout << __FILE__ <<
":" << __LINE__
247 <<
" " <<
bpItem.accountFullName()
248 <<
" " <<
bpItem.accountGuid()
249 <<
" " <<
bpItem.nickname()
252 std::cout << __FILE__ <<
":" << __LINE__
253 <<
" vt:" << m_acct-> valueText()
254 <<
" id:" << acctItem-> guid()
255 <<
" ds:" << acctItem-> description()
275 transMan.
setDate ( m_date-> date() );
276 transMan.
setValue ( acctItem-> guid() , -value() );
278 transMan.
setNotes (
bpItem.accountGuid(), m_confirm-> valueText().toUTF8() );
279 transMan.
setNum ( m_num-> valueText().toUTF8() );
292 return m_date-> valueText().toUTF8();
300 rejectWhenEscapePressed(
true );
303 addStyleClass(
"PaymentWidgetDialog" );
304 setWindowTitle(
TR(
"gcw.billPay.dialog.title" ) );
306 m_editWidget = contents()-> addNew< PaymentWidget >( _bpGuid );
308 auto pbSave = titleBar()-> addNew< Wt::WPushButton >(
TR(
"gcw.billPay.lbl.save" ) );
309 auto pbCancel = titleBar()-> addNew< Wt::WPushButton >(
TR(
"gcw.billPay.lbl.cancel" ) );
311 pbSave -> setStyleClass(
"btn-xs" );
312 pbCancel -> setStyleClass(
"btn-xs" );
323 if( m_editWidget-> saveData() )
333 return m_editWidget-> paymentDate();
auto newTransaction(const std::string &_accountGuid1, const std::string &_accountGuid2) -> void
New Transaction.
auto setDescription(const std::string &_value) -> void
auto setNum(const std::string &_value) -> void
auto setDate(const Wt::WDateTime &_value) -> void
auto setNotes(const std::string &_acctGuid, const std::string &_value) -> void
auto setValue(GCW_NUMERIC _value) -> void
#define GCW_DATE_FORMAT_DISPLAY
#define GCW_NUMERIC
Internal Numeric Type.
auto currentDateTimeDisplayString() -> std::string
auto byFullName(const std::string &_fullName) -> Item::Ptr
Load Account by 'full name' with ':' account separator.
auto fullName(const std::string &_guid) -> std::string
Account Fullname via GUID.
auto byTransaction(const std::string &_txGuid) -> Item::Vector
Load Splits by Transaction.
auto byAccount(const std::string &_accountGuid) -> Item::Vector
Load Splits by Account.
auto byGuid(const std::string &_txGuid) -> Item::Ptr
auto bpItem(const std::string &_guid) -> GCW::Gui::BillPay::Item
Bill Pay Item.