Fork Of OpenbravoPOS, Android, And The Wave of Technology !

There is some fork of OpenbravoPOS, the one that really good fork is unicentaopos, you can download it from sourceforge. Since this is new additional code, the author still not release the code when i wrote this article. Yet, the license for UnicentaoPOS still using GPL, some the improvement including icon user interface, employee attendance, shift in shift out. The standard operation of OpenbravoPOS still exist inside the UnicentaoPOS.

There is some adjustment should apply to OpenbravoPOS, since the development this POS no longer active in source forge anymore, many people create fork of OpenbravoPOS. One main reason it became harder to maintain is, there is modularity but the module bay is not provided inside of OpenbravoPOS, so if people want to change the user interface, they need hard coding to implement it.

I have seen it on Youtube OpenbravoPOS can run also in Android, well that would be extended deployment, since the code build on java, there are more tweak to deploy OpenbravoPOS under Android Operating System. Because Android protect the jar deployment inside Android APK. You need to wrap the OpenbravoPOS jar file and their library into Android APK file, so from there you can install the OpenbravoPOS into Android Apps.

Next year and many years to come, the mobile computing would be increased, and many desktop pc would be transform into ultra portable computer, and touch screen would be the standard of the computer environment. So, Android still make more impact for the wave of the computing transformation, i have no doubt, iPad is the first wave then Android is the next wave, while windows 8 still to be the next wave again, but with the adoption of Android and because Android is wider open of the source it is became more available for the industry to test out and invest for  the next mobile computing, welcome to unix family.

See you around to 2013, Happy New Year 2013, make it happen ! Cheers.

Posted in OpenbravoPOS | Leave a comment

Download OpenbravoPOS Manage Report

You need to manage report outside OpenbravoPOS, you need to get summary result of sales transaction, how many product, which top ten item has been sold, you need it, because you want to know which item that really love by customer.

This is the OBPOSManage Report that can provide the summary, top ten sold item, total amount of each category, the report written using Delphi. The code still not release by webceraton, but it could be in the near future.


How to use it ?

First of all, extract the zip file that you have been download from here, then read the readme.txt file, after you read and understand the language, open the config.txt. You need to set Database = fill with your current openbravopos schema name.

OBPOS Manage Report, Summary Report

Top Sales Item Report, CSV Report

OBPOSManage using MySQL database to work, so you should be better using MySQL in order to work with this program. To get the summary report, just click the menu Preview to see the result display in grid, and set the start date of your transaction that you want to get, and also set the end date of your POS transaction.

After you set the date, click OK, the OBPOSManage program will process the calculation of report, and processing top ten or the most moving item in POS. The result will display in the preview report, and from this report you can print, using the general printer.

Saving summary report is possible using menu save to excel csv file. The process to produce report is almost the same with preview report. The different is, after process finish, you will be asking to provide the path, where do you want to put CSV file. You can put the report in USB or flashdisk. So, it is valuable if your computer or POS at your store only once.
Download OBPOSManage click here.

If you any question regarding this program just post comment or ask support post in comment form, so other people can learn from it also. Enjoy the program.

Posted in Download, OpenbravoPOS | Tagged , , | Leave a comment

How To Install Delphi Jedi JVCL JCL ?

I still love free component from Delphi JEDI JVCL, JCL as one of the component contributor, i wrote this tutorial to give short guide how to install JVCL 3 to Delphi using JEDI Installer.

You can install JCL first, because JVCL has dependecies to JCL, go to JCL folder then run install.bat, you can also type from command prompt of windows:

Run install.bat in jcl folder

After you run install.bat at JCL folder the new JEDI Installer window will open and pop up to your scree, you can see the list of configuration under the tree menu.

If your computer using Delphi 7, the JEDI Installer will detect the Delphi and will put the Delphi as tab, so you can choose that, then click install button.

Inside of Delphi tab at JEDI Installer, there are installation log, BPL Path, DCP Path, for now, let this path as default, or if you already familiar with Delphi, you can set this Path to different disk or folder. If you think the folder is Ok then just klik Install. Then, you will be asked that you really want to install the selected features ? just click Yes.

Note: Please note, that after or you click Yes, if you have Delphi already running under windows, please close the Delphi first, or the installation will note continue. If you have more than one Delphi version installed in your computer, make sure if you don’t want to install to another Delphi, just uncheck the option in the Delphi tab of JEDI Installer.

Then, the screen progress of compiling JCL library will pop up, and will show the progress of compilation.

Progress of JEDI Installer  After the compilation success, the you should install JVCL, because it has      dependencies to JCL. Now, go to JVCL folder and still using command prompt, type    install. bat. Now, it is the JVCL installation pop up dialog will show up, and you need  to read the mozilla license, then click next, the default option to install or upgrade  already set, then click next. You will the options of the installation, for now, let is as  default and just click next. In the select packages you will see the options and many  package that you want to install, just choose or select all or do nothing, just click  next.

Finally, is the summary of the installation that will do forward, if you don’t have  anything to changes, just click Install.

The progression of JVCL installation will show you, the progress of compilation JVCL. Just wait, untill all progress has finished, then click finish. Now you can open up Delphi to see the JVCL has been installed. Cheers.

Posted in Tutorial | Tagged , , | Leave a comment

Openbravopos How To Suspend Transaction

Do you think you need suspend transaction feature in OpenbravoPOS ?

I found some user asking how to suspend transaction in openbravoPOS, in the original version there is no suspend transaction feature. The case that i found is, Customer came to Cafe and order some coffee, bread, and other item, then they said hold the bill, i will order more later. The question mark is can OpenbravoPOS handle transaction like this ?

I would glad to answer Yes for sure. I just made some changes that would be capture suspend transaction, edit suspend transaction, and close suspend transaction, and the user would be happy to see this.

 

Posted in OpenbravoPOS, Tutorial | Tagged | Leave a comment

Add Virtual Column To DBGrid

Goal : add virtual column in the left side of DBGrid component.

Why we need to add virtual column, from user experience, they need to identify how many row in the DBGrid. You can solve this using row color to differentiate between even and odd row.

In fact, when there are so many approach, to add virtual column is the close approach to this, without too much code, without changing database structure. Here is the step to do that, what we gonna do is using ZeosDB vcl component, drop TZConnection, drop TZQuery or you can use TZTable. I am using MySQL database here, and create table let say item with the structure as follow:

create item (
ID int(10),
itemname varchar(255) );

After you setup necessary properties for TZConnection, TZQuery or TZTable, add one virtual field to TZQuery or TZTable. Right click on TZQuery or TZTable, open up Field Editor.

add new field, in this example i create vRowNumber, with integer as data type, and choose calculated data.Why we choose as calculated data, because we want to assign new value to field vRowNumber each time the the OnCalc event has triggered. Delphi know very well when onCalc should be call. Here is the code :

procedure Tdm.productCalcFields(DataSet: TDataSet);
begin
productvRowNumber.AsInteger := product.RecNo;
end;

Look at the code above, virtual field vRowNumber from table product is assigned by value from method RecNo. Method RecNo will returning exact value of record number for each row in product table.

The picture at above is the result from virtual field, column Row is the representation of vRowNumber field, which is the value assigned from product.RecNo.

Note: What i am trying to show here is the one way approach, and the value from virtual field vRowNumber will not stored to database, because the goal is we do not need to add new field in item table, because i do not want to changes the database structure only to show the row number. If you want to run the MySQL script when updating client database, you can use ZeosDB component’s TZSQLProcessor. TZSQLProcessor is the VCL component to run script orSQL complex command inside Delphi. I am never test this ZeosDB using Open Source Pascal IDE such as Lazarus.

By using this approach the complexity of updating the database’s structure has been reduce, and also the code to assign row number calculation became very simple. In the next tutorial i will introduce also and write about how to use TZSQLProcessor to work with MysQL database. Remember, you became more understand if you practice more and more.

Posted in Tutorial | Leave a comment

PHP MySQL Query Case Sensitive

MySQL is the database that will differentiate between lowercase and uppercase fieldname, if you define the field name using lowercase then you should follow the lowercase field name in your programming code. In PHP there are no error found if you access the fieldname using lowercase or uppercase, instead the result will not display or blank result. In order to describe this code in programming, i will create an example below,

create table webuser( ‘NAME’ varchar(100) );
Now access this table in your PHP,
$result = mysql_query(” select name from webuser”) or die(mysql_error());
echo “Name :”. $result['name'];

The result:
Name:

The code at above will not produce error in PHP even you put the die or error trap. This might be will be solve in next PHP version ( PHP6 or next version ). But for the PHP5 and below, you should be carefull using lowercase or uppercase, or putting mistype of fieldname using lowercase or uppercase.

Posted in Review, Tutorial | Tagged | Leave a comment

Extract, Decode, Insert, PHP And MySQL Date Time

I am delphi programmer, in Delphi i use Now() to get the current datetime, how about in PHP ? In PHP getdate() will similar with Delphi Now() function, and in PHP we get the simple way to extract the year, day, and month. Let’s take a look a sample below:
<?
  $currentDate = getdate();
$dateRegistered = $currentDate[year].’-’.$currentDate[mon].’-’.$currentDate[mday];
$timeRegistered = $currentDate[hours].’:’.$currentDate[minutes];
echo(“date : “.$dateRegistered);
echo(“ time : “.$timeRegistered);
?>

the code at above will show in browser looks like,
date : 2008-8-3
time : 21:42

And from the PHP documentation the getdate() function will returning array contains ten element.
[seconds] – seconds
[minutes] – minutes
[hours] – hours
[mday] – day of the month
[wday] – day of the week
[year] – year
[yday] – day of the year
[weekday] – name of the weekday
[month] – name of the month

Here is the array of returning variable structure, the number represent in these array only to illustrate the array.
Array
(
[seconds] => 30
[minutes] => 10
[hours] => 15
[mday] => 20
[wday] => 5
[mon] => 4
[year] => 2008
[yday] => 4
[weekday] => Tuesday
[month] => January
[0] => 1122110888
).

