站長部落格 - lutuni 的日誌 |
![]() ![]() |
2009/03/16
進貨上次價格自動填入
作者: lutuni (11:51 am)
|
PURCSUB存檔後 IF PURCSUB->QUANTITY>0 &&如果數量大於0,和本筆客戶沒未曾有交易本產品新增 SELE FACT_HISTORY SEEK PURC->FACT_CODE+TRIM(Field1.Text)+" " IF EOF() APPEND BLANK REPL TRN_NO WITH PURCSUB->TRN_NO REPL ITEM_NO WITH PURCSUB->ITEM_NO REPL PRICE WITH PURCSUB->PRICE REPL FACT_CODE WITH PURCSUB->FACT_CODE REPL TERM WITH PURCSUB->TERM POST ELSE IF PURC->TRN_NO>=FACT_HISTORY->TRN_NO EDIT REPL TRN_NO WITH PURCSUB->TRN_NO REPL PRICE WITH PURCSUB->PRICE REPL TERM WITH PURCSUB->TERM POST ENDIF ENDIF ENDIF *當填入進貨產品編號時搜尋 SELECT FACT_HISTORY GO TOP SEEK PURC->FACT_CODE +TRIM(Field1.Text)+" " IF !EOF() .AND. PURCSUB.STATE()=3 ASSIGN(Field4.TEXT,ITEM->NAME) ASSIGN(FIELD3.TEXT,STR(FACT_HISTORY->PRICE)) &&ASSIGN(FIELD6.TEXT,FACT_HISTORY->TERM) &&IF !EMPTY(FIELD6.TEXT) Field2.FOCUSED() &&ELSE &&Field6.FOCUSED() &&ENDIF ELSE IF PURCSUB.STATE()=3 ASSIGN(Field4.TEXT,ITEM->NAME) MESSAGE("查無本產品歷史價可能未曾進貨") ENDIF ENDIF INVOSUB存檔後 IF INVOSUB->QUANTITY>0 &&如果數量大於0,和本筆客戶沒未曾有交易本產品新增 SELE CUST_HISTORY SEEK INVO->CUST_CODE+TRIM(Field1.Text)+" " IF EOF() APPEND BLANK REPL TRN_NO WITH INVOSUB->TRN_NO REPL ITEM_NO WITH INVOSUB->ITEM_NO REPL PRICE WITH INVOSUB->PRICE REPL CUST_CODE WITH INVOSUB->CUST_CODE REPL TERM WITH INVOSUB->TERM POST ELSE IF INVO->TRN_NO>=CUST_HISTORY->TRN_NO EDIT REPL TRN_NO WITH INVOSUB->TRN_NO REPL PRICE WITH INVOSUB->PRICE REPL TERM WITH INVOSUB->TERM POST ENDIF ENDIF ENDIF *當填入銷貨產品編號時搜尋 SELECT CUST_HISTORY GO TOP SEEK INVO->CUST_CODE +TRIM(Field1.Text)+" " IF !EOF() .AND. INVOSUB.STATE()=3 ASSIGN(Field4.TEXT,ITEM->NAME) ASSIGN(FIELD3.TEXT,STR(CUST_HISTORY->PRICE)) &&ASSIGN(FIELD6.TEXT,CUST_HISTORY->TERM) &&IF !EMPTY(FIELD6.TEXT) Field2.FOCUSED() &&ELSE &&Field6.FOCUSED() &&ENDIF ELSE IF INVOSUB.STATE()=3 ASSIGN(Field4.TEXT,ITEM->NAME) MESSAGE("查無本產品歷史價可能未曾進貨") ENDIF ENDIF |
本篇文章引用網址
http://123.204.89.156/etype/modules/weblog/weblog-tb.php/10