Beispiel #1
0
void creditMemoEditList::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected)
{
  _orderid = _cmhead->id();

  pMenu->addAction(tr("Edit Credit Memo..."), this, SLOT(sEditCreditMemo()));

  if (((XTreeWidgetItem *)pSelected)->altId() != -1)
    pMenu->addAction(tr("Edit Credit Memo Item..."), this, SLOT(sEditCreditMemoItem()));
}
Beispiel #2
0
dspCustomerInformation::dspCustomerInformation(QWidget* parent, Qt::WFlags fl)
    : QWidget(parent, fl)
{
  setupUi(this);

  connect(_arhist, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuArhist(QMenu*)));
  connect(_close, SIGNAL(clicked()), this, SLOT(close()));
  connect(_creditMemo, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuCreditMemo(QMenu*)));
  connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulate(int)));
  connect(_custList, SIGNAL(clicked()), _cust, SLOT(sEllipses()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_editCreditMemo, SIGNAL(clicked()), this, SLOT(sEditCreditMemo()));
  connect(_editInvoice, SIGNAL(clicked()), this, SLOT(sEditInvoice()));
  connect(_editOrder, SIGNAL(clicked()), this, SLOT(sEditOrder()));
  connect(_editQuote, SIGNAL(clicked()), this, SLOT(sEditQuote()));
  connect(_invoice, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuInvoice(QMenu*)));
  connect(_newCreditMemo, SIGNAL(clicked()), this, SLOT(sNewCreditMemo()));
  connect(_newInvoice, SIGNAL(clicked()), this, SLOT(sNewInvoice()));
  connect(_newOrder, SIGNAL(clicked()), this, SLOT(sNewOrder()));
  connect(_newQuote, SIGNAL(clicked()), this, SLOT(sNewQuote()));
  connect(_order, SIGNAL(valid(bool)), _viewOrder, SLOT(setEnabled(bool)));
  connect(_order, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuSalesOrder(QMenu*)));
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_quote, SIGNAL(valid(bool)), _viewQuote, SLOT(setEnabled(bool)));
  connect(_quote, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuQuote(QMenu*)));
  connect(_viewCreditMemo, SIGNAL(clicked()), this, SLOT(sViewCreditMemo()));
  connect(_viewInvoice, SIGNAL(clicked()), this, SLOT(sViewInvoice()));
  connect(_viewOrder, SIGNAL(clicked()), this, SLOT(sViewOrder()));
  connect(_viewQuote, SIGNAL(clicked()), this, SLOT(sViewQuote()));
  connect(_convertQuote, SIGNAL(clicked()), this, SLOT(sConvertQuote()));

#ifndef Q_WS_MAC
  _custList->setMaximumWidth(25);
