Credit note or Credit memo

Posted gxn8638

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Credit note or Credit memo相关的知识,希望对你有一定的参考价值。

A credit note or credit memo is a commercial document issued by a seller to a buyer. Credit notes act as a source document for the sales return journal. In other words, the credit note is evidence of the reduction in sales. A credit memo, a contraction of the term "credit memorandum", is evidence of a reduction in the amount a buyer owes a seller under an earlier invoice.

It can also be a document from a bank to a depositor to indicate the depositor\'s balance is being in the event other than a deposit, such as the collection by the bank of the depositor\'s note receivable.

Features
A credit note lists the products, quantities, and agreed prices for products or services the seller provided the buyer but the buyer returned or did not receive. It may be issued in the case of damaged goods, errors or allowances. In respect of the previously issued invoice, a Credit Memo will reduce or eliminate the amount the buyer has to pay. Note: A Credit Memo is not to be substituted as a formal document. The Credit Memo rarely contains PO #, Date, Billing Address, Shipping Address, Terms of Payment, List of products with quantities and prices. Usually, it references the original invoice and sometimes states the reason for the issue.

Uses
To allow the buyer to purchase an item or service from that seller on a future date, i.e. a gift card or store card credit. Credit notes may be issued by a seller as a goodwill gesture to a buyer who wishes to return previously purchased merchandise (instead of cash repayment) in circumstances where the original sales agreement did not include an explicit refund policy for returned items. In such circumstances, a credit note of value equal to the price of the returned item is usually issued, allowing the buyer to exchange their purchase for other items available with the sale.

创建过程并在表中插入值

【中文标题】创建过程并在表中插入值【英文标题】:Create procedure and Insert values in Table 【发布时间】:2018-11-28 12:02:35 【问题描述】:

创建一个名为 insert_credit 的过程,通过将 5 个输入作为参数传递,将值插入到 credit_card 表中。

程序名称:insert_credit

输入参数:credit_id with data type as number,credit_card_number with data type as varchar,credit_card_expire with data type as varchar,holder_name with data type as varchar and card_type with data type as varchar

使用的表:credit_card

我写了这个:

CREATE OR REPLACE PROCEDURE insert_credit(
       p_credit_id IN credit_card.credit_id%TYPE,  
       p_credit_card_number IN credit_card.credit_card_number%TYPE,  
       p_credit_card_expire IN credit_card.credit_card_expire%TYPE,  
       p_holder_name IN credit_card.holder_name%TYPE,  
       p_card_type IN credit_card.card_type%TYPE)  
IS  
BEGIN  

   INSERT INTO credit_card ("credit_id", "credit_card_number",   "credit_card_expire", "holder_name","card_type")   
  VALUES (p_credit_id, p_credit_card_number,p_credit_card_expire,  
 p_holder_name,p_card_type);  

  COMMIT;  

END;  
/                                                                            

在执行时我得到:

“警告:创建的过程存在编译错误。”

【问题讨论】:

您可以通过运行show errors 查看有关错误的详细信息。但是尽量去掉列名周围的",除非您在创建该表时也使用了它们 【参考方案1】:
CREATE OR REPLACE
PROCEDURE insert_credit(
credit_id IN credit_card.id%TYPE,
credit_card_number IN credit_card.card_number%TYPE,
credit_card_expire IN credit_card.card_expire%TYPE,
holder_name IN credit_card.name%TYPE,
card_type IN credit_card.cc_type%TYPE) AS
BEGIN
INSERT INTO credit_card(id,card_number,card_expire,name,cc_type)
VALUES(credit_id,credit_card_number,credit_card_expire,holder_name,card_type);
END insert_credit;
/

【讨论】:

【参考方案2】:

如果你想调试你的程序,你可以像一个匿名块一样运行它,并声明所有输入参数。

/*CREATE OR REPLACE PROCEDURE insert_credit(
       p_credit_id IN credit_card.credit_id%TYPE,  
       p_credit_card_number IN credit_card.credit_card_number%TYPE,  
       p_credit_card_expire IN credit_card.credit_card_expire%TYPE,  
       p_holder_name IN credit_card.holder_name%TYPE,  
       p_card_type IN credit_card.card_type%TYPE)  
IS  */
declare
p_credit_id credit_card.credit_id%TYPE := somevalue
...
..
...
P_card_type

BEGIN  

   INSERT INTO credit_card ("credit_id", "credit_card_number",   "credit_card_expire", "holder_name","card_type")   
  VALUES (p_credit_id, p_credit_card_number,p_credit_card_expire,  
 p_holder_name,p_card_type);  

  COMMIT;  

END; 

现在您将能够获得出现错误的行。块运行无任何错误后,您可以删除声明部分并取消注释代码。

【讨论】:

【参考方案3】:
CREATE OR REPLACE PROCEDURE insert_credit(
credit_id NUMBER,
credit_card_number VARCHAR,
credit_card_expire VARCHAR,
holder_name VARCHAR,
card_type VARCHAR) 
AS
   /*Declaration block*/
   
BEGIN
  INSERT INTO credit_card(id,card_number,card_expire,name,cc_type)
  VALUES(credit_id,credit_card_number,credit_card_expire,holder_name,card_type);
  
END insert_credit;
/

【讨论】:

您的答案可以通过添加有关代码的作用以及它如何帮助 OP 的更多信息来改进。

以上是关于Credit note or Credit memo的主要内容,如果未能解决你的问题,请参考以下文章

如何使用 Credit Memos 为客户创建客户退款?

company_credit

Debit and Credit Memo

创建过程并在表中插入值

Math 309 Extra-Credit

Accounting 里的Debit 和 credit是如何区分的。。。