Another Way to Insert Date to MySql Date field through PHP should someting like this,
$year = $_POST['year']; $month = $_POST['month']; $day = $_POST['day'];
$birthdate = date($year.”-”.$month.”-”.$day);
mysql_query( “INSERT INTO person( birthdate ) VALUES( ‘$birthdate’ ) ” );

And, finally to insert current date and time to MySQL should something like this,
mysql_query( “INSERT INTO person(date_signin,time_signin) VALUES( current_date,current_time ) ” );

If you want to set default timestamp at MySQL field, just use timestamp as default value when creating the
table, here is the sample create table person( timestamp timestamp default CURRENT_TIMESTAMP );
you can write CURRENT_TIMESTAMP as lowercase or uppercase when the table creation.

Posted in Review, Tutorial | Leave a comment

if elseif endif with colon :

Colon in PHP is not just as ternary operator, but it applied as part of control structure for conditional structure
such as if…elseif….endif, for..endfor, it became human readable instead of using brace open { and close
brace }, here is the sample:

/* Correct Method: */
if($a > $b):
echo $a.” is greater than “.$b;
elseif($a == $b): // Note the combination of the words.
echo $a.” equals “.$b;
else:
echo $a.” is neither greater than or equal to “.$b;
endif;
Here is the control structure that can be use with colon :
CS | (ending) KEYWORD
—————–|—————–
if() | endif
for() | endfor
while() | endwhile
foreach() | endforeach
switch() | endswitch

You need to practice in order to remember these code, and doing test, the code will not stuck in your mind, until you practice with it.

Posted in Review, Tutorial | Tagged | Leave a comment

JavaScript Going Nowhere ?

JavaScript would be usefull to validate user entry to fill the form, because it validate in user browser. But
becarefull when using JavaScript, one mistypo can make your JavaScript cannot run properly or JavaScript
going nowhere. Here is the simple code to why JavaScript will going nowhere,

