10994015 1 year ago
parent
commit
9a0006516d
  1. 2
      .env
  2. 2
      wms/rib-test.php
  3. 2
      wms/rib02-edit.php
  4. 83
      wms/rib02-purReceive-submit.php
  5. 89
      wms/rib02-purchase-submit.php

2
.env

@ -8,6 +8,6 @@
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=appwms
DB_DATABASE=appwms1113
DB_USERNAME=root
DB_PASSWORD=

2
wms/rib-test.php

@ -1,6 +1,6 @@
<?php
include "T8_Authorization.php";
echo "ii";
echo "應付確認單";
?>
<script>
console.log(<?=$now ?>);

2
wms/rib02-edit.php

@ -558,7 +558,7 @@ $materials = $conn->query($sql_Material);
$("#FeeDate").val('');
} else {
now.setMonth(now.getMonth() - 2);
now.setDate(01);
now.setDate(1);
now.setDate(now.getDate() - 1)
if (feedate < now) {
alert("超過兩個月的費用無法進行報銷");

83
wms/rib02-purReceive-submit.php

@ -0,0 +1,83 @@
<?php
include "T8_Authorization.php";
echo "收貨申請單";
?>
<script>
console.log(<?= $now ?>);
get_Auth();
window.addEventListener('message', function(event) {
if (event.origin === "http://localhost:3000" && (typeof event.data === "string")) {
var validation = event.data;
console.log("event");
console.log(validation);
// var corsurl = 'http://cors-anywhere.herokuapp.com/';
var apiurl = 'http://60.244.87.101:880//twWebAPI/V1/PURRECEIVINGORDER/PostERPData';
headerParam = {
CHI_Authorization: `${validation}`,
};
var body = [
{
"name": "purReceivingOrderMaster",
"rows": [
{
"BillNo": "Z001",
"BillDate": 20210420,
"ReceiveOrgId": "1000",
"OrgId": "1000",
"DemandOrgId": "1000",
"TypeId": "RC",
"BizPartnerId": "Z001",
"PersonId": "Z001",
"CurrId": "NTD",
"CurrOAmount": 1,
"CurrLAmount": 1,
"ReciveDate": 20210420,
"DueToId": "Z001",
"TaxId": "ST005",
"DebtorOrgId": "1000",
"DebtorCurrOAmount": 1,
"DebtorCurrLAmount": 1,
"ReceiveCompId": "1000",
"DebtorCompId": "1000",
"DemandCompId": "1000"
}
]
},
{
"name": "purReceivingOrderDetail",
"rows": [
{
"TaxId": "ST005",
"BillNo": "Z001",
"RowCode": "1",
"ItemType": 0,
"MaterialId": "Z001",
"ReceivingSQty": 1,
"SUnitId": "SET",
"SPrice": "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>

89
wms/rib02-purchase-submit.php

@ -0,0 +1,89 @@
<?php
include "T8_Authorization.php";
echo "採購單";
echo "111";
?>
<script>
console.log(<?= $now ?>);
get_Auth();
window.addEventListener('message', function(event) {
if (event.origin === "http://localhost:3000" && (typeof event.data === "string")) {
var validation = event.data;
console.log("event");
console.log(validation);
// var corsurl = 'http://cors-anywhere.herokuapp.com/';
var apiurl = 'http://60.244.87.101:880//twWebAPI/V1/PURPURCHASEORDER/PostERPData';
headerParam = {
CHI_Authorization: `${validation}`,
};
var body = [{
"name": "purBillOrderMaster",
"rows": [{
"BillNo": "Z004",
"BillDate": 20210420,
"TypeId": "PO",
"OrgId": "1000",
"FOrgId": "1000",
"BizPartnerId": "33709933",
"CurrId": "TWD",
"CurrOAmount": 1.00000,
"CurrLAmount": 1.00000,
"PersonId": "M0122",
"DueToId": "33709933",
"TaxId": "ST005",
// "DebtorOrgId": "1000",
// "DebitorCurrId": "TWD",
// "DebtorCurrOAmount": 1.00000,
// "DebtorCurrLAmount": 1.00000,
"CompId": "1001",
// "DebtorCompId": "1001",
"CurrentState": 2,
"FlowState": 2,
"PermitState": 2,
"Remark":"testtest",
"CreatorId": "M0122",
"IsPriceWithTax":1
}]
},
{
"name": "purBillOrderDetail",
"rows": [{
"DemandOrgId": "1000",
"TaxId": "ST005",
"DeliveryDate": 20210420,
"ReceiveOrgId": "1000",
"DebtorOrgId": "1000",
"ReceiveCompId": "1001",
"DemandCompId": "1001",
"BillNo": "Z004",
"RowCode": 1,
"ItemType": 0,
"MaterialId": "MX23010003",
// "MaterialSpec": "LY-08/紅光/1",
"SQuantity": 1.00000,
"PresentSQty":1,
"SPrice": 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>
Loading…
Cancel
Save