Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Customer Transaction Inquiries > Credit Note SQL Error - SOLVED
09-12-2018, 06:41 AM (This post was last modified: 09-12-2018 06:53 AM by VortecCPI.)
Post: #1
Customer Transaction Inquiries > Credit Note SQL Error - SOLVED
CustomerInquiry.php

When clicking on More Info > PDF we get a SQL error but if clicking More Info > HTML works just fine.

ERROR Message Report : There was a problem retrieving the invoice or credit note details for note number from the database. To print an invoice, the sales order record, the customer transaction record and the branch record for the customer must not have been purged. To print a credit note only requires the customer, transaction, salesman and branch records be available
ERROR Message Report : The SQL used to get this information that failed was
SELECT debtortrans.trandate, debtortrans.ovamount, debtortrans.ovdiscount, debtortrans.ovfreight, debtortrans.ovgst, debtortrans.rate, debtortrans.invtext, debtorsmaster.invaddrbranch, debtorsmaster.name, debtorsmaster.address1, debtorsmaster.address2, debtorsmaster.address3, debtorsmaster.address4, debtorsmaster.address5, debtorsmaster.address6, debtorsmaster.currcode, debtorsmaster.taxref, debtorsmaster.language_id, custbranch.brname, custbranch.braddress1, custbranch.braddress2, custbranch.braddress3, custbranch.braddress4, custbranch.braddress5, custbranch.braddress6, custbranch.brpostaddr1, custbranch.brpostaddr2, custbranch.brpostaddr3, custbranch.brpostaddr4, custbranch.brpostaddr5, custbranch.brpostaddr6, custbranch.salesman, salesman.salesmanname, debtortrans.debtorno, debtortrans.branchcode, paymentterms.terms, currencies.decimalplaces FROM debtortrans INNER JOIN debtorsmaster ON debtortrans.debtorno=debtorsmaster.debtorno INNER JOIN custbranch ON debtortrans.debtorno=custbranch.debtorno AND debtortrans.branchcode=custbranch.branchcode INNER JOIN salesman ON custbranch.salesman=salesman.salesmancode INNER JOIN currencies ON debtorsmaster.currcode=currencies.currabrev WHERE debtortrans.type=11 AND debtortrans.transno='10101'

Looking in to it now...
Error in query (1054): Unknown column 'paymentterms.terms' in 'field list'
This works fine:
PrintCustTransPortrait.php?FromTransNo=10108&InvOrCredit=Invoice&PrintPDF=True

But this does not:
PrintCustTrans.php?FromTransNo=10108&InvOrCredit=Invoice&PrintPDF=True
Added the following to the query:

PHP Code:
INNER JOIN paymentterms
ON debtorsmaster
.paymentterms=paymentterms.termsindicator 

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
09-12-2018, 12:01 PM
Post: #2
RE: Customer Transaction Inquiries > Credit Note SQL Error - SOLVED
Thanks, Paul.

I believe that has been fixed with 4.15. There were many changes to those files to get them mostly aligned with similar handling, including the queries.

If there might be something not covered, please let me know.

An overview of the changes are here.
Find all posts by this user
Quote this message in a reply
09-12-2018, 07:43 PM
Post: #3
RE: Customer Transaction Inquiries > Credit Note SQL Error - SOLVED
Yes... I should have mentioned we are still using 4.14.1.

It will be some time before we merge our branch with 4.15.X branch...

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)