PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2025 → Json et crochet
Json et crochet
Iniciado por Stéphane D., 12,dic. 2018 12:12 - 5 respuestas
Miembro registrado
231 mensajes
Publicado el 12,diciembre 2018 - 12:12
Bonjour à tous,
Je voudrais savoir comment faire pour passer les paramètres lorsque l'on a des : [ ]
Voici mon code :
vJsonIn.modeDepot="SAISIE_API"
vJsonIn.numeroFactureSaisi = Null

vJsonIn.destinataire.codeDestinataire = "22460001500511"
vJsonIn.destinataire.codeServiceExecutant = "DIRINFRA"

vJsonIn.fournisseur.idFournisseur = 160
vJsonIn.fournisseur.idServiceFournisseur = 436
vJsonIn.fournisseur.codeCoordonneesBancairesFournisseur = 132

vJsonIn.cadreDeFacturation.codeCadreFacturation = "A1_FACTURE_FOURNISSEUR"
vJsonIn.cadreDeFacturation.codeStructureValideur = Null

vJsonIn.references.deviseFacture = "EUR"
vJsonIn.references.typeFacture = "FACTURE"
vJsonIn.references.typeTva = "TVA_SUR_DEBIT"
vJsonIn.references.motifExonerationTva = Null
vJsonIn.references.numeroMarche = "VABFM001"
vJsonIn.references.numeroBonCommande = Null
vJsonIn.references.numeroFactureOrigine = Null
vJsonIn.references.modePaiement = "ESPECE"

//************************************************C'est ici que cela ne fonctionne pas********************************\\
vJsonIn.lignePoste.lignePosteNumero = 1
vJsonIn.lignePoste.lignePosteReference = "R1"
vJsonIn.lignePoste.lignePosteDenomination = "D1"
vJsonIn.lignePoste.lignePosteQuantite = 10
vJsonIn.lignePoste.lignePosteUnite = "lot"
vJsonIn.lignePoste.lignePosteMontantUnitaireHT = 50.000000
vJsonIn.lignePoste.lignePosteMontantRemiseHT = Null
vJsonIn.lignePoste.lignePosteTauxTva = "TVA5"
vJsonIn.lignePoste.lignePosteTauxTvaManuel = Null
//*********************************************************************************************************************\\

vJsonIn.montantTotal.montantHtTotal = 1326.000000
vJsonIn.montantTotal.montantTVA = 130.272000
vJsonIn.montantTotal.montantTtcTotal = 1406.272000
vJsonIn.montantTotal.montantRemiseGlobaleTTC = 50.000000
vJsonIn.montantTotal.motifRemiseGlobaleTTC = "Geste commercial"
vJsonIn.montantTotal.montantAPayer = 1400.000000

