plus | received | physical qty | purchase packing slip |
plus | received | physical qty | customer return packing slip |
plus | received | physical qty | production order |
plus | received | physical qty | |
plus | purchased | financial qty | purchase invoice |
plus | purchased | financial qty | customer return invoice |
plus | purchased | financial qty | end production |
plus | purchased | financial qty | + movement,transfer, profit loss,bill of material |
minus | deduct | physical qty | sale packing slip |
minus | deduct | physical qty | vendor return packing slip |
minus | deduct | physical qty | |
minus | deduct | physical qty | |
minus | sold | financial qty | sale invoice |
minus | sold | financial qty | vendor return invoice |
minus | sold | financial qty | |
minus | sold | financial qty | - movment,transfer,profit loss, bill of material |
วันเสาร์ที่ 30 มิถุนายน พ.ศ. 2555
Physical Qty VS Financial Qty
วันพฤหัสบดีที่ 28 มิถุนายน พ.ศ. 2555
"ชนะได้เพราะไม่คิดเอาชนะ" ก่อศักดิ์ ไชยรัศมีศักดิ์
ไม่ต้องการให้เอาชนะคนอื่น แต่ไม่ต้องการให้เป็นผู้แพ้ โดยการควบคุมจิตใจต่อการยั่วยุของฝ่ายตรงข้าม ชัยชนะจึงมาจากการรักษาตัวเองไม่ให้แพ้กิเลสของตน
วันพุธที่ 27 มิถุนายน พ.ศ. 2555
lastestPurInvPrice
Display real lastestPurInvPrice()
{
VendInvoiceTrans vendInvoiceTrans;
InventTrans inventTrans;
real ret;
;
// while loop for last record to get last price of invoiced purchase
WHILE SELECT PurchPrice FROM vendInvoiceTrans
WHERE vendInvoiceTrans.ItemId == InventSumDateTrans.ItemId
{
ret = vendInvoiceTrans.PurchPrice;
}
// if item have not purched(invoiced) then get cost price
if(!ret)
{
SELECT firstonly inventTrans
WHERE inventTrans.ItemId == InventSumDateTrans.ItemId;
ret = inventTrans.CostAmountPhysical;
}
return ret;
}
วันจันทร์ที่ 25 มิถุนายน พ.ศ. 2555
ตรวจสอบข้อมูลก่อน post
void clicked()
{
dialogButton dialogCheckMessage;
;
dialogCheckMessage
= Box::okCancel(SalesParmTable.SalesId,dialogButton::Cancel,"ตรวจสอบข้อมูล");
if(dialogCheckMessage == dialogButton::Ok)
{
info("OK");
super();
}
else
{
info("Cancle");
return;
}
}
=================================================================
void clicked()
{
//vbs begin
SalesParmLine _SalesParmLineforCancle;
CustConfirmJour CustConfirmJour;
CustConfirmTrans CustConfirmTrans;
// Pantep Cus1
dialogButton dialogCheckBeforePost;
// End Cus1
;
// Pantep Cus1.2
dialogCheckBeforePost = Box::okCancel(strfmt("%1 \n %2",SalesParmTable.VBS_ReservedInvoice,SalesParmTable.Transdate),DialogButton::No,"Check before Post");
if(dialogCheckBeforePost == DialogButton::Ok)
{
// End Cus1.2
if(updateNow.value())
{
if(element.vbs_checkMultipleAccount())
{
error("Can not post multiple customer account");
return;
}
switch (documentStatus)
{
case documentStatus::Confirmation:
if(!SalesparmTable.VBS_ReservedInvoice)
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice to cancle");
return;
}
}
}
else
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_Cancel = NoYes::Yes;
CustConfirmJour.update();
ttscommit;
}
element.close();
info(strfmt("Invoice %1 has been cancled",SalesparmTable.VBS_ReservedInvoice));
}
else
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_ReservedInvoice = "";
CustConfirmJour.update();
ttscommit;
}
}
}
}
break;
case documentStatus::PickingList:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPickingList())
{
error("Please select reserved invoice");
return;
}
}
break;
case documentStatus::PackingSlip:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPackingSlip() && _SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice");
return;
}
}
break;
}
}
//vbs end
super();
// Pantep Cus1.5
}
else
{
return;
}
//End Cus1.5
}
==================================================================
display real dispPrice()
{
real rqty, rvalue;
SysClientSessions scs;
str strUserID, strCompName;
;
//Get Client
select * from scs where scs.clientComputer == WinAPI::getComputerName();
strUserID = scs.userId;
//
rqty = this.quantitySum();
rvalue = this.valueSum();
if(rqty == 0)
{
rPrice = 0;
}else
{
if(strUserID == "Audit"||strUserID == "Audi1"||strUserID == "Audi2"||strUserID == "Audi3"||
strUserID == "Audi4"||strUserID == "Audi5"||strUserID == "Admin"||strUserID == "com_c"||
strUserID == "Comp1"||strUserID == "compu")
{
rPrice = rvalue/rqty;
}else
rPrice = 0;
//rPrice = rvalue/rqty;
}
return rPrice;
}
================================================
void clicked()
{
//vbs begin
SalesParmLine _SalesParmLineforCancle;
CustConfirmJour CustConfirmJour;
CustConfirmTrans CustConfirmTrans;
// Pantep Cus1
dialogButton dialogCheckBeforePost;
// End Cus1
SysClientSessions scs;
str strUserID;
;
select * from scs where scs.clientComputer == WinAPI::getComputerName();
strUserID = scs.userId;
if(strUserID== "Trad4")
{
// INTERNAL BEGIN
// Pantep Cus1.2
dialogCheckBeforePost = Box::okCancel(strfmt("%1 \n %2",SalesParmTable.VBS_ReservedInvoice,SalesParmTable.Transdate),DialogButton::No,"Check before Post");
if(dialogCheckBeforePost == DialogButton::Ok)
{
// End Cus1.2
if(updateNow.value())
{
if(element.vbs_checkMultipleAccount())
{
error("Can not post multiple customer account");
return;
}
switch (documentStatus)
{
case documentStatus::Confirmation:
if(!SalesparmTable.VBS_ReservedInvoice)
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice to cancle");
return;
}
}
}
else
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_Cancel = NoYes::Yes;
CustConfirmJour.update();
ttscommit;
}
element.close();
info(strfmt("Invoice %1 has been cancled",SalesparmTable.VBS_ReservedInvoice));
}
else
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_ReservedInvoice = "";
CustConfirmJour.update();
ttscommit;
}
}
}
}
break;
case documentStatus::PickingList:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPickingList())
{
error("Please select reserved invoice");
return;
}
}
break;
case documentStatus::PackingSlip:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPackingSlip() && _SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice");
return;
}
}
break;
}
}
//vbs end
super();
// Pantep Cus1.5
}
else
{
return;
}
//End Cus1.5
//INTERNAL END
}
else
{
info("external");
if(updateNow.value())
{
if(element.vbs_checkMultipleAccount())
{
error("Can not post multiple customer account");
return;
}
switch (documentStatus)
{
case documentStatus::Confirmation:
if(!SalesparmTable.VBS_ReservedInvoice)
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice to cancle");
return;
}
}
}
else
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_Cancel = NoYes::Yes;
CustConfirmJour.update();
ttscommit;
}
element.close();
info(strfmt("Invoice %1 has been cancled",SalesparmTable.VBS_ReservedInvoice));
}
else
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_ReservedInvoice = "";
CustConfirmJour.update();
ttscommit;
}
}
}
}
break;
case documentStatus::PickingList:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPickingList())
{
error("Please select reserved invoice");
return;
}
}
break;
case documentStatus::PackingSlip:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPackingSlip() && _SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice");
return;
}
}
break;
}
}
//vbs end
super();
}
}
==============================================
void clicked()
{
//vbs begin
SalesParmLine _SalesParmLineforCancle;
CustConfirmJour CustConfirmJour;
CustConfirmTrans CustConfirmTrans;
// Pantep Cus1
dialogButton dialogCheckBeforePost;
// End Cus1
SysClientSessions scs;
str strUserID;
;
select * from scs where scs.clientComputer == WinAPI::getComputerName();
// strUserID = scs.userId;
strUserID = curuserId();
//print strUserID;
//pause;
//info(strfmt("%1",strUserID));
//Trad5
// if(strUserID== "Admin")
if(strUserID== "Trad4" || strUserID== "Trad5")
{
// INTERNAL BEGIN
// Pantep Cus1.2
dialogCheckBeforePost = Box::okCancel(strfmt("%1 \n %2",SalesParmTable.VBS_ReservedInvoice,SalesParmTable.Transdate),DialogButton::No,"Check before Post");
if(dialogCheckBeforePost == DialogButton::Ok)
{
// End Cus1.2
if(updateNow.value())
{
if(element.vbs_checkMultipleAccount())
{
error("Can not post multiple customer account");
return;
}
switch (documentStatus)
{
case documentStatus::Confirmation:
if(!SalesparmTable.VBS_ReservedInvoice)
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice to cancle");
return;
}
}
}
else
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_Cancel = NoYes::Yes;
CustConfirmJour.update();
ttscommit;
}
element.close();
info(strfmt("Invoice %1 has been cancled",SalesparmTable.VBS_ReservedInvoice));
}
else
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_ReservedInvoice = "";
CustConfirmJour.update();
ttscommit;
}
}
}
}
break;
case documentStatus::PickingList:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPickingList())
{
error("Please select reserved invoice");
return;
}
}
break;
case documentStatus::PackingSlip:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPackingSlip() && _SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice");
return;
}
}
break;
}
}
//vbs end
super();
// Pantep Cus1.5
}
else
{
return;
}
//End Cus1.5
//INTERNAL END
}
else
{
//info("external");
if(updateNow.value())
{
if(element.vbs_checkMultipleAccount())
{
error("Can not post multiple customer account");
return;
}
switch (documentStatus)
{
case documentStatus::Confirmation:
if(!SalesparmTable.VBS_ReservedInvoice)
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice to cancle");
return;
}
}
}
else
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_Cancel = NoYes::Yes;
CustConfirmJour.update();
ttscommit;
}
element.close();
info(strfmt("Invoice %1 has been cancled",SalesparmTable.VBS_ReservedInvoice));
}
else
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_ReservedInvoice = "";
CustConfirmJour.update();
ttscommit;
}
}
}
}
break;
case documentStatus::PickingList:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPickingList())
{
error("Please select reserved invoice");
return;
}
}
break;
case documentStatus::PackingSlip:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPackingSlip() && _SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice");
return;
}
}
break;
}
}
//vbs end
super();
}
}
=================================================================
void clicked()
{
//vbs begin
SalesParmLine _SalesParmLineforCancle;
CustConfirmJour CustConfirmJour;
CustConfirmTrans CustConfirmTrans;
// Pantep Cus1
dialogButton dialogCheckBeforePost;
// End Cus1
;
// Pantep Cus1.2
dialogCheckBeforePost = Box::okCancel(strfmt("%1 \n %2",SalesParmTable.VBS_ReservedInvoice,SalesParmTable.Transdate),DialogButton::No,"Check before Post");
if(dialogCheckBeforePost == DialogButton::Ok)
{
// End Cus1.2
if(updateNow.value())
{
if(element.vbs_checkMultipleAccount())
{
error("Can not post multiple customer account");
return;
}
switch (documentStatus)
{
case documentStatus::Confirmation:
if(!SalesparmTable.VBS_ReservedInvoice)
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice to cancle");
return;
}
}
}
else
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_Cancel = NoYes::Yes;
CustConfirmJour.update();
ttscommit;
}
element.close();
info(strfmt("Invoice %1 has been cancled",SalesparmTable.VBS_ReservedInvoice));
}
else
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_ReservedInvoice = "";
CustConfirmJour.update();
ttscommit;
}
}
}
}
break;
case documentStatus::PickingList:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPickingList())
{
error("Please select reserved invoice");
return;
}
}
break;
case documentStatus::PackingSlip:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPackingSlip() && _SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice");
return;
}
}
break;
}
}
//vbs end
super();
// Pantep Cus1.5
}
else
{
return;
}
//End Cus1.5
}
==================================================================
display real dispPrice()
{
real rqty, rvalue;
SysClientSessions scs;
str strUserID, strCompName;
;
//Get Client
select * from scs where scs.clientComputer == WinAPI::getComputerName();
strUserID = scs.userId;
//
rqty = this.quantitySum();
rvalue = this.valueSum();
if(rqty == 0)
{
rPrice = 0;
}else
{
if(strUserID == "Audit"||strUserID == "Audi1"||strUserID == "Audi2"||strUserID == "Audi3"||
strUserID == "Audi4"||strUserID == "Audi5"||strUserID == "Admin"||strUserID == "com_c"||
strUserID == "Comp1"||strUserID == "compu")
{
rPrice = rvalue/rqty;
}else
rPrice = 0;
//rPrice = rvalue/rqty;
}
return rPrice;
}
================================================
void clicked()
{
//vbs begin
SalesParmLine _SalesParmLineforCancle;
CustConfirmJour CustConfirmJour;
CustConfirmTrans CustConfirmTrans;
// Pantep Cus1
dialogButton dialogCheckBeforePost;
// End Cus1
SysClientSessions scs;
str strUserID;
;
select * from scs where scs.clientComputer == WinAPI::getComputerName();
strUserID = scs.userId;
if(strUserID== "Trad4")
{
// INTERNAL BEGIN
// Pantep Cus1.2
dialogCheckBeforePost = Box::okCancel(strfmt("%1 \n %2",SalesParmTable.VBS_ReservedInvoice,SalesParmTable.Transdate),DialogButton::No,"Check before Post");
if(dialogCheckBeforePost == DialogButton::Ok)
{
// End Cus1.2
if(updateNow.value())
{
if(element.vbs_checkMultipleAccount())
{
error("Can not post multiple customer account");
return;
}
switch (documentStatus)
{
case documentStatus::Confirmation:
if(!SalesparmTable.VBS_ReservedInvoice)
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice to cancle");
return;
}
}
}
else
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_Cancel = NoYes::Yes;
CustConfirmJour.update();
ttscommit;
}
element.close();
info(strfmt("Invoice %1 has been cancled",SalesparmTable.VBS_ReservedInvoice));
}
else
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_ReservedInvoice = "";
CustConfirmJour.update();
ttscommit;
}
}
}
}
break;
case documentStatus::PickingList:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPickingList())
{
error("Please select reserved invoice");
return;
}
}
break;
case documentStatus::PackingSlip:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPackingSlip() && _SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice");
return;
}
}
break;
}
}
//vbs end
super();
// Pantep Cus1.5
}
else
{
return;
}
//End Cus1.5
//INTERNAL END
}
else
{
info("external");
if(updateNow.value())
{
if(element.vbs_checkMultipleAccount())
{
error("Can not post multiple customer account");
return;
}
switch (documentStatus)
{
case documentStatus::Confirmation:
if(!SalesparmTable.VBS_ReservedInvoice)
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice to cancle");
return;
}
}
}
else
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_Cancel = NoYes::Yes;
CustConfirmJour.update();
ttscommit;
}
element.close();
info(strfmt("Invoice %1 has been cancled",SalesparmTable.VBS_ReservedInvoice));
}
else
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_ReservedInvoice = "";
CustConfirmJour.update();
ttscommit;
}
}
}
}
break;
case documentStatus::PickingList:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPickingList())
{
error("Please select reserved invoice");
return;
}
}
break;
case documentStatus::PackingSlip:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPackingSlip() && _SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice");
return;
}
}
break;
}
}
//vbs end
super();
}
}
==============================================
void clicked()
{
//vbs begin
SalesParmLine _SalesParmLineforCancle;
CustConfirmJour CustConfirmJour;
CustConfirmTrans CustConfirmTrans;
// Pantep Cus1
dialogButton dialogCheckBeforePost;
// End Cus1
SysClientSessions scs;
str strUserID;
;
select * from scs where scs.clientComputer == WinAPI::getComputerName();
// strUserID = scs.userId;
strUserID = curuserId();
//print strUserID;
//pause;
//info(strfmt("%1",strUserID));
//Trad5
// if(strUserID== "Admin")
if(strUserID== "Trad4" || strUserID== "Trad5")
{
// INTERNAL BEGIN
// Pantep Cus1.2
dialogCheckBeforePost = Box::okCancel(strfmt("%1 \n %2",SalesParmTable.VBS_ReservedInvoice,SalesParmTable.Transdate),DialogButton::No,"Check before Post");
if(dialogCheckBeforePost == DialogButton::Ok)
{
// End Cus1.2
if(updateNow.value())
{
if(element.vbs_checkMultipleAccount())
{
error("Can not post multiple customer account");
return;
}
switch (documentStatus)
{
case documentStatus::Confirmation:
if(!SalesparmTable.VBS_ReservedInvoice)
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice to cancle");
return;
}
}
}
else
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_Cancel = NoYes::Yes;
CustConfirmJour.update();
ttscommit;
}
element.close();
info(strfmt("Invoice %1 has been cancled",SalesparmTable.VBS_ReservedInvoice));
}
else
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_ReservedInvoice = "";
CustConfirmJour.update();
ttscommit;
}
}
}
}
break;
case documentStatus::PickingList:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPickingList())
{
error("Please select reserved invoice");
return;
}
}
break;
case documentStatus::PackingSlip:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPackingSlip() && _SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice");
return;
}
}
break;
}
}
//vbs end
super();
// Pantep Cus1.5
}
else
{
return;
}
//End Cus1.5
//INTERNAL END
}
else
{
//info("external");
if(updateNow.value())
{
if(element.vbs_checkMultipleAccount())
{
error("Can not post multiple customer account");
return;
}
switch (documentStatus)
{
case documentStatus::Confirmation:
if(!SalesparmTable.VBS_ReservedInvoice)
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice to cancle");
return;
}
}
}
else
{
while select _SalesParmLineforCancle where _SalesParmLineforCancle.ParmId == SalesparmTable.ParmId
{
//info(strfmt("%1",_SalesParmLineforCancle.DeliverNow));
if(_SalesParmLineforCancle.DeliverNow < 0)
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_Cancel = NoYes::Yes;
CustConfirmJour.update();
ttscommit;
}
element.close();
info(strfmt("Invoice %1 has been cancled",SalesparmTable.VBS_ReservedInvoice));
}
else
{
select forupdate CustConfirmJour where CustConfirmJour.VBS_ReservedInvoice == SalesparmTable.VBS_ReservedInvoice
&& CustConfirmJour.VBS_Cancel == NoYes::No;
if(CustConfirmJour)
{
ttsbegin;
CustConfirmJour.VBS_ReservedInvoice = "";
CustConfirmJour.update();
ttscommit;
}
}
}
}
break;
case documentStatus::PickingList:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPickingList())
{
error("Please select reserved invoice");
return;
}
}
break;
case documentStatus::PackingSlip:
if(!SalesparmTable.VBS_ReservedInvoice)
{
if(!element.vbs_checkPackingSlip() && _SalesParmLineforCancle.DeliverNow < 0)
{
error("Please select reserved invoice");
return;
}
}
break;
}
}
//vbs end
super();
}
}
วันจันทร์ที่ 18 มิถุนายน พ.ศ. 2555
Item is on hold
หน้า item cardที่ปุ่ม Setup -> Default order settings -> stopped ในแท็บ Purchase Stock Sales
วันเสาร์ที่ 9 มิถุนายน พ.ศ. 2555
WorkTimeTemplate
WorkTimeTemplate >>(Complse)>> Calendar >> WorkCenterGroup >> WorkCenter
WorkCalendarTable
WorkCalendarDate
WorkCalendarDateLine
WorkTimeTable
WorkTimeLine
WrkCtrTaskGroup
WrkCtrTaskGroupLine
WrkCtrProperty
WrkCtrTable
วันพฤหัสบดีที่ 7 มิถุนายน พ.ศ. 2555
วันเสาร์ที่ 2 มิถุนายน พ.ศ. 2555
BOMๆ Routeๆ
BOMTable(~Header) >> BOM(~Line)
BOMVersion ไว้ผูก item กับ BOM
โดยปกติแล้ว item หนึ่งผูกกับ BOMTable ได้อันเดียว แต่ถ้าต้องการ Versions ให้ผูกโดยมี Fromdate Todate ต่างกันหรือ Qty ต่างกัน
RouteTable(~Header) >> Route(~Line)
RouteVersion ไว้ผูก item กับ Route
RouteOpr(s)นั้นผูกกับ Route(~Line)
BOMVersion ไว้ผูก item กับ BOM
โดยปกติแล้ว item หนึ่งผูกกับ BOMTable ได้อันเดียว แต่ถ้าต้องการ Versions ให้ผูกโดยมี Fromdate Todate ต่างกันหรือ Qty ต่างกัน
RouteTable(~Header) >> Route(~Line)
RouteVersion ไว้ผูก item กับ Route
RouteOpr(s)นั้นผูกกับ Route(~Line)
สมัครสมาชิก:
บทความ (Atom)