|
@ -1,86 +1,67 @@ |
|
|
<?php |
|
|
<?php |
|
|
include "T8_Authorization.php"; |
|
|
include "T8_Authorization.php"; |
|
|
echo "應付確認單"; |
|
|
echo "發貨單"; |
|
|
?> |
|
|
?> |
|
|
<script> |
|
|
<script> |
|
|
console.log(<?=$now ?>); |
|
|
|
|
|
get_Auth(); |
|
|
get_Auth(); |
|
|
window.addEventListener('message', function(event) { |
|
|
window.addEventListener('message', function(event) { |
|
|
if (event.origin === "http://localhost:3000" && (typeof event.data === "string")) { |
|
|
if (event.origin === "http://localhost:3000" && (typeof event.data === "string")) { |
|
|
var validation = event.data; |
|
|
var validation = event.data; |
|
|
console.log("event"); |
|
|
console.log("成功要到認證"); |
|
|
console.log(validation); |
|
|
console.log(validation); |
|
|
|
|
|
|
|
|
// var corsurl = 'http://cors-anywhere.herokuapp.com/'; |
|
|
// var corsurl = 'http://cors-anywhere.herokuapp.com/'; |
|
|
var apiurl = 'http://60.244.87.101:880/twWebAPI/V1/APCHECKBILL/PostERPData'; |
|
|
var apiurl = 'https://erp.masada.com.tw:780/twWebAPI/V1/SALDISPATCHLIST/PostERPData'; |
|
|
headerParam = { |
|
|
headerParam = { |
|
|
CHI_Authorization: `${validation}`, |
|
|
CHI_Authorization: `${validation}`, |
|
|
}; |
|
|
}; |
|
|
var body = [{ |
|
|
var body = [{ |
|
|
"name": "MasterTable", |
|
|
"name": "salDispatchListMaster", |
|
|
"rows": [{ |
|
|
"rows": [{ |
|
|
"BillNo": "Z004", |
|
|
"BillNo": "TEST03", |
|
|
"BillDate": 20231030, |
|
|
"BillDate": 20231108, |
|
|
|
|
|
"SupplyFOrgId": "1000", |
|
|
|
|
|
"FOrgId": "1000", |
|
|
|
|
|
"TypeId": "SP", |
|
|
"OrgId": "1000", |
|
|
"OrgId": "1000", |
|
|
"TypeId": "OPV", |
|
|
|
|
|
"IsPriceWithTax":1, |
|
|
|
|
|
"IsCounteract":1, |
|
|
|
|
|
"BizPartnerId": "03051501", |
|
|
|
|
|
"CurrId": "RMB", |
|
|
|
|
|
"CurrOAmount":1, |
|
|
|
|
|
"CurrLAmount":4, |
|
|
|
|
|
"TaxId": "ST101", |
|
|
|
|
|
"PersonId": "M0012", |
|
|
|
|
|
"DeptId": "220", |
|
|
|
|
|
"CompId": "1001", |
|
|
"CompId": "1001", |
|
|
"CreditAgeDate": 20230930, |
|
|
"ModeId": "T", |
|
|
"RecBizPartnerId": "03051501" |
|
|
"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": "DetailTable", |
|
|
"name": "salDispatchListDetail", |
|
|
"rows": [{ |
|
|
"rows": [{ |
|
|
"BillNo": "Z004", |
|
|
"SupplyCompId": "1001", |
|
|
|
|
|
"SupplyOrgId": "1000", |
|
|
|
|
|
"DispatchCompId": "1001", |
|
|
|
|
|
"DispatchOrgId": "1000", |
|
|
|
|
|
"SQuantity": "1", |
|
|
|
|
|
"TaxId": "ST005", |
|
|
|
|
|
"BillNo": "TEST03", |
|
|
"RowCode": 1, |
|
|
"RowCode": 1, |
|
|
"RowNo": 1, |
|
|
|
|
|
"ItemType": 0, |
|
|
"ItemType": 0, |
|
|
"TaxId": "ST101", |
|
|
"MaterialId": "3JX05302", |
|
|
"MaterialId": "MX00000001", |
|
|
"SUnitId": "SET", |
|
|
"UnitId": "PCS", |
|
|
"SPrice": "150000", |
|
|
"MaterialSpec": "", |
|
|
"WarehouseId":"100" |
|
|
"SQuantity":10, |
|
|
}] |
|
|
"SPrice":100, |
|
|
|
|
|
}, |
|
|
|
|
|
// { |
|
|
|
|
|
// "BillNo": "Z002", |
|
|
|
|
|
// "RowCode": 2, |
|
|
|
|
|
// "RowNo": 2, |
|
|
|
|
|
// "ItemType": 0, |
|
|
|
|
|
// "MaterialId": "MX00000001", |
|
|
|
|
|
// "UnitId": "PCS", |
|
|
|
|
|
// "MaterialSpec": "", |
|
|
|
|
|
// "SQuantity": 15, |
|
|
|
|
|
// // "SPrice": 210, |
|
|
|
|
|
// "OAmountWithTax": 3150, |
|
|
|
|
|
// // "OTax": 100.84, |
|
|
|
|
|
// // "OAmountWithTax": 2117.7, |
|
|
|
|
|
// "TaxId": "ST005" |
|
|
|
|
|
// } |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
} |
|
|
// , |
|
|
|
|
|
// { |
|
|
|
|
|
// "name":"apCheckBillInvInfo", |
|
|
|
|
|
// "rows":[{ |
|
|
|
|
|
// "BillNo":"Z003", |
|
|
|
|
|
// "RowCode":1, |
|
|
|
|
|
// "RowNo":1, |
|
|
|
|
|
// "InvoiceNo":"ap12345678", |
|
|
|
|
|
// "InvoiceId":25, |
|
|
|
|
|
// "TaxId":"ST005", |
|
|
|
|
|
// "LAmountWithTax":105 |
|
|
|
|
|
// }] |
|
|
|
|
|
// } |
|
|
|
|
|
]; |
|
|
]; |
|
|
var json = JSON.stringify(body); |
|
|
var json = JSON.stringify(body); |
|
|
obj = { |
|
|
obj = { |
|
|