Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy peppol #286

Open
JochemVH1 opened this issue Jul 3, 2024 · 0 comments
Open

Deploy peppol #286

JochemVH1 opened this issue Jul 3, 2024 · 0 comments

Comments

@JochemVH1
Copy link
Collaborator

JochemVH1 commented Jul 3, 2024

Zeker mee uit te voeren bij live gang peppol:

1) Postcode en land opsplitsen connection string invullen van prod mongo:
Ik ga er hier van uit dat de postcode alleen maar cijfers bevatten indien dit niet zo is dan moeten in beide scripts de regex aangepast worden
Ook checken dat in de bestaande clients and invoices.client het eerst postalcode is en dan city, anders gaat de regex ook aangepast moeten worden

Mongo script voor het aanpassen van de client in de bestaande invoices:

const connectionString = '';
db = connect(connectionString);

db.invoices.find().forEach((doc) => {
    const input = doc.client.city;
    const regex = /^(\d+)\s(.+)$/;
    const result = input.match(regex);

    if (result) {
        const postalCode = result[1];
        const city = result[2];
        const filter= {_id: doc._id};
        const update = { $set: { 'client.city': city, 'client.postalCode': postalCode }}
        db.invoices.updateOne(filter, update)
    } else {
        console.log('Could not match client city for invoice'.concat(doc._id));
    }
})

Mongo script voor het aanpassen van de bestaande clients:

const connectionString = '';
db = connect(connectionString);

db.clients.find().forEach((doc) => {
    const input = doc.city;
    const regex = /^(\d+)\s(.+)$/;
    const result = input.match(regex);

    if (result) {
        const postalCode = result[1];
        const city = result[2];
        const filter= {_id: doc._id};
        const update = { $set: { 'city': city, 'postalCode': postalCode }}
        db.clients.updateOne(filter, update)
    } else {
        console.log('Could not match client city for invoice'.concat(doc._id));
    }
})

Mongo script voor het aanpassen van your company in de bestaande invoices:

const connectionString = '';
db = connect(connectionString);

db.invoices.find().forEach((doc) => {
    const input = doc.your.city;
    if(input){
        const regex = /^(\d+)\s(.+)$/;
        const result = input.match(regex);
        if (result) {
            const postalCode = result[1];
            const city = result[2];
            const filter= {_id: doc._id};
            const update = { $set: { 'your.city': city, 'your.postalCode': postalCode }}
            db.invoices.updateOne(filter, update)
        } else {
            console.log('Could not match client city for invoice'.concat(doc._id));
        } 
    }
})

2) Nieuwe setting voor de factuur datum moet ingesteld worden voor de bestaande klanten en config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant