SQL-Ledger Homepage

SQL-Ledger User Forum

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

How is the shipto table related to the customer table (General)

posted by Gregory West(R) E-mail, Manitoba Canada, 17.05.2016, 18:26

AH I think I see what is happening now. There is one 'shipto' per order. Duplicates are ignored so each shipto record is it is the same is not shown up twice.

I think I can do a quick down and dirty replace on all the extra records for all the shipto's that are bogus.

Thanks Jay, you are a saviour!

Hi Greg

I thought about this some more and realized that you probably have a bunch
of addresses showing up that are essentially the same when you click on the
shipto button.

The way to get rid of the duplicates is NOT to delete anything from the
shipto table it's to make all of the records in the shipto table the same.

Example

123 cherry Lane
123 Chery Lane
123 Cherry lan

will cause three address to show when you click 'shipto'

Open the Shipto table and make them all the same

123 Cherry Lane

and you'll only get one address in the future because when SQL is searching
for shipto addresses it'll discard duplicates for that customer.

If you don't want to edit the table directly open each invoice from within
SQL-Ledger, edit the shipto address to correct the typo and then re-post
it.

Jeff




Don

Good afternoon Jeff.

I am looking at the three tables now. I see the trans_id on the shipto
table. I can not see the trans_id on the ar table. I have id,
customer_id, employee_id, department_id, bank_id and payment_id.

The id on the customer record does not always link to the trans_id in
the
shipto table. There must be some sort of link I am not seeing, as the
shipto addresses show up when I create a sales order, but unfortunately
way
too many shipto records were created most are exactly the same except
some
small typo fixed. The question is now how to get rid of all the
duplicate
records, and adjust pointers to point at the correct record (the one
that
is left after 3 or 4 are deleted).

Does this make any sense?

Hi Greg

I don't know if you figured this out but here's what I came up with.

The Shipto table has a trans_id number that corresponds to the
trans_id
number in the ar table,

In the ar table there is a customer_id number that corresponds to id
in
the
customer table and to trans_id in the address table giving you the
customer
and the mailing address.

Jeff





I have to write a quick query based on the ship to address, to find
out
who
the ultimate customer was. My problem is I am having trouble
figuring
out
how the shipto table relates to the customer table. ie: If I have
a
child shipto record, how do I know who the parent record is?

Anyone have an idea how this is set up?

Gregory A. West

---
Gregory A. West
DB&W Systems Limited

 

Complete thread:

Back to the forum
Board view  Mix view
971 Postings in 319 Threads, 324 registered users, 59 users online (0 registered, 59 guests)
SQL-Ledger User Forum | Admin contact
RSS-Feed
powered by my little forum