주문내역 엑셀 업로드기능에서 공백제거 추가, 주문내역에서 품목정보 생성하는 기능 추가(관리자)
This commit is contained in:
@@ -123,6 +123,7 @@ namespace FEQ0000
|
||||
this.cmbCurrency.DataSource = LstCur;
|
||||
|
||||
|
||||
|
||||
//구매자비고
|
||||
var LstRemark = FCOMMON.DBM.getCodeList("70");
|
||||
this.cmbRemark.Items.Clear();
|
||||
@@ -244,6 +245,9 @@ namespace FEQ0000
|
||||
else btEQModel.Text = dr.asset; //제조모델명
|
||||
|
||||
cmbCurrency.Text = dr.currency;
|
||||
//if (cmbCurrency.SelectedIndex < 0 && cmbCurrency.Items.Count == 1)
|
||||
// cmbCurrency.SelectedIndex = 0;
|
||||
|
||||
tbPumName.Text = dr.pumname;
|
||||
tbPumName.Tag = tbPumName.Text;
|
||||
|
||||
@@ -843,20 +847,41 @@ namespace FEQ0000
|
||||
}
|
||||
}
|
||||
|
||||
if (dr.RowState == DataRowState.Detached && vqtyreq < 1)
|
||||
{
|
||||
Util.MsgE($"요청수량을 입력하세요");
|
||||
tbQtyReq.Focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
dr.pumqty = vqtyreal;// int.Parse(tbPumQty.Text);
|
||||
dr.pumqtyReq = vqtyreq;// int.Parse(tbpumqtyReq.Text);
|
||||
dr.pumprice = vpumprice;// decimal.Parse(tbPumPrice.Text);
|
||||
dr.currency = cmbCurrency.Text.Trim();
|
||||
|
||||
var applyprice = dr.pumprice;
|
||||
if (decimal.TryParse(tbPumPriceD.Text.Replace(",", ""), out decimal priced))
|
||||
{
|
||||
dr.pumpriceD = priced;
|
||||
applyprice = priced;
|
||||
if (vpumprice == 0)
|
||||
{
|
||||
//원화단가가없다면 환산해준다
|
||||
var 환율 = lbcurrentwon.Tag != null ? (float)lbcurrentwon.Tag : 0f;
|
||||
vpumprice = ((decimal)환율 * priced);
|
||||
dr.pumprice = vpumprice;
|
||||
}
|
||||
}
|
||||
else dr.SetpumpriceDNull();
|
||||
|
||||
if (vqtyreal > 0) dr.pumamt = dr.pumqty * dr.pumprice;
|
||||
else dr.pumamt = dr.pumqtyReq * dr.pumprice;
|
||||
|
||||
if (dr.pumamt < 1)
|
||||
{
|
||||
FCOMMON.Util.MsgE($"금액이 없습니다. 단가 및 수량을 확인하세요\n해외 통화를 사용할 경우 환율을 고려한 국내단가를 입력해주세요\n환율을 자동으로 입력하려면 공용코드(69)의 FValue 에 값을 입력하세요");
|
||||
return false;
|
||||
}
|
||||
if (tbPumIDX.Text == "" || tbPumIDX.Text == "-1") dr.SetpumidxNull();
|
||||
else dr.pumidx = int.Parse(tbPumIDX.Text);
|
||||
dr.sid = tbSID.Text.Trim();
|
||||
@@ -913,7 +938,7 @@ namespace FEQ0000
|
||||
if (cmbReceive.SelectedIndex < 1) dr.receive = string.Empty;
|
||||
else dr.receive = cmbReceive.Text.Trim();
|
||||
}
|
||||
|
||||
|
||||
|
||||
dr.process = btProcess.Text;
|
||||
dr.sc = tbSC.Text;
|
||||
@@ -978,9 +1003,9 @@ namespace FEQ0000
|
||||
|
||||
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if(cmbState.Text == "PR" || cmbState.Text == "PO")
|
||||
if (cmbState.Text == "PR" || cmbState.Text == "PO")
|
||||
{
|
||||
if(chkprdate.Checked==false)
|
||||
if (chkprdate.Checked == false)
|
||||
{
|
||||
chkprdate.Checked = true;
|
||||
dtPrdate.Value = DateTime.Now;
|
||||
@@ -1188,30 +1213,32 @@ namespace FEQ0000
|
||||
private void tbDolloerPrice_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
//단가에 금액이 없는경우에는 환율을 곱해준다.
|
||||
//if ( decimal.TryParse(tbPumPrice.Text, out decimal result) == false || result == 0)
|
||||
//if (binit)
|
||||
//{
|
||||
// if (decimal.TryParse(tbPumPriceD.Text.Replace(",", ""), out decimal priced) == true)
|
||||
// {
|
||||
// applyDollerToWon();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //달러입력값도 이상하니 처리 못함
|
||||
// tbPumPrice.Text = "0";
|
||||
// }
|
||||
//}
|
||||
// if (decimal.TryParse(tbPumPrice.Text, out decimal result) == false || result == 0)
|
||||
if (binit)
|
||||
{
|
||||
if (decimal.TryParse(tbPumPriceD.Text.Replace(",", ""), out decimal priced) == true)
|
||||
{
|
||||
applyDollerToWon();
|
||||
}
|
||||
else
|
||||
{
|
||||
//달러입력값도 이상하니 처리 못함
|
||||
tbPumPrice.Text = "0";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//void applyDollerToWon()
|
||||
//{
|
||||
// if (decimal.TryParse(tbPumPriceD.Text.Replace(",", ""), out decimal priced))
|
||||
// {
|
||||
// var price = FCOMMON.info.dollertowon * (double)priced;
|
||||
// tbPumPrice.Text = (Math.Ceiling(price)).ToString();
|
||||
// }
|
||||
// else tbPumPrice.Text = "0";
|
||||
//}
|
||||
|
||||
void applyDollerToWon()
|
||||
{
|
||||
if (decimal.TryParse(tbPumPriceD.Text.Replace(",", ""), out decimal priced))
|
||||
{
|
||||
var curr = lbcurrentwon.Tag != null ? (float)lbcurrentwon.Tag : 0;
|
||||
var price = curr * (double)priced;
|
||||
tbPumPrice.Text = (Math.Ceiling(price)).ToString();
|
||||
}
|
||||
else tbPumPrice.Text = "0";
|
||||
}
|
||||
|
||||
private void btSIDChk_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -1235,7 +1262,7 @@ namespace FEQ0000
|
||||
var dt = Amkor.RestfulService.SPMSIDSearch(sid);
|
||||
if (dt.Complete)
|
||||
{
|
||||
var f = new fSIDListSelect(sid, dt.Result);
|
||||
var f = new FCM0000.fSIDListSelect(sid, dt.Result);
|
||||
if (f.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
dr.chk1 = true;
|
||||
@@ -1388,7 +1415,7 @@ namespace FEQ0000
|
||||
FCOMMON.Util.MsgE("품번호가 정확하지 않습니다\n품목을 다시 선택하세요");
|
||||
return;
|
||||
}
|
||||
if(pumidx < 0)
|
||||
if (pumidx < 0)
|
||||
{
|
||||
FCOMMON.Util.MsgE("품번호가 정확하지 않습니다\n품목을 다시 선택하세요");
|
||||
return;
|
||||
@@ -1404,5 +1431,48 @@ namespace FEQ0000
|
||||
tbSupplyIndex.Text = f.tbSupplyIdx.Text;
|
||||
tbSID.Text = f.tbSid.Text;
|
||||
}
|
||||
|
||||
private void cmbCurrency_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (cmbCurrency.SelectedIndex >= 0)
|
||||
{
|
||||
var val = cmbCurrency.SelectedValue.ToString();
|
||||
var dt = cmbCurrency.DataSource as DataTable;
|
||||
var v = dt.AsEnumerable().Where(t => t.Field<String>("Value") == val).FirstOrDefault();
|
||||
if (v != null)
|
||||
{
|
||||
var price = v.Field<float>("FValue");
|
||||
lbcurrentwon.Text = $"환율:{price}원";
|
||||
lbcurrentwon.Tag = price;
|
||||
//if (binit)
|
||||
//{
|
||||
|
||||
// if (decimal.TryParse(tbPumPriceD.Text,out decimal priced))
|
||||
// {
|
||||
// if (priced > 0)
|
||||
// dr.pumamt = priced * (decimal)price;
|
||||
// }
|
||||
|
||||
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
lbcurrentwon.Text = $"환율이 입력되지 않았습니다";
|
||||
lbcurrentwon.Tag = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lbcurrentwon.Text = "통화기호를 선택하세요";
|
||||
lbcurrentwon.Tag = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void lbcurrentwon_Click(object sender, EventArgs e)
|
||||
{
|
||||
FCOMMON.Util.MsgI("환율을 입력하려면 공용코드(68)의 Fvalue 에 값을 입력하세요");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user