Пример #1
0
void dspCashReceipts::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int)
{
  QAction *menuItem = 0;
  
  if (list()->id() > -1)
  {
    // Cash Receipt              
    if (!list()->currentItem()->rawValue("posted").toBool() && !list()->currentItem()->rawValue("voided").toBool())
    {
      menuItem = pMenu->addAction(tr("Edit Cash Receipt..."), this, SLOT(sEditCashrcpt()));
      menuItem->setEnabled(_privileges->check("MaintainCashReceipts"));
    }

    menuItem = pMenu->addAction(tr("View Cash Receipt..."), this, SLOT(sViewCashrcpt()));
    menuItem->setEnabled(_privileges->check("ViewCashReceipts") || _privileges->check("MaintainCashReceipts"));

    if (!list()->currentItem()->rawValue("voided").toBool())
    {      
      if (!list()->currentItem()->rawValue("posted").toBool())
      {   
        menuItem = pMenu->addAction(tr("Post Cash Receipt"), this, SLOT(sPostCashrcpt()));
        menuItem->setEnabled(_privileges->check("PostCashReceipts"));
      }
      else if (!list()->altId())
      {
        menuItem = pMenu->addAction(tr("Void Posted Cash Receipt"), this, SLOT(sReversePosted()));
        menuItem->setEnabled(_privileges->check("ReversePostedCashReceipt"));
      }
    }

    // Open Item
    if (list()->currentItem()->id("target") > -1 )
    {
      pMenu->addSeparator();
      menuItem = pMenu->addAction(tr("Edit Receivable Item..."), this, SLOT(sEditAropen()));
      menuItem->setEnabled(_privileges->check("EditAROpenItem"));
      menuItem = pMenu->addAction(tr("View Receivable Item..."), this, SLOT(sViewAropen()));
      menuItem->setEnabled(_privileges->check("ViewAROpenItems") || _privileges->check("EditAROpenItem"));
    }
  }
}
Пример #2
0
/*
 *  Constructs a dspCashReceipts as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
dspCashReceipts::dspCashReceipts(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

//  (void)statusBar();

  // signals and slots connections
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_close, SIGNAL(clicked()), this, SLOT(close()));
  connect(_query, SIGNAL(clicked()), this, SLOT(sFillList()));
  connect(_new, SIGNAL(clicked()), this, SLOT(sNewCashrcpt()));
  connect(_post, SIGNAL(clicked()), this, SLOT(sPostCashrcpt()));
  connect(_reverse, SIGNAL(clicked()), this, SLOT(sReversePosted()));
  connect(_arapply, SIGNAL(valid(bool)), this, SLOT(sHandleButtons(bool)));
  connect(_arapply, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_applications, SIGNAL(toggled(bool)), _arapply, SLOT(clear()));
  connect(_applications, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons(bool)));

  _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE);
  _dates->setStartDate(QDate().currentDate().addDays(-90));
  _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), TRUE);
  
  _arapply->addColumn(tr("Number"),      _orderColumn,    Qt::AlignCenter, true,  "cashrcpt_number" );
  _arapply->addColumn(tr("Source"),      _itemColumn,     Qt::AlignLeft,   true,  "source" );
  _arapply->addColumn(tr("Cust. #"),     _orderColumn,    Qt::AlignCenter, true,  "cust_number" );
  _arapply->addColumn(tr("Customer"),    -1,              Qt::AlignLeft,   true,  "cust_name"   );
  _arapply->addColumn(tr("Posted"),      _ynColumn,       Qt::AlignCenter, true,  "posted" );
  _arapply->addColumn(tr("Voided"),      _ynColumn,       Qt::AlignCenter, true,  "voided" );
  _arapply->addColumn(tr("Date"),        _dateColumn,     Qt::AlignCenter, true,  "postdate" );
  _arapply->addColumn(tr("Apply-To"),    _itemColumn,     Qt::AlignCenter, true,  "target" );
  _arapply->addColumn(tr("Amount"),      _bigMoneyColumn, Qt::AlignRight,  true,  "applied"  );
  _arapply->addColumn(tr("Currency"),    _currencyColumn, Qt::AlignLeft,   true,  "currAbbr"   );
  _arapply->addColumn(tr("Base Amount"), _bigMoneyColumn, Qt::AlignRight,  true,  "base_applied"  );
  
  _upgradeWarn = new XErrorMessage(this);
  
  _new->setEnabled(_privileges->check("MaintainCashReceipts"));
  
  sHandleButtons(false);
}
Пример #3
0
void dspCashReceipts::sPopulateMenu( QMenu * pMenu )
{
  int menuItem = -1;
  
  if (_arapply->id() > -1)
  {
    // Cash Receipt              
    if (!_arapply->currentItem()->rawValue("posted").toBool() && !_arapply->currentItem()->rawValue("voided").toBool())
    {
      menuItem = pMenu->insertItem(tr("Edit Cash Receipt..."), this, SLOT(sEditCashrcpt()), 0);
      pMenu->setItemEnabled(menuItem, _privileges->check("MaintainCashReceipts"));
    }

    pMenu->insertItem(tr("View Cash Receipt..."), this, SLOT(sViewCashrcpt()), 0);
    pMenu->setItemEnabled(menuItem, _privileges->check("ViewCashReceipts") || _privileges->check("MaintainCashReceipts"));

    if (!_arapply->currentItem()->rawValue("voided").toBool())
    {      
      if (!_arapply->currentItem()->rawValue("posted").toBool())
      {   
        menuItem = pMenu->insertItem(tr("Post Cash Receipt"), this, SLOT(sPostCashrcpt()), 0);
        pMenu->setItemEnabled(menuItem, _privileges->check("PostCashReceipts"));
      }
      else if (!_arapply->altId())
      {
        menuItem = pMenu->insertItem(tr("Reverse Posted Cash Receipt"), this, SLOT(sReversePosted()), 0);
        pMenu->setItemEnabled(menuItem, _privileges->check("ReversePostedCashReceipt"));
      }
    }

    // Open Item
    if (_arapply->currentItem()->id("target") > -1 )
    {
      pMenu->insertSeparator();
      menuItem = pMenu->insertItem(tr("Edit Receivable Item..."), this, SLOT(sEditAropen()), 0);
      pMenu->setItemEnabled(menuItem, _privileges->check("EditAROpenItem"));
      menuItem = pMenu->insertItem(tr("View Receivable Item..."), this, SLOT(sViewAropen()), 0);
      pMenu->setItemEnabled(menuItem, _privileges->check("ViewAROpenItems") || _privileges->check("EditAROpenItem"));
    }
  }
}
Пример #4
0
void arWorkBench::sPopulateCashRcptMenu(QMenu *pMenu)
{
    int menuItem;

    menuItem = pMenu->insertItem(tr("Edit Cash Receipt..."), this, SLOT(sEditCashrcpt()), 0);
    if (! _privleges->check("MaintainCashReceipts") &&
            ! _privleges->check("ViewCashReceipts"))
        pMenu->setItemEnabled(menuItem, FALSE);

    menuItem = pMenu->insertItem(tr("View Cash Receipt..."), this, SLOT(sViewCashrcpt()), 0);
    if (! _privleges->check("ViewCashReceipts"))
        pMenu->setItemEnabled(menuItem, FALSE);

    menuItem = pMenu->insertItem(tr("Delete Cash Receipt..."), this, SLOT(sDeleteCashrcpt()), 0);
    if (! _privleges->check("MaintainCashReceipts"))
        pMenu->setItemEnabled(menuItem, FALSE);

    menuItem = pMenu->insertItem(tr("Post Cash Receipt..."), this, SLOT(sPostCashrcpt()), 0);
    if (! _privleges->check("PostCashReceipts"))
        pMenu->setItemEnabled(menuItem, FALSE);
}
Пример #5
0
void arWorkBench::sPopulateCashRcptMenu(QMenu *pMenu)
{
  QAction *menuItem;

  menuItem = pMenu->addAction(tr("Edit Cash Receipt..."), this, SLOT(sEditCashrcpt()));
  if (! _privileges->check("MaintainCashReceipts") &&
      ! _privileges->check("ViewCashReceipts"))
    menuItem->setEnabled(false);

  menuItem = pMenu->addAction(tr("View Cash Receipt..."), this, SLOT(sViewCashrcpt()));
  if (! _privileges->check("ViewCashReceipts"))
    menuItem->setEnabled(false);

  menuItem = pMenu->addAction(tr("Delete Cash Receipt..."), this, SLOT(sDeleteCashrcpt()));
  if (! _privileges->check("MaintainCashReceipts"))
    menuItem->setEnabled(false);

  pMenu->addSeparator();

  menuItem = pMenu->addAction(tr("Post Cash Receipt..."), this, SLOT(sPostCashrcpt()));
  if (! _privileges->check("PostCashReceipts"))
    menuItem->setEnabled(false);
}
Пример #6
0
arWorkBench::arWorkBench(QWidget* parent, const char* name, Qt::WFlags fl)
    : QMainWindow(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(_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 );
    _cashrcpt->addColumn(tr("Amount"),     _bigMoneyColumn, Qt::AlignRight  );
    _cashrcpt->addColumn(tr("Currency"),   _currencyColumn, Qt::AlignLeft   );
    if (_privleges->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(_privleges->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 );
    _aropenCM->addColumn( tr("Doc. #"),   _itemColumn,  Qt::AlignCenter );
    _aropenCM->addColumn( tr("Amount"),   _moneyColumn, Qt::AlignRight  );
    _aropenCM->addColumn( tr("Applied"),  _moneyColumn, Qt::AlignRight  );
    _aropenCM->addColumn( tr("Balance"),  _moneyColumn, Qt::AlignRight  );
    _aropenCM->addColumn( tr("Currency"), _currencyColumn, Qt::AlignLeft );

    _aropen->addColumn(tr("Doc. Type"), -1,              Qt::AlignCenter );
    _aropen->addColumn(tr("Doc. #"),    _orderColumn,    Qt::AlignRight  );
    _aropen->addColumn(tr("Order #"),   _orderColumn,    Qt::AlignRight  );
    _aropen->addColumn(tr("Doc. Date"), _dateColumn,     Qt::AlignCenter );
    _aropen->addColumn(tr("Due Date"),  _dateColumn,     Qt::AlignCenter );
    _aropen->addColumn(tr("Amount"),    _bigMoneyColumn, Qt::AlignRight  );
    _aropen->addColumn(tr("Paid"),      _bigMoneyColumn, Qt::AlignRight  );
    _aropen->addColumn(tr("Balance"),   _bigMoneyColumn, Qt::AlignRight  );
    _aropen->addColumn( tr("Currency"), _currencyColumn, Qt::AlignLeft   );

    _preauth->addColumn(tr("Order-Seq."),  150, Qt::AlignRight  );
    _preauth->addColumn(tr("Amount"),   _bigMoneyColumn, Qt::AlignRight  );
    _preauth->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft   );

    if(_privleges->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 (_privleges->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") && _privleges->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"));
}
Пример #7
0
arWorkBench::arWorkBench(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  _aritems = new dspAROpenItems(this, "_aritems", Qt::Widget);
  _aropenFrame->layout()->addWidget(_aritems);
  _aritems->setCloseVisible(false);
  _aritems->findChild<QWidget*>("_customerSelector")->hide();
  _aritems->queryAction()->setVisible(false);
  _aritems->findChild<QWidget*>("_asofGroup")->hide();
  _aritems->findChild<DLineEdit*>("_asOf")->setDate(omfgThis->endOfTime());
  _aritems->findChild<QWidget*>("_dateGroup")->hide();
  _aritems->findChild<QWidget*>("_showGroup")->hide();
  _aritems->findChild<QWidget*>("_printGroup")->hide();
  _aritems->findChild<QRadioButton*>("_dueDate")->click();
  
  _cctrans = new dspCreditCardTransactions(this, "_cctrans", Qt::Widget);
  _creditCardTab->layout()->addWidget(_cctrans);
  _cctrans->findChild<QWidget*>("_close")->hide();
  _cctrans->findChild<QWidget*>("_customerSelector")->hide();
  _cctrans->findChild<QWidget*>("_query")->hide();
  _cctrans->findChild<QWidget*>("_alltrans")->hide();
  _cctrans->findChild<QWidget*>("_pending")->hide();
  _cctrans->findChild<QWidget*>("_processed")->hide();
  _cctrans->findChild<XTreeWidget*>("_preauth")->hideColumn("type");
  _cctrans->findChild<XTreeWidget*>("_preauth")->hideColumn("status");
  
  connect(_query, SIGNAL(clicked()), 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(_cashrcpt, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*)),
          this, SLOT(sPopulateCashRcptMenu(QMenu*)));
  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()));
  connect(_customerSelector, SIGNAL(newCustGroupId(int)), this, SLOT(sClear()));

  connect(_customerSelector, SIGNAL(newState(int)), 
          _aritems->findChild<CustomerSelector*>("_customerSelector"), SLOT(setState(int)));
  connect(_customerSelector, SIGNAL(newCustId(int)), 
          _aritems->findChild<CustomerSelector*>("_customerSelector"), SLOT(setCustId(int)));
  connect(_customerSelector, SIGNAL(newCustTypeId(int)), 
          _aritems->findChild<CustomerSelector*>("_customerSelector"), SLOT(setCustTypeId(int)));
  connect(_customerSelector, SIGNAL(newCustGroupId(int)), 
          _aritems->findChild<CustomerSelector*>("_customerSelector"), SLOT(setCustGroupId(int)));
  connect(_customerSelector, SIGNAL(newTypePattern(QString)), 
          _aritems->findChild<CustomerSelector*>("_customerSelector"), SLOT(setTypePattern(QString)));
  connect(_customerSelector, SIGNAL(newState(int)), 
          _cctrans->findChild<CustomerSelector*>("_customerSelector"), SLOT(setState(int)));
  connect(_customerSelector, SIGNAL(newCustId(int)), 
          _cctrans->findChild<CustomerSelector*>("_customerSelector"), SLOT(setCustId(int)));
  connect(_customerSelector, SIGNAL(newCustTypeId(int)), 
          _cctrans->findChild<CustomerSelector*>("_customerSelector"), SLOT(setCustTypeId(int)));
  connect(_customerSelector, SIGNAL(newCustGroupId(int)), 
          _cctrans->findChild<CustomerSelector*>("_customerSelector"), SLOT(setCustGroupId(int)));
  connect(_customerSelector, SIGNAL(newTypePattern(QString)), 
          _cctrans->findChild<CustomerSelector*>("_customerSelector"), SLOT(setTypePattern(QString)));
  connect(_debits, SIGNAL(clicked()), 
          _aritems->findChild<QRadioButton*>("_debits"), SLOT(click()));
  connect(_credits, SIGNAL(clicked()), 
          _aritems->findChild<QRadioButton*>("_credits"), SLOT(click()));
  connect(_both, SIGNAL(clicked()), 
          _aritems->findChild<QRadioButton*>("_both"), SLOT(click()));
  connect(_searchDocNum, SIGNAL(textChanged(const QString&)), this, SLOT(sSearchDocNumChanged()));

  _cashrcpt->addColumn(tr("Cust. #"),       _bigMoneyColumn, Qt::AlignLeft,  true, "cust_number");                                                                
  _cashrcpt->addColumn(tr("Name"),                       -1, Qt::AlignLeft,  true, "cust_name"); 
  _cashrcpt->addColumn(tr("Check/Doc. #"),     _orderColumn, Qt::AlignLeft,  true, "cashrcpt_docnumber");
  _cashrcpt->addColumn(tr("Bank Account"),     _orderColumn, Qt::AlignLeft,  true, "bankaccnt_name");
  _cashrcpt->addColumn(tr("Dist. Date"),        _dateColumn, Qt::AlignCenter,true, "cashrcpt_distdate");
  _cashrcpt->addColumn(tr("Funds Type"),    _bigMoneyColumn, Qt::AlignCenter,true, "cashrcpt_fundstype");
  _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)));
    if (_privileges->check("PostCashReceipts"))
      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()));

  if (omfgThis->singleCurrency())
    _cashrcpt->hideColumn(2);

  if (!_metrics->boolean("CCAccept") || !_privileges->check("ProcessCreditCards"))
    _tab->removeTab(_tab->indexOf(_creditCardTab));
}