Hello,
I'm trying to modify the stored proc VendorInsUpdSp by creating an EXTGEN for it called: EXTGEN_VendorInsUpdSp; what this will do is update all Open and Planned POs for this vendor with their new payment terms. However, the code I've added isn't updating table po_mst with the new terms. When the terms are updated on the Vendors form and saved, I refresh the Purchase Orders and there is no update. Here's my code snippet:
ELSE
BEGIN
/* Vendor Update Section */
UPDATE Vendor SET
Contact = @Contact ,
Phone = @Phone ,
Vend_type = @VendType ,
Terms_code = @TermsCode ,
Ship_code = @ShipCode ,
Fob = @FOB ,
Print_price = @PrintPrice ,
Stat = @Stat ,
Last_purch = @LastPurch ,
Last_paid = @LastPaid ,
Purch_ytd = @Purchytd ,
Purch_lst_yr = @PurchLstyr ,
Disc_ytd = @Discytd ,
Disc_lst_yr = @DiscLstyr ,
Pay_ytd = @Payytd ,
Vend_remit = @VendRemit ,
Whse = @Whse ,
Charfld1 = @Charfld1 ,
Charfld2 = @Charfld2 ,
Charfld3 = @Charfld3 ,
Decifld1 = @Decifld1 ,
Decifld2 = @Decifld2 ,
Decifld3 = @Decifld3 ,
Logifld = @Logifld ,
Datefld = @Datefld ,
Curr_code = @CurrCode ,
Bank_code = @BankCode ,
Pay_type = @PayType ,
Pay_lst_yr = @PayLstyr ,
Branch_id = @BranchID ,
Trans_nat = @TransNat ,
Delterm = @DelTerm ,
Process_ind = @ProcessInd ,
Lang_code = @LangCode ,
Pur_acct = @PurAcct ,
Pur_acct_unit1 = @PurAcctUnit1 ,
Pur_acct_unit2 = @PurAcctUnit2 ,
Pur_acct_unit3 = @PurAcctUnit3 ,
Pur_acct_unit4 = @PurAcctUnit4 ,
Lcr_reqd = @LcrReqd ,
Category = @Category ,
Account = @Account ,
Account_name = @AccountName ,
EFT_bank_num = @EFTBankNum ,
Price_by = @PriceBy ,
Include_tax_in_cost = @IncludeTaxInCost ,
Trans_nat_2 = @Transnat2 ,
Active_for_data_integration = @ActiveForDataIntegration ,
Vch_over_po_cost_tolerance = @VchOverPOCostTolernace ,
Vch_under_po_cost_tolerance = @VchUnderPoCostTolerance ,
Pay_fiscal_ytd = @PayFiscalytd ,
Pay_lst_fiscal_yr = @PayLstFiscalyr ,
supply_web_vendor = @SupplyWebVendor ,
request_acknowledgement = @RequestAcknowledgement ,
deposit_acct_type = @DepositAccountType ,
auto_voucher = @AutoVoucher ,
auto_voucher_method = @AutoVoucherMethod ,
buyer = @Buyer ,
allow_to_firm_plns = @AllowToFirmPlns ,
firm_pln_target = @FirmPlnTarget ,
firmed_poitem_stat = @FirmedPoitemStat ,
replen_po_num = @ReplenPoNum ,
transit_reference = @TransitReference ,
misc1099_ytd = @Misc1099Ytd ,
misc1099_lst_yr = @Misc1099LstYr ,
source_site = @SourceSite ,
source_site_cust_num = @SourceSiteCustNum ,
auto_receive_demanding_site_po = @AutoReceiveDemaindingSitePO ,
auto_ship_demanding_site_co = @AutoShipDemandingSiteCO ,
vend_bank = @VendBank ,
fiscal_rpt_system = @FiscalReportingSystem ,fiscal_rpt_system_type = @FiscalReportingSystemType ,business_identification_num = @BusinessIdentificationNum ,
profession = @Profession ,
bank_file_format = @EFTFormat ,
bank_authority_party_id = @BankAuthorityPartyId ,show_in_drop_down_list = @ShowInDropDownList ,
bank_transit_num = @VenBankTransitNum ,
override_bank_transit_num = @OverrideBankTransitNum ,
active_for_anonymization = @ActiveForAnonymization
WHERE Vend_Num = @Vendnum
SELECT @TermsCode = terms_code
FROM vendor_mst
WHERE vend_num = @Vendnum ;
IF @Vendnum IS NOT NULL
BEGIN
UPDATE po_mst
SET terms_code = @TermsCode
WHERE vend_num = @Vendnum AND stat IN ('O', 'P');
END
END
Thank you in advance for any assistance.