Exemple #1
0
prospect::prospect(QWidget* parent, const char* name, Qt::WFlags fl)
    : XMainWindow(parent, name, fl)
{
  setupUi(this);

  (void)statusBar();

  connect(_deleteQuote,SIGNAL(clicked()),	this,	SLOT(sDeleteQuote()));
  connect(_editQuote,	SIGNAL(clicked()),	this,	SLOT(sEditQuote()));
  connect(_newQuote,	SIGNAL(clicked()),	this,	SLOT(sNewQuote()));
  connect(_number,	SIGNAL(lostFocus()),	this,	SLOT(sCheckNumber()));
  connect(_printQuote,SIGNAL(clicked()),	this,	SLOT(sPrintQuote()));
  connect(_quotes,	SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)),	this,	SLOT(sPopulateQuotesMenu(QMenu*)));
  connect(_save,	SIGNAL(clicked()),	this,	SLOT(sSave()));
  connect(_viewQuote,	SIGNAL(clicked()),	this,	SLOT(sViewQuote()));
  connect(omfgThis,	SIGNAL(quotesUpdated(int, bool)), this, SLOT(sFillQuotesList()));

  if (_privileges->check("MaintainProspectMasters"))
    connect(_quotes, SIGNAL(itemSelected(int)), _editQuote, SLOT(animateClick()));
  else
    connect(_quotes, SIGNAL(itemSelected(int)), _viewQuote, SLOT(animateClick()));

  _prospectid = -1;
  _crmacct->setId(-1);

  _taxauth->setAllowNull(true);
  _taxauth->setType(XComboBox::TaxAuths);

  _quotes->addColumn(tr("Quote #"),          _orderColumn, Qt::AlignLeft );
  _quotes->addColumn(tr("Quote Date"),       _dateColumn,  Qt::AlignLeft );

  _NumberGen = -1;
}
Exemple #2
0
void prospect::sPopulateQuotesMenu(QMenu *menuThis)
{
  menuThis->insertItem(tr("Edit..."),   this, SLOT(sEditQuote()),   0 );
  menuThis->insertItem(tr("View..."),   this, SLOT(sViewQuote()),   0 );
  menuThis->insertItem(tr("Delete..."), this, SLOT(sDeleteQuote()), 0 );
  menuThis->insertItem(tr("Print..."),  this, SLOT(sPrintQuote()),  0 );
}
Exemple #3
0
void prospect::sPopulateQuotesMenu(QMenu *menuThis)
{
  menuThis->addAction(tr("Edit..."),   this, SLOT(sEditQuote()));
  menuThis->addAction(tr("View..."),   this, SLOT(sViewQuote()));
  menuThis->addAction(tr("Delete..."), this, SLOT(sDeleteQuote()));
  menuThis->addAction(tr("Print..."),  this, SLOT(sPrintQuote()));
}
Exemple #4
0
prospect::prospect(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_crmacct,     SIGNAL(clicked()),      this,   SLOT(sCrmAccount()));
  connect(_deleteQuote, SIGNAL(clicked()),	this,	SLOT(sDeleteQuote()));
  connect(_editQuote,	SIGNAL(clicked()),	this,	SLOT(sEditQuote()));
  connect(_newQuote,	SIGNAL(clicked()),	this,	SLOT(sNewQuote()));
  connect(_number,	SIGNAL(editingFinished()),	this,	SLOT(sCheckNumber()));
  connect(_printQuote,  SIGNAL(clicked()),	this,	SLOT(sPrintQuote()));
  connect(_quotes,	SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)),	this,	SLOT(sPopulateQuotesMenu(QMenu*)));
  connect(_save,	SIGNAL(clicked()),	this,	SLOT(sSave()));
  connect(_viewQuote,	SIGNAL(clicked()),	this,	SLOT(sViewQuote()));
  connect(omfgThis,	SIGNAL(quotesUpdated(int, bool)), this, SLOT(sFillQuotesList()));

  if (_privileges->check("MaintainQuotes"))
    connect(_quotes, SIGNAL(itemSelected(int)), _editQuote, SLOT(animateClick()));
  else
    connect(_quotes, SIGNAL(itemSelected(int)), _viewQuote, SLOT(animateClick()));

  _prospectid = -1;
  _crmacctid = -1;

  _taxzone->setAllowNull(true);
  _taxzone->setType(XComboBox::TaxZones);

  _quotes->addColumn(tr("Quote #"),          _orderColumn, Qt::AlignLeft, true, "quhead_number" );
  _quotes->addColumn(tr("Quote Date"),       _dateColumn,  Qt::AlignLeft, true, "quhead_quotedate" );

  _NumberGen = -1;
}
Exemple #5
0
void opportunity::sEditSale()
{
  if (_salesList->altId() == 0)
    sEditQuote();
  else
    sEditSalesOrder();
}
Exemple #6
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"));
}