Compare commits
4 Commits
1d877e8df1
...
e18c008231
| Author | SHA1 | Date | |
|---|---|---|---|
| e18c008231 | |||
| a5a67660e8 | |||
| 99e70fcafb | |||
| 49a0eca117 |
34
app/main.ts
34
app/main.ts
@@ -81,24 +81,38 @@ const main = async () => {
|
|||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
const allowedOrigins = [
|
const allowedOrigins = [
|
||||||
"http://localhost:5173", // lstV2 dev
|
/^https?:\/\/localhost:(5173|5500|4200|3000|4000)$/, // all the allowed backend ports
|
||||||
"http://localhost:5500", // lst dev
|
/^https?:\/\/.*\.alpla\.net$/,
|
||||||
"http://localhost:4200", // express
|
|
||||||
"http://localhost:4000", // prod port
|
|
||||||
env.BETTER_AUTH_URL, // prod
|
env.BETTER_AUTH_URL, // prod
|
||||||
];
|
];
|
||||||
|
|
||||||
app.use(
|
app.use(
|
||||||
cors({
|
cors({
|
||||||
origin: (origin, callback) => {
|
origin: (origin, callback) => {
|
||||||
// allow requests with no origin (like curl, service workers, PWAs)
|
//console.log("CORS request from origin:", origin);
|
||||||
if (!origin) return callback(null, true);
|
|
||||||
|
|
||||||
if (allowedOrigins.includes(origin)) {
|
if (!origin) return callback(null, true); // allow same-site or direct calls
|
||||||
return callback(null, true);
|
|
||||||
} else {
|
try {
|
||||||
return callback(new Error("Not allowed by CORS"));
|
const hostname = new URL(origin).hostname; // strips protocol/port
|
||||||
|
//console.log("Parsed hostname:", hostname);
|
||||||
|
|
||||||
|
if (allowedOrigins.includes(origin)) {
|
||||||
|
return callback(null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now this works for *.alpla.net
|
||||||
|
if (
|
||||||
|
hostname.endsWith(".alpla.net") ||
|
||||||
|
hostname === "alpla.net"
|
||||||
|
) {
|
||||||
|
return callback(null, true);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
//console.error("Invalid Origin header:", origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return callback(new Error("Not allowed by CORS: " + origin));
|
||||||
},
|
},
|
||||||
methods: ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"],
|
methods: ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"],
|
||||||
credentials: true,
|
credentials: true,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
socketio "github.com/googollee/go-socket.io"
|
socketio "github.com/googollee/go-socket.io"
|
||||||
)
|
)
|
||||||
|
|
||||||
func copyBuild(server *socketio.Server, plant string, drive string) {
|
func copyBuild(server *socketio.Server, plant string, location string) {
|
||||||
// Load from environment in real-life code!
|
// Load from environment in real-life code!
|
||||||
user := os.Getenv("ADM_USER")
|
user := os.Getenv("ADM_USER")
|
||||||
pass := os.Getenv("ADM_PASS")
|
pass := os.Getenv("ADM_PASS")
|
||||||
@@ -21,7 +21,7 @@ func copyBuild(server *socketio.Server, plant string, drive string) {
|
|||||||
// latest build
|
// latest build
|
||||||
latestbuild := lastestBuild()
|
latestbuild := lastestBuild()
|
||||||
src := latestbuild
|
src := latestbuild
|
||||||
plantServer := fmt.Sprintf("\\\\%v\\%v$\\lst", plant, drive)
|
plantServer := fmt.Sprintf("\\\\%v\\%v", plant, location)
|
||||||
|
|
||||||
// Build PowerShell
|
// Build PowerShell
|
||||||
psScript := fmt.Sprintf(`
|
psScript := fmt.Sprintf(`
|
||||||
|
|||||||
@@ -32,6 +32,28 @@
|
|||||||
.error {
|
.error {
|
||||||
color: #f33;
|
color: #f33;
|
||||||
}
|
}
|
||||||
|
#server-buttons {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, 1fr); /* 4 equal columns */
|
||||||
|
gap: 0.75rem; /* roughly Tailwind gap-3 */
|
||||||
|
margin: 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#server-buttons button {
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
font-family: monospace;
|
||||||
|
border: 1px solid #444;
|
||||||
|
background: #222;
|
||||||
|
color: #eee;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
#server-buttons button:hover {
|
||||||
|
background: #333;
|
||||||
|
border-color: #888;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -74,15 +96,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="logWindow"></div>
|
<div id="logWindow"></div>
|
||||||
<div>
|
<div id="controls">
|
||||||
<button id="USMCD1VMS036">USMCD1VMS036</button>
|
<div id="server-buttons"></div>
|
||||||
<button id="USBET1VMS006">USBET1VMS006</button>
|
<button id="btnAll">Copy to ALL</button>
|
||||||
<button id="USBOW1VMS006">USBOW1VMS006</button>
|
|
||||||
<button id="USKSC1VMS006">USKSC1VMS006</button>
|
|
||||||
<button id="USMCD1VMS006">USMCD1VMS006</button>
|
|
||||||
<button id="USSLC1VMS006">USSLC1VMS006</button>
|
|
||||||
<button id="USSTP1VMS006">USSTP1VMS006</button>
|
|
||||||
<button id="USDAY1VMS006">USDAY1VMS006</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -98,6 +114,91 @@
|
|||||||
transports: ["polling"],
|
transports: ["polling"],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const servers = [
|
||||||
|
{
|
||||||
|
name: "Test server",
|
||||||
|
server: "USMCD1VMS036",
|
||||||
|
location: "E$\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Bethlehem",
|
||||||
|
server: "USBET1VMS006",
|
||||||
|
location: "E$\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Bowling Green 1",
|
||||||
|
server: "USBOW1VMS006",
|
||||||
|
location: "E$\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Bowling Green 2",
|
||||||
|
server: "USBOW2VMS006",
|
||||||
|
location: "E$\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Flornece",
|
||||||
|
server: "USFLO1VMS006",
|
||||||
|
location: "E$\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Kasnas City",
|
||||||
|
server: "USKSC1VMS006",
|
||||||
|
location: "E$\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Marked Tree",
|
||||||
|
server: "USMAR1VMS006",
|
||||||
|
location: "E$\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "McDonough",
|
||||||
|
server: "USMCD1VMS006",
|
||||||
|
location: "E$\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Salt Lake City",
|
||||||
|
server: "USSLC1VMS006",
|
||||||
|
location: "E$\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "St.Peters",
|
||||||
|
server: "USSTP1VMS006",
|
||||||
|
location: "D$\\LST",
|
||||||
|
},
|
||||||
|
{ name: "Dayton", server: "USDAY1VMS006", location: "E$\\LST" },
|
||||||
|
{ name: "Lima", server: "USLIM1VMS006", location: "E$\\LST" },
|
||||||
|
{
|
||||||
|
name: "Iowa - EBM",
|
||||||
|
server: "USIOW1VMS006",
|
||||||
|
location: "D$\\LST\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Iowa - ISBM",
|
||||||
|
server: "USIOW1VMS006",
|
||||||
|
location: "D$\\LST\\LST_2",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Houston",
|
||||||
|
server: "USHOU1VMS006",
|
||||||
|
location: "E$\\LST\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Sherman",
|
||||||
|
server: "USSHE1VMS006",
|
||||||
|
location: "E$\\LST\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "West Bend",
|
||||||
|
server: "USWEB1VMS006",
|
||||||
|
location: "E$\\LST\\LST",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Jerfferson City",
|
||||||
|
server: "USJCI1VMS006",
|
||||||
|
location: "E$\\LST\\LST",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
// log window reference
|
// log window reference
|
||||||
const logWindow = document.getElementById("logWindow");
|
const logWindow = document.getElementById("logWindow");
|
||||||
|
|
||||||
@@ -208,73 +309,89 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// all the server copy buttons
|
const serverButtonsDiv = document.getElementById("server-buttons");
|
||||||
document.getElementById("USMCD1VMS036").onclick = () => {
|
servers.forEach((srv) => {
|
||||||
socket.emit("update", {
|
const btn = document.createElement("button");
|
||||||
action: "copy",
|
btn.textContent = srv.name;
|
||||||
target: "USMCD1VMS036",
|
btn.dataset.server = srv.server;
|
||||||
drive: "e",
|
btn.dataset.drive = srv.drive;
|
||||||
}); // "frontend" = payload target
|
|
||||||
logMessage("info", "Copying to USMCD1VMS036");
|
btn.addEventListener("click", () => {
|
||||||
|
socket.emit("update", {
|
||||||
|
action: "copy",
|
||||||
|
target: srv.server,
|
||||||
|
location: srv.location,
|
||||||
|
});
|
||||||
|
logMessage(
|
||||||
|
"info",
|
||||||
|
`Copying to ${
|
||||||
|
srv.name
|
||||||
|
} (drive ${srv.drive.toUpperCase()})`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
serverButtonsDiv.appendChild(btn);
|
||||||
|
});
|
||||||
|
|
||||||
|
let copyQueue = []; // Holds list of servers left
|
||||||
|
let currentServer = null; // Track which server is waiting confirmation
|
||||||
|
let isRunningAll = false;
|
||||||
|
|
||||||
|
document.getElementById("btnAll").onclick = () => {
|
||||||
|
if (isRunningAll) {
|
||||||
|
logMessage("info", "⚠️ Copy to ALL already running...");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
copyQueue = [...servers]; // fresh clone of the servers
|
||||||
|
isRunningAll = true;
|
||||||
|
logMessage(
|
||||||
|
"info",
|
||||||
|
"▶️ Starting sequential copy to ALL servers..."
|
||||||
|
);
|
||||||
|
|
||||||
|
runNextInQueue();
|
||||||
};
|
};
|
||||||
|
|
||||||
document.getElementById("USBET1VMS006").onclick = () => {
|
function runNextInQueue() {
|
||||||
socket.emit("update", {
|
if (copyQueue.length === 0) {
|
||||||
action: "copy",
|
logMessage("info", "✅ Finished copying to ALL servers!");
|
||||||
target: "USBET1VMS006",
|
isRunningAll = false;
|
||||||
drive: "e",
|
currentServer = null;
|
||||||
}); // "frontend" = payload target
|
return;
|
||||||
logMessage("info", "Copying to USBET1VMS006");
|
}
|
||||||
};
|
|
||||||
document.getElementById("USBOW1VMS006").onclick = () => {
|
currentServer = copyQueue.shift();
|
||||||
socket.emit("update", {
|
logMessage(
|
||||||
action: "copy",
|
"info",
|
||||||
target: "USBOW1VMS006",
|
`🚀 Copying to ${
|
||||||
drive: "e",
|
currentServer.name
|
||||||
}); // "frontend" = payload target
|
} (drive ${currentServer.drive.toUpperCase()})`
|
||||||
logMessage("info", "Copying to USBOW1VMS006");
|
);
|
||||||
};
|
|
||||||
document.getElementById("USSLC1VMS006").onclick = () => {
|
|
||||||
socket.emit("update", {
|
|
||||||
action: "copy",
|
|
||||||
target: "USSLC1VMS006",
|
|
||||||
drive: "e",
|
|
||||||
}); // "frontend" = payload target
|
|
||||||
logMessage("info", "Copying to USSLC1VMS006");
|
|
||||||
};
|
|
||||||
|
|
||||||
document.getElementById("USSTP1VMS006").onclick = () => {
|
|
||||||
socket.emit("update", {
|
socket.emit("update", {
|
||||||
action: "copy",
|
action: "copy",
|
||||||
target: "USSTP1VMS006",
|
target: currentServer.name,
|
||||||
drive: "d",
|
drive: currentServer.drive,
|
||||||
}); // "frontend" = payload target
|
});
|
||||||
logMessage("info", "Copying to USSTP1VMS006");
|
}
|
||||||
};
|
|
||||||
document.getElementById("USKSC1VMS006").onclick = () => {
|
socket.on("updateLogs", (msg) => {
|
||||||
socket.emit("update", {
|
//logMessage("update", msg);
|
||||||
action: "copy",
|
|
||||||
target: "USksc1VMS006",
|
// Only check queue progress if we're in All mode and have a currentServer
|
||||||
drive: "e",
|
if (isRunningAll && currentServer) {
|
||||||
}); // "frontend" = payload target
|
const expected = `✅ Copy to ${currentServer.name} successful`;
|
||||||
logMessage("info", "Copying to USKSC1VMS006");
|
|
||||||
};
|
if (msg.includes(expected)) {
|
||||||
document.getElementById("USDAY1VMS006").onclick = () => {
|
logMessage(
|
||||||
socket.emit("update", {
|
"info",
|
||||||
action: "copy",
|
`✅ Confirmed: ${currentServer.name} done`
|
||||||
target: "USDAY1VMS006",
|
);
|
||||||
drive: "e",
|
runNextInQueue(); // trigger the next server
|
||||||
}); // "frontend" = payload target
|
}
|
||||||
logMessage("info", "Copying to USDAY1VMS006");
|
}
|
||||||
};
|
});
|
||||||
document.getElementById("USMCD1VMS006").onclick = () => {
|
|
||||||
socket.emit("update", {
|
|
||||||
action: "copy",
|
|
||||||
target: "USMCD1VMS006",
|
|
||||||
drive: "e",
|
|
||||||
}); // "frontend" = payload target
|
|
||||||
logMessage("info", "Copying to USMCD1VMS006");
|
|
||||||
};
|
|
||||||
|
|
||||||
socket.on("logs", (msg) => logMessage("logs", msg));
|
socket.on("logs", (msg) => logMessage("logs", msg));
|
||||||
socket.on("errors", (msg) => logMessage("errors", msg));
|
socket.on("errors", (msg) => logMessage("errors", msg));
|
||||||
|
|||||||
@@ -15,9 +15,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type UpdatePayload struct {
|
type UpdatePayload struct {
|
||||||
Action string `json:"action"`
|
Action string `json:"action"`
|
||||||
Target string `json:"target"`
|
Target string `json:"target"`
|
||||||
Drive string `json:"drive"`
|
Location string `json:"location"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func registerUpdateChannel(server *socketio.Server) {
|
func registerUpdateChannel(server *socketio.Server) {
|
||||||
@@ -32,7 +32,7 @@ func registerUpdateChannel(server *socketio.Server) {
|
|||||||
server.OnEvent("/", "update", func(s socketio.Conn, payload UpdatePayload) {
|
server.OnEvent("/", "update", func(s socketio.Conn, payload UpdatePayload) {
|
||||||
switch strings.ToLower(payload.Action) {
|
switch strings.ToLower(payload.Action) {
|
||||||
case "copy":
|
case "copy":
|
||||||
copyLatestBuild(server, payload.Target, payload.Drive)
|
copyLatestBuild(server, payload.Target, payload.Location)
|
||||||
|
|
||||||
case "update":
|
case "update":
|
||||||
updateServer(server, payload.Target)
|
updateServer(server, payload.Target)
|
||||||
@@ -81,13 +81,13 @@ func updateServer(server *socketio.Server, target string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func copyLatestBuild(server *socketio.Server, target string, drive string) {
|
func copyLatestBuild(server *socketio.Server, target string, location string) {
|
||||||
server.BroadcastToRoom("/", "update", "updateLogs",
|
server.BroadcastToRoom("/", "update", "updateLogs",
|
||||||
fmt.Sprintf("🚀 Copying latest build to %v", target))
|
fmt.Sprintf("🚀 Copying latest build to %v", target))
|
||||||
copyBuild(server, target, drive)
|
copyBuild(server, target, location)
|
||||||
}
|
}
|
||||||
|
|
||||||
func triggerRemoteUpdate(server *socketio.Server, remoteURL string, payload UpdatePayload) {
|
func triggerRemoteUpdate(server *socketio.Server, token string, payload UpdatePayload) {
|
||||||
|
|
||||||
fmt.Println("running the update process")
|
fmt.Println("running the update process")
|
||||||
basePath := "/api/controller"
|
basePath := "/api/controller"
|
||||||
@@ -98,7 +98,7 @@ func triggerRemoteUpdate(server *socketio.Server, remoteURL string, payload Upda
|
|||||||
// send POST request with JSON, expect SSE / streaming text back
|
// send POST request with JSON, expect SSE / streaming text back
|
||||||
body, _ := json.Marshal(payload)
|
body, _ := json.Marshal(payload)
|
||||||
|
|
||||||
url := fmt.Sprintf("https://%v.alpla.net%v/update", remoteURL, basePath)
|
url := fmt.Sprintf("https://%vprod.alpla.net%v/update", token, basePath)
|
||||||
fmt.Println(url)
|
fmt.Println(url)
|
||||||
//url := fmt.Sprintf("http://%v:8080/api/controller/update", remoteURL)
|
//url := fmt.Sprintf("http://%v:8080/api/controller/update", remoteURL)
|
||||||
fmt.Println(url)
|
fmt.Println(url)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default function TransferToNextLot() {
|
|||||||
const [typeSwitch, setTypeSwitch] = useState(false);
|
const [typeSwitch, setTypeSwitch] = useState(false);
|
||||||
const { settings } = useSettingStore();
|
const { settings } = useSettingStore();
|
||||||
|
|
||||||
const server = settings.filter((n: any) => n.name === "dbServer");
|
const server = settings.filter((n: any) => n.name === "plantToken");
|
||||||
const form = useAppForm({
|
const form = useAppForm({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
runningNumber: "",
|
runningNumber: "",
|
||||||
@@ -319,7 +319,7 @@ export default function TransferToNextLot() {
|
|||||||
you
|
you
|
||||||
will
|
will
|
||||||
be
|
be
|
||||||
transfering
|
transferring
|
||||||
at
|
at
|
||||||
EOM,
|
EOM,
|
||||||
NOTE:
|
NOTE:
|
||||||
@@ -407,7 +407,7 @@ export default function TransferToNextLot() {
|
|||||||
For more in depth instructions
|
For more in depth instructions
|
||||||
please{" "}
|
please{" "}
|
||||||
<a
|
<a
|
||||||
href={`https://${server[0].value}.alpla.net/lst/d/docs/ocp/ocp#tranfer-partial-estimated-quantity-to-the-next-lot`}
|
href={`https://${server[0].value}prod.alpla.net/lst/d/docs/ocp/ocp#tranfer-partial-estimated-quantity-to-the-next-lot`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<em>CLICK HERE</em>
|
<em>CLICK HERE</em>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export const Route = createRootRoute({
|
|||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const { settings } = useSettingStore();
|
const { settings } = useSettingStore();
|
||||||
|
|
||||||
const server = settings.filter((n: any) => n.name === "dbServer");
|
const server = settings.filter((n: any) => n.name === "plantToken");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="overflow-hidden">
|
<div className="overflow-hidden">
|
||||||
|
|||||||
@@ -116,7 +116,14 @@ sales.[KdArtBez] as CustomerArticleDescription,
|
|||||||
round(V_Artikel.Zyklus, 2) as CycleTime,
|
round(V_Artikel.Zyklus, 2) as CycleTime,
|
||||||
Sypronummer as salesAgreement,
|
Sypronummer as salesAgreement,
|
||||||
V_Artikel.ProdArtikelBez as ProductFamily
|
V_Artikel.ProdArtikelBez as ProductFamily
|
||||||
,REPLACE(pur.UOM,'UOM:','') as UOM
|
--,REPLACE(pur.UOM,'UOM:','')
|
||||||
|
,Case when LEFT(
|
||||||
|
LTRIM(REPLACE(pur.UOM,'UOM:','')),
|
||||||
|
CHARINDEX(' ', LTRIM(REPLACE(REPLACE(pur.UOM,'UOM:',''), CHAR(13)+CHAR(10), ' ')) + ' ') - 1
|
||||||
|
) is null then '1' else LEFT(
|
||||||
|
LTRIM(REPLACE(pur.UOM,'UOM:','')),
|
||||||
|
CHARINDEX(' ', LTRIM(REPLACE(REPLACE(pur.UOM,'UOM:',''), CHAR(13)+CHAR(10), ' ')) + ' ') - 1
|
||||||
|
) end AS UOM
|
||||||
--,*
|
--,*
|
||||||
FROM dbo.V_Artikel (nolock)
|
FROM dbo.V_Artikel (nolock)
|
||||||
|
|
||||||
@@ -159,7 +166,20 @@ left join
|
|||||||
,GueltigabDatum as validDate
|
,GueltigabDatum as validDate
|
||||||
,EKPreis as price
|
,EKPreis as price
|
||||||
,LiefArtNr as supplierNr
|
,LiefArtNr as supplierNr
|
||||||
,case when Bemerkung is not null and Bemerkung like '%UOM:%' then LEFT(Bemerkung, CHARINDEX(' ', Bemerkung)) else 'UOM:1' end as UOM
|
,CASE
|
||||||
|
WHEN Bemerkung IS NOT NULL AND Bemerkung LIKE '%UOM:%'
|
||||||
|
THEN
|
||||||
|
-- incase there is something funny going on in the remark well jsut check for new lines and what not
|
||||||
|
LEFT(
|
||||||
|
REPLACE(REPLACE(Bemerkung, CHAR(13)+CHAR(10), ' '), CHAR(10), ' '),
|
||||||
|
CASE
|
||||||
|
WHEN CHARINDEX(' ', REPLACE(REPLACE(Bemerkung, CHAR(13)+CHAR(10), ' '), CHAR(10), ' ')) > 0
|
||||||
|
THEN CHARINDEX(' ', REPLACE(REPLACE(Bemerkung, CHAR(13)+CHAR(10), ' '), CHAR(10), ' ')) - 1
|
||||||
|
ELSE LEN(Bemerkung)
|
||||||
|
END
|
||||||
|
)
|
||||||
|
ELSE 'UOM:1'
|
||||||
|
END AS UOM
|
||||||
,Bemerkung
|
,Bemerkung
|
||||||
--,*
|
--,*
|
||||||
from dbo.T_HistoryEK (nolock)
|
from dbo.T_HistoryEK (nolock)
|
||||||
@@ -169,7 +189,7 @@ left join
|
|||||||
where RN = 1) as pur
|
where RN = 1) as pur
|
||||||
on dbo.V_Artikel.IdArtikelvarianten = pur.av
|
on dbo.V_Artikel.IdArtikelvarianten = pur.av
|
||||||
|
|
||||||
where V_Artikel.aktiv = 1
|
where V_Artikel.aktiv = 1 --and dbo.V_Artikel.IdArtikelvarianten = 1445
|
||||||
|
|
||||||
order by V_Artikel.IdArtikelvarianten /*, TypeOfMaterial */
|
order by V_Artikel.IdArtikelvarianten /*, TypeOfMaterial */
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -14,24 +14,28 @@ param (
|
|||||||
# example string to pass over, you must be in the script dir when you run this script. or it will fail to find the linked scripts
|
# example string to pass over, you must be in the script dir when you run this script. or it will fail to find the linked scripts
|
||||||
|
|
||||||
# If we do not pass plant to update over it will auto do all plants if we want a specific plant we need to do like below
|
# If we do not pass plant to update over it will auto do all plants if we want a specific plant we need to do like below
|
||||||
# .\update-controllers.ps1 -App_Path "C:\Users\matthes01\Documents\lst" -Token "usiow2" -BuildController no -PlantToUpdate "usiow1vms006" -Remote_Path "D$\LST\lst_2"
|
# .\update-controllers.ps1 -App_Path "C:\Users\matthes01\Documents\lst" -Token "usstp1" -BuildController yes -PlantToUpdate "usstp1vms006" -Remote_Path "D$\LST"
|
||||||
# .\update-controllers.ps1 -App_Path "C:\Users\matthes01\Documents\lst" -Token "test3" -BuildController yes
|
# .\update-controllers.ps1 -App_Path "C:\Users\matthes01\Documents\lst" -Token "test3" -BuildController yes
|
||||||
|
|
||||||
$Plants = @(
|
$Plants = @(
|
||||||
@{ Server = "usmcd1vms036"; Token = "test3"; Remote_Path = "E$\LST" }
|
@{ Server = "usmcd1vms036"; Token = "test3"; Remote_Path = "E$\LST" }
|
||||||
@{ Server = "usmar1vms006"; Token = "usmar1" ; Remote_Path = "E$\LST" }
|
@{ Server = "usmar1vms006"; Token = "usmar1" ; Remote_Path = "E$\LST" }
|
||||||
@{ Server = "usbet1vms006"; Token = "usbet1"; Remote_Path = "E$\LST" }
|
@{ Server = "usbet1vms006"; Token = "usbet1"; Remote_Path = "E$\LST" }
|
||||||
@{ Server = "usbow1vms006"; Token = "usbow1" ; Remote_Path = "E$\LST" }
|
@{ Server = "usbow1vms006"; Token = "usbow1" ; Remote_Path = "E$\LST" }
|
||||||
@{ Server = "usbow2vms006"; Token = "usbow2" ; Remote_Path = "E$\LST" }
|
@{ Server = "usbow2vms006"; Token = "usbow2" ; Remote_Path = "E$\LST" }
|
||||||
@{ Server = "usday1vms006"; Token = "usday1" ; Remote_Path = "E$\LST" }
|
@{ Server = "usday1vms006"; Token = "usday1" ; Remote_Path = "E$\LST" }
|
||||||
@{ Server = "usflo1vms006"; Token = "usflo1" ; Remote_Path = "E$\LST" }
|
@{ Server = "usflo1vms006"; Token = "usflo1" ; Remote_Path = "E$\LST" }
|
||||||
@{ Server = "usiow1vms006"; Token = "usiow1" ; Remote_Path = "D$\LST\lst" }
|
@{ Server = "usiow1vms006"; Token = "usiow1" ; Remote_Path = "D$\LST\lst" }
|
||||||
@{ Server = "usiow1vms006"; Token = "usiow2" ; Remote_Path = "D$\LST\lst_2" }
|
@{ Server = "usiow1vms006"; Token = "usiow2" ; Remote_Path = "D$\LST\lst_2" }
|
||||||
@{ Server = "uslim1vms006"; Token = "uslim1" ; Remote_Path = "E$\LST" }
|
@{ Server = "uslim1vms006"; Token = "uslim1" ; Remote_Path = "E$\LST" }
|
||||||
@{ Server = "usmcd1vms006"; Token = "usmcd1" ; Remote_Path = "E$\LST" }
|
@{ Server = "usmcd1vms006"; Token = "usmcd1" ; Remote_Path = "E$\LST" }
|
||||||
@{ Server = "usslc1vms006"; Token = "usslc1" ; Remote_Path = "E$\LST" }
|
@{ Server = "usslc1vms006"; Token = "usslc1" ; Remote_Path = "E$\LST" }
|
||||||
@{ Server = "usstp1vms006"; Token = "usstp1" ; Remote_Path = "D$\LST" }
|
@{ Server = "usstp1vms006"; Token = "usstp1" ; Remote_Path = "D$\LST" }
|
||||||
@{ Server = "usksc1vms006"; Token = "usksc1" ; Remote_Path = "E$\LST" }
|
@{ Server = "usksc1vms006"; Token = "usksc1" ; Remote_Path = "E$\LST" }
|
||||||
|
@{ Server = "ushou1vms006"; Token = "ushou1" ; Remote_Path = "E$\LST" } #15
|
||||||
|
@{ Server = "usshe1vms006"; Token = "usshe1" ; Remote_Path = "E$\LST" }#16
|
||||||
|
@{ Server = "usweb1vms006"; Token = "usweb1" ; Remote_Path = "E$\LST" }#17
|
||||||
|
@{ Server = "usjci1vms006"; Token = "usjci1" ; Remote_Path = "E$\LST" }
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user