05/06/23 - 17h

master
cherif 2023-06-05 17:29:39 +02:00
parent 40ccd19f0a
commit acc5705f2d
7 changed files with 3022 additions and 24 deletions

View File

@ -1,15 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="02/06/23 - 22h">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="05/06/23 - 15h">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Template/MySy_Invoice_tpl.html" beforeDir="false" afterPath="$PROJECT_DIR$/Template/MySy_Invoice_tpl.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Template/MySy_Sales_Order_tpl.html" beforeDir="false" afterPath="$PROJECT_DIR$/Template/MySy_Sales_Order_tpl.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Template/invoice.html" beforeDir="false" afterPath="$PROJECT_DIR$/Template/invoice.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/code_promo_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/code_promo_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/ela_factures_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/ela_factures_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/email_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/email_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/strype_payement.py" beforeDir="false" afterPath="$PROJECT_DIR$/strype_payement.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -291,7 +289,14 @@
<option name="project" value="LOCAL" />
<updated>1685735947619</updated>
</task>
<option name="localTasksCounter" value="32" />
<task id="LOCAL-00032" summary="05/06/23 - 15h">
<created>1685969841934</created>
<option name="number" value="00032" />
<option name="presentableId" value="LOCAL-00032" />
<option name="project" value="LOCAL" />
<updated>1685969841934</updated>
</task>
<option name="localTasksCounter" value="33" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -306,7 +311,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="14/04/23 - 23h" />
<MESSAGE value="15/04/23 - 14h" />
<MESSAGE value="15/04/23 - 22h" />
<MESSAGE value="20/04/23 - 16h" />
@ -331,6 +335,7 @@
<MESSAGE value="29/0523 - 20h" />
<MESSAGE value="30/05/23 - 22h" />
<MESSAGE value="02/06/23 - 22h" />
<option name="LAST_COMMIT_MESSAGE" value="02/06/23 - 22h" />
<MESSAGE value="05/06/23 - 15h" />
<option name="LAST_COMMIT_MESSAGE" value="05/06/23 - 15h" />
</component>
</project>

File diff suppressed because one or more lines are too long

View File

@ -190,7 +190,7 @@
<tr>
<td>Montant Remise </td>
<td>{{params.discount_montant_remise}}</td>
<td>( {{params.discount_montant_remise}} )</td>
</tr>
{% endif %}
<tr>

View File

@ -181,7 +181,7 @@
<tr>
<td>Montant Remise </td>
<td>{{params.discount_montant_remise}}</td>
<td>( {{params.discount_montant_remise}} )</td>
</tr>
{% endif %}
<tr>

View File

@ -90,7 +90,7 @@
<td style="text-align:left;">&nbsp; </td>
<td style="text-align:left;">&nbsp; </td>
<td style="text-align:center;">Montant Remise : </td>
<td style="text-align:center;">{{json_data.discount_montant_remise}}</td>
<td style="text-align:center;">( {{json_data.discount_montant_remise}} )</td>
</tr>
{% endif %}

View File

@ -628,7 +628,7 @@ def createOrder(diction):
#print(" #### fix : montant_remise = ", montant_remise)
#print(" #### fix : total_ht = ", total_ht)
if(mycommon.tryFloat(str(total_ht)) <= 0 ):
if(mycommon.tryFloat(str(total_ht)) < 0 ):
mycommon.myprint(
str(inspect.stack()[0][
3]) + " La remise est supérieure au montant HT. ")
@ -765,8 +765,12 @@ def createOrder(diction):
#print(" new_data['total_ht'] = "+str(new_data['total_ht']) + " -- new_data['total_tva'] "
# +str(new_data['total_tva'])+ " -- new_data['total_ttc'] = "+ str(new_data['total_ttc']))
# Les données de payement ne sont utilisées que si le montant > 0
if (total_ttc_float > 0):
"""
# Les données de payement ne sont utilisées que si le montant > 0 ou si il y a un code promo.
En effet on peut avoir montant TTC = 0 par qu'on a benéficié d'un code promo à 100%
"""
if (total_ttc_float > 0 or len(str(discount_code)) > 2 ):
if ("type" in part_account[0].keys()):
if part_account[0]['type']:
new_data['type_payment'] = part_account[0]['type']
@ -847,7 +851,7 @@ def createOrder(diction):
# Facturation de la commande
print(" ######## lancement de la facturation total_ttc_float = " + str(total_ttc_float))
if (total_ttc_float > 0):
if (total_ttc_float > 0 or len(str(discount_code)) > 2):
CreateInvoice(new_data)
# Apres la facturation, on met à jour le display_ranking des formations du partenaire.

View File

@ -831,6 +831,7 @@ def strip_update_subscription_qty(diction):
inspect.stack()[0][3]) + " Le champ '" + val + "' n'existe pas. ")
return False, " Les informations fournies sont incorrecte",
print(" ### strip_update_subscription_qty : diction = ", diction)
"""
Controle des champs Obligatoires
"""
@ -878,11 +879,13 @@ def strip_update_subscription_qty(diction):
str(inspect.stack()[0][3]) + " Impossible d'annuler le payement ")
return False, " Impossible de changer la quantité de l'abonnement "
print(" ### local_ret_val = ", local_ret_val)
pack = ""
if ("pack_service" in local_ret_val.keys()):
if local_ret_val['pack_service']:
pack = local_ret_val['pack_service']
print(" ### pack = ", pack)
discount_code = ""
if ("discount_code" in diction.keys()):
if diction['discount_code']:
@ -908,7 +911,7 @@ def strip_update_subscription_qty(diction):
price_id = MYSY_GV.STRIPE_GOLD_PRICE_ID_100_OFF
elif (str(pack).lower() == "standard" and str(discount_type) == "percent"):
elif (str(pack).lower() == "standard" ):
price_id = MYSY_GV.STRIPE_STANDARD_PRICE_ID
# On ecrase la valeur celle du discount si il existe une discount
if (str(discount_valeur) == "50" and str(discount_type) == "percent"):
@ -922,17 +925,33 @@ def strip_update_subscription_qty(diction):
print(" #### str(local_ret_val['stripe_subscription_id']) = ", str(local_ret_val['stripe_subscription_id']))
print(" ### price_id = ", price_id)
current_subscription = stripe.Subscription.retrieve(str(local_ret_val['stripe_subscription_id']))
#a = stripe.SubscriptionSchedule.release( str(local_ret_val['stripe_subscription_id']), )
a = stripe.Subscription.modify(
str(local_ret_val['stripe_subscription_id']),
proration_behavior='create_prorations',
items=[{
'id': current_subscription['items'].data[0].id,
'quantity': qty,
}]
)
if( discount_code ):
a = stripe.Subscription.modify(
str(local_ret_val['stripe_subscription_id']),
proration_behavior='create_prorations',
items=[{
'id': current_subscription['items'].data[0].id,
'price': price_id,
'quantity': qty,
}]
)
else:
a = stripe.Subscription.modify(
str(local_ret_val['stripe_subscription_id']),
proration_behavior='create_prorations',
items=[{
'id': current_subscription['items'].data[0].id,
'price': price_id,
'quantity': qty,
}]
)
#print(" ### aa = ", a)
arret_abonnement = datetime.today().date() + relativedelta(months=+1)
@ -988,6 +1007,7 @@ def strip_update_subscription_plan(diction):
inspect.stack()[0][3]) + " Le champ '" + val + "' n'existe pas. ")
return False, " Les informations fournies sont incorrecte",
print(" ### strip_update_subscription_plan : diction = ", diction)
"""
Controle des champs Obligatoires
"""
@ -1084,8 +1104,8 @@ def strip_update_subscription_plan(diction):
price_id = MYSY_GV.STRIPE_TEST_PRICE_ID
#print(" ### pack = ", pack, " ## price_id = ", price_id)
#print(" #### str(local_ret_val['stripe_subscription_id']) = ", str(local_ret_val['stripe_subscription_id']))
print(" ### pack = ", pack, " ## price_id = ", price_id, " ### qty = ", qty)
print(" #### str(local_ret_val['stripe_subscription_id']) = ", str(local_ret_val['stripe_subscription_id']))
current_subscription = stripe.Subscription.retrieve(str(local_ret_val['stripe_subscription_id']))