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.
45 lines
1.7 KiB
45 lines
1.7 KiB
<?php
|
|
include "./header.php";
|
|
date_default_timezone_set('Asia/Taipei');
|
|
|
|
//表頭
|
|
$BillNo ="TEST01";
|
|
$BillDate = 20231204;
|
|
$PersonId = "M0122";
|
|
$DeptId = "220";
|
|
// $ProjectId = "3MH00545";
|
|
$CreateTime = Date("YmdHis");
|
|
$CurrentState = 2;
|
|
|
|
//表身
|
|
$ItemType = 0;
|
|
$MaterialId = "MX00011078";
|
|
$SUnitId = "PCS";
|
|
$DemandSQty = 5; //核准數量
|
|
$RequestSQty = 5; //請購數量
|
|
$RequireDate=20231205;
|
|
$CurrId="TWD";
|
|
$UnTransQty = 5; //未轉採購基本數量
|
|
$TransQty = 0; //已轉採購基本數量
|
|
$SupplyQty = 5; //供給數量
|
|
$ProjectId="3MH00545"; //合約號
|
|
$SupplyId= "P"; //供應商
|
|
$UnTransOtherSQty = 5;
|
|
$AllowTransOtherSQty = 5;
|
|
$CU_MaterialId="3MH00352"; //作番號 、預留標示號
|
|
|
|
$sql = "INSERT INTO purRequestOrder(BillNo, BillDate, PersonId, DeptId, CreateTime, CurrentState,
|
|
TypeId, DemandOrgId, FOrgId,CreatorId, CompId) VALUES ('$BillNo',$BillDate,'$PersonId','$DeptId',$CreateTime,$CurrentState,
|
|
'PR','1000','1000','$user_id','1001')";
|
|
|
|
$sql_sub = "INSERT INTO purApplyOrderDetail(BillNo,RowCode, RowNo, ItemType, MaterialId, SUnitId,
|
|
DemandSQty, DemandQty, RequestSQty,RequestQty, RequireDate, IsPriceWithTax, CurrId,
|
|
PurOrgId, BpOrgId, SupplyId, UnTransQty, TransQty, SupplyQty, ProjectId, PlanRangeId,
|
|
UnTransOtherSQty, AllowTransOtherSQty,P_A_DemandOrgId, PurCompId, CU_MaterialId, MarkerNo
|
|
) VALUES ('$BillNo',1,1,$ItemType,'$MaterialId','$SUnitId',
|
|
$DemandSQty, $DemandSQty, $RequestSQty, $RequestSQty, $RequireDate, 1, '$CurrId',
|
|
'1000', '1000', '$SupplyId', $UnTransQty, $TransQty, $SupplyQty, '$ProjectId', '1000',
|
|
$UnTransOtherSQty, $AllowTransOtherSQty,'1000','1001','$CU_MaterialId','$CU_MaterialId')";
|
|
|
|
$conn ->query($sql);
|
|
$conn ->query($sql_sub);
|