#endif

  // setup arhist list
  _arhist->addColumn(tr("Open"),      _orderColumn, Qt::AlignCenter );
  _arhist->addColumn(tr("Doc. Type"), _dateColumn,  Qt::AlignCenter );
  _arhist->addColumn(tr("Doc. #"),    _orderColumn, Qt::AlignRight  );
  _arhist->addColumn(tr("Doc. Date"), _dateColumn,  Qt::AlignCenter );
  _arhist->addColumn(tr("Due. Date"), _dateColumn,  Qt::AlignCenter );
  _arhist->addColumn(tr("Amount"),    _moneyColumn, Qt::AlignRight  );
  _arhist->addColumn(tr("Balance"),   _moneyColumn, Qt::AlignRight  );
  _arhist->addColumn(tr("Currency"),  _currencyColumn, Qt::AlignLeft);

  // setup Quote list
  _quote->addColumn(tr("Quote #"),    _orderColumn, Qt::AlignRight  );
  _quote->addColumn(tr("P/O Number"), _itemColumn,  Qt::AlignLeft   );
  _quote->addColumn(tr("Quote Date"), _dateColumn,  Qt::AlignCenter );
  if(_privleges->check("MaintainQuotes"))
  {
    connect(_quote, SIGNAL(valid(bool)), _editQuote, SLOT(setEnabled(bool)));
    connect(_quote, SIGNAL(itemSelected(int)), _editQuote, SLOT(animateClick()));
  }
  else
  {
    _newQuote->setEnabled(false);
    connect(_quote, SIGNAL(itemSelected(int)), _viewQuote, SLOT(animateClick()));
  }
  if (_privleges->check("ConvertQuotes"))
    connect(_quote, SIGNAL(valid(bool)), _convertQuote, SLOT(setEnabled(bool)));
  connect(omfgThis, SIGNAL(quotesUpdated(int, bool)), this, SLOT(sFillQuoteList()));

  // setup Order list
  _order->addColumn(tr("S/O #"),            _orderColumn, Qt::AlignLeft   );
  _order->addColumn(tr("Cust. P/O Number"), _itemColumn,  Qt::AlignLeft   );
  _order->addColumn(tr("Ordered"),          _dateColumn,  Qt::AlignCenter );
  _order->addColumn(tr("Scheduled"),        _dateColumn,  Qt::AlignCenter );
  if(_privleges->check("MaintainSalesOrders"))
  {
    connect(_order, SIGNAL(valid(bool)), _editOrder, SLOT(setEnabled(bool)));
    connect(_order, SIGNAL(itemSelected(int)), _editOrder, SLOT(animateClick()));
  }
  else
  {
    _newOrder->setEnabled(false);
    connect(_order, SIGNAL(itemSelected(int)), _viewOrder, SLOT(animateClick()));
  }
  connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sFillOrderList()));

  // setup Invoice list
  _invoice->addColumn(tr("Posted"),     _ynColumn,    Qt::AlignCenter );
  _invoice->addColumn(tr("Open"),       _ynColumn,    Qt::AlignCenter );
  _invoice->addColumn(tr("Invoice #"),  _orderColumn, Qt::AlignLeft   );
  _invoice->addColumn(tr("S/O #"),      _orderColumn, Qt::AlignLeft   );
  _invoice->addColumn(tr("Invc. Date"), _dateColumn,  Qt::AlignCenter );
  _invoice->addColumn(tr("Amount"),     _moneyColumn, Qt::AlignRight  );
  _invoice->addColumn(tr("Balance"),    _moneyColumn, Qt::AlignRight  );
  _invoice->addColumn(tr("Currency"),   _currencyColumn, Qt::AlignLeft);
  if(_privleges->check("MaintainMiscInvoices"))
  {
    connect(_invoice, SIGNAL(valid(bool)), _editInvoice, SLOT(setEnabled(bool)));
    connect(_invoice, SIGNAL(itemSelected(int)), _editInvoice, SLOT(animateClick()));
  }
  else
  {
    _newInvoice->setEnabled(false);
    connect(_invoice, SIGNAL(itemSelected(int)), _viewInvoice, SLOT(animateClick()));
  }
  if(_privleges->check("MaintainMiscInvoices") || _privleges->check("ViewMiscInvoices"))
    connect(_invoice, SIGNAL(valid(bool)), _viewInvoice, SLOT(setEnabled(bool)));
  connect(omfgThis, SIGNAL(invoicesUpdated(int, bool)), this, SLOT(sFillInvoiceList()));

  // setup CreditMemo list
  _creditMemo->addColumn(tr("Posted"),    _ynColumn,    Qt::AlignCenter );
  _creditMemo->addColumn(tr("Open"),      _ynColumn,    Qt::AlignCenter );
  _creditMemo->addColumn(tr("Type"),      _ynColumn,    Qt::AlignCenter );
  _creditMemo->addColumn(tr("C/M #"),     _orderColumn, Qt::AlignLeft   );
  _creditMemo->addColumn(tr("Doc. Date"), _dateColumn,  Qt::AlignCenter );
  _creditMemo->addColumn(tr("Amount"),    _moneyColumn, Qt::AlignRight  );
  _creditMemo->addColumn(tr("Balance"),   _moneyColumn, Qt::AlignRight  );
  _creditMemo->addColumn(tr("Currency"),  _currencyColumn, Qt::AlignLeft);
  if(!_privleges->check("MaintainCreditMemos"))
    _newCreditMemo->setEnabled(false);
  connect(_creditMemo, SIGNAL(valid(bool)), this, SLOT(sCreditMemoSelected(bool)));
  connect(_creditMemo, SIGNAL(itemSelected(int)), _viewCreditMemo, SLOT(animateClick()));
  connect(omfgThis, SIGNAL(creditMemosUpdated()), this, SLOT(sFillCreditMemoList()));

  _payments->addColumn(tr("Type"),         _whsColumn,      Qt::AlignLeft  );
  _payments->addColumn(tr("Status"),       _whsColumn,      Qt::AlignLeft  );
  _payments->addColumn(tr("Timestamp"),    _timeDateColumn, Qt::AlignLeft  );
  _payments->addColumn(tr("Entered By"),   _userColumn,     Qt::AlignLeft  );
  _payments->addColumn(tr("Total Amount"), _moneyColumn,    Qt::AlignRight );
  _payments->addColumn(tr("Currency"),     _currencyColumn, Qt::AlignLeft  );
  _payments->addColumn(tr("S/O #"),        _orderColumn,    Qt::AlignLeft  );
  _payments->addColumn(tr("Reference"),    _orderColumn,    Qt::AlignLeft  );
  _payments->addColumn(tr("Allocated"),    _moneyColumn,    Qt::AlignRight );
  _payments->addColumn(tr("Currency"),     _currencyColumn, Qt::AlignLeft  );

  if (omfgThis->singleCurrency())
  {
    _arhist->hideColumn(7);
    _invoice->hideColumn(7);
    _creditMemo->hideColumn(6);
    _payments->hideColumn(5);
    _payments->hideColumn(8);
  }

  _edit->setEnabled(_privleges->check("MaintainCustomerMasters"));
}