前回は前払金について書きました。
今回は前受金についてご紹介します。

前受金」は一部代金を事前に受け取るものです。頭金などに相当します。

たとえば、700,000円の商品を売り上げるときに、事前に300,000円を現金で受け取っていたとします。

その場合の仕訳は、

借方貸方
現金300000前受金300000

と、なります。

その後、商品を渡す際に残りのお金を現金で受け取ったとします。

その場合の仕訳は、

借方貸方
前受金300000売上700000
現金400000

と、なります。

前受金を受け取っていたにも関わらず、商品を売ることが出来なくなった場合には、返金をします。

その場合の仕訳は、

借方貸方
前受金300000現金300000

と、なります。

前受金は負債です。

posted by Png mari on Mon 1 Sep 2008 at 11:20

MozillaLab's Ubiquity is a promising new window to the world after the age of the search box. I was strongly impressed with it, I've done a quickie job.

Gist Ubiquitifier

This is a service for enabling us to publish your Ubiquity commands without any servers which host the HTML file for installing the commands.

USAGE

At first, you make a JavaScript snippet including Ubiquity commands on the Gist.

If the URL of the page is as follows,

http://gist.github.com/7630

the URL of installation page is as follows.

http://ubiquity.s21g.com/7630

You can also specify the name of the command by adding name parameter to the query string, like this.

http://ubiquity.s21g.com/7630?name=s21g-blog-search

Currently the design of the service is very crufty. I will improve it if there are needs.

posted by Png takiuchi on Mon 1 Sep 2008 at 10:43

LLfutureで使用した端末用プレゼンツールをリリースいたしました。

