Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015147Openbravo ERPZ. Otherspublic2010-11-10 11:232010-12-09 16:07
maite 
mirurita 
urgentmajoralways
closedfixed 
5
2.50 
 
OBPS
Advanced Payables and Receivables Mngmt
No
0015147: Error "paymentrule" is null when using intercompany module
When using IntercompanyDocuments module and APR module, you get the following error "null value in column "paymentrule" violates not-null constraint" when trying to process Inter-company Sales Invoice document.

As you are using APRM, field paymentrule should not be required.
1. Install last version of Intercompany Documents module and APR module
2. Apply APRM dataset
2. Follow http://wiki.openbravo.com/wiki/Projects/intercompanyinvoicing/User_Guide#Definition_of_Inter-company_Document_Types [^]
3. Create Financial Management || Receivables & Payables || Transactions || Financial Account
4. Create Financial Management || Receivables & Payables || Setup || Payment Method || Payment Method , and associate it to the Financial Account
5. Create 2 new Business Partner: BP1 y BP2, and set PaymentMethod for both
6. Go to General Setup || Enterprise || Organization || Organization >> Information for Org A and set BP1
7. Go to General Setup || Enterprise || Organization || Organization >> Information for Org B and set BP2
8. Go to Sales Management || Transactions || Sales Invoice || Header and create "Inter-company Sales Invoice document" for BP1 and Org B
9. Process and you will obtain error "null value in column "paymentrule" violates not-null constraint"
The problem is in function "interco_create_invoice". When selecting data from business partner, a COALESCE is performing for "paymentrule" but not for "PaymentRulePO". Due to that, when trying to create Purchase Invoice value is null.

COALESCE should also be performed for PaymentRulePO field
No tags attached.
Issue History
2010-11-10 11:23maiteNew Issue
2010-11-10 11:23maiteAssigned To => mirurita
2010-11-10 11:23maiteOBNetwork customer => Yes
2010-11-10 11:23maiteIssue Monitored: networkb
2010-11-12 11:34miruritaStatusnew => scheduled
2010-11-12 11:34miruritafix_in_branch => pi
2010-11-12 11:36hgbotCheckin
2010-11-12 11:36hgbotNote Added: 0032581
2010-11-12 11:36hgbotStatusscheduled => resolved
2010-11-12 11:36hgbotResolutionopen => fixed
2010-11-12 11:36hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.interco/rev/a0a27382dca7c4dfd7e1d20fc32fafc0ee635262 [^]
2010-11-15 12:22adrianromeroNote Added: 0032613
2010-11-15 12:24adrianromeroNote Added: 0032614
2010-11-16 16:56adrianromeroNote Added: 0032638
2010-11-16 16:56adrianromeroStatusresolved => closed
2010-12-09 16:07anonymoussf_bug_id0 => 3133550

Notes
(0032581)
hgbot   
2010-11-12 11:36   
Repository: erp/pmods/org.openbravo.interco
Changeset: a0a27382dca7c4dfd7e1d20fc32fafc0ee635262
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Fri Nov 12 11:34:51 2010 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.interco/rev/a0a27382dca7c4dfd7e1d20fc32fafc0ee635262 [^]

Fixes issue 15147: Error paymentrule is null when using intercompany module

---
M src-db/database/model/functions/INTERCO_CREATE_INVOICE.xml
M src-db/database/model/functions/INTERCO_CREATE_ORDER.xml
---
(0032613)
adrianromero   
2010-11-15 12:22   
This fix modifies the CREATE_INVOICE process and CREATE_ORDER process to take into account the fields v_paymentMethod, v_paymentMethodPO when generating a new Invoice or a new Order.
(0032614)
adrianromero   
2010-11-15 12:24   
* Testing the issue

Kindly follow the steps to test and verify that now when creating Inter-company Sales Invoice document no error is thrown when APRM module is installed

* Other areas affected

No other areas affected just the processes of creating Inter-company invoices and orders.
(0032638)
adrianromero   
2010-11-16 16:56   
Fixed in 2.1.6