{"action":"created","issue":{"url":"https://api.github.com/repos/uzerpllp/migration-testing/issues/69","labels_url":"https://api.github.com/repos/uzerpllp/migration-testing/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/uzerpllp/migration-testing/issues/69/comments","events_url":"https://api.github.com/repos/uzerpllp/migration-testing/issues/69/events","html_url":"https://github.com/uzerpllp/migration-testing/issues/69","id":119169729,"number":69,"title":"Error adding periodic payment","user":{"login":"steveblamey","id":297376,"avatar_url":"https://avatars.githubusercontent.com/u/297376?v=3","gravatar_id":"","url":"https://api.github.com/users/steveblamey","html_url":"https://github.com/steveblamey","followers_url":"https://api.github.com/users/steveblamey/followers","following_url":"https://api.github.com/users/steveblamey/following{/other_user}","gists_url":"https://api.github.com/users/steveblamey/gists{/gist_id}","starred_url":"https://api.github.com/users/steveblamey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveblamey/subscriptions","organizations_url":"https://api.github.com/users/steveblamey/orgs","repos_url":"https://api.github.com/users/steveblamey/repos","events_url":"https://api.github.com/users/steveblamey/events{/privacy}","received_events_url":"https://api.github.com/users/steveblamey/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/uzerpllp/migration-testing/labels/Accounts%20and%20GL","name":"Accounts and GL","color":"ededed"},{"url":"https://api.github.com/repos/uzerpllp/migration-testing/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/uzerpllp/migration-testing/labels/major","name":"major","color":"ededed"}],"state":"closed","locked":false,"assignee":{"login":"steveblamey","id":297376,"avatar_url":"https://avatars.githubusercontent.com/u/297376?v=3","gravatar_id":"","url":"https://api.github.com/users/steveblamey","html_url":"https://github.com/steveblamey","followers_url":"https://api.github.com/users/steveblamey/followers","following_url":"https://api.github.com/users/steveblamey/following{/other_user}","gists_url":"https://api.github.com/users/steveblamey/gists{/gist_id}","starred_url":"https://api.github.com/users/steveblamey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveblamey/subscriptions","organizations_url":"https://api.github.com/users/steveblamey/orgs","repos_url":"https://api.github.com/users/steveblamey/repos","events_url":"https://api.github.com/users/steveblamey/events{/privacy}","received_events_url":"https://api.github.com/users/steveblamey/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-11-27T10:12:30Z","updated_at":"2015-11-27T11:09:32Z","closed_at":"2015-11-27T10:20:58Z","body":"When attempting to enter a new periodic payment an error appears indicating the company is not found. To recreate this use the following links (substitute local url for our trial system)\r\n\r\nhttp://uzerp-trial.severndelta.co.uk/?pid=607&module=ledger_setup&controller=periodicpayments&action=new\r\n\r\nI selected the source as purchase ledger, this then ajaxes the company so only PL suppliers are being shown (a subset of the company list) in the company drop down. When I try to save I get an error message \"Input value 421 for company does not exist in Company\"\r\n\r\nThe periodic_payments table has a constraint\r\n\r\nCONSTRAINT periodic_payments_companyid_fkey FOREIGN KEY (company_id)\r\nREFERENCES company (id) MATCH SIMPLE\r\n\r\nwhich is correct and the error seems to indicate that it is trying to use and invalid id.\r\n\r\nLooking at the data the company in question is id 13027 with a purchase ledger id of\r\nhttp://uzerp-trial.severndelta.co.uk/?pid=638&module=contacts&controller=companys&action=view&id=13027\r\nhttp://uzerp-trial.severndelta.co.uk/?pid=448&module=purchase_ledger&controller=plsuppliers&action=view&id=421\r\n\r\nSo it would seem that the system is picking the id from plmaster rather than company - I confirmed this because if I change the source to cashbook payment (not purchase ledger payment) then this works and the correct company id is used. I also tested Sales Ledger receipts and the error happens here as well. "},"comment":{"url":"https://api.github.com/repos/uzerpllp/migration-testing/issues/comments/160115952","html_url":"https://github.com/uzerpllp/migration-testing/issues/69#issuecomment-160115952","issue_url":"https://api.github.com/repos/uzerpllp/migration-testing/issues/69","id":160115952,"user":{"login":"steveblamey","id":297376,"avatar_url":"https://avatars.githubusercontent.com/u/297376?v=3","gravatar_id":"","url":"https://api.github.com/users/steveblamey","html_url":"https://github.com/steveblamey","followers_url":"https://api.github.com/users/steveblamey/followers","following_url":"https://api.github.com/users/steveblamey/following{/other_user}","gists_url":"https://api.github.com/users/steveblamey/gists{/gist_id}","starred_url":"https://api.github.com/users/steveblamey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveblamey/subscriptions","organizations_url":"https://api.github.com/users/steveblamey/orgs","repos_url":"https://api.github.com/users/steveblamey/repos","events_url":"https://api.github.com/users/steveblamey/events{/privacy}","received_events_url":"https://api.github.com/users/steveblamey/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T11:09:32Z","updated_at":"2015-11-27T11:09:32Z","body":"fixes #69 Error adding periodic payment for Sales/Purchase Ledger Source\n\n\n→ <<cset 28a18d1da038>>"}}