/*
 * This file is part of the xTuple ERP: PostBooks Edition, a free and
 * open source Enterprise Resource Planning software suite,
 * Copyright (c) 1999-2009 by OpenMFG LLC, d/b/a xTuple.
 * It is licensed to you under the Common Public Attribution License
 * version 1.0, the full text of which (including xTuple-specific Exhibits)
 * is available at www.xtuple.com/CPAL.  By using this software, you agree
 * to be bound by its terms.
 */

#ifndef CUSTOMER_H
#define CUSTOMER_H

#include "guiclient.h"
#include "xwidget.h"
#include <QStandardItemModel>
#include <parameter.h>

#include "ui_customer.h"

class customer : public XWidget, public Ui::customer
{
    Q_OBJECT

public:
    customer(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window);
    ~customer();

public slots:
    virtual SetResponse set(const ParameterList & pParams );
    virtual void populate();
    virtual void sCheck();
    virtual void sDeleteCharacteristic();
    virtual void sDeleteShipto();
    virtual void sDeleteTaxreg();
    virtual void sEditCharacteristic();
    virtual void sEditCreditCard();
    virtual void sEditShipto();
    virtual void sEditTaxreg();
    virtual void sFillCcardList();
    virtual void sFillCharacteristicList();
    virtual void sFillShiptoList();
    virtual void sFillTaxregList();
    virtual void sMoveDown();
    virtual void sMoveUp();
    virtual void sNewCharacteristic();
    virtual void sNewCreditCard();
    virtual void sNewShipto();
    virtual void sNewTaxreg();
    virtual void sPopulateCommission();
    virtual void sPopulateShiptoMenu( QMenu * menuThis );
    virtual void sPrintShipto();
    virtual bool sSave( bool partial );
    virtual void sSave();
    virtual void sViewCreditCard();
    virtual void sViewShipto();
    virtual void sViewTaxreg();
    virtual void sLoadProspect(int);
    virtual void sLoadCrmAcct(int);
    virtual void sHandleButtons();

protected slots:
    virtual void languageChange();
    virtual int  saveContact(ContactCluster*);
    virtual void sProfileSelected();
    virtual void sSoProfileSelected();
    virtual void sNumberEdited();

protected:
    virtual void closeEvent(QCloseEvent*);

private:
    int _mode;
    int _custid;
    int	_crmacctid;
    int _NumberGen;
    QString _cachedNumber;
    QString key;
    bool _notice;
    QStandardItemModel * _custchar;

};

#endif // CUSTOMER_H
