Script för packsoft online - Sidan 5 - Ehandel.se
Ehandel.se Forum

Gå tillbaka   Ehandel.se > >

Svara
 
Ämnesverktyg Visningsalternativ
  #41  
Gammal 2017-01-06, 21:43
PontusAndersson PontusAndersson är inte uppkopplad
Novis
Script för packsoft online Hallabalo.se
Script för packsoft online Hallabalo.se
 
Reg.datum: mar 2016
Inlägg: 19
PontusAndersson is on a distinguished road
Standard

Nu har jag löst scriptet. Fick ändra lite knappnamn samt lägga in ett extra moment för att ta sig till utskriftfavoriten.

Kod:
// ==UserScript==
// @name          varubrev
// @namespace     www.fractalposter.com
// @author        Mikael Backlund
// @description   Varubrev
// @include       https://po.unifaun.se*
// @include       http://hallabalo.se*
// @require 	    http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
// @version		    001
// @grant       GM_getValue
// @grant       GM_setValue
// ==/UserScript==
// Base url of page to collect addresses on.
var customer_info_url_base = 'hallabalo.se/din_sökväg.php';
// When object of this class is clicked on the above page addresses are collected
var object_class_to_click = '.knapp';
// Pacsoft online user id
var my_pacsoft_uid = 'DITT PACKSOFT ID';
// Pacsoft online password
var my_pacsoft_pwd = 'DITT PACKSOFT LÖSENORD';
// Name on image next to favorite <img name="xxxxxxxx">
var favorite_html_name = "act_ShipmentJobFavoriteSearchActions_SearchResultEdit_RowId_19404"; //ÄNDRA DETTA PÅ RAD 66
// Senders packsoft customer number
var my_packsoft_customer_nr = '1';


// Class of <p> with customer name etc...
var click_class      = ".knapp";
var customer_name_class      = ".customer_name";
var customer_address1_class  = ".customer_address1";
var customer_address2_class  = ".customer_address2";
var customer_postcode_class  = ".customer_postcode";
var customer_email_class     = ".customer_email";
var customer_telephone_class = ".customer_telephone";
var customer_order_id_class  = ".customer_order_id";
var customer_names      = new Array();
var customer_address1s  = new Array();
var customer_address2s  = new Array();
var customer_postcodes  = new Array();
var customer_emails     = new Array();
var customer_telephones = new Array();
var customer_order_ids  = new Array();

// Attach the collect_addresses function to a object on the page with addresses
if (window.location.href.indexOf(customer_info_url_base) > - 1) {
  $(object_class_to_click).click(collect_addresses);
} // The login page of packsoft online
 else if (GM_getValue('trigger') == '1' && $('button[name="act_LoginActions_Login"]') [0]) {
  $('input[name="CompanyLogin"]').val(my_pacsoft_uid);
  $('input[name="UserPass"]').val(my_pacsoft_pwd);
  GM_setValue('trigger', '2');
  setTimeout(function () {
    $('button[name="act_LoginActions_Login"]').trigger('click');
  }, 100);
} // Packsoft home screen, go to my favorite named Varubrev
else if (GM_getValue("trigger")== '2' && document.location.href.indexOf("Action=act_PostRedirectHomeActions_Render") > -1) {
  GM_setValue("trigger", "3");
  GM_setValue("session_link", document.location.href.split("&")[0].split("?")[1]);
  document.location = "webapp?"+GM_getValue("session_link")+"&Action=act_MenuActions_Item&Target=body&ItemHandler=ShipmentJobFavoriteSearchActions2";  
} 

