Only for ECS Staff
There are referrals (remittances) that are shown by conciliation as unpaid, thus provoking that cashier cannot be closed when trying.
This is a normal error message due to the customer of these remittances, has the Invoice to Insurance company check active ( Business Partner window), which is forcing all of its credit referrals to be invoiced immediately. Customers must invoice these pending charges.
In case of having any customer that wants these referrals unbilled and allowing users to close cashier :
(This only to allow close cashier without invoicing)
What should be done to fix this is to go to the Business Partner window and uncheck the Invoice to Insurance company field, also make sure to check the It requires consolidated invoice field and save the changes. Just so that it allows you to close the cashier without billing those referrals. When billing is required the check must be active.
See video (in Spanish) as reference :
Business rules :
The message says the following :
Unable to close the cash journal.
There are unreconciled, which is , (any of the following two options)
A)
- unbilled
- that have not gone through the cashier
B )
- are Accounts Receivable
- that are not in a multiple (consolidated) invoice
- that its business partner allows performing consolidated invoice
If these accounts receivable remittances are not assigned to a consolidated (multiple) invoice, then B applies.
Query to validate that there are no unreconciled delivery notes.
-- validamos que no haya notas de remision sin conciliar SELECT i.documentno,i.created,i.c_invoice_id FROM C_Invoice i INNER JOIN C_DocType dt ON i.C_DocTypeTarget_ID = dt.C_DocType_ID AND dt.DocBaseType = 'ARI' AND dt.docsubtypeso is null INNER JOIN C_Bpartner bp ON bp.C_BPartner_ID = i.C_BPartner_ID LEFT JOIN C_Invoice fact ON fact.Ref_Invoice_Sales_ID = i.C_Invoice_ID and fact.ad_client_id = i.ad_client_id and fact.docstatus != 'NA' -- Pueden o pudieron tener una factura relacionada WHERE fact.c_invoice_id IS NULL -- Que no esten facturadas AND i.IsActive = 'Y' -- Que este activa AND i.C_Cash_ID = ? -- De la caja AND ( i.afecta_caja = 'N' -- Todos los tipos de remision deben pasar por caja OR ( i.afecta_caja = 'Y' AND i.ispaid = 'N' and i.multiple_id is null AND bp.Consolidated = 'N' ) ) -- remisiones no pagadas y no es consolidado AND i.DocStatus NOT IN ( 'VO','RE' ) AND i.IsSOTrx = 'Y' ;
Query with data example
SELECT i.documentno,i.created,i.c_invoice_id FROM C_Invoice i INNER JOIN C_DocType dt ON i.C_DocTypeTarget_ID = dt.C_DocType_ID AND dt.DocBaseType = 'ARI' AND dt.docsubtypeso is null INNER JOIN C_Bpartner bp ON bp.C_BPartner_ID = i.C_BPartner_ID LEFT JOIN C_Invoice fact ON fact.Ref_Invoice_Sales_ID = i.C_Invoice_ID and fact.ad_client_id = i.ad_client_id and fact.docstatus != 'NA'
WHERE fact.c_invoice_id IS NULL
AND i.IsActive = 'Y'
AND i.C_Cash_ID = 15029408 AND ( i.afecta_caja = 'N'
OR ( i.afecta_caja = 'Y' AND i.ispaid = 'N' and i.multiple_id is null AND bp.Consolidated = 'N' ) )
AND i.DocStatus NOT IN ( 'VO','RE' ) AND i.IsSOTrx = 'Y' ;
But it is necessary to get the ID from the Cash Journal, which can be obtained as in here :
select c_cash_id from c_cash where secuencia=1960 and EXME_Operador_ID=10002918
select count(*) from c_allocationline where c_invoice_id=13898234
Shows every cashier operator opened by the client and the number of sales receipts without payment :
SELECT c.C_Cash_ID, c.C_Cashbook_ID, c.EXME_Operador_id, c.Name, COUNT(*) NoInvoicesWithPendingConcilliation, SUM(i.GrandTotal) TotalInvoicesAmount FROM C_Invoice i INNER JOIN C_DocType dt ON i.C_DocTypeTarget_ID = dt.C_DocType_ID AND dt.DocBaseType = 'ARI' AND dt.docsubtypeso IS NULL INNER JOIN C_Bpartner bp ON bp.C_BPartner_ID = i.C_BPartner_ID INNER JOIN C_Cash c ON c.C_Cash_ID = i.C_Cash_ID AND c.DocStatus = 'DR' LEFT JOIN C_Invoice fact ON fact.Ref_Invoice_Sales_ID = i.C_Invoice_ID AND fact.ad_client_id = i.ad_client_id and fact.docstatus != 'NA' WHERE i.AD_Client_ID = 15000000 AND i.AD_Org_ID = 15000000 AND i.DocStatus NOT IN ('RE', 'VO') AND i.IsSOTrx = 'Y' AND fact.c_invoice_id IS NULL AND ( i.afecta_caja = 'N' OR (i.afecta_caja = 'Y' AND i.ispaid = 'N' AND i.multiple_id IS NULL AND bp.Consolidated = 'N')) GROUP BY c.C_Cash_ID, c.C_Cashbook_ID, c.EXME_Operador_id, c.Name ORDER BY c.Name