Voici le jSon à compléter :
{
"modeDepot" : "SAISIE_API",
"numeroFactureSaisi" : null,

"destinataire" : {
"codeDestinataire" : "22460001500511",
"codeServiceExecutant" : "DIRINFRA"
},
"fournisseur" : {
"idFournisseur" : 160,
"idServiceFournisseur" : 436,
"codeCoordonneesBancairesFournisseur" : 132
},
"cadreDeFacturation" : {
"codeCadreFacturation" : "A1_FACTURE_FOURNISSEUR",
"codeStructureValideur" : null
},
"references" : {
"deviseFacture" : "EUR",
"typeFacture" : "FACTURE",
"typeTva" : "TVA_SUR_DEBIT",
"motifExonerationTva" : null,
"numeroMarche" : "VABFM001",
"numeroBonCommande" : null,
"numeroFactureOrigine" : null,
"modePaiement" : "ESPECE"
},
****************************************************C'est ici les crochets****************************************
"lignePoste" : [
{
"lignePosteNumero" : 1,
"lignePosteReference" : "R1",
"lignePosteDenomination" : "D1",
"lignePosteQuantite" : 10,
"lignePosteUnite" : "lot",
"lignePosteMontantUnitaireHT" : 50.000000,
"lignePosteMontantRemiseHT" : null,
"lignePosteTauxTva" : "TVA5",
"lignePosteTauxTvaManuel" : null
}
,{
"lignePosteNumero" : 2,
"lignePosteReference" : "R2",
"lignePosteDenomination" : "D2",
"lignePosteQuantite" : 12,
"lignePosteUnite" : "Kg",
"lignePosteMontantUnitaireHT" : 36.000000,
"lignePosteMontantRemiseHT" : null,
"lignePosteTauxTva" : null,
"lignePosteTauxTvaManuel" : 2.1
}
,{
"lignePosteNumero" : 3,
"lignePosteReference" : "R3",
"lignePosteDenomination" : "D3",
"lignePosteQuantite" : 16,
"lignePosteUnite" : "lot",
"lignePosteMontantUnitaireHT" : 24.000000,
"lignePosteMontantRemiseHT" : null,
"lignePosteTauxTva" : null,
"lignePosteTauxTvaManuel" : 5
}
,{
"lignePosteNumero" : 4,
"lignePosteReference" : "XX",
"lignePosteDenomination" : "XX",
"lignePosteQuantite" : 1,
"lignePosteUnite" : "lot",
"lignePosteMontantUnitaireHT" : 10.000000,
"lignePosteMontantRemiseHT" : null,
"lignePosteTauxTva" : "TVA5",
"lignePosteTauxTvaManuel" : null
}
],
"ligneTva" : [
{
"ligneTvaTauxManuel" : null,
"ligneTvaTaux" : "TVA5",
"ligneTvaMontantBaseHtParTaux" : 510.000000,
"ligneTvaMontantTvaParTaux" : 102.000000
}
,{
"ligneTvaTauxManuel" : 2.1,
"ligneTvaTaux" : null,
"ligneTvaMontantBaseHtParTaux" : 432.000000,
"ligneTvaMontantTvaParTaux" : 9.072000
}
,{
"ligneTvaTauxManuel" : 5,
"ligneTvaTaux" : null,
"ligneTvaMontantBaseHtParTaux" : 384.000000,
"ligneTvaMontantTvaParTaux" : 19.200000
}
],
"montantTotal" : {
"montantHtTotal" : 1326.000000,
"montantTVA" : 130.272000,
"montantTtcTotal" : 1406.272000,
"montantRemiseGlobaleTTC" : 50.000000,
"motifRemiseGlobaleTTC" : "Geste commercial",
"montantAPayer" : 1400.000000
},
"commentaire" : "Création_VABF_SoumettreFacture"
}


Merci d'avance de votre aide.

--
Stéphane.
Mensaje modificado, 12,diciembre 2018 - 12:14
Miembro registrado
352 mensajes
Publicado el 12,diciembre 2018 - 12:18
vJsonIn.lignePoste[1].lignePosteNumero = 1
vJsonIn.lignePoste[2].lignePosteNumero = 2
.....
Miembro registrado
231 mensajes
Publicado el 12,diciembre 2018 - 14:08
Parfait merci Romu, sa fonctionne parfaitement.
Bonne fêtes de fin d'années.

--
Stéphane.
Miembro registrado
231 mensajes
Publicado el 12,diciembre 2018 - 14:37
Et une autre dernière question, comment je fais lorsque j'ai deux jSon à compléter ?
Toujours sur le même exemple, mais voici le lien pour retrouver la demande :
https://communaute.chorus-pro.gouv.fr/soumettre-facture/…
(En bas de page)
Merci d'avance.

--
Stéphane.
Miembro registrado
352 mensajes
Publicado el 12,diciembre 2018 - 14:48
Le soucis est que je ne comprends pas vraiment comment ça fonctionne, la partie "documentation" n'est pas très claire (même concernant le header), à moins qu'il s'agisse de 2 formats différents qui peuvent être envoyés.
Par exemple, on envoi une facture, les impots vont la traiter, quelques jours plus tard, on demande l'état de la facture.
Miembro registrado
231 mensajes
Publicado el 14,diciembre 2018 - 16:46
Ok super et encore merci de ton temps.
@+++ et bon Week-End

--
Stéphane.