Skip to content

Payment terms is always resetting when opened for editing #1036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jmgasper opened this issue Apr 15, 2025 · 6 comments
Open

Payment terms is always resetting when opened for editing #1036

jmgasper opened this issue Apr 15, 2025 · 6 comments

Comments

@jmgasper
Copy link
Collaborator

REF: https://topcoder.atlassian.net/browse/PM-1081

Go to billing accounts page

click Edit account

See the payments terms filed is empty even it was saved with a value

Image
https://github.com/user-attachments/assets/52e729ff-8b67-4e87-bb00-e59ddcff35c8

@phead198708
Copy link

hey, @jmgasper do you know any valid payment term id ? I checked many billing accounts on dev environment, but all of them's payment term are null. When we fetch the billing account data, it will associate payment_terms table on SQL level.

SELECT p.project_id AS id,
       p.name AS name,
       pt.payment_terms_id AS paymentTerms_id,
       pt.description AS paymentTerms_description,
       RTRIM(decode (p.active, 1, 'Active', 'Inactive')) AS status,
       p.sales_tax AS salesTax,
       p.po_box_number AS poNumber,
       p.start_date AS startDate,
       p.end_date AS endDate,
       p.budget AS budgetAmount,
       p.creation_date AS createdAt,
       p.creation_user AS createdBy,
       p.modification_date AS updatedAt,
       p.modification_user AS updatedBy,
       p.description AS description,
       p.subscription_number AS subscriptionNumber,
       p.company_id AS companyId,
       p.is_manual_prize_setting AS manualPrizeSetting,
       cp.client_id AS clientId,
       p.billable as billable
FROM project p
LEFT OUTER JOIN  payment_terms pt ON pt.payment_terms_id = p.payment_terms_id
LEFT OUTER JOIN client_project cp ON cp.project_id = p.project_id
WHERE p.project_id = :billingAccountId

if the payment terms id is not an existed id, then, it will make paymentTerms_id null.

@jmgasper
Copy link
Collaborator Author

@phead198708 - Here's a spreadsheet of 100 BAs that have a payment terms ID set

dev_BAs.csv

@phead198708
Copy link

I tried to set payment term id to 1, but the update endpoint doesn't return the new value.

Image

Image

Image

@jmgasper
Copy link
Collaborator Author

@phead198708 - I dug into the API here. This is a long-standing bug that would take a fair bit of work to fix. We're replacing the billing API in the next couple of months, so I'm not gonna fix it. For now, let's just disable the payment terms text fields.

@phead198708
Copy link

hey, @jmgasper if we disable the payment terms text fields, the value will be null in the update request body which is not allowed by the endpoints.

If we aims to disable this field, i think we could send what we received when we update the object. But in dev environment, the payment terms we received is always null, Im not sure it is the code issue or data issue, could you help to check both dev and prod environment ? because if we received null, and set it to the request body, it will always returns error when we update the BA.

@jmgasper
Copy link
Collaborator Author

jmgasper commented Jun 5, 2025

@phead198708 - All BAs created in the last 3 years have payment_terms_id=1 in the database - let's just hard-code that for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants