30/08/22 - 15h
parent
7f4b682572
commit
7ecb3ab91b
|
@ -455,15 +455,26 @@ def createOrder(diction):
|
||||||
if part_account[0]['invoice_telephone']:
|
if part_account[0]['invoice_telephone']:
|
||||||
new_data['invoice_telephone'] = part_account[0]['invoice_telephone']
|
new_data['invoice_telephone'] = part_account[0]['invoice_telephone']
|
||||||
|
|
||||||
|
total_ht = 0
|
||||||
|
new_data['total_ht'] = total_ht
|
||||||
|
new_data['total_tva'] = mycommon.tryFloat(str(total_ht)) * MYSY_GV.TVA_TAUX
|
||||||
|
new_data['total_ttc'] = mycommon.tryFloat(str(total_ht)) + mycommon.tryFloat(str(new_data['total_tva']))
|
||||||
|
|
||||||
|
|
||||||
# Recuperation ds données de payement
|
# Recuperation ds données de payement
|
||||||
coll_part_payment = MYSY_GV.dbname['payement_mode']
|
coll_part_payment = MYSY_GV.dbname['payement_mode']
|
||||||
part_account = coll_part_payment.find({'client_recid': user_recid, 'valide': '1'})
|
part_account = coll_part_payment.find({'client_recid': user_recid, 'valide': '1'})
|
||||||
if( part_account.count() <= 0 ):
|
|
||||||
mycommon.myprint(
|
|
||||||
str(inspect.stack()[0][3]) + "Aucune donnée de payement, Impossible de créer la commande ")
|
|
||||||
return False, "Aucune donnée de payement,, Impossible de créer la commande ", None
|
|
||||||
|
|
||||||
|
total_ttc_float = mycommon.tryFloat(str(new_data['total_ttc']))
|
||||||
|
print( "str(new_data['total_ttc']) === "+str(total_ttc_float))
|
||||||
|
|
||||||
|
if( part_account.count() <= 0 and total_ttc_float > 0):
|
||||||
|
mycommon.myprint(
|
||||||
|
str(inspect.stack()[0][3]) + " Aucune donnée de payement, Impossible de créer la commande ")
|
||||||
|
return False, " Aucune donnée de payement,, Impossible de créer la commande ", None
|
||||||
|
|
||||||
|
# Les données de payement ne sont utilisées que si le montatn > 0
|
||||||
|
if( total_ttc_float > 0 ):
|
||||||
if ("type" in part_account[0].keys()):
|
if ("type" in part_account[0].keys()):
|
||||||
if part_account[0]['type']:
|
if part_account[0]['type']:
|
||||||
new_data['type_payment'] = part_account[0]['type']
|
new_data['type_payment'] = part_account[0]['type']
|
||||||
|
@ -498,7 +509,7 @@ def createOrder(diction):
|
||||||
|
|
||||||
new_data['nb_product'] = str(nb_line)
|
new_data['nb_product'] = str(nb_line)
|
||||||
i = 0
|
i = 0
|
||||||
total_ht = 0
|
|
||||||
while (i < nb_line):
|
while (i < nb_line):
|
||||||
print("PRODUIT N° " + str((i + 1)) + " : " )
|
print("PRODUIT N° " + str((i + 1)) + " : " )
|
||||||
line_dict = json.loads(diction[str(i)])
|
line_dict = json.loads(diction[str(i)])
|
||||||
|
@ -525,9 +536,6 @@ def createOrder(diction):
|
||||||
|
|
||||||
i = i + 1
|
i = i + 1
|
||||||
|
|
||||||
new_data['total_ht'] = total_ht
|
|
||||||
new_data['total_tva'] = mycommon.tryFloat( str(total_ht) ) * MYSY_GV.TVA_TAUX
|
|
||||||
new_data['total_ttc'] = mycommon.tryFloat(str(total_ht))+mycommon.tryFloat(str(new_data['total_tva']))
|
|
||||||
|
|
||||||
print(" new_data['total_ht'] = "+str(new_data['total_ht']) + " -- new_data['total_tva'] "
|
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']))
|
+str(new_data['total_tva'])+ " -- new_data['total_ttc'] = "+ str(new_data['total_ttc']))
|
||||||
|
|
Loading…
Reference in New Issue