Waiting manual payment not substract from the total

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1364786
    Mickael Quirin
    Participant

    Hello
    Some times my clients send me a part of the payment by the post or by others ways, I add them in manual payment in status on hold.
    But the issue with this is that thoses payements are not substracted of the total when I send them the payment link, the only way to substract them is set the status to completed which is not ideal.
    From my point of view a payement on hold/waiting should be substracted from the total.
    Is there a way to do it ?
    Even if I need to modify code I’ll do it. (since it take status completed in consideration,I assume it’ll really not be complicated to add also status on hold too)

    Thanks

    #1364810
    Mickael Quirin
    Participant

    For thoses who are interrested in the modification I juste modified a line in PaymentUtils.php (path : wp-content/plugins/mphb-request-payment/classes/Utils/PaymentUtils.php )

    Line 16
    replace if ($payment->getStatus() == PaymentStatuses::STATUS_COMPLETED) {

    by
    if ($payment->getStatus() == PaymentStatuses::STATUS_COMPLETED || $payment->getStatus() == PaymentStatuses::STATUS_ON_HOLD ) {

    It’ll take the on_hold payement in count of ammount already paid.
    As far I I can tell it modify only the payment link of the plugin payment-request.
    The on hold payment is not marked as paid in the backoffice.

    If that could be added in a way or another officialy that could be nice to avoid overwriting it with an update

    #1364812
    Mickael Quirin
    Participant
    #1366292
    J. Davis
    Keymaster

    Hi Mickael,

    Thanks for your reply and for the shared experience. Unfortunately, we do not offer customization orders of this type as all our developers are involved in the development process of the themes and plugins.

    best regards,
    John Davis

    #1366370
    Mickael Quirin
    Participant

    I don’t really understand your reply. I know your dev are involved in the dev process of theme and plugins (what they would do otherwise).

    I Don’t think I’m the only one concerned by this and the modification is ,like I showed, really simple to add.

    Anyway, if nobody wants it I do not have issue with that either.

    #1366575
    J. Davis
    Keymaster

    Hi Mickael,

    I’m sorry I meant that there was no free developer who might do this customization. I’ve made some research myself and you may try to modify the following files by adding the lines below instead of the default

    line 829
    \wp-content\plugins\motopress-hotel-booking\template-functions.php

    if ($payment->getStatus() == PaymentStatuses::STATUS_COMPLETED || PaymentStatuses::STATUS_ON_HOLD) {

    line 250 \wp-content\plugins\motopress-hotel-booking\includes\admin\manage-cpt-pages\booking-manage-cpt-page.php

    'post_status' => array('mphb-p-on-hold','mphb-p-completed')

    Unfortunately, I did not test if it works correctly everywhere so I can not guarantee it will work correctly. Let me know if it is helpful.

    best regards,
    John Davis

    #1366588
    Mickael Quirin
    Participant

    Thanks for your reply.
    I was probably not clear enough (english not my natural language, sorry :/ ).
    I wasn’t asking for help to modify the code, I know you’re busy and can’t take all request like that, I was just asking if my modification could be added if thats something others peoples want too.

    And if not, what could I do to avoid loosing my modification with future update.

    I tested your code, it work well but I prefer mine. I’d rather show not paid in invoice and admin page as long as the status is still on hold.
    I just wanted to not bill a customer for something he already paid (which is what my modification do).

    Sorry if I made myself unclear and maybe offensive in any way, thats wasn’t the goal.

    #1367942
    J. Davis
    Keymaster

    Hi Mickael,

    Thanks for your clarification. Usually, we measure the priority of the request by the votes under this request. So we may keep an eye on the topic and check if this feature is highly required by a community.
    Thank you for the solution that you have described and do not hesitate to ask any additional questions.

    best regards,
    John Davis

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.