Пример #1
0
void arWorkBench::sPopulateAropenMenu(QMenu *pMenu)
{
    int menuItem;

    if (_aropen->altId() == 0)
    {
        menuItem = pMenu->insertItem(tr("View Apply-To Debit Memo..."), this, SLOT(sViewAropen()), 0);
        if (! _privleges->check("MaintainARMemos") &&
                ! _privleges->check("ViewARMemos"))
            pMenu->setItemEnabled(menuItem, FALSE);
    }

    else if (_aropen->altId() == 1)
    {
        menuItem = pMenu->insertItem(tr("View Apply-To Invoice..."), this, SLOT(sViewAropen()), 0);
        if (! _privleges->check("MaintainMiscInvoices") &&
                ! _privleges->check("ViewMiscInvoices"))
            pMenu->setItemEnabled(menuItem, FALSE);
    }
}
Пример #2
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"));
    }
  }
}
Пример #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
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"));
}
Пример #5
0
void dspCashReceipts::sHandleButtons(bool valid)
{      
  int menuItem = -1;
  QMenu * editMenu = new QMenu;
  QMenu * viewMenu = new QMenu;   

  _reverse->setVisible(!_applications->isChecked());

  if (valid && _arapply->id() > -1)
  {
    // Handle Edit Button
    // Cash Receipt
    if (_arapply->currentItem()->rawValue("voided").toBool())
    {
      _post->hide();
      _reverse->hide();
    }
    else if (!_arapply->currentItem()->rawValue("posted").toBool())
    {
      editMenu->insertItem(tr("Cash Receipt..."), this, SLOT(sEditCashrcpt()), 0);
      editMenu->setItemEnabled(menuItem, _privileges->check("MaintainCashReceipts"));
        
      _post->show();
      _reverse->setVisible(!_applications->isChecked());
      _reverse->setEnabled(false);
      _post->setEnabled(_privileges->check("PostCashReceipts"));
    }
    else
    {
      _post->show();
      _reverse->setVisible(!_applications->isChecked());
      _post->setEnabled(false);
      _reverse->setEnabled(_privileges->check("ReversePostedCashReceipt")
                           && _cashreceipts->isChecked()
                           && !_arapply->altId());
    } 
        
    if (_arapply->currentItem()->id("target") > -1)
    {
      editMenu->insertItem(tr("Receivable Item..."), this, SLOT(sEditAropen()), 0);
      editMenu->setItemEnabled(menuItem, _privileges->check("EditAROpenItem"));
    }
    
    // Handle View Button
    // Cash Receipt             
    viewMenu->insertItem(tr("Cash Receipt..."), this, SLOT(sViewCashrcpt()), 0);
    viewMenu->setItemEnabled(menuItem, _privileges->check("ViewCashReceipts") || _privileges->check("MaintainCashReceipts"));
   
    // Open Item
    if (_arapply->currentItem()->id("target") > -1)
    {
      viewMenu->insertItem(tr("Receivable Item..."), this, SLOT(sViewAropen()), 0);
      viewMenu->setItemEnabled(menuItem, _privileges->check("ViewAROpenItems") || _privileges->check("EditAROpenItem"));
    }   
    
    _edit->setMenu(editMenu);
    _edit->setEnabled(!editMenu->isEmpty());
    _view->setMenu(viewMenu);
    _view->setEnabled(!viewMenu->isEmpty());
  }
  else
  {
    _edit->setEnabled(false);
    _view->setEnabled(false);
    _post->setEnabled(false);
    _reverse->setEnabled(false);
  }
}