Openbravo Forum End of Life Notice

Dear Openbravo Forum User,

Because of continued very low usage we decided to stop the forums on 31st of August 2017

In case of questions: webmaster "at" openbravo.com

regarding the supply process

<<

Helder Teixeira

Posts: 55

Joined: Sat Feb 06, 2010 6:23 pm

Post Fri Jan 28, 2011 2:56 pm

RE:regarding the supply process

Hi,



The changes made by gjergjsheldija will be on the next commit.



Take care
<<

Gjergj Sheldija

Posts: 28

Joined: Wed Mar 18, 2009 7:25 pm

Post Fri Jan 28, 2011 3:41 pm

RE:regarding the supply process

hi Corvisier,


thank you :)


 


gj.

<<

Gjergj Sheldija

Posts: 28

Joined: Wed Mar 18, 2009 7:25 pm

Post Fri Jan 28, 2011 7:36 pm

RE:regarding the supply process

hi,


this is a bit urgen, Mr. Helder Teixeira, warned me about an error in the diary when storing a movement on derby and postgres db's. the solution is to replace the getStockDiaryInsert() function in DataLogicSales.java with the code submitted below. plz test it and let me know if it works.


regards


gj.

Code: Select all
public final SentenceExec getStockDiaryInsert() {
return new SentenceExecTransaction(s) {
private Object units;
private Object price;

public int execInTransaction(final Object params) throws BasicException {
int updateresult = ((Object[]) params)[5] == null // si ATTRIBUTESETINSTANCE_ID is null
? new PreparedSentence(s, "UPDATE STOCKCURRENT SET UNITS = (UNITS + ?) WHERE LOCATION = ? AND PRODUCT = ? AND ATTRIBUTESETINSTANCE_ID IS NULL", new SerializerWriteBasicExt(stockdiaryDatas, new int[]{6, 3, 4})).exec(params)
: new PreparedSentence(s, "UPDATE STOCKCURRENT SET UNITS = (UNITS + ?) WHERE LOCATION = ? AND PRODUCT = ? AND ATTRIBUTESETINSTANCE_ID = ?", new SerializerWriteBasicExt(stockdiaryDatas, new int[]{6, 3, 4, 5})).exec(params);

if (updateresult == 0) {
new PreparedSentence(s, "INSERT INTO STOCKCURRENT (LOCATION, PRODUCT, ATTRIBUTESETINSTANCE_ID, UNITS) VALUES (?, ?, ?, ?)", new SerializerWriteBasicExt(stockdiaryDatas, new int[]{3, 4, 5, 6})).exec(params);
}
int j = new PreparedSentence(s, "INSERT INTO STOCKDIARY (ID, DATENEW, REASON, LOCATION, PRODUCT, ATTRIBUTESETINSTANCE_ID, UNITS, PRICE) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", new SerializerWriteBasicExt(stockdiaryDatas, new int[]{0, 1, 2, 3, 4, 5, 6, 7})).exec(params);

// MSL : update cost price
Object[] sparams = new Object[]{((Object[]) params)[4], ((Object[]) params)[7]};
int i = new PreparedSentence(s, "UPDATE PRODUCTS SET PRICEBUY=? WHERE ID=?", new SerializerWriteBasicExt(new Datas[]{Datas.STRING, Datas.DOUBLE}, new int[]{1, 0})).exec(sparams);

i = new PreparedSentence(s, "UPDATE MATERIALS_UNITS SET PRICEBUY=? WHERE MATERIAL=?", new SerializerWriteBasicExt(new Datas[]{Datas.STRING, Datas.DOUBLE}, new int[]{1, 0})).exec(sparams);

// MSL : add supplier id
if (((Object[]) params).length >= 13) {
sparams = new Object[]{((Object[]) params)[0], ((Object[]) params)[13]};
i = new PreparedSentence(s, "UPDATE STOCKDIARY SET SUPPLIERID=? WHERE ID=?", new SerializerWriteBasicExt(new Datas[]{Datas.STRING, Datas.STRING}, new int[]{1, 0})).exec(sparams);

units = ((Object[]) params)[6];
price = ((Object[]) params)[7];

getSupplierDebtUpdate().exec(new DataParams() {
public void writeValues() throws BasicException {
setDouble(1, new Double(units.toString()) * new Double(price.toString()));
setString(2, Formats.DATE.formatValue(((Object[]) params)[1]) );
setString(3, Formats.STRING.formatValue(((Object[]) params)[13]));
}
});


}

return j;
}
};
}
<<

Gjergj Sheldija

Posts: 28

Joined: Wed Mar 18, 2009 7:25 pm

Post Fri Jan 28, 2011 8:01 pm

RE:regarding the supply process

hi


i've made a silly mistake in the supplyer payment, it erreously saves it with a minus sign, anyway, the fix is pretty easy.


in file SupplierInfoExt.java replace line


curdebt = curdebt == null ? amount : curdebt + amount;


with


curdebt = curdebt == null ? amount : curdebt - amount;


in SuppliersPayment.java replace line


payments.add(new PaymentInfoTicket(-total, "debtpaid"));


with


payments.add(new PaymentInfoTicket(total, "debtpaid"));


 


can someone please test it and tell if everything it's ok ?


regards


gj.

<<

padraig downey

Posts: 1

Joined: Tue Mar 22, 2011 4:49 pm

Post Tue Mar 22, 2011 5:00 pm

RE:regarding the supply process

gj,


 


about to implement openpos and am really interested in your waiter/table allocations and presence reports. could you post a full working model?? Or how does one integrate your changes into openpos - not a programmer just potential user.


 


Thanks to you and all you other great contributors


 


Padraig

<<

Gjergj Sheldija

Posts: 28

Joined: Wed Mar 18, 2009 7:25 pm

Post Fri Mar 25, 2011 1:58 pm

RE:regarding the supply process

hi


 


me and corvoisier are curretly preparing a new release for openpos which will integrate all the work done untill now, comprising the waiter table management.


 


regards


Gjergj Sheldija


gjergj.sheldija@acme-tech.net


acme-tech.net/blog

Previous

Return to Open discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Website Terms


Designed by ST Software for PTF.