利用法は、 READMEファイルsample/ディレクトリの中身 をご覧ください。

   1  
   2  
   3  
   4  
   5        _                  _
   6       |_)   |_     _ ._  |_) _.o| _
   7       | \|_||_)\/ (_)| | | \(_|||_>
   8                /
   9  
  10       The Web Application Framework
  11  
  12             s21g LLC 瀧内元気
  13  
  14  
  15   1/15|**                          |00:02

こんな感じでプレゼンできます。

posted by Png genki on Mon 1 Sep 2008 at 06:05

LLfutureこと、 Lightweight Language Futureサイコー?!フレームワーク のセッションで、Ruby on Rails担当ということで講演いたしました。 お聞きくださった皆様、ありがとうございました。

プレゼンで使った資料を公開いたします。

llfuture.pt

ファイル形式は自作のPuTTY用プレゼンテーションアプリ(Ruby製) のものですが、テキストファイルとして読めるようになっています。 プレゼンテーションアプリは、そのうちGitHubにUpします。

それでは、よろしくお願いします。

posted by Png genki on Sun 31 Aug 2008 at 00:49

以前git-svnについて記事を書いたのですが、最近s21gでもGitでリポジトリができたので、pure gitにしてみることにしました。

よく使うコマンド達

   1  #リモートやブランチを確認・追加
   2  git remote #リモート一覧
   3  git branch #ブランチ一覧
   4  git remote add origin ssh://git.s21g.com/mnt/git/muji.git
   5  git config --get remote.origin.url #リモートoriginのURLを表示
   6  
   7  #変更を確認してマージ
   8  git fetch origin
   9  git log -p master..origin/master # -pをつけるとdiff状態を見せてくれる
  10  git merge origin/master
  11  
  12  #コミット
  13  git push origin master

  • 以前に書いたgit stash, git stash apply, git checkout -- filenameなどももちろん使っています。

git-pullは二つの動作をまとめてやってくれる

"pull" コマンドは次の2つの操作を実行します:
(1) リモートブランチから変更を取得。= fetch
(2) それらを現在のブランチにマージ。= merge
http://www8.atwiki.jp/git_jp/pub/Documentation.ja/tutorial.html

git-logはややこしい

   1  git log test..master  # master から到達可能だが、test からは到達可でないコミット
   2  git log master..test  # test から到達可能だが、master からは到達可能でないコミット
   3  git log master...test # test または master から到達可能だが、両方からは到達可能でない...
http://www8.atwiki.jp/git_jp/pub/Documentation.ja/user-manual.html#browsing-revisions

posted by Png satoko on Sat 30 Aug 2008 at 01:53

債権」は代金を回収する権利、「債務」は代金を支払う義務のことです。
その一部に前払金と前受金があります。
今回は前払金について説明します。

前払金」は一部代金を事前に支払うものです。手付金、内金とも言います(仕訳では必ず「前払金」勘定を用います)

たとえば、500,000円の商品を仕入れるために、100,000円を手付金として約束手形で支払ったとします。

その場合の仕訳は、

借方貸方
前払金100000支払手形100000

と、なります。

現金で支払えば貸方の勘定科目が「現金」、小切手で支払えば「当座預金」となります。

その後、実際に商品を仕入れる際に残りの金額を現金で支払ったとします。

その場合の仕訳は、

借方貸方
仕入500000前払金100000
現金400000

と、なります。

前払金を支払った後、仕入をする前に相手の会社から取引の中止を求められた場合は、前払金は返してもらえます。
前払金を小切手で返してもらったとすると

その場合の仕訳は、

借方貸方
現金100000前払金100000

と、なります。

前払金は資産です。

posted by Png mari on Thu 28 Aug 2008 at 20:03

rabbitのソースコードハイライトをするために必要なruby.stを探していたのですが、 各所でデッドリンクになっていたので、見つけたファイルの場所をメモしておきます。

http://support.rubyforge.org/svn/trunk/support/ruby.st

See Also

posted by Png genki on Thu 28 Aug 2008 at 19:50

例えばselect結果をinsertするような場合は効率面からActiveRecordを通さずそのままSQLを実行したい。select結果が数千件ある場合ARで素直に書くとそのまま数千回insert実行しなきゃならんので。

Railsでは基本ARで操作できるけど必要があればSQL書ける柔軟な所がある。 今回の場合ActiveRecord::Base::connection::executeを使用する。 Railsレシピブックで言うとP239の例。

   1  Class Entry < ActiveRecord::Base
   2    def self.select_insert_hogehoge
   3      sqlstr = "hogehoge"
   4      return connection.execute(sqlstr)
   5    end
   6  end

posted by Face ysakaki on Thu 28 Aug 2008 at 16:01

http://www.railsenvy.com/2008/8/27/rails-envy-podcast-episode-044-08-27-2008

耳慣らしに聞いてみました。サイトには話題になった各トピックスへの(ブログ等の)リンクがあるので手掛り+フォローアップになります。
面白そうなところだけカバーしておきます。

Bossman Gem

Yahoo! BOSS Web Serviceを使えるようになるgem
http://github.com/jpignata/bossman-gem/tree/master

RSpecが便利らしい:it_should_behave_like

瀧内さんが前に絶賛してたのだけど、最近はit_should_behave_likeというものが存在するようで、かつEnvyPodcastでも一度に3つリンクを挙げているので今Hotなのだなと思います。

http://www.robbyonrails.com/articles/2008/08/19/rspec-it-should-behave-like
http://edspencer.net/2008/08/drying-up-your-crud-controller-rspecs.html
http://www.joesniff.co.uk/ruby/telling-a-good-story-rspec-stories-from-the-trenches.html

[メモ] 日本語でのRSpecの解説:
http://jp.rubyist.net/magazine/?0021-Rspec
http://jp.rubyist.net/magazine/?0023-Rspec

EnvyCasts

Rails Envy Podcastのホスト二人が出演するビデオ。1エピソード$9。
http://envycasts.com/

第1回の内容は以下

  • Loading Large Data Sets
  • Foreign Keys
  • Using and Abusing Include
  • Counter Caching Properly
  • Polymorphic Associations
  • Single Table Inheritance
  • New Rails 2.1 Features
posted by Png satoko on Thu 28 Aug 2008 at 14:24

やっつけで作ってみました。

Gist Ubiquitifier

Gist上のJavaScriptコードをUbiquityコマンド化してインストール可能にするサービスです。これを利用することで、Ubiquityコマンドインストール用のHTMLファイルを設置するサーバを持っていない場合でも、 コマンドを公開することができます。

USAGE:

まずは、Gist上でUbiquityコマンドをJavaScriptで登録します。 例えば、Gist上のURIが

http://gist.github.com/7630

の場合、

http://ubiquity.s21g.com/7630

がインストールページなります。 コマンド名は、nameパラメータで指定できます。

http://ubiquity.s21g.com/7630?name=s21g-blog-search

使えそうであれば、もうちょっとちゃんとしたデザインにしようと思います。

posted by Png genki on Thu 28 Aug 2008 at 13:54