Skip to content
This repository has been archived by the owner on Feb 20, 2022. It is now read-only.

Commit

Permalink
fixing journal for discounted items and try to get office handling be…
Browse files Browse the repository at this point in the history
…tter
  • Loading branch information
anti43 committed Jan 11, 2013
1 parent b4c49f4 commit 045ee7a
Show file tree
Hide file tree
Showing 15 changed files with 1,294 additions and 1,234 deletions.
33 changes: 16 additions & 17 deletions src/enoa/connection/NoaConnection.java
Expand Up @@ -54,6 +54,7 @@ public class NoaConnection {
* Indicates a remote OO installation.
*/
public static final int TYPE_REMOTE = 1;
public static volatile boolean officeAvailable = false;

/*
* Define the native dll /so path
Expand Down Expand Up @@ -88,13 +89,14 @@ public static void killConnection() {
}
}
}

} catch (Exception e) {
Log.Debug(NoaConnection.class, e.getMessage());
} finally {
YabsViewProxy.instance().setWaiting(false);
YabsViewProxy.instance().setProgressReset();
YabsViewProxy.instance().showOfficeStatus(false, "");

officeAvailable = false;
}
}
protected static IOfficeApplication officeAplication;
Expand Down Expand Up @@ -124,12 +126,9 @@ public synchronized static NoaConnection getConnection() throws Exception {
YabsViewProxy.instance().setWaiting(true);
YabsViewProxy.instance().setProgressRunning(true);
Notificator.raiseNotification(Messages.OO_WAITING, false);
if (LocalSettings.getBooleanProperty(LocalSettings.OFFICE_USE) && (LocalSettings.hasProperty(LocalSettings.OFFICE_HOST) || LocalSettings.hasProperty(LocalSettings.OFFICE_HOME))) {
cachedConnection = new NoaConnection(LocalSettings.getBooleanProperty(LocalSettings.OFFICE_REMOTE) ? LocalSettings.getProperty(LocalSettings.OFFICE_HOST) : LocalSettings.getProperty(LocalSettings.OFFICE_HOME), LocalSettings.getBooleanProperty(LocalSettings.OFFICE_REMOTE) ? Integer.valueOf(LocalSettings.getProperty(LocalSettings.OFFICE_PORT)) : 0);
Notificator.raiseNotification(Messages.OO_DONE_LOADING, false);
} else {
throw new UnsupportedOperationException(Messages.OO_NOT_CONFIGURED.getValue());
}
cachedConnection = new NoaConnection(LocalSettings.getBooleanProperty(LocalSettings.OFFICE_REMOTE) ? LocalSettings.getProperty(LocalSettings.OFFICE_HOST) : LocalSettings.getProperty(LocalSettings.OFFICE_HOME), LocalSettings.getBooleanProperty(LocalSettings.OFFICE_REMOTE) ? Integer.valueOf(LocalSettings.getProperty(LocalSettings.OFFICE_PORT)) : 0);
officeAvailable = true;
Notificator.raiseNotification(Messages.OO_DONE_LOADING, false);
} catch (Exception ex) {
mpv5.logging.Log.Debug(ex);
Notificator.raiseNotification(Messages.OOCONNERROR + " \n" + ex, true);
Expand Down Expand Up @@ -197,7 +196,7 @@ private synchronized boolean createServerConnection(String host, int port) throw
configuration.put(IOfficeApplication.APPLICATION_ARGUMENTS_KEY, String.valueOf(port));

officeAplication =
OfficeApplicationRuntime.getApplication(configuration);
OfficeApplicationRuntime.getApplication(configuration);
officeAplication.setConfiguration(configuration);
try {
officeAplication.activate(Notificator.getOfficeMonitor());
Expand Down Expand Up @@ -337,15 +336,15 @@ public void run() {
protected static String[] getOOArgs(String path, int port) {
String b = LocalSettings.getProperty(LocalSettings.OFFICE_BINARY_FOLDER);
return new String[]{path.replace("\\", "\\\\") + File.separator + (b == null || b.equals("null") ? "program" : b) + File.separator + "soffice",
"--headless",
"--nofirststartwizard",
(GlobalSettings.getBooleanProperty("org.openyabs.exportproperty.invisibleofficeserver", true) ? "--invisible" : ""),
"--norestore",
"--nolockcheck",
"--nocrashreport",
"--nodefault",
(Main.osIsWindows ? "--accept=socket,host=0.0.0.0,port=" + port + ";urp;StarOffice.Service"
: "--accept='socket,host=0.0.0.0,port=" + port + ";urp;StarOffice.Service'")};
"--headless",
"--nofirststartwizard",
(GlobalSettings.getBooleanProperty("org.openyabs.exportproperty.invisibleofficeserver", true) ? "--invisible" : ""),
"--norestore",
"--nolockcheck",
"--nocrashreport",
"--nodefault",
(Main.osIsWindows ? "--accept=socket,host=0.0.0.0,port=" + port + ";urp;StarOffice.Service"
: "--accept='socket,host=0.0.0.0,port=" + port + ";urp;StarOffice.Service'")};
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/enoa/connection/NoaConnectionLocalServer.java
Expand Up @@ -62,6 +62,7 @@ public synchronized static NoaConnection getConnection() {
if (cachedConnection == null) {
try {
cachedConnection = new NoaConnectionLocalServer(LocalSettings.getProperty(LocalSettings.OFFICE_HOST), Integer.valueOf(LocalSettings.getProperty(LocalSettings.OFFICE_PORT)));
NoaConnection.officeAvailable=true;
} catch (Exception ex) {
mpv5.logging.Log.Debug(ex);//Logger.getLogger(NoaConnection.class.getName()).log(Level.SEVERE, null, ex);
YabsViewProxy.instance().addMessage(Messages.OOCONNERROR + "\n" + ex, Color.RED);
Expand Down
2 changes: 1 addition & 1 deletion src/mpv5/Main.java
Expand Up @@ -877,7 +877,7 @@ public void run() {
}
}

if (LocalSettings.getBooleanProperty(LocalSettings.OFFICE_AUTOSTART)) {
if (LocalSettings.getBooleanProperty(LocalSettings.OFFICE_AUTOSTART)&& LocalSettings.getBooleanProperty(LocalSettings.OFFICE_USE)) {
Runnable runnable2 = new Runnable() {
@Override
public void run() {
Expand Down
6 changes: 3 additions & 3 deletions src/mpv5/db/common/Context.java
Expand Up @@ -216,9 +216,9 @@ public class Context implements Serializable {
+ IDENTITY_ITEMS + "." + "netvalue,"
+ IDENTITY_ITEMS + "." + "taxvalue, "
+ IDENTITY_ITEMS + "." + "datetodo";
public static String DETAILS_JOURNAL = Context.IDENTITY_ITEMS + "." + "IDS," + Context.IDENTITY_CONTACTS + "." + "cname," + Context.IDENTITY_CONTACTS + "." + "prename," + Context.IDENTITY_CONTACTS + "." + "street," + Context.IDENTITY_CONTACTS + "." + "city," + Context.IDENTITY_CONTACTS + "." + "country," + Context.IDENTITY_ITEMS + "." + "{date}," + Context.IDENTITY_GROUPS + "." + "CNAME," + Context.IDENTITY_ACCOUNTS + "." + "cname," + Context.IDENTITY_ITEMS + "." + "CNAME," + Context.IDENTITY_ITEMS + "." + "inttype," + Context.IDENTITY_ITEMS + "." + "intstatus," + Context.IDENTITY_ITEMS + "." + "netvalue," + Context.IDENTITY_ITEMS + "." + "taxvalue, (" + Context.IDENTITY_ITEMS + "." + "netvalue +" + Context.IDENTITY_ITEMS + "." + "taxvalue -" + Context.IDENTITY_ITEMS + "." + "discountvalue)";
public static String DETAILS_JOURNAL2 = Context.IDENTITY_REVENUE + "." + "IDS," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_REVENUE + "." + "dateadded," + Context.IDENTITY_GROUPS + "." + "CNAME," + Context.IDENTITY_ACCOUNTS + "." + "cname," + Context.IDENTITY_REVENUE + "." + "CNAME," + Context.IDENTITY_REVENUE + "." + "ids," + Context.IDENTITY_REVENUE + "." + "ispaid," + Context.IDENTITY_REVENUE + "." + "netvalue, (" + Context.IDENTITY_REVENUE + "." + "brutvalue-" + Context.IDENTITY_REVENUE + "." + "netvalue)," + Context.IDENTITY_REVENUE + "." + "brutvalue";
public static String DETAILS_JOURNAL3 = Context.IDENTITY_EXPENSE + "." + "IDS," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_EXPENSE + "." + "{date}," + Context.IDENTITY_GROUPS + "." + "CNAME," + Context.IDENTITY_ACCOUNTS + "." + "cname," + Context.IDENTITY_EXPENSE + "." + "CNAME," + Context.IDENTITY_EXPENSE + "." + "ids," + Context.IDENTITY_EXPENSE + "." + "ispaid," + Context.IDENTITY_EXPENSE + "." + "netvalue, (" + Context.IDENTITY_EXPENSE + "." + "brutvalue-" + Context.IDENTITY_EXPENSE + "." + "netvalue)," + Context.IDENTITY_EXPENSE + "." + "brutvalue";
public static String DETAILS_JOURNAL = Context.IDENTITY_ITEMS + "." + "IDS," + Context.IDENTITY_CONTACTS + "." + "cname," + Context.IDENTITY_CONTACTS + "." + "prename," + Context.IDENTITY_CONTACTS + "." + "street," + Context.IDENTITY_CONTACTS + "." + "city," + Context.IDENTITY_CONTACTS + "." + "country," + Context.IDENTITY_ITEMS + "." + "{date}," + Context.IDENTITY_GROUPS + "." + "CNAME," + Context.IDENTITY_ACCOUNTS + "." + "cname," + Context.IDENTITY_ITEMS + "." + "CNAME," + Context.IDENTITY_ITEMS + "." + "inttype," + Context.IDENTITY_ITEMS + "." + "intstatus,(" + Context.IDENTITY_ITEMS + "." + "netvalue-" + Context.IDENTITY_ITEMS + "." + "discountvalue)," + Context.IDENTITY_ITEMS + "." + "taxvalue, (" + Context.IDENTITY_ITEMS + "." + "netvalue +" + Context.IDENTITY_ITEMS + "." + "taxvalue -" + Context.IDENTITY_ITEMS + "." + "discountvalue),"+ Context.IDENTITY_ITEMS + "." + "discountvalue";
public static String DETAILS_JOURNAL2 = Context.IDENTITY_REVENUE + "." + "IDS," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_REVENUE + "." + "dateadded," + Context.IDENTITY_GROUPS + "." + "CNAME," + Context.IDENTITY_ACCOUNTS + "." + "cname," + Context.IDENTITY_REVENUE + "." + "CNAME," + Context.IDENTITY_REVENUE + "." + "ids," + Context.IDENTITY_REVENUE + "." + "ispaid," + Context.IDENTITY_REVENUE + "." + "netvalue, (" + Context.IDENTITY_REVENUE + "." + "brutvalue-" + Context.IDENTITY_REVENUE + "." + "netvalue)," + Context.IDENTITY_REVENUE + "." + "brutvalue, 0";
public static String DETAILS_JOURNAL3 = Context.IDENTITY_EXPENSE + "." + "IDS," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_GROUPS + "." + "reserve2," + Context.IDENTITY_EXPENSE + "." + "{date}," + Context.IDENTITY_GROUPS + "." + "CNAME," + Context.IDENTITY_ACCOUNTS + "." + "cname," + Context.IDENTITY_EXPENSE + "." + "CNAME," + Context.IDENTITY_EXPENSE + "." + "ids," + Context.IDENTITY_EXPENSE + "." + "ispaid," + Context.IDENTITY_EXPENSE + "." + "netvalue, (" + Context.IDENTITY_EXPENSE + "." + "brutvalue-" + Context.IDENTITY_EXPENSE + "." + "netvalue)," + Context.IDENTITY_EXPENSE + "." + "brutvalue, 0";
public static String DETAILS_HISTORY = getHistory().getDbIdentity() + ".ids, " + getHistory().getDbIdentity() + ".cname, " + getHistory().getDbIdentity() + ".username, " + Context.getGroup().getDbIdentity() + ".cname," + Context.getHistory().getDbIdentity() + ".dateadded";
public static String DETAILS_FILES_TO_CONTACTS = Context.getFiles().getDbIdentity() + ".cname," + getFilesToContacts().getDbIdentity() + ".cname, " + Context.getFiles().getDbIdentity() + ".dateadded," + Context.getFilesToContacts().getDbIdentity() + ".description," + Context.getFilesToContacts().getDbIdentity() + ".intsize," + Context.getFilesToContacts().getDbIdentity() + ".mimetype";
public static String DETAILS_FILES_TO_ITEMS = Context.getFiles().getDbIdentity() + ".cname," + getFilesToItems().getDbIdentity() + ".cname, " + Context.getFiles().getDbIdentity() + ".dateadded," + Context.getFilesToItems().getDbIdentity() + ".description," + Context.getFilesToItems().getDbIdentity() + ".intsize," + Context.getFilesToItems().getDbIdentity() + ".mimetype";
Expand Down
2 changes: 1 addition & 1 deletion src/mpv5/globals/Constants.java
Expand Up @@ -30,7 +30,7 @@ public interface Constants {
*
* Full Version number
*/
public static final String VERSION = "Yabs-1.2-Beta2";
public static final String VERSION = "Yabs-1.2-Beta3";

/**
* The original database version of this release
Expand Down
2 changes: 1 addition & 1 deletion src/mpv5/globals/Headers.java
Expand Up @@ -16,7 +16,7 @@ public enum Headers {
FILE_REFERENCES(new String[]{"Internal ID", "Filename", "Date", "Description", "Size", "Type"}),
HISTORY(new String[]{"Internal ID", "Description", "User", "Group", "Date"}),
IMPORT(new String[]{"Internal ID", "Import", "Type", "Name", "Data"}),
JOURNAL(new String[]{"Internal ID", "Name", "Surname", "Street", "City", "Country", "Date", "Group", "Account", "Number", "Type", "Status", "Net", "Tax","Brut","Revenue"}),
JOURNAL(new String[]{"Internal ID", "Name", "Surname", "Street", "City", "Country", "Date", "Group", "Account", "Number", "Type", "Status", "Net", "Tax","Brut","Revenue", "Discount"}),
TRASHBIN(new String[]{"Type", "Internal ID", "Description"}),
PRODUCT_DEFAULT(new String[]{"Internal ID", "Name", "Number", "Description"}),
SUBITEMS(new String[]{"Internal ID", "Nr", "Count", "Measure", "Text", "Netto Price", "Tax Rate", "Total Price", "Tax value", "Net 2", "Product ID", "A", "C", "Link", "Optional", "Discount", "Discount Value"}),
Expand Down
5 changes: 3 additions & 2 deletions src/mpv5/resources/languages/Panels.properties
Expand Up @@ -1980,7 +1980,7 @@ wizard_Toolbar1.jButton2.text=Save
wizard_Toolbar1.jLabel1.text=Script
wizard_Toolbar1.name._Label=Name
JournalPanel.jPanel5.TabConstraints.tabTitle=Contact Overview
JournalPanel.taxVolume._Label=Tax
JournalPanel.taxVolume._Label=Volume Tax
JournalPanel.volumeBrutto._Label=Volume Brut
JournalPanel.volumeNetto._Label=Volume Net
JournalPanel.revenueNetto._Label=Revenue Net
Expand All @@ -2005,9 +2005,10 @@ JournalPanel.filterinvoice.text=Unpaid Invoices
JournalPanel.filternone.text=None
JournalPanel.jPanel10.border.title=Filter
ControlPanel_External.jButton6.text=Let Yabs decide
ControlPanel_External.jCheckBox4.text=Start Office automatically
MPView.jMenuItem50.text=Change language from file
ContactPanel.filetab.TabConstraints.tabTitle=Files
ProductOrderPanel.groupnameselect._Label=Group
ControlPanel_Formats.minstart._Label=Min. Start
ControlPanel_Formats.positionstart._Label=Position
ControlPanel_External.auto.text=Start Office automatically
JournalPanel.volumeDiscount._Label=Volume Discount
12 changes: 6 additions & 6 deletions src/mpv5/ui/dialogs/subcomponents/ControlPanel_External.form
Expand Up @@ -57,7 +57,7 @@
</Group>
<Component id="jCheckBox1" alignment="1" pref="497" max="32767" attributes="0"/>
<Component id="jCheckBox2" alignment="1" pref="497" max="32767" attributes="0"/>
<Component id="jCheckBox4" alignment="0" pref="501" max="32767" attributes="0"/>
<Component id="auto" alignment="0" pref="501" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel3" min="-2" max="-2" attributes="0"/>
Expand Down Expand Up @@ -90,7 +90,7 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="jCheckBox2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jCheckBox4" min="-2" max="-2" attributes="0"/>
<Component id="auto" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jButton6" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="14" max="32767" attributes="0"/>
Expand Down Expand Up @@ -187,15 +187,15 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton6ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JCheckBox" name="jCheckBox4">
<Component class="javax.swing.JCheckBox" name="auto">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="mpv5/resources/languages/Panels.properties" key="ControlPanel_External.jCheckBox4.text" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
<ResourceString bundle="mpv5/resources/languages/Panels.properties" key="ControlPanel_External.auto.text" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
</Property>
<Property name="name" type="java.lang.String" value="jCheckBox4" noResource="true"/>
<Property name="name" type="java.lang.String" value="auto" noResource="true"/>
</Properties>
<Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="jCheckBox4ItemStateChanged"/>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="autoItemStateChanged"/>
</Events>
</Component>
</SubComponents>
Expand Down

0 comments on commit 045ee7a

Please sign in to comment.