You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Ian Gilbert <ia...@ethicalshopper.co.uk> on 2006/07/11 17:28:06 UTC

Error when adding a payment ...

Hi All,

I am testing a fairly recent build with a payment process and have tried to raise a payment in
compensation for a purchase order which was raised successfuly.

I am getting the error attached with this and am not sure why.  Can anyone shed any light on this?
 It is clearly a foreign key violation but I'm not sure why?  The dataset used is the default demo
data.  I have posted the full error (which is truncated in the image at the bottom of this mail.

Very best wishes

Ian

    *  ERROR: Could not complete the Create a Payment
[file:/home/ofbiz1/apps/ofbiz_ethical/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml#createPayment]
process [problem creating the payment value: Exception while inserting the following entity:
[GenericEntity:Payment][amount,73.48(java.lang.Double)][comments,null()][createdStamp,2006-07-11
16:27:20.629(java.sql.Timestamp)][createdTxStamp,2006-07-11
16:27:20.629(java.sql.Timestamp)][currencyUomId,USD(java.lang.String)][effectiveDate,2006-07-11
16:25:38.36(java.sql.Timestamp)][finAccountTransId,null()][lastUpdatedStamp,2006-07-11
16:27:20.629(java.sql.Timestamp)][lastUpdatedTxStamp,2006-07-11
16:27:20.629(java.sql.Timestamp)][overrideGlAccountId,null()][partyIdFrom,COMPANY(java.lang.String)][partyIdTo,DemoSupplier(java.lang.String)][paymentId,10010(java.lang.String)][paymentMethodId,null()][paymentMethodTypeId,PERSONAL_CHECK(java.lang.String)][paymentPreferenceId,null()][paymentRefNum,null()][paymentTypeId,VENDOR_PAYMENT(java.lang.String)][roleTypeIdTo,null()][statusId,PMNT_NOT_PAID(java.lang.String)]
(while inserting:
[GenericEntity:Payment][amount,73.48(java.lang.Double)][comments,null()][createdStamp,2006-07-11
16:27:20.629(java.sql.Timestamp)][createdTxStamp,2006-07-11
16:27:20.629(java.sql.Timestamp)][currencyUomId,USD(java.lang.String)][effectiveDate,2006-07-11
16:25:38.36(java.sql.Timestamp)][finAccountTransId,null()][lastUpdatedStamp,2006-07-11
16:27:20.629(java.sql.Timestamp)][lastUpdatedTxStamp,2006-07-11
16:27:20.629(java.sql.Timestamp)][overrideGlAccountId,null()][partyIdFrom,COMPANY(java.lang.String)][partyIdTo,DemoSupplier(java.lang.String)][paymentId,10010(java.lang.String)][paymentMethodId,null()][paymentMethodTypeId,PERSONAL_CHECK(java.lang.String)][paymentPreferenceId,null()][paymentRefNum,null()][paymentTypeId,VENDOR_PAYMENT(java.lang.String)][roleTypeIdTo,null()][statusId,PMNT_NOT_PAID(java.lang.String)]
(SQL Exception while executing the following:INSERT INTO public.PAYMENT (PAYMENT_ID,
PAYMENT_TYPE_ID, PAYMENT_METHOD_TYPE_ID, PAYMENT_METHOD_ID, PAYMENT_GATEWAY_RESPONSE_ID,
PAYMENT_PREFERENCE_ID, PARTY_ID_FROM, PARTY_ID_TO, ROLE_TYPE_ID_TO, STATUS_ID, EFFECTIVE_DATE,
PAYMENT_REF_NUM, AMOUNT, CURRENCY_UOM_ID, COMMENTS, FIN_ACCOUNT_TRANS_ID,
OVERRIDE_GL_ACCOUNT_ID, ACTUAL_CURRENCY_AMOUNT, ACTUAL_CURRENCY_UOM_ID, LAST_UPDATED_STAMP,
LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: insert or update on table "payment" violates
foreign key constraint "payment_fpty")))]


www.ethicalshopper.net
Fair trade: the alternative choice for your everyday shopping
0845 456 2429

WHAT DO YOU DRINK AT WORK?
We can supply your organisation with high quality fair trade tea and
coffee.  Discounts are available for regular orders.  Contact us for more
details.

Re: Error when adding a payment ...

Posted by Ian Gilbert <ia...@ethicalshopper.co.uk>.
Thanks for responding David,

I figured shortly afterwards that this was the problem.  I manually put this in rather than using
thelookup form which I think works fine.


On Tue, July 11, 2006 16:33, David E. Jones wrote:
>

> The last bit of the message is the key: it is violating a the from party foreign key. It looks
> like you have entered "COMPANY" which is not valid unless you have created one. The demo data
> value for that is "Company".
>
> Which form did you use for this? Did it have a lookup window?
>
>
> -David
>
>
>
> Ian Gilbert wrote:
>
>> Hi All,
>>
>>
>> I am testing a fairly recent build with a payment process and have tried to raise a payment in
>> compensation for a purchase order which was raised successfuly.
>>
>> I am getting the error attached with this and am not sure why.  Can anyone shed any light on
>> this? It is clearly a foreign key violation but I'm not sure why?  The dataset used is the
>> default demo data.  I have posted the full error (which is truncated in the image at the bottom
>> of this mail.
>>
>> Very best wishes
>>
>>
>> Ian
>>
>>
>> *  ERROR: Could not complete the Create a Payment
>> [file:/home/ofbiz1/apps/ofbiz_ethical/applications/accounting/script/org/ofbiz/accounting/paymen
>> t/PaymentServices.xml#createPayment] process [problem creating the payment value: Exception
>> while inserting the following entity:
>> [GenericEntity:Payment][amount,73.48(java.lang.Double)][comments,null()][createdStamp,2006-07-1
>> 1
>> 16:27:20.629(java.sql.Timestamp)][createdTxStamp,2006-07-11
>> 16:27:20.629(java.sql.Timestamp)][currencyUomId,USD(java.lang.String)][effectiveDate,2006-07-11
>> 16:25:38.36(java.sql.Timestamp)][finAccountTransId,null()][lastUpdatedStamp,2006-07-11
>> 16:27:20.629(java.sql.Timestamp)][lastUpdatedTxStamp,2006-07-11
>> 16:27:20.629(java.sql.Timestamp)][overrideGlAccountId,null()][partyIdFrom,COMPANY(java.lang.Stri
>> ng)][partyIdTo,DemoSupplier(java.lang.String)][paymentId,10010(java.lang.String)][paymentMethod
>> Id,null()][paymentMethodTypeId,PERSONAL_CHECK(java.lang.String)][paymentPreferenceId,null()][pa
>> ymentRefNum,null()][paymentTypeId,VENDOR_PAYMENT(java.lang.String)][roleTypeIdTo,null()][status
>> Id,PMNT_NOT_PAID(java.lang.String)]
>> (while inserting:
>> [GenericEntity:Payment][amount,73.48(java.lang.Double)][comments,null()][createdStamp,2006-07-11
>>  16:27:20.629(java.sql.Timestamp)][createdTxStamp,2006-07-11
>> 16:27:20.629(java.sql.Timestamp)][currencyUomId,USD(java.lang.String)][effectiveDate,2006-07-11
>> 16:25:38.36(java.sql.Timestamp)][finAccountTransId,null()][lastUpdatedStamp,2006-07-11
>> 16:27:20.629(java.sql.Timestamp)][lastUpdatedTxStamp,2006-07-11
>> 16:27:20.629(java.sql.Timestamp)][overrideGlAccountId,null()][partyIdFrom,COMPANY(java.lang.Stri
>> ng)][partyIdTo,DemoSupplier(java.lang.String)][paymentId,10010(java.lang.String)][paymentMethod
>> Id,null()][paymentMethodTypeId,PERSONAL_CHECK(java.lang.String)][paymentPreferenceId,null()][pa
>> ymentRefNum,null()][paymentTypeId,VENDOR_PAYMENT(java.lang.String)][roleTypeIdTo,null()][status
>> Id,PMNT_NOT_PAID(java.lang.String)]
>> (SQL Exception while executing the following:INSERT INTO public.PAYMENT (PAYMENT_ID,
>> PAYMENT_TYPE_ID, PAYMENT_METHOD_TYPE_ID, PAYMENT_METHOD_ID, PAYMENT_GATEWAY_RESPONSE_ID,
>> PAYMENT_PREFERENCE_ID, PARTY_ID_FROM, PARTY_ID_TO, ROLE_TYPE_ID_TO, STATUS_ID, EFFECTIVE_DATE,
>> PAYMENT_REF_NUM, AMOUNT, CURRENCY_UOM_ID, COMMENTS, FIN_ACCOUNT_TRANS_ID,
>> OVERRIDE_GL_ACCOUNT_ID, ACTUAL_CURRENCY_AMOUNT, ACTUAL_CURRENCY_UOM_ID, LAST_UPDATED_STAMP,
>> LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: insert or update on table "payment" violates
>> foreign key constraint "payment_fpty")))]
>>
>>
>> www.ethicalshopper.net Fair trade: the alternative choice for your everyday shopping
>> 0845 456 2429
>>
>>
>> WHAT DO YOU DRINK AT WORK?
>> We can supply your organisation with high quality fair trade tea and
>> coffee.  Discounts are available for regular orders.  Contact us for more details.
>


-- 
Ian Gilbert
www.ethicalshopper.net
Fair trade: the alternative choice for your everyday shopping
0845 456 2429

WHAT DO YOU DRINK AT WORK?
We can supply your organisation with high quality fair trade tea and
coffee.  Discounts are available for regular orders.  Contact us for more
details.


Re: Error when adding a payment ...

Posted by Jacopo Cappellato <ti...@sastau.it>.
I've noticed that sometimes the foreign keys are missing from entity 
definition (for example the party* fields of the Agreement entity)... is 
this by design?

Jacopo

David E. Jones wrote:
> 
> The last bit of the message is the key: it is violating a the from party 
> foreign key. It looks like you have entered "COMPANY" which is not valid 
> unless you have created one. The demo data value for that is "Company".
> 
> Which form did you use for this? Did it have a lookup window?
> 
> -David
> 


Re: Error when adding a payment ...

Posted by "David E. Jones" <jo...@undersunconsulting.com>.
The last bit of the message is the key: it is violating a the from party foreign key. It looks like you have entered "COMPANY" which is not valid unless you have created one. The demo data value for that is "Company".

Which form did you use for this? Did it have a lookup window?

-David


Ian Gilbert wrote:
> Hi All,
> 
> I am testing a fairly recent build with a payment process and have tried to raise a payment in
> compensation for a purchase order which was raised successfuly.
> 
> I am getting the error attached with this and am not sure why.  Can anyone shed any light on this?
>  It is clearly a foreign key violation but I'm not sure why?  The dataset used is the default demo
> data.  I have posted the full error (which is truncated in the image at the bottom of this mail.
> 
> Very best wishes
> 
> Ian
> 
>     *  ERROR: Could not complete the Create a Payment
> [file:/home/ofbiz1/apps/ofbiz_ethical/applications/accounting/script/org/ofbiz/accounting/payment/PaymentServices.xml#createPayment]
> process [problem creating the payment value: Exception while inserting the following entity:
> [GenericEntity:Payment][amount,73.48(java.lang.Double)][comments,null()][createdStamp,2006-07-11
> 16:27:20.629(java.sql.Timestamp)][createdTxStamp,2006-07-11
> 16:27:20.629(java.sql.Timestamp)][currencyUomId,USD(java.lang.String)][effectiveDate,2006-07-11
> 16:25:38.36(java.sql.Timestamp)][finAccountTransId,null()][lastUpdatedStamp,2006-07-11
> 16:27:20.629(java.sql.Timestamp)][lastUpdatedTxStamp,2006-07-11
> 16:27:20.629(java.sql.Timestamp)][overrideGlAccountId,null()][partyIdFrom,COMPANY(java.lang.String)][partyIdTo,DemoSupplier(java.lang.String)][paymentId,10010(java.lang.String)][paymentMethodId,null()][paymentMethodTypeId,PERSONAL_CHECK(java.lang.String)][paymentPreferenceId,null()][paymentRefNum,null()][paymentTypeId,VENDOR_PAYMENT(java.lang.String)][roleTypeIdTo,null()][statusId,PMNT_NOT_PAID(java.lang.String)]
> (while inserting:
> [GenericEntity:Payment][amount,73.48(java.lang.Double)][comments,null()][createdStamp,2006-07-11
> 16:27:20.629(java.sql.Timestamp)][createdTxStamp,2006-07-11
> 16:27:20.629(java.sql.Timestamp)][currencyUomId,USD(java.lang.String)][effectiveDate,2006-07-11
> 16:25:38.36(java.sql.Timestamp)][finAccountTransId,null()][lastUpdatedStamp,2006-07-11
> 16:27:20.629(java.sql.Timestamp)][lastUpdatedTxStamp,2006-07-11
> 16:27:20.629(java.sql.Timestamp)][overrideGlAccountId,null()][partyIdFrom,COMPANY(java.lang.String)][partyIdTo,DemoSupplier(java.lang.String)][paymentId,10010(java.lang.String)][paymentMethodId,null()][paymentMethodTypeId,PERSONAL_CHECK(java.lang.String)][paymentPreferenceId,null()][paymentRefNum,null()][paymentTypeId,VENDOR_PAYMENT(java.lang.String)][roleTypeIdTo,null()][statusId,PMNT_NOT_PAID(java.lang.String)]
> (SQL Exception while executing the following:INSERT INTO public.PAYMENT (PAYMENT_ID,
> PAYMENT_TYPE_ID, PAYMENT_METHOD_TYPE_ID, PAYMENT_METHOD_ID, PAYMENT_GATEWAY_RESPONSE_ID,
> PAYMENT_PREFERENCE_ID, PARTY_ID_FROM, PARTY_ID_TO, ROLE_TYPE_ID_TO, STATUS_ID, EFFECTIVE_DATE,
> PAYMENT_REF_NUM, AMOUNT, CURRENCY_UOM_ID, COMMENTS, FIN_ACCOUNT_TRANS_ID,
> OVERRIDE_GL_ACCOUNT_ID, ACTUAL_CURRENCY_AMOUNT, ACTUAL_CURRENCY_UOM_ID, LAST_UPDATED_STAMP,
> LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: insert or update on table "payment" violates
> foreign key constraint "payment_fpty")))]
> 
> 
> www.ethicalshopper.net
> Fair trade: the alternative choice for your everyday shopping
> 0845 456 2429
> 
> WHAT DO YOU DRINK AT WORK?
> We can supply your organisation with high quality fair trade tea and
> coffee.  Discounts are available for regular orders.  Contact us for more
> details.