本文整理汇总了Java中com.openbravo.pos.forms.AppLocal类的典型用法代码示例。如果您正苦于以下问题:Java AppLocal类的具体用法?Java AppLocal怎么用?Java AppLocal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AppLocal类属于com.openbravo.pos.forms包,在下文中一共展示了AppLocal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteTicket
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
public void deleteTicket() {
if (m_ticketCopy != null) {
// Para editar borramos el ticket anterior
try {
m_dlSales.deleteTicket(m_ticketCopy, m_App.getInventoryLocation());
} catch (BasicException eData) {
MessageInf msg = new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.nosaveticket"), eData);
msg.show(this);
}
}
m_ticket = null;
m_ticketCopy = null;
resetToTicket();
}
示例2: btnCustomerActionPerformed
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
private void btnCustomerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCustomerActionPerformed
JCustomerFinder finder = JCustomerFinder.getCustomerFinder(this, dlCustomers);
finder.search(ticket.getCustomer());
finder.setVisible(true);
try {
ticket.setCustomer(finder.getSelectedCustomer() == null
? null
: dlSales.loadCustomerExt(finder.getSelectedCustomer().getId()));
} catch (BasicException e) {
MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotfindcustomer"), e);
msg.show(this);
}
// The ticket name
m_jTicketId.setText(ticket.getName(ticketext));
refreshTicketTaxes();
// refresh the receipt....
setTicket(ticket, ticketext);
}
示例3: incProductByCodePrice
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
private void incProductByCodePrice(String sCode, double dPriceSell) {
// precondicion: sCode != null
try {
ProductInfoExt oProduct = dlSales.getProductInfoByCode(sCode);
if (oProduct == null) {
Toolkit.getDefaultToolkit().beep();
new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.noproduct")).show(this);
stateToZero();
} else {
// Se anade directamente una unidad con el precio y todo
if (m_jaddtax.isSelected()) {
// debemos quitarle los impuestos ya que el precio es con iva incluido...
TaxInfo tax = taxeslogic.getTaxInfo(oProduct.getTaxCategoryID(), m_oTicket.getDate(), m_oTicket.getCustomer());
addTicketLine(oProduct, 1.0, dPriceSell / (1.0 + tax.getRate()));
} else {
addTicketLine(oProduct, 1.0, dPriceSell);
}
}
} catch (BasicException eData) {
stateToZero();
new MessageInf(eData).show(this);
}
}
示例4: incProduct
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
private void incProduct(ProductInfoExt prod) {
if (prod.isScale() && m_App.getDeviceScale().existsScale()) {
try {
Double value = m_App.getDeviceScale().readWeight();
if (value != null) {
incProduct(value.doubleValue(), prod);
}
} catch (ScaleException e) {
Toolkit.getDefaultToolkit().beep();
new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.noweight"), e).show(this);
stateToZero();
}
} else {
// No es un producto que se pese o no hay balanza
incProduct(1.0, prod);
}
}
示例5: btnCustomerActionPerformed
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
private void btnCustomerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCustomerActionPerformed
JCustomerFinder finder = JCustomerFinder.getCustomerFinder(this, dlCustomers);
finder.search(m_oTicket.getCustomer());
finder.setVisible(true);
try {
m_oTicket.setCustomer(finder.getSelectedCustomer() == null
? null
: dlSales.loadCustomerExt(finder.getSelectedCustomer().getId()));
} catch (BasicException e) {
MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotfindcustomer"), e);
msg.show(this);
}
refreshTicket();
}
示例6: jEditAttributesActionPerformed
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
private void jEditAttributesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jEditAttributesActionPerformed
int i = m_ticketlines.getSelectedIndex();
if (i < 0) {
Toolkit.getDefaultToolkit().beep(); // no line selected
} else {
try {
TicketLineInfo line = m_oTicket.getLine(i);
JProductAttEdit attedit = JProductAttEdit.getAttributesEditor(this, m_App.getSession());
attedit.editAttributes(line.getProductAttSetId(), line.getProductAttSetInstId());
attedit.setVisible(true);
if (attedit.isOK()) {
// The user pressed OK
line.setProductAttSetInstId(attedit.getAttributeSetInst());
line.setProductAttSetInstDesc(attedit.getAttributeSetInstDescription());
paintTicketLine(i, line);
}
} catch (BasicException ex) {
MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotfindattributes"), ex);
msg.show(this);
}
}
}
示例7: writeValues
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
public void writeValues(DataWrite dp) throws BasicException {
dp.setString(1, m_sTicket);
dp.setInt(2, new Integer(m_iLine));
dp.setString(3, productid);
dp.setString(4, attsetinstid);
dp.setDouble(5, new Double(multiply));
dp.setDouble(6, new Double(price));
dp.setString(7, tax.getId());
try {
ByteArrayOutputStream o = new ByteArrayOutputStream();
attributes.storeToXML(o, AppLocal.APP_NAME, "UTF-8");
dp.setBytes(8, o.toByteArray());
} catch (IOException e) {
dp.setBytes(8, null);
}
}
示例8: JPaymentMagcard
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
/** Creates new form JPaymentMagcard */
public JPaymentMagcard(AppView app, JPaymentNotifier notifier) {
initComponents();
m_notifier = notifier;
m_paymentgateway = PaymentGatewayFac.getPaymentGateway(app.getProperties());
if (m_paymentgateway == null) {
jlblMessage.setText(AppLocal.getIntString("message.nopaymentgateway"));
} else {
// Se van a poder efectuar pagos con tarjeta
m_cardpanel = PaymentPanelFac.getPaymentPanel(app.getProperties().getProperty("payment.magcardreader"), notifier);
add(m_cardpanel.getComponent(), BorderLayout.CENTER);
jlblMessage.setText(null);
// jlblMessage.setText(AppLocal.getIntString("message.nocardreader"));
}
}
示例9: addTabPayment
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
protected void addTabPayment(JPaymentCreator jpay) {
if (app.getAppUserView().getUser().hasPermission(jpay.getKey())) {
JPaymentInterface jpayinterface = payments.get(jpay.getKey());
if (jpayinterface == null) {
jpayinterface = jpay.createJPayment();
payments.put(jpay.getKey(), jpayinterface);
}
jpayinterface.getComponent().applyComponentOrientation(getComponentOrientation());
m_jTabPayment.addTab(
AppLocal.getIntString(jpay.getLabelKey()),
new javax.swing.ImageIcon(getClass().getResource(jpay.getIconKey())),
jpayinterface.getComponent());
}
}
示例10: JPaymentCashPos
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
/** Creates new form JPaymentCash */
public JPaymentCashPos(JPaymentNotifier notifier, DataLogicSystem dlSystem) {
m_notifier = notifier;
initComponents();
m_jTendered.addPropertyChangeListener("Edition", new RecalculateState());
m_jTendered.addEditorKeys(m_jKeys);
String code = dlSystem.getResourceAsXML("payment.cash");
if (code != null) {
try {
ScriptEngine script = ScriptFactory.getScriptEngine(ScriptFactory.BEANSHELL);
script.put("payment", new ScriptPaymentCash(dlSystem));
script.eval(code);
} catch (ScriptException e) {
MessageInf msg = new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.cannotexecute"), e);
msg.show(this);
}
}
}
示例11: initComponents
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jLabel2 = new javax.swing.JLabel();
m_jName = new javax.swing.JTextField();
setLayout(null);
jLabel2.setText(AppLocal.getIntString("Label.Name")); // NOI18N
add(jLabel2);
jLabel2.setBounds(20, 20, 80, 15);
add(m_jName);
m_jName.setBounds(100, 20, 200, 19);
}
示例12: readWeight
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
public Double readWeight() throws ScaleException {
if (m_scale == null) {
throw new ScaleException(AppLocal.getIntString("scale.notdefined"));
} else {
Double result = m_scale.readWeight();
if (result == null) {
return null; // Canceled by the user / scale
} else if (result.doubleValue() < 0.002) {
// invalid result. nothing on the scale
throw new ScaleException(AppLocal.getIntString("scale.invalidvalue"));
} else {
// valid result
return result;
}
}
}
示例13: init
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
protected void init() {
row = new Row(
new Field("ID", Datas.STRING, Formats.STRING),
new Field(AppLocal.getIntString("Label.Name"), Datas.STRING, Formats.STRING, true, true, true)
);
Table table = new Table(
"ATTRIBUTESET",
new PrimaryKey("ID"),
new Column("NAME"));
lpr = row.getListProvider(app.getSession(), table);
spr = row.getSaveProvider(app.getSession(), table);
editor = new AttributeSetsEditor(dirty);
}
示例14: changePassword
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
public static String changePassword(Component parent) {
// Show the changePassword dialogs but do not check the old password
String sPassword = JPasswordDialog.showEditPassword(parent,
AppLocal.getIntString("Label.Password"),
AppLocal.getIntString("label.passwordnew"),
new ImageIcon(Hashcypher.class.getResource("/com/openbravo/images/password.png")));
if (sPassword != null) {
String sPassword2 = JPasswordDialog.showEditPassword(parent,
AppLocal.getIntString("Label.Password"),
AppLocal.getIntString("label.passwordrepeat"),
new ImageIcon(Hashcypher.class.getResource("/com/openbravo/images/password.png")));
if (sPassword2 != null) {
if (sPassword.equals(sPassword2)) {
return Hashcypher.hashString(sPassword);
} else {
JOptionPane.showMessageDialog(parent, AppLocal.getIntString("message.changepassworddistinct"), AppLocal.getIntString("message.title"), JOptionPane.WARNING_MESSAGE);
}
}
}
return null;
}
示例15: init
import com.openbravo.pos.forms.AppLocal; //导入依赖的package包/类
protected void init() {
row = new Row(
new Field("ID", Datas.STRING, Formats.STRING),
new Field(AppLocal.getIntString("Label.Name"), Datas.STRING, Formats.STRING, true, true, true)
);
Table table = new Table(
"ATTRIBUTE",
new PrimaryKey("ID"),
new Column("NAME"));
lpr = row.getListProvider(app.getSession(), table);
spr = row.getSaveProvider(app.getSession(), table);
editor = new AttributesEditor(dirty);
}