Number is inserted to collection as text

Note: your code is not correctly handling the Promise returned from the insert() function. Lines 64 to 75 should be something like this:

console.log('toInsert', toInsert);
wixData.insert("OrdersList", toInsert)
.then(() => {
   console.log('added')
   $w('#dataBox').hide();
   $w('#loadingBox').show();
   $w("#text15").scrollTo();
   $w('#dataset1').refresh()
      .then(() => {
         wixLocation.to(`/NewOrder/${$w('#orderNumber').text}`)
         });
   });