Topic: Import of customers and branches

Good day:

Very nice project!  Thank you.

Using MySQL Workbench, I have run SQL statements to INSERT INTO 0_debtors_master successfully from a  csv file.  All Customers show up fine in FA under Sales->Maintenance->Add and Manage Customers.

Then using MySQL Workbench, I ran the following SQL statements:

INSERT INTO 0_cust_branches (debtor_no, br_name, branch_ref, br_address, br_post_address, inactive)
SELECT debtor_no, name, debtor_ref, address, address, inactive
FROM 0_debtors_master;

This completed successfully and I can see all the added branches from within MySQL Workbench and phpMyAdmin.

When I select a Customer in FA and click on Add or Edit to see the Branch, it does not bring up the corresponding Branch, but an empty panel with "Add New" button at the bottom.   The same occurs if I go directly to Customer Branches and select a Customer.

I looked into /sales/manage/customer_branches.php and customers.php to see if I could figure out if the problem was within those scripts, but not quite sure of parts of that code.  The project I am working with will need for certain Customers to have Branches, so I would like to resolve this issue.

Any help would be greatly appreciated.

Butch

2 (edited by poncho1234 06/20/2018 08:45:27 pm)

Re: Import of customers and branches

Hi,
apmuthu wrote 'Anatomy of adding 1 customer', which you can find  here
You could also have a look at sql/en_US-demo.sql which I think has only 2 customers and 2 suppliers and look at the relationship between tables:-
debtors_master
cust_branch
crm_persons
crm_contacts

There is also an ER diagram its for V2.3, but 2.4 is very similar

And there is a full how-to here.

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Import of customers and branches

Hi poncho1234,

Thanks for the link, pretty much how I created debtors, branches and persons.
Not sure if empty contacts is preventing the Branch from showing up in FA.

Showing 3 rows of 291 successfully imported. (Partial rows shown):

0_debtors_master:
debtor_no    name            debtor_ref        address           
1        PETER MARK ACHAM@$    ACH900        SOUTHERN CARIBBEAN TRINIDAD LTD
2        ADENA SPRINGS SOUTH    ADE104        15045 NW 141ST COURT
3        AG INTERNATIONAL            AGI900        207 OLD JUPITER BEACH RD

0_cust_branch:
branch_code    debtor_no    br_name            branch_ref    br_address                                       salesman    default_location               
1                1        PETER MARK ACHAM@$    ACH900        SOUTHERN CARIBBEAN TRINIDAD LTD        0        DEF
2                2        ADENA SPRINGS SOUTH    ADE104        15045 NW 141ST COURT                            0        DEF
3                3        AG INTERNATIONAL            AGI900        207 OLD JUPITER BEACH RD                        0        DEF

0_crm_persons:
id    ref            name                    address                                   inactive
1    ACH900    PETER MARK ACHAM@$    SOUTHERN CARIBBEAN TRINIDAD LTD    0
2    ADE104    ADENA SPRINGS SOUTH    15045 NW 141ST COURT                    0
3    AGI900    AG INTERNATIONAL    207 OLD JUPITER BEACH RD                         0

I am working on a ER Diagram for 2.4.4 using the EER from MySQL Workbench and will share when completed.  Not sure how to link a PDF of a partial to these replies.

Please check the above and let me know what is off.

Thanks.

4 (edited by poncho1234 06/20/2018 11:03:35 pm)

Re: Import of customers and branches

Read the other links please

Your finished tables need to relate to each other so they are the same relationship as the customers/suppliers in sql/en_US-demo.sql

The FrontAccounting Wiki(Manual, examples, tips, setup info, links to accounting sites, etc) https://frontaccounting.com/fawiki/

Re: Import of customers and branches

OK - Solved!

Linking data was correct, but sales_account, etc were not present.

Working now.

Thanks!