Notes |
|
|
Probably the error is in the function C_INVOICE_CREATE. When requesting the document type:
SELECT od.C_DocTypeInvoice_ID,
od.DocSubTypeSO
INTO v_DocType_ID,
v_DocSubTypeSO
FROM C_DOCTYPE od,
C_DOCTYPE ID
WHERE od.C_DocType_ID=Cur_Order.C_DocType_ID
AND od.C_DocTypeInvoice_ID=ID.C_DocType_ID;
Here is not verified that the document type is active.
Take into account that this function is very sensitive and changes must be done without affecting any other business case. |
|
|
|
This is not an issue. The way you suppose the ERP has to work is not correct.
Please log another issue related with the casuistic of deactivating a document type |
|
|
|
Actually the problem here is problably that the POS order document type has not the value AR Invoice Document Type in the "Document Type for Invoice" field . If both document types are related it will work.
Other problem is that the SQL sentece described in the previous note does not filter by ACTIVE='Y'. This sentence must have this filter and raise an error if the sentence does not return any value. |
|
|
|
Modified the steps to reproduce to identify properly the cause of the isue |
|
|
(0026610)
|
hgbot
|
2010-04-23 12:21
|
|
Repository: erp/devel/pi
Changeset: f416696344a65ee0d719fc26b98099f7f1f1c876
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Fri Apr 23 15:50:49 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/f416696344a65ee0d719fc26b98099f7f1f1c876 [^]
Fixes issue 12857: It is possible to generate an invoice with a Transaction Document disabled
---
M src-db/database/model/functions/C_INVOICE_CREATE.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/erpCommon/ad_forms/GenerateInvoicesmanual.java
---
|
|
|
|
Steps to test:
-As Openbravo Admin go to Financial Management || Accounting || Setup || Document Type
-Select AR Invoice and disabled it (Active: no)
-Go to Sales Management || Transactions || Create Invoices from Orders
-Create an Invoice.
-Realize that 'No document type found' error message is thrown |
|
|
|
|
|
|
It has been tested in PI + PostgreSQL and this is the error message:
Error:
null value in column "c_doctype_id" violates not-null constraint
Please, reopen it, and fix it properly for PostgreSQL |
|
|
(0027170)
|
hgbot
|
2010-05-12 13:28
|
|
Repository: erp/devel/pi
Changeset: f38fcdbde42072b7e015c51752f3c3d20f7fa4d0
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Wed May 12 13:27:35 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f38fcdbde42072b7e015c51752f3c3d20f7fa4d0 [^]
Fixes issue 0012857: It is possible to generate an invoice with a Transaction Document disabled
In order to behave the same way in PosgreSQL and Oracle, it has been modified the PL/SQL flow. The problem is that when an SQL sentence is used to assign a variable and the SQL does not return any row, In PosgreSQL it just sets the variable to NULL and in Oracle a NOT_DATA_FOUND exception is thrown
---
M src-db/database/model/functions/C_INVOICE_CREATE.xml
---
|
|
|
|
Pi Postgres also display the error message as
"No document type found for invoice"
Tested working fine |
|
|
|
|
|
|
|
|
(0027972)
|
hgbot
|
2010-06-04 14:45
|
|
Repository: erp/devel/pi
Changeset: 1b3b2e2ae942eb759aa2541a8e1d61d6df6b6117
Author: Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
Date: Fri Apr 23 15:50:49 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/1b3b2e2ae942eb759aa2541a8e1d61d6df6b6117 [^]
Fixes issue 12857: It is possible to generate an invoice with a Transaction Document disabled
---
M src-db/database/model/functions/C_INVOICE_CREATE.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/erpCommon/ad_forms/GenerateInvoicesmanual.java
---
|
|
|
|
|
|
|
|
|
|
Retestd by following the below steps
1) For "POS" Document type changed the value for"Document Type for Invoice" as "AR Invoice"
2) Deactivated the "AR invoice" document type
3) Tried to create a sales order with transaction document type as "POS" order
System rightly shows the below error
" Error: No document type found for invoice" |
|