You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
92 lines
2.6 KiB
92 lines
2.6 KiB
<?php
|
|
$today = strtotime("now");
|
|
echo $today;
|
|
$delivery_date = strtotime("2023-11-03");
|
|
echo "<br>".$delivery_date;
|
|
$final_date = strtotime("2023-05-03 +6 months");
|
|
echo "<br>".$final_date;
|
|
echo "<br>-------<br>".gettype($final_date);
|
|
exit();
|
|
include "T8_Authorization.php";
|
|
echo "發貨單";
|
|
?>
|
|
<script>
|
|
get_Auth();
|
|
window.addEventListener('message', function(event) {
|
|
if (event.origin === "http://localhost:3000" && (typeof event.data === "string")) {
|
|
var validation = event.data;
|
|
console.log("成功要到認證");
|
|
console.log(validation);
|
|
|
|
// var corsurl = 'http://cors-anywhere.herokuapp.com/';
|
|
var apiurl = 'https://erp.masada.com.tw:780/twWebAPI/V1/SALDISPATCHLIST/PostERPData';
|
|
headerParam = {
|
|
CHI_Authorization: `${validation}`,
|
|
};
|
|
var body = [{
|
|
"name": "salDispatchListMaster",
|
|
"rows": [{
|
|
"BillNo": "TEST03",
|
|
"BillDate": 20231108,
|
|
"SupplyFOrgId": "1000",
|
|
"FOrgId": "1000",
|
|
"TypeId": "SP",
|
|
"OrgId": "1000",
|
|
"CompId": "1001",
|
|
"ModeId": "T",
|
|
"BizPartnerId": "M230575",
|
|
"PersonId": "M0122",
|
|
"CurrId": "TWD",
|
|
"CurrOAmount": 1,
|
|
"CurrLAmount": 1,
|
|
"TrusteeWarehouseId": "",
|
|
"SendGoodsDate": 20231108,
|
|
"DueToId": "M230575",
|
|
"TaxId": "ST005",
|
|
"CreditorOrgId": "1000",
|
|
"CreditorCompId": "1001",
|
|
"CreditorCurrOAmount": 1,
|
|
"CreditorCurrLAmount": 1,
|
|
"TradeConditionId": "",
|
|
"TrusteeWarehouseBPType": 0,
|
|
"CurrentState":2
|
|
}]
|
|
},
|
|
{
|
|
"name": "salDispatchListDetail",
|
|
"rows": [{
|
|
"SupplyCompId": "1001",
|
|
"SupplyOrgId": "1000",
|
|
"DispatchCompId": "1001",
|
|
"DispatchOrgId": "1000",
|
|
"SQuantity": "1",
|
|
"TaxId": "ST005",
|
|
"BillNo": "TEST03",
|
|
"RowCode": 1,
|
|
"ItemType": 0,
|
|
"MaterialId": "3JX05302",
|
|
"SUnitId": "SET",
|
|
"SPrice": "150000",
|
|
"WarehouseId":"100"
|
|
}]
|
|
}
|
|
];
|
|
var json = JSON.stringify(body);
|
|
obj = {
|
|
type: 'POST',
|
|
// url: `${corsurl}${apiurl}`,
|
|
url: `${apiurl}`,
|
|
// dataType: 'json',
|
|
headers: headerParam,
|
|
data: json,
|
|
dataType: "json",
|
|
success: function(res) {
|
|
console.log(res.Status);
|
|
console.log(res.ErrorMsg);
|
|
console.log(res.Data);
|
|
}
|
|
};
|
|
jQuery.ajax(obj);
|
|
}
|
|
})
|
|
</script>
|