Compare commits

..

2 Commits

Author SHA1 Message Date
Rohan
9606520064 fix: use Stripe's Price API for plan-price information (#26107)
* fix: use Stripe's new Plan API for price information

* patch: use inbuilt function to rename field

* fix: patch call

Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
Co-authored-by: Nabin Hait <nabinhait@gmail.com>
(cherry picked from commit 16eed07a0f)

# Conflicts:
#	erpnext/accounts/doctype/subscription_plan/subscription_plan.json
#	erpnext/erpnext_integrations/stripe_integration.py
#	erpnext/patches.txt
2025-01-03 00:13:41 +00:00
mergify[bot]
f5160dc83d fix: use Stock Qty while getting POS Reserved Qty (backport #38962) (#38983)
fix: use `Stock Qty` while getting `POS Reserved Qty`

(cherry picked from commit 7223106417)

Co-authored-by: s-aga-r <sagarsharma.s312@gmail.com>
2023-12-28 12:00:04 +05:30
5 changed files with 39 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ import frappe
from erpnext.hooks import regional_overrides
__version__ = "13.55.2"
__version__ = "13.54.4"
def get_default_company(user=None):

View File

@@ -704,7 +704,7 @@ def get_pos_reserved_qty(item_code, warehouse):
reserved_qty = (
frappe.qb.from_(p_inv)
.from_(p_item)
.select(Sum(p_item.qty).as_("qty"))
.select(Sum(p_item.stock_qty).as_("stock_qty"))
.where(
(p_inv.name == p_item.parent)
& (IfNull(p_inv.consolidated_invoice, "") == "")
@@ -715,7 +715,7 @@ def get_pos_reserved_qty(item_code, warehouse):
)
).run(as_dict=True)
return reserved_qty[0].qty or 0 if reserved_qty else 0
return flt(reserved_qty[0].stock_qty) if reserved_qty else 0
@frappe.whitelist()

View File

@@ -148,7 +148,11 @@
}
],
"links": [],
<<<<<<< HEAD
"modified": "2021-12-10 15:24:15.794477",
=======
"modified": "2021-08-13 10:53:44.205774",
>>>>>>> 16eed07a0f (fix: use Stripe's Price API for plan-price information (#26107))
"modified_by": "Administrator",
"module": "Accounts",
"name": "Subscription Plan",

View File

@@ -1,6 +1,11 @@
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
<<<<<<< HEAD
=======
import stripe
>>>>>>> 16eed07a0f (fix: use Stripe's Price API for plan-price information (#26107))
import frappe
import stripe
from frappe import _
@@ -23,6 +28,7 @@ def create_stripe_subscription(gateway_controller, data):
except Exception:
frappe.log_error(frappe.get_traceback())
<<<<<<< HEAD
return {
"redirect_to": frappe.redirect_to_message(
_("Server Error"),
@@ -31,6 +37,14 @@ def create_stripe_subscription(gateway_controller, data):
),
),
"status": 401,
=======
return{
"redirect_to": frappe.redirect_to_message(
_('Server Error'),
_("It seems that there is an issue with the server's stripe configuration. In case of failure, the amount will get refunded to your account.")
),
"status": 401
>>>>>>> 16eed07a0f (fix: use Stripe's Price API for plan-price information (#26107))
}
@@ -44,12 +58,17 @@ def create_subscription_on_stripe(stripe_settings):
customer = stripe.Customer.create(
source=stripe_settings.data.stripe_token_id,
description=stripe_settings.data.payer_name,
<<<<<<< HEAD
email=stripe_settings.data.payer_email,
=======
email=stripe_settings.data.payer_email
>>>>>>> 16eed07a0f (fix: use Stripe's Price API for plan-price information (#26107))
)
subscription = stripe.Subscription.create(customer=customer, items=items)
if subscription.status == "active":
<<<<<<< HEAD
stripe_settings.integration_request.db_set("status", "Completed", update_modified=False)
stripe_settings.flags.status_changed_to = "Completed"
@@ -58,6 +77,16 @@ def create_subscription_on_stripe(stripe_settings):
frappe.log_error("Subscription N°: " + subscription.id, "Stripe Payment not completed")
except Exception:
stripe_settings.integration_request.db_set("status", "Failed", update_modified=False)
=======
stripe_settings.integration_request.db_set('status', 'Completed', update_modified=False)
stripe_settings.flags.status_changed_to = "Completed"
else:
stripe_settings.integration_request.db_set('status', 'Failed', update_modified=False)
frappe.log_error('Subscription N°: ' + subscription.id, 'Stripe Payment not completed')
except Exception:
stripe_settings.integration_request.db_set('status', 'Failed', update_modified=False)
>>>>>>> 16eed07a0f (fix: use Stripe's Price API for plan-price information (#26107))
frappe.log_error(frappe.get_traceback())
return stripe_settings.finalize_request()

View File

@@ -301,10 +301,13 @@ erpnext.patches.v13_0.update_export_type_for_gst #2021-08-16
erpnext.patches.v13_0.update_tds_check_field #3
erpnext.patches.v13_0.update_recipient_email_digest
erpnext.patches.v13_0.shopify_deprecation_warning
<<<<<<< HEAD
erpnext.patches.v13_0.add_custom_field_for_south_africa #2
erpnext.patches.v13_0.rename_discharge_ordered_date_in_ip_record
erpnext.patches.v13_0.remove_bad_selling_defaults
erpnext.patches.v13_0.trim_whitespace_from_serial_nos # 16-01-2022
=======
>>>>>>> 16eed07a0f (fix: use Stripe's Price API for plan-price information (#26107))
erpnext.patches.v13_0.migrate_stripe_api
erpnext.patches.v13_0.reset_clearance_date_for_intracompany_payment_entries
execute:frappe.reload_doc("erpnext_integrations", "doctype", "TaxJar Settings")