else if (GM_getValue("trigger")== '3' && document.location.href.indexOf("Action=act_ShipmentJobFavoriteSearchActions_Render") > -1) {
  GM_setValue("trigger", "4");
// alert('Samlade kundadress.');
  
  $('button[name="act_ShipmentJobFavoriteSearchActions_SearchResultEdit_RowId_19404"]').trigger('click'); 
} 
// Fill the first page of the form press next (do while there is addresses left) 
 else if (GM_getValue('trigger') == '4' && GM_getValue('no_of_customers') > 0 && $('button[name="act_ShipmentJobEdit1Actions2_Next"]') [0]) {
  $('input[name="RECEIVERName"]').val(GM_getValue('customer_names').split('¤') [GM_getValue('no_of_customers') - 1]);
  $('input[name="RECEIVERDeliveryAddress1"]').val(GM_getValue('customer_address1s').split('¤') [GM_getValue('no_of_customers') - 1]);
  $('input[name="RECEIVERDeliveryAddress2"]').val(GM_getValue('customer_address2s').split('¤') [GM_getValue('no_of_customers') - 1]);
  $('input[name="RECEIVERDeliveryZipcode"]').focus();
  $('input[name="RECEIVERDeliveryZipcode"]').val(GM_getValue('customer_postcodes').split('¤') [GM_getValue('no_of_customers') - 1]);
   setTimeout(function () {
   $('button[name="act_ShipmentJobEdit1Actions2_Folding_FoldName_RECEIVERDeliveryZipcode$HelpNote"]').trigger('click');
  $('input[name="RECEIVERDeliveryZipcode"]').blur();
  $('input[name="RECEIVERSms"]').focus();
  $('input[name="RECEIVERSms"]').val(GM_getValue('customer_telephones').split('¤') [GM_getValue('no_of_customers') - 1]);
  $('input[name="RECEIVEREmail"]').val(GM_getValue('customer_emails').split('¤') [GM_getValue('no_of_customers') - 1]);
  setTimeout(function () {
    $('button[name="act_ShipmentJobEdit1Actions2_Next"]').trigger('click');
  }, 400);
     }, 100);
} // Fill the second page of the form click "lagra" (do while there is addresses left) 
 else if (GM_getValue('trigger') == '4' && GM_getValue('no_of_customers') > 0 && $('button[name="act_ShipmentJobEdit2Actions2_Store"]') [0]) {
  $('input[name="ShipmentSndReference"]').val(GM_getValue('customer_order_ids').split('¤') [GM_getValue('no_of_customers') - 1]);
  $('select[name="SenderCustNo"]').val(my_packsoft_customer_nr);
  GM_setValue('no_of_customers', GM_getValue('no_of_customers') - 1);
  if (GM_getValue('no_of_customers') === 0)
  GM_setValue('trigger', '5');
  setTimeout(function () {
    $('button[name="act_ShipmentJobEdit2Actions2_Store"]').trigger('click');
  }, 100);
} // Go to "Lagrade utskrifter"
 else if (GM_getValue('trigger') == '5' && $('button[name="act_ShipmentJobEdit1Actions2_Next"]') [0]) {
  GM_setValue('trigger', '0');
  document.location = 'webapp?' + GM_getValue('session_link') + '&Action=act_MenuActions_Item&Target=body&ItemHandler=ShipmentJobSearchActions2';
} // This function collects addresses stores them and then opens packsoft online
// This function is attached to a object on the page with addresses
// It is triggered when the user clicks the object

function collect_addresses() {
  $('.customer_name').each(function (i, elem) {
    customer_names[i] = $(elem).text().replace('¤', '');
  });
  $('.customer_address1').each(function (i, elem) {
    customer_address1s[i] = $(elem).text().replace('¤', '');
  });
  $('.customer_address2').each(function (i, elem) {
    customer_address2s[i] = $(elem).text().replace('¤', '');
  });
  $('.customer_postcode').each(function (i, elem) {
    customer_postcodes[i] = $(elem).text().replace('¤', '');
  });
  $('.customer_email').each(function (i, elem) {
    customer_emails[i] = $(elem).text().replace('¤', '');
  });
  $('.customer_telephone').each(function (i, elem) {
    customer_telephones[i] = $(elem).text().replace('¤', '');
  });
  $('.customer_order_id').each(function (i, elem) {
    customer_order_ids[i] = $(elem).text().replace('¤', '');
  });
  GM_setValue('customer_names', customer_names.join('¤'));
  GM_setValue('customer_address1s', customer_address1s.join('¤'));
  GM_setValue('customer_address2s', customer_address2s.join('¤'));
  GM_setValue('customer_postcodes', customer_postcodes.join('¤'));
  GM_setValue('customer_emails', customer_emails.join('¤'));
  GM_setValue('customer_telephones', customer_telephones.join('¤'));
  GM_setValue('customer_order_ids', customer_order_ids.join('¤'));
  GM_setValue('no_of_customers', customer_names.length);
  GM_setValue('trigger', '1');
  window.open('https://po.unifaun.se');
}
__________________
www.hallabalo.se
Svara med citat
Annons


  #42  
Gammal 2018-03-20, 10:58
Dent Dent är inte uppkopplad
Ny medlem
Script för packsoft online www
Script för packsoft online dent
 
Reg.datum: okt 2017
Inlägg: 8
Dent is on a distinguished road
Standard

Citat:
Ursprungligen postat av PontusAndersson Visa inlägg
Nu har jag löst scriptet. Fick ändra lite knappnamn samt lägga in ett extra moment för att ta sig till utskriftfavoriten.

Kod:
// ==UserScript==
// @name          varubrev
// @namespace     www.fractalposter.com
// @author        Mikael Backlund
// @description   Varubrev
// @include       https://po.unifaun.se*
// @include       http://hallabalo.se*
// @require 	    http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
// @version		    001
// @grant       GM_getValue
// @grant       GM_setValue
// ==/UserScript==
// Base url of page to collect addresses on.
var customer_info_url_base = 'hallabalo.se/din_sökväg.php';
// When object of this class is clicked on the above page addresses are collected
var object_class_to_click = '.knapp';
// Pacsoft online user id
var my_pacsoft_uid = 'DITT PACKSOFT ID';
// Pacsoft online password
var my_pacsoft_pwd = 'DITT PACKSOFT LÖSENORD';
// Name on image next to favorite <img name="xxxxxxxx">
var favorite_html_name = "act_ShipmentJobFavoriteSearchActions_SearchResultEdit_RowId_19404"; //ÄNDRA DETTA PÅ RAD 66
// Senders packsoft customer number
var my_packsoft_customer_nr = '1';


// Class of <p> with customer name etc...
var click_class      = ".knapp";
var customer_name_class      = ".customer_name";
var customer_address1_class  = ".customer_address1";
var customer_address2_class  = ".customer_address2";
var customer_postcode_class  = ".customer_postcode";
var customer_email_class     = ".customer_email";
var customer_telephone_class = ".customer_telephone";
var customer_order_id_class  = ".customer_order_id";
var customer_names      = new Array();
var customer_address1s  = new Array();
var customer_address2s  = new Array();
var customer_postcodes  = new Array();
var customer_emails     = new Array();
var customer_telephones = new Array();
var customer_order_ids  = new Array();

// Attach the collect_addresses function to a object on the page with addresses
if (window.location.href.indexOf(customer_info_url_base) > - 1) {
  $(object_class_to_click).click(collect_addresses);
} // The login page of packsoft online
 else if (GM_getValue('trigger') == '1' && $('button[name="act_LoginActions_Login"]') [0]) {
  $('input[name="CompanyLogin"]').val(my_pacsoft_uid);
  $('input[name="UserPass"]').val(my_pacsoft_pwd);
  GM_setValue('trigger', '2');
  setTimeout(function () {
    $('button[name="act_LoginActions_Login"]').trigger('click');
  }, 100);
} // Packsoft home screen, go to my favorite named Varubrev
else if (GM_getValue("trigger")== '2' && document.location.href.indexOf("Action=act_PostRedirectHomeActions_Render") > -1) {
  GM_setValue("trigger", "3");
  GM_setValue("session_link", document.location.href.split("&")[0].split("?")[1]);
  document.location = "webapp?"+GM_getValue("session_link")+"&Action=act_MenuActions_Item&Target=body&ItemHandler=ShipmentJobFavoriteSearchActions2";  
} 

else if (GM_getValue("trigger")== '3' && document.location.href.indexOf("Action=act_ShipmentJobFavoriteSearchActions_Render") > -1) {
  GM_setValue("trigger", "4");
// alert('Samlade kundadress.');
  
  $('button[name="act_ShipmentJobFavoriteSearchActions_SearchResultEdit_RowId_19404"]').trigger('click'); 
} 
// Fill the first page of the form press next (do while there is addresses left) 
 else if (GM_getValue('trigger') == '4' && GM_getValue('no_of_customers') > 0 && $('button[name="act_ShipmentJobEdit1Actions2_Next"]') [0]) {
  $('input[name="RECEIVERName"]').val(GM_getValue('customer_names').split('¤') [GM_getValue('no_of_customers') - 1]);
  $('input[name="RECEIVERDeliveryAddress1"]').val(GM_getValue('customer_address1s').split('¤') [GM_getValue('no_of_customers') - 1]);
  $('input[name="RECEIVERDeliveryAddress2"]').val(GM_getValue('customer_address2s').split('¤') [GM_getValue('no_of_customers') - 1]);
  $('input[name="RECEIVERDeliveryZipcode"]').focus();
  $('input[name="RECEIVERDeliveryZipcode"]').val(GM_getValue('customer_postcodes').split('¤') [GM_getValue('no_of_customers') - 1]);
   setTimeout(function () {
   $('button[name="act_ShipmentJobEdit1Actions2_Folding_FoldName_RECEIVERDeliveryZipcode$HelpNote"]').trigger('click');
  $('input[name="RECEIVERDeliveryZipcode"]').blur();
  $('input[name="RECEIVERSms"]').focus();
  $('input[name="RECEIVERSms"]').val(GM_getValue('customer_telephones').split('¤') [GM_getValue('no_of_customers') - 1]);
  $('input[name="RECEIVEREmail"]').val(GM_getValue('customer_emails').split('¤') [GM_getValue('no_of_customers') - 1]);
  setTimeout(function () {
    $('button[name="act_ShipmentJobEdit1Actions2_Next"]').trigger('click');
  }, 400);
     }, 100);
} // Fill the second page of the form click "lagra" (do while there is addresses left) 
 else if (GM_getValue('trigger') == '4' && GM_getValue('no_of_customers') > 0 && $('button[name="act_ShipmentJobEdit2Actions2_Store"]') [0]) {
  $('input[name="ShipmentSndReference"]').val(GM_getValue('customer_order_ids').split('¤') [GM_getValue('no_of_customers') - 1]);
  $('select[name="SenderCustNo"]').val(my_packsoft_customer_nr);
  GM_setValue('no_of_customers', GM_getValue('no_of_customers') - 1);
  if (GM_getValue('no_of_customers') === 0)
  GM_setValue('trigger', '5');
  setTimeout(function () {
    $('button[name="act_ShipmentJobEdit2Actions2_Store"]').trigger('click');
  }, 100);
} // Go to "Lagrade utskrifter"
 else if (GM_getValue('trigger') == '5' && $('button[name="act_ShipmentJobEdit1Actions2_Next"]') [0]) {
  GM_setValue('trigger', '0');
  document.location = 'webapp?' + GM_getValue('session_link') + '&Action=act_MenuActions_Item&Target=body&ItemHandler=ShipmentJobSearchActions2';
} // This function collects addresses stores them and then opens packsoft online
// This function is attached to a object on the page with addresses
// It is triggered when the user clicks the object

function collect_addresses() {
  $('.customer_name').each(function (i, elem) {
    customer_names[i] = $(elem).text().replace('¤', '');
  });
  $('.customer_address1').each(function (i, elem) {
    customer_address1s[i] = $(elem).text().replace('¤', '');
  });
  $('.customer_address2').each(function (i, elem) {
    customer_address2s[i] = $(elem).text().replace('¤', '');
  });
  $('.customer_postcode').each(function (i, elem) {
    customer_postcodes[i] = $(elem).text().replace('¤', '');
  });
  $('.customer_email').each(function (i, elem) {
    customer_emails[i] = $(elem).text().replace('¤', '');
  });
  $('.customer_telephone').each(function (i, elem) {
    customer_telephones[i] = $(elem).text().replace('¤', '');
  });
  $('.customer_order_id').each(function (i, elem) {
    customer_order_ids[i] = $(elem).text().replace('¤', '');
  });
  GM_setValue('customer_names', customer_names.join('¤'));
  GM_setValue('customer_address1s', customer_address1s.join('¤'));
  GM_setValue('customer_address2s', customer_address2s.join('¤'));
  GM_setValue('customer_postcodes', customer_postcodes.join('¤'));
  GM_setValue('customer_emails', customer_emails.join('¤'));
  GM_setValue('customer_telephones', customer_telephones.join('¤'));
  GM_setValue('customer_order_ids', customer_order_ids.join('¤'));
  GM_setValue('no_of_customers', customer_names.length);
  GM_setValue('trigger', '1');
  window.open('https://po.unifaun.se');
}
Fungerar detta fortfarande?
Svara med citat
  #43  
Gammal 2018-03-31, 13:48
SimonJ SimonJ är inte uppkopplad
Nyfödd
Script för packsoft online you.se
Script för packsoft online YOU.se
 
Reg.datum: apr 2012
Inlägg: 26
SimonJ is on a distinguished road
Standard

Citat:
Ursprungligen postat av Dent Visa inlägg
Fungerar detta fortfarande?
Det borde den. Kanske med lite modifikation. Vi kör på den eller en lite ändrad variant.

Är det för övrigt någon som har löst ett script för dhl multishipping?
__________________
YOU.se - Sverige nya nätbutik för hudvård, hårvård, kosmetika, parfym och hälsokost
Svara med citat
  #44  
Gammal 2018-06-25, 14:32
elitasson elitasson är inte uppkopplad
Ny medlem
Script för packsoft online ingen
Script för packsoft online treno
 
Reg.datum: feb 2009
Inlägg: 5
elitasson is on a distinguished road
Standard

Är detta verkligen bästa alternativet för att automatisera pacsoft online? Vilka andra alternativ finns för att sköta detta med ett enkelt API? Dessa transportföretag verkar göra det krångligt för sig...?

EDIT: Ok, Unifaun som är samma som Pacsoft Online har ett OK API: https://www.unifaunonline.se/rs-docs/.

Det går att aktivera detta API i Pacsoft Online under webbutik > Lägg till mer i systemet > Unifaun Orderkoppling - Unifaun APIConnect. Kostnad 2000 startavgift + 2000 kr / år.

Notering för Unifauns API:
På avsändare räcker det med att du sätter quickId. quickId ska ha samma värde som "snabbsökvärde" under Underhåll > Avsändare.

Nu skapar vi fraktsedlar med ett knapptryck i vårt affärssystem!

Senast redigerad av elitasson den 2018-06-28 klockan 13:01.
Svara med citat
Svara

Ämnesverktyg
Visningsalternativ

Regler för att posta
Du får inte posta nya ämnen
Du får inte posta svar
Du får inte posta bifogade filer
Du får inte redigera dina inlägg

BB-kod är
Smilies är
[IMG]-kod är
HTML-kod är av

Forumhopp



Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Svensk översättning av: Anders Pettersson
vBulletin Skin developed by: vBStyles.com
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Ad Management plugin by RedTyger