Skip to content

WP payment query: Wrong payment amount calculated #317

Closed
@sandhiyakavi

Description

@sandhiyakavi

Description:

Wrong payment amount calculated while trying WP payment query.

WP_payment_query

  1. Member rate set as 200 for all records
    image

  2. Check using GET/work-periods?page=1&perPage=10&projectId=17768&startDate=2023-01-29

[
    {
        "userHandle": "TCConnCopilot",
        "updatedBy": null,
        "endDate": "2023-02-04",
        "resourceBookingId": "ea9e9c92-8e73-4d9d-9b2a-8ccd3b69378f",
        "daysWorked": null,
        "payments": [
            {
                "createdAt": "2021-06-08T05:32:15.779Z",
                "amount": 500,
                "challengeId": null,
                "updatedBy": null,
                "createdBy": "71c5e6a8-51d9-4fb5-91ce-d974642531af",
                "billingAccountId": 80000068,
                "id": "598900b8-2132-42f8-8c3f-56ff7adf6152",
                "workPeriodId": "f0206476-6fe6-4919-b1cc-5e2f7825b35d",
                "status": "scheduled",
                "updatedAt": "2021-06-08T05:32:15.779Z"
            }
        ],
        "createdAt": "2021-06-08T03:44:25.499Z",
        "memberRate": null,
        "createdBy": "00000000-0000-0000-0000-000000000000",
        "customerRate": null,
        "id": "f0206476-6fe6-4919-b1cc-5e2f7825b35d",
        "projectId": 17768,
        "startDate": "2023-01-29",
        "paymentStatus": "pending",
        "updatedAt": "2021-06-08T03:44:25.499Z"
    },
    {
        "userHandle": "tester1234",
        "updatedBy": null,
        "endDate": "2023-02-04",
        "resourceBookingId": "677e05c6-f053-406b-a559-f72684c57524",
        "daysWorked": null,
        "createdAt": "2021-06-08T03:45:54.593Z",
        "memberRate": null,
        "createdBy": "00000000-0000-0000-0000-000000000000",
        "customerRate": null,
        "id": "cafdb216-e1fe-4411-b302-0aa7d91fe0c8",
        "projectId": 17768,
        "startDate": "2023-01-29",
        "paymentStatus": "pending",
        "updatedAt": "2021-06-08T03:45:54.593Z"
    },
    {
        "userHandle": "GunaK-TopCoder",
        "updatedBy": null,
        "endDate": "2023-02-04",
        "resourceBookingId": "97a7e21f-4b27-44db-972a-707d3ecec420",
        "daysWorked": null,
        "payments": [
            {
                "createdAt": "2021-06-08T05:32:16.008Z",
                "amount": 500,
                "challengeId": null,
                "updatedBy": null,
                "createdBy": "71c5e6a8-51d9-4fb5-91ce-d974642531af",
                "billingAccountId": 80000068,
                "id": "12ce7b87-3516-4ccb-952c-aa950aac125d",
                "workPeriodId": "c37dbf40-bd63-4555-ae5d-eba02d52a173",
                "status": "scheduled",
                "updatedAt": "2021-06-08T05:32:16.008Z"
            }
        ],
        "createdAt": "2021-06-08T03:45:31.461Z",
        "memberRate": null,
        "createdBy": "00000000-0000-0000-0000-000000000000",
        "customerRate": null,
        "id": "c37dbf40-bd63-4555-ae5d-eba02d52a173",
        "projectId": 17768,
        "startDate": "2023-01-29",
        "paymentStatus": "pending",
        "updatedAt": "2021-06-08T03:45:31.461Z"
    },
    {
        "userHandle": "pshah_manager",
        "updatedBy": null,
        "endDate": "2023-02-04",
        "resourceBookingId": "d552991a-5c00-4abd-a9a4-e590418c6808",
        "daysWorked": null,
        "payments": [
            {
                "createdAt": "2021-06-08T05:32:15.969Z",
                "amount": 500,
                "challengeId": null,
                "updatedBy": null,
                "createdBy": "71c5e6a8-51d9-4fb5-91ce-d974642531af",
                "billingAccountId": 80000068,
                "id": "df05bcc2-4480-4a05-9580-ef8ef866c890",
                "workPeriodId": "a1eb95a8-2f78-4268-acf7-78e8f1a64063",
                "status": "scheduled",
                "updatedAt": "2021-06-08T05:32:15.969Z"
            }
        ],
        "createdAt": "2021-06-08T03:45:10.480Z",
        "memberRate": null,
        "createdBy": "00000000-0000-0000-0000-000000000000",
        "customerRate": null,
        "id": "a1eb95a8-2f78-4268-acf7-78e8f1a64063",
        "projectId": 17768,
        "startDate": "2023-01-29",
        "paymentStatus": "pending",
        "updatedAt": "2021-06-08T03:45:10.480Z"
    },
    {
        "userHandle": "nkumar1",
        "updatedBy": null,
        "endDate": "2023-02-04",
        "resourceBookingId": "d7c0c3d2-5e07-4745-ac9e-045df576d89b",
        "daysWorked": null,
        "payments": [
            {
                "createdAt": "2021-06-08T05:32:15.847Z",
                "amount": 500,
                "challengeId": null,
                "updatedBy": null,
                "createdBy": "71c5e6a8-51d9-4fb5-91ce-d974642531af",
                "billingAccountId": 80000068,
                "id": "fbe11d19-a32d-439b-aebf-b8e7185693fd",
                "workPeriodId": "0a6921d0-b691-437e-a18e-cbca73c5cb6c",
                "status": "scheduled",
                "updatedAt": "2021-06-08T05:32:15.847Z"
            }
        ],
        "createdAt": "2021-06-08T03:44:49.869Z",
        "memberRate": null,
        "createdBy": "00000000-0000-0000-0000-000000000000",
        "customerRate": null,
        "id": "0a6921d0-b691-437e-a18e-cbca73c5cb6c",
        "projectId": 17768,
        "startDate": "2023-01-29",
        "paymentStatus": "pending",
        "updatedAt": "2021-06-08T03:44:49.869Z"
    }
]

Actual result:

The amount is set to 500 for all payments (it should be 200) and one payment for "resourceBookingId": "677e05c6-f053-406b-a559-f72684c57524", the payment is not created but displayed as success in response.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions