예제 #1
0
dspCreditCardTransactions::dspCreditCardTransactions(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_query, SIGNAL(clicked()), this, SLOT(sFillList()));
  connect(_preauth, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(sgetCCAmount()));
  connect(_postPreauth, SIGNAL(clicked()), this, SLOT(sPostPreauth()));
  connect(_voidPreauth, SIGNAL(clicked()), this, SLOT(sVoidPreauth()));
  connect(_customerSelector, SIGNAL(newState(int)), this, SLOT(sClear()));
  connect(_customerSelector, SIGNAL(newCustId(int)), this, SLOT(sClear()));
  connect(_customerSelector, SIGNAL(newCustTypeId(int)), this, SLOT(sClear()));
  connect(_customerSelector, SIGNAL(newTypePattern(QString)), this, SLOT(sClear()));
  
  _preauth->addColumn(tr("Timestamp"),   _dateColumn, Qt::AlignLeft, true,  "ccpay_transaction_datetime"  ); 
  _preauth->addColumn(tr("Cust. #"),    _orderColumn, Qt::AlignLeft,  true, "cust_number");  
  _preauth->addColumn(tr("Name"),                 -1, Qt::AlignLeft,  true, "cust_name");
  _preauth->addColumn(tr("Type"),       _orderColumn, Qt::AlignLeft,  true, "type"  );
  _preauth->addColumn(tr("Status"),  _bigMoneyColumn, Qt::AlignLeft,  true,  "status"  );
  _preauth->addColumn(tr("Document #"),           -1, Qt::AlignLeft,  true,  "docnumber"  );
  _preauth->addColumn(tr("Amount"),     _moneyColumn, Qt::AlignRight, true, "ccpay_amount");
  _preauth->addColumn(tr("Currency"),_currencyColumn, Qt::AlignLeft,  true, "currabbr");;
  _preauth->addColumn(tr("Entered By"),   _userColumn,     Qt::AlignLeft,   false,  "ccpay_by_username"  );
  _preauth->addColumn(tr("Reference"),    _orderColumn,    Qt::AlignLeft,   false,  "ccpay_r_ref"  );
  _preauth->addColumn(tr("Allocated"),    _moneyColumn,    Qt::AlignRight,  false,  "allocated" );
  _preauth->addColumn(tr("Allocated Currency"), _currencyColumn, Qt::AlignLeft,   false,  "payco_currAbbr"  );
  
  if (omfgThis->singleCurrency())
    _preauth->hideColumn(2);

  if (_metrics->value("CCValidDays").toInt())
    _validDays->setValue(_metrics->value("CCValidDays").toInt());
  else
    _validDays->setValue(7);
}
예제 #2
0
void dspCreditCardTransactions::sPopulateMenu( QMenu * pMenu, QTreeWidgetItem *pItem )
{ 
  if (((XTreeWidgetItem *)pItem)->rawValue("status") == "C")
  {
    QAction* printAct = new QAction(tr("Print Receipt"), this);
    connect(printAct, SIGNAL(triggered()), this, SLOT(sPrintCCReceipt()));
    pMenu->addAction(printAct);
  }

  if (_postPreauth->isEnabled())
  {
    QAction* postAct = new QAction(tr("Post"), this);
    connect(postAct, SIGNAL(triggered()), this, SLOT(sPostPreauth()));
    pMenu->addAction(postAct);
  }

  if (_voidPreauth->isEnabled())
  {
    QAction* voidAct = new QAction(tr("Void"), this);
    connect(voidAct, SIGNAL(triggered()), this, SLOT(sVoidPreauth()));
    pMenu->addAction(voidAct);
  }
}
예제 #3
0
arWorkBench::arWorkBench(QWidget* parent, const char* name, Qt::WFlags fl)
    : XMainWindow(parent, name, fl)
{
  setupUi(this);

  (void)statusBar();

  connect(_viewAropen, SIGNAL(clicked()), this, SLOT(sViewAropen()));
  connect(_editAropen, SIGNAL(clicked()), this, SLOT(sEditAropen()));
  connect(_applyAropenCM, SIGNAL(clicked()), this, SLOT(sApplyAropenCM()));
  connect(_editAropenCM, SIGNAL(clicked()), this, SLOT(sEditAropenCM()));
  connect(_viewAropenCM, SIGNAL(clicked()), this, SLOT(sViewAropenCM()));
  connect(_ccRefundCM,   SIGNAL(clicked()), this, SLOT(sCCRefundCM()));
  connect(_cust, SIGNAL(newId(int)), this, SLOT(sFillList()));
  connect(_newCashrcpt, SIGNAL(clicked()), this, SLOT(sNewCashrcpt()));
  connect(_editCashrcpt, SIGNAL(clicked()), this, SLOT(sEditCashrcpt()));
  connect(_viewCashrcpt, SIGNAL(clicked()), this, SLOT(sViewCashrcpt()));
  connect(_deleteCashrcpt, SIGNAL(clicked()), this, SLOT(sDeleteCashrcpt()));
  connect(_postCashrcpt, SIGNAL(clicked()), this, SLOT(sPostCashrcpt()));
  connect(_preauth, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(sgetCCAmount()));
  connect(_postPreauth, SIGNAL(clicked()), this, SLOT(sPostPreauth()));
  connect(_voidPreauth, SIGNAL(clicked()), this, SLOT(sVoidPreauth()));
  connect(_aropen, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*)),
          this, SLOT(sPopulateAropenMenu(QMenu*)));
  connect(_aropenCM, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*)),
          this, SLOT(sPopulateAropenCMMenu(QMenu*)));
  connect(_cashrcpt, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*)),
          this, SLOT(sPopulateCashRcptMenu(QMenu*)));
  connect(_preauth, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*)),
          this, SLOT(sPopulatePreauthMenu(QMenu*)));

  _cashrcpt->addColumn(tr("Dist. Date"), _dateColumn,     Qt::AlignCenter,true, "cashrcpt_distdate");
  _cashrcpt->addColumn(tr("Amount"),     _bigMoneyColumn, Qt::AlignRight, true, "cashrcpt_amount");
  _cashrcpt->addColumn(tr("Currency"),   _currencyColumn, Qt::AlignLeft,  true, "currabbr");
  if (_privileges->check("MaintainCashReceipts"))
  {
    connect(_cashrcpt, SIGNAL(valid(bool)), _editCashrcpt, SLOT(setEnabled(bool)));
    connect(_cashrcpt, SIGNAL(valid(bool)), _deleteCashrcpt, SLOT(setEnabled(bool)));
    connect(_cashrcpt, SIGNAL(valid(bool)), _postCashrcpt, SLOT(setEnabled(bool)));
  }
  else
  {
    _newCashrcpt->setEnabled(FALSE);
    connect(_cashrcpt, SIGNAL(itemSelected(int)), _viewCashrcpt, SLOT(animateClick()));
  }
  if(_privileges->check("PostCashReceipts"))
    connect(_cashrcpt, SIGNAL(itemSelected(int)), _editCashrcpt, SLOT(animateClick()));
  connect(omfgThis, SIGNAL(cashReceiptsUpdated(int, bool)), this, SLOT(sFillList()));
                                                                       
  _aropenCM->addColumn( tr("Type"),              _ynColumn, Qt::AlignCenter,true, "doctype");
  _aropenCM->addColumn( tr("Doc. #"),          _itemColumn, Qt::AlignCenter,true, "aropen_docnumber");
  _aropenCM->addColumn( tr("Amount"),         _moneyColumn, Qt::AlignRight, true, "aropen_amount");
  _aropenCM->addColumn( tr("Applied"),        _moneyColumn, Qt::AlignRight, true, "applied");
  _aropenCM->addColumn( tr("Balance"),        _moneyColumn, Qt::AlignRight, true, "balance");
  _aropenCM->addColumn( tr("Currency"),    _currencyColumn, Qt::AlignLeft,  true, "currabbr");
  _aropenCM->addColumn(tr("Base Balance"), _bigMoneyColumn, Qt::AlignRight, true, "base_balance");
  
  _aropen->addColumn(tr("Type"),               _ynColumn, Qt::AlignCenter,true, "doctype");
  _aropen->addColumn(tr("Doc. #"),          _orderColumn, Qt::AlignRight, true, "aropen_docnumber");
  _aropen->addColumn(tr("Order #"),         _orderColumn, Qt::AlignRight, true, "aropen_ordernumber");
  _aropen->addColumn(tr("Doc. Date"),        _dateColumn, Qt::AlignCenter,true, "aropen_docdate");
  _aropen->addColumn(tr("Due Date"),         _dateColumn, Qt::AlignCenter,true, "aropen_duedate");
  _aropen->addColumn(tr("Amount"),          _moneyColumn, Qt::AlignRight, true, "aropen_amount");
  _aropen->addColumn(tr("Paid"),            _moneyColumn, Qt::AlignRight, true, "aropen_paid");
  _aropen->addColumn(tr("Balance"),         _moneyColumn, Qt::AlignRight, true, "balance");
  _aropen->addColumn(tr("Currency"),     _currencyColumn, Qt::AlignLeft,  true, "currAbbr");
  _aropen->addColumn(tr("Base Balance"), _bigMoneyColumn, Qt::AlignRight, true, "base_balance");
  
  _preauth->addColumn(tr("Order-Seq."),          150, Qt::AlignRight, true, "ordnum" );
  _preauth->addColumn(tr("Amount"),  _bigMoneyColumn, Qt::AlignRight, true, "ccpay_amount");
  _preauth->addColumn(tr("Currency"),_currencyColumn, Qt::AlignLeft,  true, "currabbr");

  if(_privileges->check("EditAROpenItem"))
  {
    connect(_aropen, SIGNAL(valid(bool)), _editAropen, SLOT(setEnabled(bool)));
    connect(_aropen, SIGNAL(itemSelected(int)), _editAropen, SLOT(animateClick()));
    connect(_aropenCM, SIGNAL(valid(bool)), _editAropenCM, SLOT(setEnabled(bool)));
    connect(_aropenCM, SIGNAL(itemSelected(int)), _editAropenCM, SLOT(animateClick()));
  }
  else
  {
    connect(_aropen, SIGNAL(itemSelected(int)), _viewAropen, SLOT(animateClick()));
    connect(_aropenCM, SIGNAL(itemSelected(int)), _viewAropenCM, SLOT(animateClick()));
  }
  if (_privileges->check("ApplyARMemos"))
    connect(_aropenCM, SIGNAL(valid(bool)), _applyAropenCM, SLOT(setEnabled(bool)));

  if (omfgThis->singleCurrency())
  {
    _cashrcpt->hideColumn(2);
    _preauth->hideColumn(2);
    _aropen->hideColumn(8);
    _aropenCM->hideColumn(4);
  }

  if (_metrics->boolean("CCAccept") && _privileges->check("ProcessCreditCards"))
    connect(_aropenCM, SIGNAL(valid(bool)), _ccRefundCM, SLOT(setEnabled(bool)));
  else
  {
    _ccRefundCM->setEnabled(false);
    _preauthLit->setEnabled(false);
    _preauth->setEnabled(false);
    _postPreauth->setEnabled(false);
    _CCAmountLit->setEnabled(false);
    _CCAmount->setEnabled(false);
  }

  if(_metrics->boolean("EnableCustomerDeposits"))
    _aropenCMLit->setText(tr("A/R Open Credit Memos and Deposits"));
}