function checkForm()
{
var cemail, cpassword1, cpassword2,cfirstname, clastname;
with(window.document.regform)
{
cemail = email;
cpassword1 = user_password;
cpassword2 = confirm_password;
< code continue….>
Now let see the html form

…..
…..
Have you notice which different name variable compare to variable in javascript?
Yes that’s true, in JavaScript there is line with code cpassword2 = confirm_password and in the form the
code is
Those mistype can make JavaScript will not work, but in web browser the form will appear normal, in fact
when user click submit form, the validation of JavaScript will not work or doesn’t make any effect. So
becarefull with mistype.
Some IDE provide debugging and check syntax, so you can safe your time when developing your web with
JavaScript.

Posted in Review, Tutorial | Tagged | Leave a comment

Download OpenbravoPOS Source Code Ingredients or Recipee

If you need to add more feature for openbravopos including ingredients process for recipee, this is the source to do that, please download using this link CLICK HERE or go to download category.

The ingredients process will effected to inventory control. Again, if any question or comment, please post to forum section, this is the only way to share with other developer or user which is using the openbravopos.

Posted in Download, OpenbravoPOS | 3 Responses

Download The Guideline To Add Supplier Form

I have been upload the pdf document regarding the guideline to add supplier form, please use this link CLICK HERE to download. Any comment or question regarding the content or you might be wondering about the content, please post to forum section.

Posted in Download | Tagged | Leave a comment

Part 1 : Add Suppliers form, StockIn process, StockReturn process

This is the part of my book that i am writing about Extending Openbravo POS.Openbravo POS lack of supplier information, so what end user need is the supplier, so they can add list of their supplier.

Work On It!

Create reason table, in order to create report that reflect the meaning of reason code on stockdiary table.

DROP TABLE IF EXISTS `openbravopos`.`reasons`;
CREATE TABLE  `openbravopos`.`reasons` (
`REASON` int(11) NOT NULL,
`NOTES` varchar(45) NOT NULL,
PRIMARY KEY (`REASON`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

All value contain in reason table following the code from file MovementReason.java class, here is the code

public static final MovementReason IN_PURCHASE = new MovementReason(+1, "stock.in.purchase");
public static final MovementReason IN_REFUND = new MovementReason(+2, "stock.in.refund");
public static final MovementReason IN_MOVEMENT = new MovementReason(+4, "stock.in.movement");
public static final MovementReason OUT_SALE = new MovementReason(-1, "stock.out.sale");
public static final MovementReason OUT_REFUND = new MovementReason(-2, "stock.out.refund");
public static final MovementReason OUT_BREAK = new MovementReason(-3, "stock.out.break");
public static final MovementReason OUT_MOVEMENT = new MovementReason(-4, "stock.out.movement");
public static final MovementReason OUT_CROSSING = new MovementReason(1000, "stock.out.crossing");


Create Stock History,

I need to have form to entry from date to date of stock history to print, then which category to print of stock history, in able to do that, I need to create as follow:

RECEIVE ITEM

Several field that should input into system when receive item transaction happen as follow
- Delivery Order Number
- Supplier
- Receive Date
( the other including , item name, and receiver name )
from OpenbravoPOS all details has been recorded in StockDiary table, we only need to add header of details, Contain( DO Number , Supplier Code, Receive Date, Receiver Name ) {

each of Stock In transaction which has been entered into Stock Maintenance, each item would be store as details, and they had unique ID in StockDiary table }.

Here is the sample of StockDiary Query

RETURNING ITEM (to supplier)
The information should be printed
- Return Number document
- Delivery Order Number when receiving item
- Return Date,
- Receive Date

Changes note on OpenbravoPOS

 

create stockin
DROP TABLE IF EXISTS `openbravopos`.`stockin`;

CREATE TABLE  `openbravopos`.`stockin` (

`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,

`DELIVERYORDER` varchar(255) NOT NULL,

`SUPPLIER` varchar(45) NOT NULL,

`NOTES` varchar(255) DEFAULT NULL,

`DATEIN` datetime NOT NULL,

PRIMARY KEY (`ID`)

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

 

We need to add table stockinstockdiarymap, in order not to change table stockdiary metadata.
DROP TABLE IF EXISTS `openbravopos`.`stockinstockdiarymap`;

CREATE TABLE  `openbravopos`.`stockinstockdiarymap` (

`ID` varchar255) NOT NULL,

`STOCKIN` varchar(255) NOT NULL,

`STOCKDIARY` varchar(255) NOT NULL,

PRIMARY KEY (`ID`)

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

now add interaction between openbravoPOS and this table stockin , I put some code inside these file, here the code snapshoot.

File InventoryRecord.java

-Change class Inventory Record, and add

/*@Eko Subagio add Delivery Order */

private String m_deliveryorder;

private String m_supplier;

private String m_notes;

-Change InventoryRecord class constructor, add

/*@Eko Subagio add Delivery Order */

public InventoryRecord(Date d, MovementReason reason, LocationInfo location,

String deliveryorder, String supplier, String notes,

List<InventoryLine> invlines) {

m_dDate = d;

m_reason = reason;

m_locationOri = location;

m_deliveryorder = deliveryorder;

m_supplier = supplier;

m_notes = notes;

m_invlines = invlines;

}

 

-Change and add field getter
public String getDeliveryOrder() {

return m_deliveryorder;

}

public String getSupplier(){

return m_supplier;

}

 

public String getNotes(){

return m_notes;

}

 

File DataLogicSales.Java

/*

*@Eko Subagio, add stockinDatas declaration

*

*/

stockinDatas = new Datas[] { Datas.STRING, Datas.TIMESTAMP, Datas.STRING, Datas.STRING, Datas.STRING};

 

/* add @Eko Subagio July 02,  2010*/

protected Datas[] stockinDatas;
/* add @eko subagio July 02, 2010

* PreparedSentence( s is session connection, sentence i SQL data manipulation,

*/

public final SentenceExec getStockInInsert() {

return new SentenceExecTransaction(s){

public int execInTransaction(Object params) throws BasicException {

return new PreparedSentence(s

,”INSERT INTO STOCKIN (ID, DATEIN, DELIVERYORDER, SUPPLIER, NOTES) VALUES(?, ?, ?, ?, ?)”

, new SerializerWriteBasicExt(stockinDatas, new int[]{0, 1, 2, 3, 4})).exec(params);

}

 

};

 

}

 

 

File StockManagement.Java
Add Label, and TextField for DeliveryOrder Number entry, Supplier Code, Notes
declare in top of variable declaration
/* @Eko Subagio

* store UUID for StockIn

*/

private String UUIDStockIn;

 

-Add parameter for method that call InventoryRec constructor, because we add new parameter
/*@Eko Subagio add Delivery Order */

String deliveryorder = m_jdonumber.getText();

String supplier = m_jsupplier.getText();

String notes = m_jnotes.getText();
saveData(new InventoryRecord(

d, MovementReason.OUT_MOVEMENT,

(LocationInfo) m_LocationsModel.getSelectedItem(),

/*@Eko Subagio add DeliveryOrder */

deliveryorder, supplier, notes,

m_invlines.getLines()

));

 

-Change saveData()
private void saveData(InventoryRecord rec) throws BasicException {

/*

* @ Eko Subagio

* save also StockIn Head, save UUID from stockin

*/

UUIDStockIn  = UUID.randomUUID().toString();

SentenceExec sentStockIn = m_dlSales.getStockInInsert();

sentStockIn.exec(new Object[] {

UUIDStockIn,

rec.getDate(),

rec.getDeliveryOrder(),

rec.getSupplier(),

rec.getNotes()

});

// A grabar.

SentenceExec sent = m_dlSales.getStockDiaryInsert();

 

for (int i = 0; i < m_invlines.getCount(); i++) {

InventoryLine inv = rec.getLines().get(i);

 

sent.exec(new Object[] {

UUID.randomUUID().toString(),

rec.getDate(),

rec.getReason().getKey(),

rec.getLocation().getID(),

inv.getProductID(),

inv.getProductAttSetInstId(),

rec.getReason().samesignum(inv.getMultiply()),

inv.getPrice()

});

}

 

// si se ha grabado se imprime, si no, no.

printTicket(rec);

}

NOW PROCESSING for table STOCKINSTOCKDIARYMAP
File DataLogicSales.java

 

-Add this declaration

protected Datas[] stockinstockdiarymapDatas;

 

-Add this method
/* add @eko subagio July 02, 2010

* to work with stockinstockdiarymap table

*/

public final SentenceExec getStockInStockDiaryMap() {

return new SentenceExecTransaction(s){

public int execInTransaction(Object params) throws BasicException {

return new PreparedSentence(s

,”INSERT INTO STOCKINSTOCKDIARYMAP(ID, STOCKIN, STOCKDIARY) VALUES(?, ?, ?)”

,new SerializerWriteBasicExt(stockinstockdiarymapDatas, new int[]{0, 1, 2})).exec(params);

}

};

}

File StockManagement.java

Variable Declaration
/* @Eko Subagio

* store UUID for StockIn

*/

private String m_UUIDStockIn;

private String m_UUIDStockInStockDiaryMap;

private String m_UUIDStockDiary;

Now, the declaration method of saveData() became like this:

private void saveData(InventoryRecord rec) throws BasicException {

/*

* @ Eko Subagio

* save also StockIn Head, save UUID from stockin

*/

m_UUIDStockIn  = UUID.randomUUID().toString();

SentenceExec sentStockIn = m_dlSales.getStockInInsert();

sentStockIn.exec(new Object[] {

m_UUIDStockIn,

rec.getDate(),

rec.getDeliveryOrder(),

rec.getSupplier(),

rec.getNotes()

});

 

/*@ Eko Subagio

* Declare variable for stockinstockdiarymap table

*/

 

//prepare query for insert

SentenceExec sentStockInStockDiaryMap = m_dlSales.getStockInStockDiaryMap();

// A grabar.

SentenceExec sent = m_dlSales.getStockDiaryInsert();

// Save lines of row stock

for (int i = 0; i < m_invlines.getCount(); i++) {

InventoryLine inv = rec.getLines().get(i);

 

/*@ Eko Subagio

* Declare variable for stockinstockdiarymap table

*/

m_UUIDStockInStockDiaryMap =  UUID.randomUUID().toString();

/*generate UUID for StockDiary ID column table and store it to m_UUIDStockDiary

so we can use it later for MAP with StockIn */

m_UUIDStockDiary = UUID.randomUUID().toString();

//execute now

sentStockInStockDiaryMap.exec(new Object[]{ m_UUIDStockInStockDiaryMap, m_UUIDStockIn, m_UUIDStockDiary });

 

sent.exec(new Object[] {

//UUID.randomUUID().toString(), <- original code from @Adrian Romero

m_UUIDStockDiary, //I @Eko Subagio change it to variable

rec.getDate(),

rec.getReason().getKey(),

rec.getLocation().getID(),

inv.getProductID(),

inv.getProductAttSetInstId(),

rec.getReason().samesignum(inv.getMultiply()),

inv.getPrice()

});

}

 

// si se ha grabado se imprime, si no, no.

printTicket(rec);

}

 

Add Clear Text Field method
/* @Eko Subagio July 02, 2010

* Clear text field

*

*/

private void clearTextField(){

m_jdocnumber.setText(“”);

m_jsupplier.setText(“”);

m_jnotes.setText(“”);

m_jdocnumber.setFocusable(true);

}

 

Add Supplier Form and Database Table
Create table suppliers
DROP TABLE IF EXISTS `openbravopos`.`suppliers`;

CREATE TABLE  `openbravopos`.`suppliers` (

`ID` varchar(255) NOT NULL,

`CODE` varchar(45) NOT NULL,

`NAME` varchar(100) NOT NULL,

`ADDRESS` varchar(255) NOT NULL,

PRIMARY KEY (`ID`)

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

How Display new JPanel in OpenbravoPOS ?

I just learn and follow the customers package to construct supplier package.

 

I create new package com.openbravo.pos.suppliers:

 

DataLogicSuppliers.java
SupplierInfo.java

SuppliersPanel.java

SuppliersView.java,

 

Some returning list to fill comboBoxList still not work, I just look at the simple code in Categories section and file how to fix it, and learn the simple way using

 

 

File DataLogicSales.java, with code
public final SentenceList getCategoriesList() {

return new StaticSentence(s

, “SELECT ID, NAME, IMAGE FROM CATEGORIES ORDER BY NAME”

, null

, CategoryInfo.getSerializerRead());

}

 

These code implemented in DataLogicSuppliers.java as follow

public final SentenceList getSupplierList() {

return new StaticSentence(s

, “SELECT ID, CODE, NAME, ADDRESS FROM SUPPLIERS ORDER BY NAME”

, null

, SupplierInfo.getSerializerRead());

}

 

File CategoryInfo.java with code,
public static SerializerRead getSerializerRead() {

return new SerializerRead() { public Object readValues(DataRead dr) throws BasicException {

return new CategoryInfo(dr.getString(1), dr.getString(2), ImageUtils.readImage(dr.getBytes(3)));

}};

}

 

These code implemented in SupplierInfo.java as follow

public static SerializerRead getSerializerRead() {

return new SerializerRead() { public Object readValues(DataRead dr) throws BasicException {

return new SupplierInfo(dr.getString(1), dr.getString(2), dr.getString(3), dr.getString(4));

}};

}
Implementation in file CategoriesEditor.java
m_sentcat = dlSales.getCategoriesList();

these code implemented in file StockManagement.java as follow

At private field StockManagement declaration

private SentenceList m_sentSuppliers;

private ComboBoxValModel m_SuppliersModel;

 

At Constructor StockManagement

m_sentSuppliers = m_dlSuppliers.getSupplierList();

m_SuppliersModel = new ComboBoxValModel();

 

At method StockManagement.activate()

public void activate() throws BasicException {

m_cat.loadCatalog();

java.util.List l = m_sentlocations.list();

m_LocationsModel = new ComboBoxValModel(l);

m_jLocation.setModel(m_LocationsModel); // para que lo refresque

m_LocationsModelDes = new ComboBoxValModel(l);

m_jLocationDes.setModel(m_LocationsModelDes); // para que lo refresque

 

/* @Eko Subagio July 02, 2010 */

java.util.List listSupplier = m_sentSuppliers.list();

m_SuppliersModel = new ComboBoxValModel(listSupplier);

m_jListSuplier.setModel(m_SuppliersModel);

 

stateToInsert();

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

jTextField1.requestFocus();

}

});

}

 

 

How To Get KeyID from ComboBox ?

you should implemented IKeyed for class, so you can get keyed.

At file SupplierInfo.java add as follow

public class SupplierInfo implements Serializable, IKeyed{

protected String id;

protected String supplierCode;

protected String name;

protected String address;

 

Override getKey method implementation, because getKey is abstract method, you should implemented in each class which use IKeyed.

 

public Object getKey(){

return id;

}

 

Then in implementation add,
String supplier = m_SuppliersModel.getSelectedKey().toString();
These code will assign ID key of the table as implemented on class you have been created which implement IKeyed for getKey.

 

 

How To Add Application Link To Menu?
Go to Maintenance

Roles, Administrator, add

<class name=”com.openbravo.pos.suppliers.SuppliersPanel”/>

Resources, Menu.Root, add under Title menu StockManagement
submenu.addPanel(“/com/openbravo/images/bookmark.png”, “Menu.Suppliers”, “com.openbravo.pos.suppliers.SuppliersPanel”);

 


JRootApp.java

Declare and put code to list the task to prepare session connection, prepare menu, etc.

 

All menu for each user assign from table roles column PERMISSION, this PERMISSION column contain BLOB XML configuration for each user, the menu assigned for each user define and stored here.

Using OpenbravoPOS to add menu, just click Maintenance, then click Resource, click Menu.Root, you will see the XML menu definition here.

File DataLogicAdmin.java
public final SentenceList getRolesList() {

return new StaticSentence(s

, “SELECT ID, NAME FROM ROLES ORDER BY NAME”

, null

, new SerializerReadClass(RoleInfo.class));

}

File DataLogicSystem.java
m_rolepermissions = new PreparedSentence(s, “SELECT PERMISSIONS FROM ROLES WHERE ID = ?” , SerializerWriteString.INSTANCE, SerializerReadBytes.INSTANCE);

 

Then how OpenbravoPOS construct roles.PERMISSION into menu and assigned it?
Using OpenbravoPOS to add menu, just click Maintenance, then click Resource, click Menu.Root, you will see the XML menu definition here.

This script menu calling java class that has been inherited from JPanel, JPanel encapsulated as field class member of java class.

Example for Customer Class:

 

Email

Password
Confirm Password
No Class File Notes
1 CustomerInfo.java adalah class base standard yang memiliki member ID, NAME
DataLogicCustomers.java adalah class yang mendefiniskan SQL Data Manipulation Language section.
CustomersView.java Adalah panel customer yang di extend dari JPanel.
CustomersPanel.java Adalah class yang membungkus class CustomerView.java, dan pendefinisan di XML menu script, memanggil class CustomersPanel untuk menampilkan customer data.

That’s all for now Part #1.

Posted in OpenbravoPOS | Tagged , | Leave a comment

The TicketLineInfo Class

Today i will answer the question from david, he asking me by sending me email to ask about dMultiplyUnits. dMultiplyUnits variable is the only variable which will store how much customer bought your product quantity.

The TicketLineInfo will capture all the transaction and process into structure database. Let’s look at the picture, that is the snapshoot of the DataLogicSales.java files,

dMultiplyUnits variable

dMultiplyUnits variable

Attention: please do not change the sign variable. Since the original one using signed, not unsigned. Example, do not change the original -dMultiplyUnits became dMultiplyUnits. Do not remove the minus ( – ) sign.

TicketLineInfo class contain variable that will hold each row of product in sales panel or cart shopping. It contain variable that will store the value of each column in item detail. Lets’s take a look at closer look of the variable inside of the TicketLineInfo Class.

public class TicketLineInfo implements SerializableWrite, SerializableRead, Serializable {
    private static final long serialVersionUID = 6608012948284450199L;
    private String m_sTicket;
    private int m_iLine;
    private double multiply; // total unit sold for each product
    private double price;
    private TaxInfo tax;
    private Properties attributes;
    private String productid;
    private String attsetinstid;

Please concern only to private variable multiply, price, productid. Those variable are very important for tracking sales and product inventory.

Let’s get back to dMultiplyUnits, this is variable that will store how many product in cart shopping or in sales bag. The value has assigned from private variable multiply, and to take the variable OpenbraboPOS using TicketLineInfo.getMultiply() method to get the value. We then use it to multiply the units of raw material inside the recipee in order to decrease the stock of raw material.

Posted in OpenbravoPOS, Tutorial | Tagged , | Leave a comment

Library for OpenbravoPOS, Netbeans Platform

If you are using Netbeans as favourite development of OpenbravoPOS, it is necessary to understand all library that will need by OpenbravoPOS.

Netbeans OpenbravoPOS Library

Netbeans OpenbravoPOS Library

Click the image on the left to see the larger view, if you found error, red notice inside netbeans, or when you press build and doing running test of OpenbravoPOS, it will happen sometimes, even your library is in the position of correct path, and correct list. All you need to do is to reassign these library.

How to reassign the library ?  select all library from project, you can do this by clicking in project name, right click, then click properties. After project’s library appear, click library, select all library, then click remove. After all library removed, you can add library again, it will refresh and Netbeans will rescan project code, let this work in background, then click OK.

That’s it, i ever found some weird result when doing these development, but after reattached library those issue has solved. I prefer using Netbeans for development, because it is simple and more convenient when editing java swing and java form. If you already familiar with C++ under C++ Builder or using Delphi development you will learn that using Netbeans is could similar. Yes, not all interface is similar, but, in terms of fast development of java form, using Netbeans is the answer.

There is database grid component for java, which is similar with DBGrid VCL in delphi, i think whoever works for java dbgrid component has been doing the great work for java community.

Posted in OpenbravoPOS, Tutorial | Leave a comment

Ingredients Code

To see the code inside of OpenbravoPOS, use Netbeans to open and edit the code, better using Netbeans 6.8 or latest version. Current release when this article created is version 7.0.

After you add new project base on source code inside Netbeans, and add proper library in order source doesn’t have warning error, go to DataLogicSales.java, and open it.

File DataLogicSales.java is located in com.openbravo.pos.forms, the picture of Netbeans code’s editor as follow:

Ingredients code inside Netbeans

Ingredients code inside Netbeans

The code will search, if ingredients of sold product exist or not in ingredients’s table. If exist, the code will processing to decrease current stock which has been define as recipee.

/*Update again for ingredients RAW_PRODUCT Stock
*Check if product exist in Ingredietns
* July 11, 2010 @eko subagio
*/
isProductIDExist = isIngredientsExist(l.getProductID());
//javax.swing.JOptionPane.showConfirmDialog(null, “ProductId Exist : “+isProductIDExist);
if(isProductIDExist == true){
//process product here to update in stock
java.util.List ingredientsList = getIngredientsList(l.getProductID());

//javax.swing.JOptionPane.showConfirmDialog(null, ” Return list ingredients: “+ingredientsList.toArray().toString());

for (IngredientsInfo info : ingredientsList){
// update the stock
getStockDiaryInsert().exec(new Object[] {
UUID.randomUUID().toString(), //0
ticket.getDate(), //1
l.getMultiply() < 0.0
? MovementReason.IN_REFUND.getKey()
: MovementReason.OUT_SALE.getKey(), //2 stock movement reason
location, //3
info.getProductId(), //4 product id from ingredients line
l.getProductAttSetInstId(), //5
((new Double( -info.getUnits()) ) * -dMultiplyUnits), //6 deduct stockcurrent with this getUnits
//multiply by total unit product sold in
//panel ticket
new Double( l.getPrice() ) //7
});
//debug
//javax.swing.JOptionPane.showConfirmDialog(null, ” DBG: Return list ingredients:
//”+ingredientsList.toArray().toString());
}
}

Notes: there are some remarks inside of it, also i remark the code for debugging purpose, to debug in better way is using the log, because i need to cut the debug time, i use inside message code to display if it is work or not. You can use better approach to make debugging more better from developer view.

Posted in OpenbravoPOS, Tutorial | Tagged | Leave a comment

New Forums

I have created new forums in order for the user of openbravo wondering how to use ingredients in openbravopos, also we can discuss the concept and if you found some error, or pushing the new feature you can put the question in the forums.

Note, i have limitation to interact with you, please use forum so other people can also read your issue.

For this time, i just put one topic to discuss, i want to focus only in this issue, since many email asking me regarding this ingredients with openbravopos. I think this is good feature for the store that care to their inventory. I have experience with the customer which run the store, their inventory sometimes not accurate with the manual counting, this is because an error came from human error, and put the wrong and implementation of the inventory system for the ingredients.

You can use it for your startup to capture inventory control, but you need to adjust it in order to work with your business process perfectly. Please be notice, before you put the code into production, you need to create the concept first, synchronize with the business process in your company, if there are need adjustment, do it exactly the same with your company’s business process.

There not perfect system for all issue, people can adjust to make it near to 100% the same with the actual and daily business process. System can adapt and extend to fulfill the daily business process, never surrender to make it came true with your goal.

Posted in Internet Marketing | Tagged | Leave a comment

How To Extend OpenbravoPOS With Ingredients ?

I have publish my code regarding to extend openbravopos in openbravo forums, also the guidance how to exploit and use the java code in order POS can work with ingredients.

Many of you could be wondering how it will work, or could be takes time to understand the java code inside of it, if you have any question regarding this issue, please submit your questions to info at webceraton.com, i will glad to help you to solve this issue.

In those code ingredients works as follow:

  1. Let say the case is to serve one cup of a coffee, then you need to define the ingredients for one cup of a coffee.
  2. Let assume, the ingredient will contain raw material base on a 1 gram sugar, 1 gram coffee.
  3. You need to define those recipee and put inside of the ingredients form.
  4. When the ingredients already setup, and the transaction one cup of a coffee punch into POS, the program will search product of cup of a coffee, if its found in ingredients table, it will search and cut the inventory quantity for sugar and coffee, and will decrease the quantity.
  5. All those process automatically done, when you already setup the ingredients, if you not setup the ingredients, it will not work, and will not decrease the inventory quantity.
Here is the concept:

Ingredients Concept Flow

Sure, you can extend also the code inside of the OpenbravoPOS, using netbeans. But you need to be carefull doing so.
You can read the details how to change the code of ingredients by reading my guidance in PDF format. You can search in openbravo forum regarding my documentation. I have highlight which one is importang in the guidance.

Posted in OpenbravoPOS, Tutorial | Tagged , , | Leave a comment

How To Make Online Shop ?

For starter business, should be wonder how to make online shop or something ?
Next questions would be, all right, i want to reduce cost to sell online, i found some vendor offering expensive software to online, well the answer is do not afraid to do online, or create online shop.

There more step to create online store, or online shop, first of all, what do you want to sell ? is it your own product, or you just want to have online store but the product is from your vendor ? It is up to your decision, but when you already decide to do selling online, just do it.

Ok, i have courage to do that, but how, i don’t understand to do it. Well, you need to read my experience as follow:

  1. When you already have idea to sell something online, buy the domain, domain is the name that customer can find you on the internet. Buy it, it cost you cheap.
  2. You need a hosting, hosting is the place for your domain to put your product data, price, and contact where customer can find you or find the product, you can put list of your product here also.
  3. When you already buy the domain and hosting, you need to setup the software to run your online business. You can use wordpress, joomla, magento or anything that will cost you free. And use their plugin, worpress has wp-ecommer plugin, joomla has virtuemart. Magento is very special to ecommerce.
  4. It’s ok, when free software has limitation, at least you just make great decision to do it, and not just wrote in your idea’s paper.
  5. For the payment from your online customer, you use paypal for start, but there are many online payment that you subscribe as business subscriber.
Finally, you need to advertise your online shop using google or other online advertiser, everything is in your hand to decide which one is effective to advertise your online shop. Advertising will create brand awareness, and increase traffic also to your online shop.
Posted in Business, Domains, Tutorial | Tagged , | Leave a comment

Happy New Year 2011, The New Beginning

As we leave 2010 with our plan and effort, now we challenge and we grab the opportunity on 2011 with joy and fun. We have seen the fast growing business of facebook and twitter in 2010, what will happen on 2011? the next techpreneur to challenge facebook and twitter.

Happy New Year 2011.

Posted in Internet Marketing | Leave a comment

Free Tutorial Website Design And Drawing Tutorial

For the novice or new to the web design, should be wondering, how to create a website, how to create great website, from where ? should the web create from notepad ? or from graphic ? All you need answer for all of your questions regarding website design could be answered to this article:

Designing A Highly-Professional Website, From the Sketch to the Code

I have design the website from many years, but it is worth to read from other people how they think about designing to the web, and it will give you more light bulb to design more and more.

Another worth graphic design to create sophisticated graphic using sketch or pecil would be to this article, it is more than one, yes it is 50 Awesome Graphic Tutorial, here is the title and the link:

50 Awesome Drawing Tutorials

Have a great look and learn, keep on fighting for your greatest goal.

Posted in CSS, Tutorial | Tagged , , | Leave a comment