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.
74 lines
1.9 KiB
74 lines
1.9 KiB
<?php
|
|
include "T8_Authorization.php";
|
|
echo "收入申請單";
|
|
?>
|
|
<script>
|
|
let validation = get_Auth();
|
|
// window.addEventListener('message', function(event) {
|
|
// console.log('123')
|
|
// if (event.origin === "http://localhost:3000" && (typeof event.data === "string")) {
|
|
// if (event.origin === "https://masada.com.tw" && (typeof event.data === "string")) {
|
|
console.log(validation)
|
|
// var validation = event.data;
|
|
// console.log("event");
|
|
// console.log(validation);
|
|
|
|
// var corsurl = 'http://cors-anywhere.herokuapp.com/';
|
|
var apiurl = 'https://erp.masada.com.tw:780/twWebAPI/V1/SALINCOMEAPPLY/PostERPData';
|
|
headerParam = {
|
|
CHI_Authorization: `${validation}`,
|
|
};
|
|
var body = [{
|
|
"name": "salIncomeApplyMaster",
|
|
"rows": [{
|
|
"BillNo": "B23100061",
|
|
"BillDate": 20231220,
|
|
"OrgId": "1000",
|
|
"FOrgId": "1000",
|
|
"TypeId": "RAS",
|
|
"BpOrgId": "1000",
|
|
"BizPartnerId": "B23100061",
|
|
"CurrId": "TWD",
|
|
"CurrOAmount": 1,
|
|
"CurrLAmount": 1,
|
|
"PersonId": "M0065",
|
|
"DtOrgId": "1000",
|
|
"DueToId": "B23100061",
|
|
"TaxId": "ST005",
|
|
"CompId": "1001"
|
|
}]
|
|
},
|
|
{
|
|
"name": "salIncomeApplyDetail",
|
|
"rows": [{
|
|
"BillNo": "B23100061",
|
|
"IncomeId": "A40003",
|
|
"TaxId": "ST005",
|
|
"RowCode": 12,
|
|
"ItemType": "1",
|
|
"SPrice": 10000,
|
|
"SQuantity": 1,
|
|
"FromSourceTag": 0,
|
|
"FromBillNo": ""
|
|
}]
|
|
}
|
|
];
|
|
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>
|